customKeys: {
increasePlaybackRateKey: {
key: function (event) {
- // use '>'
- return event.which === 51
+ return event.key === '>'
},
- handler: function (player, options, event) {
- player.playbackRate(player.playbackRate() + 0.1)
+ handler: function (player) {
+ player.playbackRate((player.playbackRate() + 0.1).toFixed(2))
}
},
decreasePlaybackRateKey: {
key: function (event) {
- // use '<'
- return event.which === 50
+ return event.key === '<'
},
- handler: function (player, options, event) {
- player.playbackRate(player.playbackRate() - 0.1)
+ handler: function (player) {
+ player.playbackRate((player.playbackRate() - 0.1).toFixed(2))
}
}
}
// Voodoo magic for IOS
setTimeout(() => {
this.build()
+
+ // Update on rate change
+ player.on('ratechange', this.submenuClickHandler)
+
this.reset()
}, 0)
})
target = event.currentTarget
}
- if (target.classList.contains('vjs-back-button')) {
+ if (target && target.classList.contains('vjs-back-button')) {
this.loadMainMenu()
return
}