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

Commit 39ca492

Browse files
authored
Merge pull request #1602 from sag333ar/video-duration-fix
bug fix for video duration
2 parents 40df03a + 6c0edcb commit 39ca492

File tree

1 file changed

+4
-1
lines changed
  • src/common/components/video-upload-threespeak

1 file changed

+4
-1
lines changed

src/common/components/video-upload-threespeak/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export const VideoUpload = (props: Props & React.HTMLAttributes<HTMLDivElement>)
4646
const [videoUrl, setVideoUrl] = useState("");
4747
const [thumbUrl, setThumbUrl] = useState("");
4848
const [duration, setDuration] = useState("");
49+
const [durationForApiCall, setDurationForApiCall] = useState(0);
4950
const [showRecorder, setShowRecorder] = useState(false);
5051

5152
const canUpload = videoUrl;
@@ -68,6 +69,7 @@ export const VideoUpload = (props: Props & React.HTMLAttributes<HTMLDivElement>)
6869
setVideoPercentage(0);
6970
setThumbnailPercentage(0);
7071
setShowRecorder(false);
72+
setDurationForApiCall(0);
7173
}
7274
}, [props.show]);
7375

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

@@ -205,7 +208,7 @@ export const VideoUpload = (props: Props & React.HTMLAttributes<HTMLDivElement>)
205208
videoUrl,
206209
thumbUrl,
207210
activeUser: activeUser!.username,
208-
duration
211+
duration: durationForApiCall,
209212
});
210213
props.setShow(false);
211214
setStep("upload");

0 commit comments

Comments
 (0)