Reputation: 21
I've tried to write my first iOS app. It's a simple UIWebView of a site with HTML5 audio stream (radio). When app is in foreground the audio works perfectly, but, if press the home button or lock the device the audio stop!
If click play on lockscreen or on control center, audio work for about 10 second.
Any solution?
Sorry for bad english
Upvotes: 2
Views: 2160
Reputation: 835
From http://www.raywenderlich.com/29948/backgrounding-for-ios, the part which explains Playing Audio in Background
: "If it still doesn’t work for you, it is probably because you’re using the Simulator. Testing it on a device should get it working"
You should try on the Device.
Upvotes: 0
Reputation: 835
Go to your plist and add the row "Required background modes" with the key "App plays audio or streams audio/video using AirPlay"
Upvotes: 1