AVPlayer can't resume livestream after pause + some waiting

I use AVPlayer to play an audio livestream via internet. I like to recover playback if it was paused for longer than 1 minute.


I call `player.rate = 1.0` to resume. However if the stream was paused for >1 minute it does not play any more. I need to recreate AVPlayerItem in this case to make it work again.


How can I catch this case, so I know the playback did not recover?


  • I tried KVO on `player.rate`. It stays at `1.0` though. The player is not playing!
  • I tried KVO on `currentItem.playbackBufferEmpty`. It is not called in this case though.
  • `currentItem.status` does not switch to `.Failed`. It does not change at all.


The AVPlayer just seems to do nothing in this case. Any ideas?

Same issue here, even if UIBackgroundModes includes the "audio" string. Any idea on how to catch this situation to workaround the problem? It happens even if the play/pause actions are triggered by an AVPlayerViewController.

AVPlayer can't resume livestream after pause + some waiting
 
 
Q