I took an mp4 video, encoded it for HTTP Live Streaming (HLS) using ffmpeg — resulting in a series of myvideo.ts files and a myvideo.m3u8 playlist — and am attempting to play it using the HTML <video>
tag in Safari, with the native HLS capabilities of that browser:
<video id="myvideo" src="myvideo.m3u8" loop="loop"></video>
It plays, once. But despite the "loop" attribute in the video tag, it doesn't loop. It stays frozen on the last frame of the video.
If I try to detect the end of the video using an event listener as described here: Detect when an HTML5 video finishes … that event never seems to fire.
The "paused" property in javascript (document.getElementById('myvideo').paused
) evaluates to false, even after the video has played once and stopped.
How can I get the video to loop in Safari?