3

Possible Duplicate:
AVPlayer streaming progress

I'm using AVPlayer to play streamed audio from an URL. I would like to show buffering percentage while audio is being streamed. I know that I can observe playbackBufferEmpty and playBackLikelyToKeepUp properties but it can only give me the information if buffer is loading.

Do you have any ideas how to realize it?

Thanks.

Community
  • 1
  • 1
yury.ku
  • 1,188
  • 1
  • 10
  • 19
  • 1
    This is not a duplicate. The other question just wants `downloaded video / total video duration`, this question is asking for `buffered data / data required for playBackLikelyToKeepUp to be true`. This also takes into account the download rate. Because the implementation of `playBackLikelyToKeepUp` is private we have to guess. I can't find anything useful so far. – vaughan Nov 26 '13 at 06:15

1 Answers1

1

AVPlayerItem has a property for loadedTimeRanges. If you know the length of the audio then you can use this property to figure out what percentage of the audio has downloaded at any given time.

SteveB
  • 652
  • 3
  • 12