Allow iTunes to Keep Playing!

[I feel like I saw this in here, but I searched and couldn’t find it.]

Would love the ability to let iTunes music play while the app is running – Not even intermingled … if I’m willing to have NO sound in the app, I’d just like to let iTunes play through if the user started playing music before opening the app.

Hope this makes sense … getting a few low ratings cause we can’t do it, so I figured I’d ask.

Thanks,
~~Kenn [import]uid: 13859 topic_id: 16265 reply_id: 316265[/import]

See
http://developer.anscamobile.com/forum/2011/06/05/new-audiosession-properties [import]uid: 7563 topic_id: 16265 reply_id: 60561[/import]

That’s awesome… But I’m totally missing what I need to set in build.settings.

I’m just going with a simple this:

local is\_supported = audio.supportsSessionProperty  
if (is\_supported) then  
 -- If another app/iPod is playing background music, then allow that music to continue playing,  
 if audio.getSessionProperty( audio.OtherAudioIsPlaying ) == 1 then   
 audio.setSessionProperty(audio.MixMode, audio.AmbientMixMode)  
 end  
 end  

Any help on what the build.settings entry is? :slight_smile:

Thanks!!!
[import]uid: 13859 topic_id: 16265 reply_id: 60565[/import]

This goes in your regular code, not build.settings.
[import]uid: 7563 topic_id: 16265 reply_id: 60575[/import]

Yeah, got that … but as soon as the app starts, the iPod music I had playing still stops.

Seems like somewhere we’d need to tell iOS to not stop the music before the app “starts”?

If not… this code either doesn’t actually work … or there’s miscommunication on what I want to do —> which is leave a song playing on the iPod when I open my app.
:slight_smile:
Help appreciated!
~~Kenn [import]uid: 13859 topic_id: 16265 reply_id: 60576[/import]

I just tested with the TimeAnimation example. I put this at the very top of main.lua:

local is_supported = audio.supportsSessionProperty
if (is_supported) then
audio.setSessionProperty(audio.MixMode, audio.AmbientMixMode)
end

It works fine when my iPod is already playing music.

[import]uid: 7563 topic_id: 16265 reply_id: 60579[/import]

Awesome-sauce… indeed. I had it below these two lines of code:

display.setStatusBar( display.HiddenStatusBar )
crawlSpace = require (“crawlSpace”)

… when I moved it to the tippy top, above them it’s golden…
dunno which of the two is the culprit, though. :wink:
THANK YOU! This is great!
~~Kenn [import]uid: 13859 topic_id: 16265 reply_id: 60581[/import]