feat: shift + arrows to seek track
This commit is contained in:
@@ -36,6 +36,7 @@ function getReactions(particle: Particle): Record<string, string[]> | undefined
|
||||
|
||||
const EXIT_DELAY_MS = 5000;
|
||||
const EXIT_TICK_MS = 100;
|
||||
const SEEK_DELTA_SEC = 5;
|
||||
|
||||
type PlaybackStatus = "idle" | "playing" | "ended";
|
||||
|
||||
@@ -99,6 +100,7 @@ const STREAM_VIEW_KEYBINDINGS: KeybindingGroup[] = [
|
||||
bindings: [
|
||||
{ keys: ["Hold", "Space"], description: "Pause" },
|
||||
{ keys: ["Hold", "Shift"], description: "1.5× speed" },
|
||||
{ keys: ["Shift", "←", "→"], description: "Seek ±5s" },
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -269,11 +271,17 @@ function StreamViewInner({ path, streamParticle }: StreamViewProps) {
|
||||
|
||||
switch (e.key) {
|
||||
case "ArrowRight":
|
||||
e.preventDefault();
|
||||
if (!e.shiftKey || !mediaRef.current?.seek(SEEK_DELTA_SEC)) next();
|
||||
break;
|
||||
case "ArrowDown":
|
||||
e.preventDefault();
|
||||
next();
|
||||
break;
|
||||
case "ArrowLeft":
|
||||
e.preventDefault();
|
||||
if (!e.shiftKey || !mediaRef.current?.seek(-SEEK_DELTA_SEC)) prev();
|
||||
break;
|
||||
case "ArrowUp":
|
||||
e.preventDefault();
|
||||
prev();
|
||||
|
||||
Reference in New Issue
Block a user