mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 09:22:31 -06:00
add video hotkeys for digit-seeking
This commit is contained in:
parent
4a76663fb2
commit
daa6f4c94c
|
@ -373,6 +373,7 @@ the browser has the following hotkeys (always qwerty)
|
||||||
* `Esc` close viewer
|
* `Esc` close viewer
|
||||||
* videos:
|
* videos:
|
||||||
* `U/O` skip 10sec back/forward
|
* `U/O` skip 10sec back/forward
|
||||||
|
* `0..9` jump to 0%..90%
|
||||||
* `P/K/Space` play/pause
|
* `P/K/Space` play/pause
|
||||||
* `M` mute
|
* `M` mute
|
||||||
* `C` continue playing next video
|
* `C` continue playing next video
|
||||||
|
|
|
@ -224,6 +224,7 @@ window.baguetteBox = (function () {
|
||||||
['space, P, K', 'video: play / pause'],
|
['space, P, K', 'video: play / pause'],
|
||||||
['U', 'video: seek 10sec back'],
|
['U', 'video: seek 10sec back'],
|
||||||
['P', 'video: seek 10sec ahead'],
|
['P', 'video: seek 10sec ahead'],
|
||||||
|
['0..9', 'video: seek 0%..90%'],
|
||||||
['M', 'video: toggle mute'],
|
['M', 'video: toggle mute'],
|
||||||
['V', 'video: toggle loop'],
|
['V', 'video: toggle loop'],
|
||||||
['C', 'video: toggle auto-next'],
|
['C', 'video: toggle auto-next'],
|
||||||
|
@ -248,7 +249,7 @@ window.baguetteBox = (function () {
|
||||||
if (e.ctrlKey || e.altKey || e.metaKey || e.isComposing || modal.busy)
|
if (e.ctrlKey || e.altKey || e.metaKey || e.isComposing || modal.busy)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var k = e.code + '', v = vid();
|
var k = e.code + '', v = vid(), pos = -1;
|
||||||
|
|
||||||
if (k == "ArrowLeft" || k == "KeyJ")
|
if (k == "ArrowLeft" || k == "KeyJ")
|
||||||
showPreviousImage();
|
showPreviousImage();
|
||||||
|
@ -264,6 +265,8 @@ window.baguetteBox = (function () {
|
||||||
playpause();
|
playpause();
|
||||||
else if (k == "KeyU" || k == "KeyO")
|
else if (k == "KeyU" || k == "KeyO")
|
||||||
relseek(k == "KeyU" ? -10 : 10);
|
relseek(k == "KeyU" ? -10 : 10);
|
||||||
|
else if (k.indexOf('Digit') === 0)
|
||||||
|
vid().currentTime = vid().duration * parseInt(k.slice(-1)) * 0.1;
|
||||||
else if (k == "KeyM" && v) {
|
else if (k == "KeyM" && v) {
|
||||||
v.muted = vmute = !vmute;
|
v.muted = vmute = !vmute;
|
||||||
mp_ctl();
|
mp_ctl();
|
||||||
|
|
Loading…
Reference in a new issue