Skip to content

Build your personal knowledge base with Trilium Notes

feat(video_player): add keyboard shortcuts for toggling volume

Elian Dorand81dec94a9c0
diff --git a/apps/client/src/widgets/type_widgets/file/Video.tsx b/apps/client/src/widgets/type_widgets/file/Video.tsx
index d797a855be..511fd6c25c 100644
--- a/apps/client/src/widgets/type_widgets/file/Video.tsx
+++ b/apps/client/src/widgets/type_widgets/file/Video.tsx
@@ -73,6 +73,16 @@ export default function VideoPreview({ note }: { note: FNote }) {
video.muted = !video.muted;
flashControls();
break;
+ case "ArrowUp":
+ e.preventDefault();
+ video.volume = Math.min(1, video.volume + 0.05);
+ flashControls();
+ break;
+ case "ArrowDown":
+ e.preventDefault();
+ video.volume = Math.max(0, video.volume - 0.05);
+ flashControls();
+ break;
case "Home":
e.preventDefault();
video.currentTime = 0;