From fc3412fd4e90c8836dfd8ced6f85c6118adfbe75 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 12 Jan 2022 16:01:39 +0100 Subject: Cleanup player hotkeys --- client/src/assets/player/peertube-player-manager.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'client/src/assets/player') diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts index b5317f45b..d715adf56 100644 --- a/client/src/assets/player/peertube-player-manager.ts +++ b/client/src/assets/player/peertube-player-manager.ts @@ -687,9 +687,20 @@ export class PeertubePlayerManager { player.playbackRate(parseFloat(newValue.toFixed(2))) } }, - frameByFrame: { + previousFrame: { key: function (event: KeyboardEvent) { - return isNaked(event, '.') + return event.key === ',' + }, + handler: function (player: videojs.Player) { + player.pause() + // Calculate movement distance (assuming 30 fps) + const dist = 1 / 30 + player.currentTime(player.currentTime() - dist) + } + }, + nextFrame: { + key: function (event: KeyboardEvent) { + return event.key === '.' }, handler: function (player: videojs.Player) { player.pause() -- cgit v1.2.3