AVPlayer Buffer Percentage

Possible duplicate:
Play AVPlayer

I am using AVPlayer to play streaming audio from a URL. I want to show the percentage of buffering during audio streaming. I know that I can watch the playbackBufferEmpty and playBackLiciousToKeepUp properties, but it can only give me information if a buffer is loading.

Do you have any idea how to implement this?

Thank.

+3
source share
1 answer

AVPlayerItem has a property for loaded TimeRanges. If you know the length of the sound, you can use this property to find out what percentage of the audio downloaded at any given time.

+1
source

All Articles