mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 08:26:00 +01:00
Resume after scrubbing, hide player UI faster
This commit is contained in:
parent
97c01c70b3
commit
af2d1fa6b0
1 changed files with 13 additions and 5 deletions
|
|
@ -360,7 +360,7 @@ export const ScenePlayer: React.FC<IScenePlayerProps> = PatchComponent(
|
||||||
},
|
},
|
||||||
nativeControlsForTouch: false,
|
nativeControlsForTouch: false,
|
||||||
playbackRates: [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2],
|
playbackRates: [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2],
|
||||||
inactivityTimeout: 2000,
|
inactivityTimeout: 700,
|
||||||
preload: "none",
|
preload: "none",
|
||||||
playsinline: true,
|
playsinline: true,
|
||||||
techOrder: ["chromecast", "html5"],
|
techOrder: ["chromecast", "html5"],
|
||||||
|
|
@ -893,15 +893,23 @@ export const ScenePlayer: React.FC<IScenePlayerProps> = PatchComponent(
|
||||||
);
|
);
|
||||||
}, [getPlayer, scene]);
|
}, [getPlayer, scene]);
|
||||||
|
|
||||||
|
const pausedBeforeScrubber = useRef(true);
|
||||||
|
|
||||||
function onScrubberScroll() {
|
function onScrubberScroll() {
|
||||||
if (started.current) {
|
const player = getPlayer();
|
||||||
getPlayer()?.pause();
|
if (started.current && player) {
|
||||||
|
pausedBeforeScrubber.current = player.paused();
|
||||||
|
player.pause();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onScrubberSeek(seconds: number) {
|
function onScrubberSeek(seconds: number) {
|
||||||
if (started.current) {
|
const player = getPlayer();
|
||||||
getPlayer()?.currentTime(seconds);
|
if (started.current && player) {
|
||||||
|
player.currentTime(seconds);
|
||||||
|
if (!pausedBeforeScrubber.current) {
|
||||||
|
player.play();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
setTime(seconds);
|
setTime(seconds);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue