Skip to content

Build your personal knowledge base with Trilium Notes

feat(video_player): keyboard shortcut to toggle full-screen

Elian Doran87229600d2f9
diff --git a/apps/client/src/widgets/type_widgets/file/Video.tsx b/apps/client/src/widgets/type_widgets/file/Video.tsx
index a74e874dc6..6972f57484 100644
--- a/apps/client/src/widgets/type_widgets/file/Video.tsx
+++ b/apps/client/src/widgets/type_widgets/file/Video.tsx
@@ -58,6 +58,15 @@ export default function VideoPreview({ note }: { note: FNote }) {
video.currentTime = Math.min(video.duration, video.currentTime + (e.ctrlKey ? 60 : 10));
flashControls();
break;
+ case "f":
+ case "F":
+ e.preventDefault();
+ if (document.fullscreenElement) {
+ document.exitFullscreen();
+ } else {
+ wrapperRef.current?.requestFullscreen();
+ }
+ break;
}
}, [togglePlayback, flashControls]);