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,
|
||||
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"],
|
||||
|
|
@ -893,15 +893,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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue