Add ability to set playback speed on motion playback (#10628)

* Allow control of playback rate on motion page

* Apply playback rate
This commit is contained in:
Nicolas Mowen
2024-03-23 10:24:57 -06:00
committed by GitHub
parent 76a114a3cd
commit 63bf986e08
3 changed files with 26 additions and 14 deletions

View File

@@ -160,6 +160,7 @@ export default function HlsVideoPlayer({
show={controls}
controlsOpen={controlsOpen}
setControlsOpen={setControlsOpen}
playbackRate={videoRef.current?.playbackRate ?? 1}
onPlayPause={(play) => {
if (!videoRef.current) {
return;
@@ -180,6 +181,9 @@ export default function HlsVideoPlayer({
videoRef.current.currentTime = Math.max(0, currentTime + diff);
}}
onSetPlaybackRate={(rate) =>
videoRef.current ? (videoRef.current.playbackRate = rate) : null
}
/>
{children}
</div>