Why does AVPlayer download the manifest several times?

Hello guys,


I have been working with AVPlayer and HLS protocol for several months.

I usually use Charles proxy to observe the streaming traffic and I find out some weird things


1) When streaming an HLS-based URL, at the initial time, the AVPlayer downloads the manifest file twice (I tried with Apple HLS sample, it does download once)


2) Regarding my observing, the AVPlayer usually downloads the sub-manifest several times for unknown reasons. I have no idea what is the logic which the AVPlayer relies on to determine download these sub-manifest or change to another manifest.


Does anybody know? Please help answer. Thanks a lot.

Replies

1) I believe the first fetch is to determine what sort of file it is. This is prior to any involvement by the HLS playback code.


2) Assuming this is VOD content (rather than live) I don't know why the media playlists would be fetched multiple times. Various media playlists are fetched as it tries to get to the optimum bitrate. If the declared BANDWIDTH in the master playlist is incorrect or your network throughput is erratic then you may do more fetches. In the case of live content media playlists are, of course, repeatedly fetched.