aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/peertube-player.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2018-09-22 19:01:59 +0200
committerRigel Kent <sendmemail@rigelk.eu>2018-09-22 19:01:59 +0200
commit52b1ba03f401d062d8fe417dd82b4ecbc7dc58cb (patch)
tree9a66ee11d20de7acaeee04aef31734606199a228 /client/src/assets/player/peertube-player.ts
parent81cdf382ffab82357320b575533c784878d4b4c1 (diff)
downloadPeerTube-52b1ba03f401d062d8fe417dd82b4ecbc7dc58cb.tar.gz
PeerTube-52b1ba03f401d062d8fe417dd82b4ecbc7dc58cb.tar.zst
PeerTube-52b1ba03f401d062d8fe417dd82b4ecbc7dc58cb.zip
add chevron hotkeys to change playback rate
Diffstat (limited to 'client/src/assets/player/peertube-player.ts')
-rw-r--r--client/src/assets/player/peertube-player.ts22
1 files changed, 21 insertions, 1 deletions
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: {
69 Object.assign(videojsOptions.plugins, { 69 Object.assign(videojsOptions.plugins, {
70 hotkeys: { 70 hotkeys: {
71 enableVolumeScroll: false, 71 enableVolumeScroll: false,
72 enableModifiersForNumbers: false 72 enableModifiersForNumbers: false,
73 customKeys: {
74 increasePlaybackRateKey: {
75 key: function (event) {
76 // use '>'
77 return event.which === 51
78 },
79 handler: function (player, options, event) {
80 player.playbackRate(player.playbackRate() + 0.1)
81 }
82 },
83 decreasePlaybackRateKey: {
84 key: function (event) {
85 // use '<'
86 return event.which === 50
87 },
88 handler: function (player, options, event) {
89 player.playbackRate(player.playbackRate() - 0.1)
90 }
91 }
92 }
73 } 93 }
74 }) 94 })
75 } 95 }