Skip to content

Commit

Permalink
Merge pull request #1602 from sag333ar/video-duration-fix
Browse files Browse the repository at this point in the history
bug fix for video duration
  • Loading branch information
feruzm authored May 7, 2024
2 parents 40df03a + 6c0edcb commit 39ca492
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit 39ca492

Please sign in to comment.