fix: when the seek input is focused and the video is playing, the space key can't make the video pause, because after 'keyup', it always make the video play

This commit is contained in:
cky 2018-06-06 19:27:07 +08:00
parent c95d9923f7
commit 84424f7f67

View File

@ -563,6 +563,12 @@ class Listeners {
on(this.player.elements.inputs.seek, 'mousedown mouseup keydown keyup touchstart touchend', event => {
const seek = event.currentTarget;
const code = event.keyCode ? event.keyCode : event.which;
const eventType = event.type;
if ((eventType === 'keydown' || eventType === 'keyup') && (code !== 39 && code !== 37)) {
return;
}
// Was playing before?
const play = seek.hasAttribute('play-on-seeked');