HTML5 video fires pause event while seeked

Refresh

6 days ago

Views

395 time

1

I am designing an app which uses HTML 5 video. When I seek while the video is running "video pause" event is fired which in turns affect my logic for actions which has to happen during seeking. Is there a way by which I can remove this pause event or find that particular pause events which happen with seeking?

2 answers

2

Вы можете использовать видео элемент readyStateсвойство , чтобы проверить уволило ли событие паузы , когда пользователь добившегося или когда пользователь сделал паузу.

var vid = document.getElementById("myVideo");
var vidState = vid.readyState;   //when user hit the pause button, this value will be 4
2

I'd suggest you read though the HTML5 spec to understand how events work when seeking: https://www.w3.org/TR/2011/WD-html5-20110113/video.html#seeking

Without a code sample it is hard to diagnose, but you could try testing the seeking event during your pause handler.