Hi,
I’m referring to this discussion:
Used this piece code Anonymous provided in my app:
function keepPlayingAudio() -- Set the audio mix mode to allow sounds from the app to mix with other sounds from the device if audio.supportsSessionProperty == true then print("supportsSessionProperty is true") audio.setSessionProperty(audio.MixMode, audio.AmbientMixMode) end -- Store whether other audio is playing. It's important to do this once and store the result now, -- as referring to audio.OtherAudioIsPlaying later gives misleading results, since at that point -- the app itself may be playing audio isOtherAudioPlaying = false if audio.supportsSessionProperty == true then print("supportsSessionProperty is true") if not(audio.getSessionProperty(audio.OtherAudioIsPlaying) == 0) then --print("I think there is other Audio Playing") isOtherAudioPlaying = true end end end keepPlayingAudio ()
Seemed to be working but when I tried it on device I noticed it actually doesn’t let the background audio stop when I open my app, except for the first I open it. NOT the first launch of the app once installed, but when I quit the app from working in background and re-open it the audio I’m playing (music, podcast,…) stops playing. If I pull up control center (ios 8) audio restart (without having to tap play).
What do you think It’s due to? and how to fix?
It’s very important in my app not have background audio interruptions…
Thanks!