Does anyone know if AVQueuePlayer starts buffering the next AVPlayerItem when the current item is about to finish playing?
I know there’s nothing in the docs to suggest this, I’m asking mostly if anyone has observed this kind of behavior or not.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Ok, I’ve looked over this problem again and written some code to check out
AVQueuePlayer.jollyCocoa’s answer pointed me in the right direction by suggesting to observe the status property on
AVPlayerItem. However the documentation doesn’t seem to point out that this property (and it’sAVPlayerItemStatusReadyToPlayvalue in particular) might be related to buffering.However the
AVPlayerItem'sloadedTimeRangesproperty seems more related to buffering.Doing KVO on that array was a bit trickier – the array object itself doesn’t change, only it’s items do – so I resorted to printing out it’s content every second.
What I found out is that a few seconds in the queue’s first item, the
loadedTimeRangesfor the second item shows up a newCMTimeRangewith start time 0 and some small duration. The duration can increase up to 60 or so seconds while the previous item keeps playing.Short answer:
AVQueuePlayerwill buffer the nextAVPlayerItemwhile playing the current one.