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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

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 =