From e2dd74c0afcd4ee0565ea76487f94570964ed954 Mon Sep 17 00:00:00 2001 From: Jip Fr Date: Thu, 30 Mar 2023 19:53:24 +0200 Subject: [PATCH] feat(player): add arrow up/down controls for volume --- src/video/components/actions/KeyboardShortcutsAction.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/video/components/actions/KeyboardShortcutsAction.tsx b/src/video/components/actions/KeyboardShortcutsAction.tsx index cab92baa..d698e656 100644 --- a/src/video/components/actions/KeyboardShortcutsAction.tsx +++ b/src/video/components/actions/KeyboardShortcutsAction.tsx @@ -63,6 +63,14 @@ export function KeyboardShortcutsAction() { toggleVolume(); break; + case "arrowdown": + controls.setVolume(Math.max(mediaPlaying.volume - 0.1, 0)); + break; + + case "arrowup": + controls.setVolume(Math.min(mediaPlaying.volume + 0.1, 1)); + break; + // Do a barrel Roll! case "r": if (isRolling || evt.ctrlKey || evt.metaKey) return;