How to stop HTML5 audio when iOS4 iPhone Web app is put into background? -
I am creating a web app for iPhone (on chirpid.com) which runs an audio file to identify cricket co. is. User can start and stop audio by tapping the screen button, but if the user taps the Home button while playing the sound button, then it continues to play in the background (the iOS 4 feature). I want to stop the audio in this case. Is there an event or property that I can use in Safari via javascript to determine when I have been placed in the background?
You can manually trigger the "stop" button like this when closing the app .
- (zero) applicationDidderbackground: (UIApplication *) application {if (AudioIsplaying) {[btnStop sendActionsForControlEvents: UIControlEventTouchUpInside]; }}
When you use the application, you receive 5 seconds to do anything: Background Background: Function. It should be enough to stop the audio; -).
Comments
Post a Comment