add chevron hotkeys to change playback rate
This commit is contained in:
parent
81cdf382ff
commit
52b1ba03f4
1 changed files with 21 additions and 1 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue