feat(video_player): don't hide controls if not playing

This commit is contained in:
Elian Doran 2026-03-10 19:48:21 +02:00
parent fabc07be42
commit f6d61eefcc
No known key found for this signature in database

View File

@ -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(() => {