2

I was using an AVPlayer to stream remote audio files. When an item ended, i would load up a new item into the AVPlayer and then start playing again. This worked well in both foreground and in the background in iOS 9.2 . With the release of iOS 9.3 this method no longer worked. I had to switch over to using an AVQueuePlayer in order to ensure that when a song ended the audio would continue to the next song.

My issue now is that there are scenarios in my app that require the AVQueuePlayer, or the AVPlayer to get a new URL and load it into the player then begin playing it, all while in the background. This was working fine in iOS 9.2 but now with 9.3 it just stopped working.

Does anybody know why this stopped working and how to fix it? Is it common for Apple to make a change like this and not mention anything about it?

Update: I have even tried a hack, where i begin playback of a second player, while the first one loads a new item from a new URL, so that audio never stops. This also didnt work.

MikeG
  • 3,745
  • 1
  • 29
  • 51

1 Answers1

1

By adding the line

UIApplication.sharedApplication().beginReceivingRemoteControlEvents()

to view did load...this solved the problem...

MikeG
  • 3,745
  • 1
  • 29
  • 51