HTML5 video fires pause event while seeked

Refresh

March 2019

Views

412 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

You can use video element's readyState property to check whether the pause event fired when the user seeked or when the user paused.

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.