From: Rigel Kent Date: Sat, 22 Sep 2018 17:01:59 +0000 (+0200) Subject: add chevron hotkeys to change playback rate X-Git-Tag: v1.0.0-beta.14~20 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=52b1ba03f401d062d8fe417dd82b4ecbc7dc58cb;p=github%2FChocobozzz%2FPeerTube.git add chevron hotkeys to change playback rate --- diff --git a/client/src/assets/player/peertube-player.ts b/client/src/assets/player/peertube-player.ts index eca2ce6c3..5cea69eb8 100644 --- a/client/src/assets/player/peertube-player.ts +++ b/client/src/assets/player/peertube-player.ts @@ -69,7 +69,27 @@ function getVideojsOptions (options: { Object.assign(videojsOptions.plugins, { hotkeys: { enableVolumeScroll: false, - enableModifiersForNumbers: false + enableModifiersForNumbers: false, + customKeys: { + increasePlaybackRateKey: { + key: function (event) { + // use '>' + return event.which === 51 + }, + handler: function (player, options, event) { + player.playbackRate(player.playbackRate() + 0.1) + } + }, + decreasePlaybackRateKey: { + key: function (event) { + // use '<' + return event.which === 50 + }, + handler: function (player, options, event) { + player.playbackRate(player.playbackRate() - 0.1) + } + } + } } }) }