mirror of
https://github.com/zadam/trilium.git
synced 2026-03-13 20:03:36 +01:00
feat(video_player): don't hide controls if not playing
This commit is contained in:
parent
fabc07be42
commit
f6d61eefcc
@ -72,6 +72,7 @@ function useAutoHideControls(videoRef: RefObject<HTMLVideoElement>, playing: boo
|
||||
}, [scheduleHide]);
|
||||
|
||||
const onClick = useCallback((e: MouseEvent) => {
|
||||
if (!playing) return;
|
||||
if ((e.target as HTMLElement).closest(".video-preview-controls")) return;
|
||||
setVisible((prev) => {
|
||||
const next = !prev;
|
||||
@ -79,7 +80,7 @@ function useAutoHideControls(videoRef: RefObject<HTMLVideoElement>, playing: boo
|
||||
if (next) scheduleHide();
|
||||
return next;
|
||||
});
|
||||
}, [scheduleHide]);
|
||||
}, [playing, scheduleHide]);
|
||||
|
||||
// Auto-hide when playback starts, show when paused.
|
||||
useEffect(() => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user