Reputation: 4858
I have seen 2 properties of AVPlayerItem
:
@property (nonatomic, readonly, getter=isPlaybackBufferFull) BOOL playbackBufferFull;
@property (nonatomic, readonly, getter=isPlaybackBufferEmpty) BOOL playbackBufferEmpty;
Now, here is what Apple documentation says:
playbackBufferFull:
This property reports that the data buffer used for playback has reach capacity. Despite the playback buffer reaching capacity there might not exist sufficient statistical data to support a
playbackLikelyToKeepUp
prediction ofYES
.
playbackBufferEmpty:
It indicates that playback has consumed all buffered media and that playback will stall or end.
From these statements, what I am understanding is that:
playbackBufferFull:
The whole data has been loaded to play. For example, I am playing a video from URL that is 5 minutes long. When all that content till the end has been loaded, these will be true.
playbackBufferEmpty:
The actual playback has consumed all the buffer loaded till now. For example, the data till 2.3 minutes have been loaded and playback too has reached till that time and no more content to present. (I think this is the time to start our merry-go-round, a indicator)
Have I misunderstood anything ? If yes, please correct me..
Any depth knowledge or advice are welcomed !
Upvotes: 2
Views: 1951
Reputation: 131426
I'm no expert on this, but here's my understanding:
Videos are stored in compressed format. They don't get uncompressed until the frames are needed to display. That happens in a playback buffer, in real time, as the video is being displayed.
The playback buffer is a buffer of decompressed frames ready for display. If it's full it does not mean that the full video is ready for play. The playback buffer is only a few seconds long. It means that the few seconds of playback that the playback buffer holds is full.
If it's empty it means that there is no video ready to play back, so the playback is either finished or it's going to freeze and display a "buffering" message while it loads more content.
Upvotes: 5