I have a standard HTML5 video element. I would like to pause the video at specific frames (not minutes) via pure JavaScript.
<video id="media-video" controls>
<source id="media-source" src="media/video.mp4" type="video/mp4">
</video>
Also given is a JavaScript array, which defines frames, where the video should stop.
var stopframes = [300, 600, 900];
Unfortunately, I have only a solution for stopping the video at a specific time by seconds:
video.addEventListener('timeupdate', function () {
if (mediaPlayer.currentTime > stopframes[0]) {
...
}
});
How can I stop the video at one specific frame with pure JavaScript?