Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI improvements #11429

Merged
merged 4 commits into from
May 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Add keyboard shortcut for fullscreen
  • Loading branch information
NickM-27 committed May 19, 2024
commit eaedfe60701bfb12369d97c9752ea439ee9e03d5
9 changes: 7 additions & 2 deletions web/src/components/player/VideoControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ export default function VideoControls({
onSeek(10);
}
break;
case "f":
if (setFullscreen && down && !repeat) {
setFullscreen(!fullscreen);
}
break;
case "m":
if (setMuted && down && !repeat && video) {
setMuted(!muted);
Expand All @@ -157,10 +162,10 @@ export default function VideoControls({
},
// only update when preview only changes
// eslint-disable-next-line react-hooks/exhaustive-deps
[video, isPlaying, onSeek],
[video, isPlaying, fullscreen, setFullscreen, onSeek],
);
useKeyboardListener(
hotKeys ? ["ArrowLeft", "ArrowRight", "m", " "] : [],
hotKeys ? ["ArrowLeft", "ArrowRight", "f", "m", " "] : [],
onKeyboardShortcut,
);

Expand Down