1
0
mirror of https://github.com/TeamPiped/Piped.git synced 2024-12-14 22:30:28 +05:30

Add hotkeys to slow and speed up video.

Closes #705
This commit is contained in:
FireMasterK 2022-01-12 05:15:32 +00:00
parent ea72e4c3ac
commit 2886ad966b
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD

View File

@ -81,8 +81,11 @@ export default {
.then(hotkeys => { .then(hotkeys => {
this.hotkeys = hotkeys; this.hotkeys = hotkeys;
var self = this; var self = this;
hotkeys("f,m,j,k,l,c,space,up,down,left,right,0,1,2,3,4,5,6,7,8,9", function(e, handler) { hotkeys(
"f,m,j,k,l,c,space,up,down,left,right,0,1,2,3,4,5,6,7,8,9,shift+,,shift+.",
function (e, handler) {
const videoEl = self.$refs.videoEl; const videoEl = self.$refs.videoEl;
console.log(handler.key);
switch (handler.key) { switch (handler.key) {
case "f": case "f":
self.$ui.getControls().toggleFullScreen(); self.$ui.getControls().toggleFullScreen();
@ -166,8 +169,15 @@ export default {
videoEl.currentTime = videoEl.duration * 0.9; videoEl.currentTime = videoEl.duration * 0.9;
e.preventDefault(); e.preventDefault();
break; break;
case "shift+,":
self.$player.trickPlay(Math.max(videoEl.playbackRate - 0.25, 0.25));
break;
case "shift+.":
self.$player.trickPlay(Math.min(videoEl.playbackRate + 0.25, 2));
break;
} }
}); },
);
}); });
}, },
deactivated() { deactivated() {