1
0
Fork 0

add chevron hotkeys to change playback rate

This commit is contained in:
Rigel Kent 2018-09-22 19:01:59 +02:00
parent 81cdf382ff
commit 52b1ba03f4
No known key found for this signature in database
GPG key ID: EA12971B0E438F36

View file

@ -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)
}
}
}
}
})
}