Skip to content

Commit 635f70d

Browse files
committed
Add up / down keyboard shortcut
1 parent 3886064 commit 635f70d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

web/src/components/player/VideoControls.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ export default function VideoControls({
139139
const onKeyboardShortcut = useCallback(
140140
(key: string, down: boolean, repeat: boolean) => {
141141
switch (key) {
142+
case "ArrowDown":
143+
if (down) {
144+
onSeek(-1);
145+
}
146+
break;
142147
case "ArrowLeft":
143148
if (down) {
144149
onSeek(-10);
@@ -149,6 +154,11 @@ export default function VideoControls({
149154
onSeek(10);
150155
}
151156
break;
157+
case "ArrowUp":
158+
if (down) {
159+
onSeek(1);
160+
}
161+
break;
152162
case "f":
153163
if (setFullscreen && down && !repeat) {
154164
setFullscreen(!fullscreen);
@@ -171,7 +181,9 @@ export default function VideoControls({
171181
[video, isPlaying, fullscreen, setFullscreen, onSeek],
172182
);
173183
useKeyboardListener(
174-
hotKeys ? ["ArrowLeft", "ArrowRight", "f", "m", " "] : [],
184+
hotKeys
185+
? ["ArrowDown", "ArrowLeft", "ArrowRight", "ArrowUp", "f", "m", " "]
186+
: [],
175187
onKeyboardShortcut,
176188
);
177189

0 commit comments

Comments
 (0)