mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Use hotkeys '[' and ']' to scrub video player forwards and backwards by 10% of the scene (#2678)
* Use hotkeys '[' and ']' to scrub video player forwards and backwards by 10% of the scene * Don't loop back to beginning * Add manual keybind entry Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
@@ -37,6 +37,14 @@ function handleHotkeys(player: VideoJsPlayer, event: VideoJS.KeyboardEvent) {
|
||||
player.currentTime(time);
|
||||
}
|
||||
|
||||
function seekPercentRelative(percent: number) {
|
||||
const duration = player.duration();
|
||||
const currentTime = player.currentTime();
|
||||
const time = currentTime + duration * percent;
|
||||
if (time > duration) return;
|
||||
player.currentTime(time);
|
||||
}
|
||||
|
||||
if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) {
|
||||
return;
|
||||
}
|
||||
@@ -96,6 +104,12 @@ function handleHotkeys(player: VideoJsPlayer, event: VideoJS.KeyboardEvent) {
|
||||
case 57: // 9
|
||||
seekPercent(0.9);
|
||||
break;
|
||||
case 221: // ]
|
||||
seekPercentRelative(0.1);
|
||||
break;
|
||||
case 219: // [
|
||||
seekPercentRelative(-0.1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,6 +64,9 @@
|
||||
| `p n` | Play next scene in queue |
|
||||
| `p p` | Play previous scene in queue |
|
||||
| `p r` | Play random scene in queue |
|
||||
| `{1-9}` | Seek to 10-90% duration |
|
||||
| `[` | Scrub backwards 10% duration |
|
||||
| `]` | Scrub forwards 10% duration |
|
||||
|
||||
### Scene Markers tab shortcuts
|
||||
|
||||
|
||||
Reference in New Issue
Block a user