From 635f70df6557016b15260454ea3ed6659112964c Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Thu, 30 May 2024 10:17:51 -0600 Subject: [PATCH] Add up / down keyboard shortcut --- web/src/components/player/VideoControls.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/web/src/components/player/VideoControls.tsx b/web/src/components/player/VideoControls.tsx index 168f04fee..7e0259b63 100644 --- a/web/src/components/player/VideoControls.tsx +++ b/web/src/components/player/VideoControls.tsx @@ -139,6 +139,11 @@ export default function VideoControls({ const onKeyboardShortcut = useCallback( (key: string, down: boolean, repeat: boolean) => { switch (key) { + case "ArrowDown": + if (down) { + onSeek(-1); + } + break; case "ArrowLeft": if (down) { onSeek(-10); @@ -149,6 +154,11 @@ export default function VideoControls({ onSeek(10); } break; + case "ArrowUp": + if (down) { + onSeek(1); + } + break; case "f": if (setFullscreen && down && !repeat) { setFullscreen(!fullscreen); @@ -171,7 +181,9 @@ export default function VideoControls({ [video, isPlaying, fullscreen, setFullscreen, onSeek], ); useKeyboardListener( - hotKeys ? ["ArrowLeft", "ArrowRight", "f", "m", " "] : [], + hotKeys + ? ["ArrowDown", "ArrowLeft", "ArrowRight", "ArrowUp", "f", "m", " "] + : [], onKeyboardShortcut, );