HTML5 video fires pause event while seeked


March 2019


412 time


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


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

I'd suggest you read though the HTML5 spec to understand how events work when seeking:

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