Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

bug fix for video duration #1602

Merged
merged 1 commit into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/common/components/video-upload-threespeak/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const VideoUpload = (props: Props & React.HTMLAttributes<HTMLDivElement>)
const [videoUrl, setVideoUrl] = useState("");
const [thumbUrl, setThumbUrl] = useState("");
const [duration, setDuration] = useState("");
const [durationForApiCall, setDurationForApiCall] = useState(0);
const [showRecorder, setShowRecorder] = useState(false);

const canUpload = videoUrl;
Expand All @@ -68,6 +69,7 @@ export const VideoUpload = (props: Props & React.HTMLAttributes<HTMLDivElement>)
setVideoPercentage(0);
setThumbnailPercentage(0);
setShowRecorder(false);
setDurationForApiCall(0);
}
}, [props.show]);

Expand All @@ -78,6 +80,7 @@ export const VideoUpload = (props: Props & React.HTMLAttributes<HTMLDivElement>)
const seconds = Math.floor(duration % 60);
const videoDuration = `${minutes}:${seconds}`;
setDuration(videoDuration);
setDurationForApiCall(duration);
}
};

Expand Down Expand Up @@ -205,7 +208,7 @@ export const VideoUpload = (props: Props & React.HTMLAttributes<HTMLDivElement>)
videoUrl,
thumbUrl,
activeUser: activeUser!.username,
duration
duration: durationForApiCall,
});
props.setShow(false);
setStep("upload");
Expand Down