AVPlayer doesn't have good error handling for live streaming issues

I noticed when AVPlayer play HLS live video, if the mediaplay list response 404 or other error status code, The AVPlayer will just stop fetching for new playlist. But it doesn't file for AVPlayerItemNewErrorLogEntryNotification event.


This makes hard to implement a reliable live streaming player with error torrelence.

Replies

AFAIK, the general approach to playing HLS is that you (as the client) don't know anything about the content of the Master playlist.


That means it would be pointless to tell you about a problem fetching a Media Playlist - it's way below the level you can see.


Instead, the Master Playlist should contain multiple variants with the same (or nearly identical bit rates) so that when one is unable to be fetched, it can switch to another. That puts the error tolerance down at the framework level.


Here's what I've ben told in the past about HTTP erorr codes vis-a-vis playback:


In general, HTTP errors (other than 410) will put the variant stream into a 2 minute penalty box. A 410 will remove the variant from the list permanently.


A 404/410/5xx from a media segment may cause us to skip the segment and move on to the next.

Unless the stream is unmuxed, which case we will stop playback immediately.

Hello,

I have webvtt links in my playlist and i noticed that when webvtt files are not available on the server (resulting a 404) the whole stream is frozen.

Is there any explanation for that?

thanks

Hello,


I got many cases the AVPlayer getting to idle state. No Error, warning or complaint from the player. No fetching new manifest, or media segments. It just wait until run of buffering then recover from that. The length of the penalty box is 15~20s.


I just wonder what cases else which make AVPlayer suspended like that? Could you share?

Thanks & regards.