I’d like to code my phonegap app so at a minimum the audio that is streaming/playing can stay active across pages. Even better would be a way to have it interact with the OS and stop when a call comes in or they play their own music or something else.
Has anyone accomplished either of these things yet?
Thanks!
The PhoneGap Media API plays just fine in the background on both iOS and Android.
In iOS you have to make sure to set the required background modes to include playback of audio:
I don’t think anything extra is required for Android.
NOTE: If you have multiple “pages” in your app and music must continue to play amongst them, be sure that the page changes are not actually “file” changes (i.e.: you are still really displaying index.html, just changing content via js/ajax/etc). The common mobile JS frameworks handle this just fine (jQuery Mobile, jQTouch, etc etc).