Keep Audio Playing when Sleep / IDLE

Hello,

Please, there is any way to keep the audio playing when device go to sleep?

I’m avoiding the sleep using “system.setIdleTimer( false )” and showing a black screen but when the user press the power button to force the sleep the audio stop.

I’m building an audio app, to listen long ambient sounds and podcasts and testing it in a iphone.

Thank you very much [import]uid: 6732 topic_id: 29706 reply_id: 329706[/import]

Don’t know how to do this on Android, but on iOS add this to your build.settings in the plist section:

 UIBackgroundModes = {  
 "audio"  
 }  

Then anything played through medial.playVideo() (which plays music too) will play in the background when the device sleeps.
[import]uid: 19626 topic_id: 29706 reply_id: 119228[/import]

Thank you,

It is working… It is hard to find in corona docs…
[import]uid: 6732 topic_id: 29706 reply_id: 119241[/import]

It is possible to identify if an application is going to background by pressing the Home Button or by pressing the Sleep Button on the iOS?

I’m using the system events and the two buttons call “applicationSuspend”

In the console when I press the home button get nothing and the sleep button get this:

Aug 31 13:57:38 unknown SpringBoard[46697] : Posting ‘com.apple.iokit.hid.displayStatus’ notifyState=0
Aug 31 13:57:38 unknown SpringBoard[46697] : MultitouchHID: detection mode: 0->255
Aug 31 13:57:38 unknown UserEventAgent[12] : DEBUG: Changing screen blanked state: 1
Reference:
http://docs.coronalabs.com/api/event/system/type.html [import]uid: 6732 topic_id: 29706 reply_id: 122025[/import]

It is possible to identify if an application is going to background by pressing the Home Button or by pressing the Sleep Button on the iOS?

I’m using the system events and the two buttons call “applicationSuspend”

In the console when I press the home button get nothing and the sleep button get this:

Aug 31 13:57:38 unknown SpringBoard[46697] : Posting ‘com.apple.iokit.hid.displayStatus’ notifyState=0
Aug 31 13:57:38 unknown SpringBoard[46697] : MultitouchHID: detection mode: 0->255
Aug 31 13:57:38 unknown UserEventAgent[12] : DEBUG: Changing screen blanked state: 1
Reference:
http://docs.coronalabs.com/api/event/system/type.html [import]uid: 6732 topic_id: 29706 reply_id: 122025[/import]