diff --git a/packages/roomkit-react/src/Prebuilt/components/HMSVideo/VideoTime.tsx b/packages/roomkit-react/src/Prebuilt/components/HMSVideo/VideoTime.tsx index b1ef358507..bcd6c3410b 100644 --- a/packages/roomkit-react/src/Prebuilt/components/HMSVideo/VideoTime.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/HMSVideo/VideoTime.tsx @@ -12,7 +12,8 @@ export const VideoTime = () => { const timeupdateHandler = (currentTime: number) => { const videoEl = hlsPlayer?.getVideoElement(); if (videoEl) { - setVideoTime(getDurationFromSeconds(videoEl.duration - currentTime)); + const duration = isFinite(videoEl.duration) ? videoEl.duration : videoEl.seekable.end(0) || 0; + setVideoTime(getDurationFromSeconds(duration - currentTime)); } else { setVideoTime(getDurationFromSeconds(currentTime)); }