Merge pull request #20851 from JoVictorNunes/fix-ext-video-starting-advanced

fix(external-video): player starting at an advanced point
This commit is contained in:
Gustavo Trott 2024-08-02 17:46:14 -03:00 committed by GitHub
commit 45c144d435
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -248,7 +248,8 @@ const ExternalVideoPlayer: React.FC<ExternalVideoPlayerProps> = ({
useEffect(() => {
if (playerRef.current) {
playerRef.current.seekTo(currentTime, 'seconds');
const truncatedTime = currentTime < 1 ? 0 : currentTime;
playerRef.current.seekTo(truncatedTime, 'seconds');
}
}, [playerRef.current, playing]);