WKAudioFileQueuePlayer and MPRemoteCommandCenter

I'm using WKAudioFileQueuePlayer to play a list of audio files in the background, I have two issues:


- Trying to detect when current item changed while app in the background by adding an observer to currentItem, but it didn't call the observer.


- The remote control can control the audio player (play and pause) BUT any configs and targets with MPRemoteCommandCenter ignored. I want to detect when the user play/pause the audio from the remote center.


Thanks,

Replies

Use AVAudioPlayer instead.


WKAudioFileQueuePlayer won't wake your app in the background for playback events.


You will need to roll your own queue management though, but you'll now be woken in the background when the current AVAsset finishes so you can move to the next one.