aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/peertube-player.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-09-24 17:44:50 +0200
committerChocobozzz <me@florianbigard.com>2018-09-24 17:44:50 +0200
commit5363a766d95ed8654ad3e1b94538f085c2a3a101 (patch)
tree4bcbce6da8a3f99059821abc6e1cd80a739c183e /client/src/assets/player/peertube-player.ts
parent47d0b3ee611d1ae85c92149521619ebdf5f5cc25 (diff)
downloadPeerTube-5363a766d95ed8654ad3e1b94538f085c2a3a101.tar.gz
PeerTube-5363a766d95ed8654ad3e1b94538f085c2a3a101.tar.zst
PeerTube-5363a766d95ed8654ad3e1b94538f085c2a3a101.zip
Fix playback rate hotkey
Diffstat (limited to 'client/src/assets/player/peertube-player.ts')
-rw-r--r--client/src/assets/player/peertube-player.ts14
1 files changed, 6 insertions, 8 deletions
diff --git a/client/src/assets/player/peertube-player.ts b/client/src/assets/player/peertube-player.ts
index 5cea69eb8..2c16c87ec 100644
--- a/client/src/assets/player/peertube-player.ts
+++ b/client/src/assets/player/peertube-player.ts
@@ -73,20 +73,18 @@ function getVideojsOptions (options: {
73 customKeys: { 73 customKeys: {
74 increasePlaybackRateKey: { 74 increasePlaybackRateKey: {
75 key: function (event) { 75 key: function (event) {
76 // use '>' 76 return event.key === '>'
77 return event.which === 51
78 }, 77 },
79 handler: function (player, options, event) { 78 handler: function (player) {
80 player.playbackRate(player.playbackRate() + 0.1) 79 player.playbackRate((player.playbackRate() + 0.1).toFixed(2))
81 } 80 }
82 }, 81 },
83 decreasePlaybackRateKey: { 82 decreasePlaybackRateKey: {
84 key: function (event) { 83 key: function (event) {
85 // use '<' 84 return event.key === '<'
86 return event.which === 50
87 }, 85 },
88 handler: function (player, options, event) { 86 handler: function (player) {
89 player.playbackRate(player.playbackRate() - 0.1) 87 player.playbackRate((player.playbackRate() - 0.1).toFixed(2))
90 } 88 }
91 } 89 }
92 } 90 }