UI improvements (#11429)

* Respect classname when no preview is found

* Don't check for go2rtc info if camera is not restramed

* Show error banner when playback fails

* Add keyboard shortcut for fullscreen
This commit is contained in:
Nicolas Mowen
2024-05-19 06:39:17 -06:00
committed by GitHub
parent 171a142adb
commit c1560308bf
5 changed files with 38 additions and 7 deletions

View File

@@ -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);
@@ -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,
);