A f'up for my comment above: The onended event fires only after the video player has spent its contents and went black. So, between the end of the video and the poster, we see a black flicker.
To prevent flickering, I just ran the video near its end and then called .load() to put the player on the poster:
<video ontimeupdate="video_time_update(this)" poster="/ourMovie.png"> <source src="/ourMovie.mp4" type="video/mp4"> </video>
...
function video_time_update(video) { if (video.currentTime > 3.3) { video.load(); } }
Please note that we know that our video lasts 3.4 seconds, and we are not averse to skipping the last few frames. video_time_update() is lazy and does not require for each tick.
And note that those of you who serve videos of unknown duration may need this.duration instead of 3.3, there.
Phlip
source share