Play scene when scrubber clicked (#2546)

This commit is contained in:
WithoutPants
2022-05-05 11:03:46 +10:00
committed by GitHub
parent a8456dd188
commit 1964481ff2

View File

@@ -412,7 +412,12 @@ export const ScenePlayer: React.FC<IScenePlayerProps> = ({
playerRef.current?.pause(); playerRef.current?.pause();
}; };
const onScrubberSeek = (seconds: number) => { const onScrubberSeek = (seconds: number) => {
playerRef.current?.currentTime(seconds); const player = playerRef.current;
if (player) {
player.play()?.then(() => {
player.currentTime(seconds);
});
}
}; };
const isPortrait = const isPortrait =