mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-02 04:46:18 -05:00
Adding fullscreen keyboard shortcut.
This commit is contained in:
parent
d9fef1bfa2
commit
81f1456fed
2 changed files with 12 additions and 0 deletions
|
|
@ -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/>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue