plyr
plyr copied to clipboard
[Question] Why "ended" event does not fire if autoplay is ON.
This is not a bug or feature request but a clarification question on a statement on the Plyr documentation page.
On the main page of this repo it says:
Event | Description |
---|---|
ended | Sent when playback completes. Note: This does not fire if autoplay is true. |
And I observe this behaviour in Safari on Mac and in any browser on apple mobile devices (iPhone and iPad). I get it somehow related to the fact they don't allow autoplay but I don't understand how 'ended' is related to it and why I can't find it mentioned on MDN (https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/ended_event)
Could someone please shed some light?
Context I have a player with a list of videos (HLS) on a side and when user marks autoplay setting, it should play videos in the list sequentially. But because of this annoying behaviour, I have no visibility (in my code) when playback is finished so I can load next video.
I’m also wondering the same thing. It’s very common to want to autoplay a playlist.