Looping HLS videos in native Safari

(will only work in browsers that support HLS natively)

The HLS sources for some of these test streams live here: dylanjha/hls-streams

After the 2nd loop in Safari iOS 14.3 on iPhone X or iPhone 12 we're seeing the playback glitch

1. Mux HLS test

This is an HLS video created with Mux video

2. HLS.js test stream

This is an HLS video that Hls.js uses as a test stream (I downloaded it and made it shorter by removing a bunch of the segments at the end)

3. multi-rendition HLS test (not created by Mux)

This is an HLS video created with a fairly vanilla ffmpeg command

4. Manually looping, avoiding the 'loop' attribute

This is an attempt to avoid the 'loop' attribute. We will listen for the player to emit 'ended' and then call play() manually. (Doesn't help with the bug).