This commit is contained in:
hckrman101 2025-12-04 03:04:27 +02:00 committed by GitHub
commit 2565f8f8b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -361,7 +361,7 @@ export const ScenePlayer: React.FC<IScenePlayerProps> = PatchComponent(
},
nativeControlsForTouch: false,
playbackRates: [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2],
inactivityTimeout: 2000,
inactivityTimeout: 700,
preload: "none",
playsinline: true,
techOrder: ["chromecast", "html5"],
@ -895,15 +895,23 @@ export const ScenePlayer: React.FC<IScenePlayerProps> = PatchComponent(
);
}, [getPlayer, scene]);
const pausedBeforeScrubber = useRef(true);
function onScrubberScroll() {
if (started.current) {
getPlayer()?.pause();
const player = getPlayer();
if (started.current && player) {
pausedBeforeScrubber.current = player.paused();
player.pause();
}
}
function onScrubberSeek(seconds: number) {
if (started.current) {
getPlayer()?.currentTime(seconds);
const player = getPlayer();
if (started.current && player) {
player.currentTime(seconds);
if (!pausedBeforeScrubber.current) {
player.play();
}
} else {
setTime(seconds);
}