Adding fullscreen keyboard shortcut.

This commit is contained in:
Roland 2026-03-27 17:59:36 -06:00
parent d9fef1bfa2
commit 81f1456fed
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
2 changed files with 12 additions and 0 deletions

View file

@ -250,6 +250,17 @@ function VideoPage({videoFile, prevFile, nextFile, fetchVideo, ...props}) {
}
}, {enableOnFormTags: false}, [prevFile, navigate]);
// f: Toggle fullscreen
useHotkeys('f', () => {
if (videoRef.current) {
if (document.fullscreenElement) {
document.exitFullscreen();
} else {
videoRef.current.requestFullscreen();
}
}
}, {enableOnFormTags: false});
if (videoFile === null) {
return <VideoPlaceholder/>;
}