質問

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

役に立ちましたか?

解決 2

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.

他のヒント

Go to your plist and add the row "Required background modes" with the key "App plays audio or streams audio/video using AirPlay"

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top