Is it possible to know if the AVPlayerItem buffer has stopped buffering and won't resume

I implemented KVO for PlayLiciousToKeepUp and PlayBufferEmpty, and also added a watcher to notify AVPlayerItemPlaybackStalledNotification.

I use Buffer Empty and Keep up events to show / hide the buffering activity indicator, and if I get a playback block notification, I show an error message above the player until I get a Keep Up event to return true; I've noticed that sometimes after the stall, the buffer won't try to resume playback. Also, searching for this game will solve this problem.

Is there a way for the player to automatically save buffering, or to tell me if the buffer is completely stopped and won't keep trying to play?

I have annotated the logs to show this functionality.

**APP HITS LOW BANDWIDTH STALL NOTIFICATION GOES OUT
2014-11-22 09:09:16.887 SampleApp[216:60b] Playback Stall Notification: Show Error Slate
2014-11-22 09:09:29.072 SampleApp[216:60b] Playback Buffer Event: Buffer Empty - False
2014-11-22 09:09:29.373 SampleApp[216:60b] Playback Buffer Event: Playback Likely to keep up - True (If showing, hide error)
2014-11-22 09:09:44.466 SampleApp[216:60b] Playback Buffer Event: Playback Likely to keep up - False
**VIDEO PLAYBACK RESUMES
2014-11-22 09:09:44.468 SampleApp[216:60b] Playback Buffer Event: Buffer Empty - True
2014-11-22 09:09:45.839 SampleApp[216:60b] Playback Buffer Event: Buffer Empty - False
2014-11-22 09:09:47.582 SampleApp[216:60b] Playback Buffer Event: Playback Likely to keep up - True (If showing, hide error)
**VIDEO HAS JUST BEEN SEEKED FORWARD
2014-11-22 09:10:03.556 SampleApp[216:60b] Playback Buffer Event: Playback Likely to keep up - False
2014-11-22 09:10:03.558 SampleApp[216:60b] Playback Buffer Event: Buffer Empty - True
**PLAY BACK STALLS BUFFER MAKES NO ATTEMPT TO RESUME -- LOGS GENERATED BY HITTING PLAY BUTTON
2014-11-22 09:10:03.560 SampleApp[216:60b] Playback Stall Notification: Show Error Slate
2014-11-22 09:10:25.491 SampleApp[216:60b] Playback Buffer Event: Playback Likely to keep up - False
2014-11-22 09:10:25.494 SampleApp[216:60b] Playback Buffer Event: Buffer Empty - True
2014-11-22 09:10:25.495 SampleApp[216:60b] Playback Stall Notification: Show Error Slate
2014-11-22 09:10:27.302 SampleApp[216:60b] Playback Buffer Event: Playback Likely to keep up - False
2014-11-22 09:10:27.304 SampleApp[216:60b] Playback Buffer Event: Buffer Empty - True
2014-11-22 09:10:27.305 SampleApp[216:60b] Playback Stall Notification: Show Error Slate
2014-11-22 09:10:52.266 SampleApp[216:60b] Playback Buffer Event: Playback Likely to keep up - False
2014-11-22 09:10:52.269 SampleApp[216:60b] Playback Buffer Event: Buffer Empty - True
2014-11-22 09:10:52.270 SampleApp[216:60b] Playback Stall Notification: Show Error Slate
2014-11-22 09:10:53.521 SampleApp[216:60b] Playback Buffer Event: Playback Likely to keep up - False
2014-11-22 09:10:53.523 SampleApp[216:60b] Playback Buffer Event: Buffer Empty - True
2014-11-22 09:10:53.525 SampleApp[216:60b] Playback Stall Notification: Show Error Slate
2014-11-22 09:10:57.542 SampleApp[216:60b] Playback Buffer Event: Playback Likely to keep up - False
2014-11-22 09:10:57.545 SampleApp[216:60b] Playback Buffer Event: Buffer Empty - True
**I'VE MOVED THE PLAYHEAD UP SLIGHTLY AND THE BUFFERING EVENTS AND PLAYBACK HAVE RETURNED
2014-11-22 09:10:58.817 SampleApp[216:60b] Playback Buffer Event: Buffer Empty - False
2014-11-22 09:10:59.502 SampleApp[216:60b] Playback Buffer Event: Playback Likely to keep up - True (If showing, hide error slate)

      

+3


source to share





All Articles