mirror of https://github.com/Chocobozzz/PeerTube
add chevron hotkeys to change playback rate
parent
81cdf382ff
commit
52b1ba03f4
|
@ -69,7 +69,27 @@ function getVideojsOptions (options: {
|
||||||
Object.assign(videojsOptions.plugins, {
|
Object.assign(videojsOptions.plugins, {
|
||||||
hotkeys: {
|
hotkeys: {
|
||||||
enableVolumeScroll: false,
|
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 New Issue