- Home /
Stop audio/background music from pausing when showing ads
Is there any way to prevent background music from being paused ever?
I'm working on an game which uses an android chartboost plugin (prime31) to display ads. Whenever I show a static add, my background music gets paused as well. My game is mainly music based, so this sort of ruins the experience a bit.. :(
Is there any way to override this behavior and keep the music playing in the background.?
I actually have the opposite problem... When I show ads (Test Video Ads) my music keeps on playing and gets in the way. Not sure if its a test things, but I think you could look into the code of the plugin a bit. Check for a place where it accesses the audio listener maybe?
Answer by Xarbrough · Jun 24, 2015 at 09:21 AM
The way Unity Ads work on mobile, is that the app is brought to the background, meaning that by default it is completely paused until you click away the ad.
I haven't tested this, but there is an option in Project Settings > Player > Run In background to keep the app running instead of suspending it. Maybe try this.
Your answer
Follow this Question
Related Questions
Loading music for initial scene loading takes a very long time 1 Answer
Audio controls disabled??! 0 Answers
Prime31 Social Breaking Unity Ads 0 Answers
Stereo Mix as Input? 1 Answer
Can not play a disabled audio source 2 Answers