Reputation: 303
I have an audio element in the UIWebView, but when I lock the screen, the audio will be paused. How can I continue to play it when the screen locked?
Upvotes: 2
Views: 1668
Reputation: 57
You must ensure that background audio is enabled in your iOS app. You can find a sample project here https://github.com/jsagorin/iOSBackgroundAudio
Upvotes: 0
Reputation: 68
If you are talking about iOS devices, then as long as you do not bookmark the site to the home screen and Safari is open and playing the audio, it will continue to play when the screen locks. Only if you try to multi-task will it shut off the sound on your page.
Upvotes: 2