Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AVPlayer seekToTime download an insane amount of media segment files consuming a lot of data

I'm working in an app where I'm able to play a HLS m3u8 playlist of a streaming radio (audio only) without any problem using an instance of AVPlayer. Using Charles I can see how the playlist is updated properly in a normal pace (each 9-10 seconds, which takes one media segment file). When I perform a seekToTime: (back in time), the player success playing the stream from when I want to, but in Charles I observe how the player starts dowloading a huge amount of media segment files, consuming a lot of data. It seems that the player downloads all the media segment files until that time and then keeps again with the normal behaviour.

I understand that the correct behaviour would be to download the media segment file for the time I'm seeking to, start playing it and then download constantly 1 or 2 media segment files each 9-10 seconds, as it does when I play the stream without timeshift.

My question is if this is a normal behaviour, or if something could be wrong with my m3u8 playlist or the client implementation. Anyone could help me to clarify this?

UPDATED: I can confirm this doesn't happen in iOS 7, so it seems to be a bug introduced by iOS 8.

like image 482
Daniel Avatar asked Oct 31 '22 10:10

Daniel


1 Answers

I've been told by Apple that this is not a bug, but a feature. They've made the buffer bigger since iOS 8.

like image 152
Daniel Avatar answered Nov 11 '22 17:11

Daniel