0

I want to know -- what happens to a user's music when an AVPlayer starts to play? Does nothing happen, does it stop, or does the action cancel itself? If so, how would I check and see if the user is playing music?

Apple's Documentation for this confused me.

DDPWNAGE
  • 1,423
  • 10
  • 37
  • Have you tried it for yourself? – sangony Apr 24 '15 at 23:34
  • 1
    @sangony I didn't get to. I don't have an Apple Developer account. I'm still a senior in high school. I didn't want to spring the $99/year and get a Tax ID until before I had to implement multiplayer and Game Center. – DDPWNAGE Apr 24 '15 at 23:47

1 Answers1

3

Alright, looking up the info for this, it seems that AVAudioPlayer objects only interrupts the user's audio if the app's AVAudioSession's category is set to Solo Ambient, the default.

I saw this answer: App with AVPlayer plays mp4 interrupt iPod music after launched

I also saw this table in the Apple Developer documentation that explains whether or not different categories interrupt the user's music, with examples of different scenarios, including one for a game: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/Sound.html#//apple_ref/doc/uid/TP40006556-CH44-SW1

In order to not interrupt the user's music, I need to set this to Ambient.

Community
  • 1
  • 1
DDPWNAGE
  • 1,423
  • 10
  • 37