iOS 4: Remote controls for background audio

后端 未结 7 1388

I\'m currently attempting to set up background audio for an app I\'m developing for iOS 4. The app doesn\'t have a dedicated music player viewController, howeve

7条回答
  •  半阙折子戏
    2020-12-07 18:45

    One thing that seems to influence this behavior is any category options you set for your AVAudioSession using setCategory:withOptions:error: instead of just setCategory:error:. In particular, from trial and error, it appears that if you set AVAudioSessionCategoryOptionMixWithOthers you will not get remote control events; the now playing controls will still control the iPod app. If you set AVAudioSessionCategoryOptionDuckOthers you will get remote control events, but it seems like there may be some ambiguity regarding which app is controlled. Setting the categoryOptions to 0 or just calling setCategory:error: works best.

提交回复
热议问题