mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-19 22:46:20 -05:00
Adding fullscreen keyboard shortcut.
This commit is contained in:
parent
d9fef1bfa2
commit
81f1456fed
2 changed files with 12 additions and 0 deletions
|
|
@ -34,6 +34,7 @@ export const SHORTCUTS = [
|
|||
{keys: 'l', description: 'Jump forward 30 seconds', category: 'Video Player'},
|
||||
{keys: 'n', description: 'Navigate to newer video', category: 'Video Player'},
|
||||
{keys: 'p', description: 'Navigate to older video', category: 'Video Player'},
|
||||
{keys: 'f', description: 'Toggle fullscreen', category: 'Video Player'},
|
||||
];
|
||||
|
||||
function SearchModal({open, onClose}) {
|
||||
|
|
|
|||
|
|
@ -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