From ec436b71c88fd3e37cb14b7a85262b06610dce1d Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 13 Mar 2024 13:13:49 -0600 Subject: [PATCH] Ensure playback rate stays teh same when source changes --- web/src/components/player/HlsVideoPlayer.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/src/components/player/HlsVideoPlayer.tsx b/web/src/components/player/HlsVideoPlayer.tsx index 06ed67a3c..9293dc1bb 100644 --- a/web/src/components/player/HlsVideoPlayer.tsx +++ b/web/src/components/player/HlsVideoPlayer.tsx @@ -62,6 +62,8 @@ export default function HlsVideoPlayer({ return; } + const currentPlaybackRate = videoRef.current.playbackRate; + if (!hlsRef.current) { videoRef.current.src = currentSource; videoRef.current.load(); @@ -69,6 +71,7 @@ export default function HlsVideoPlayer({ } hlsRef.current.loadSource(currentSource); + videoRef.current.playbackRate = currentPlaybackRate; }, [videoRef, hlsRef, currentSource]); // controls