As the title says, is there some way to avoid this? I want to keep any music from an external music player, playing when I run my app.
(IOS) Music from an external player stops when running my app. How do I prevent this from happening?
I am facing the same problem with version 3.9. Basically, when launching my game, I’d like the music from the music player on the ios device to continue and not play the music inside my game. Instead, what’s happening is that the music from my game is overriding the music from the music player.
Is there a way to control this behavior? I scanned the forum and I was surprised that there is no solution and that more people are not talking about it.
Actually I don’t know, how this is done with Cocos Creator, but maybe it is helpful to know how it’s done in cocos2d-x.
You have to set the AudioSessionCategory, if I remember correctly.
Add the following line to
RootViewController.mm right under
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil];
Of course you also need to add
to the top.
Could you find a solution for this topic?
The same issue with cocos2d 3.16 on android.
How to fix it on android?