在后台播放广播
我只需要确认 iPhone 应用程序是否可以在后台播放或流式传输广播。
我创建了一个运行良好的收音机应用程序。
我想添加一项功能,用户可以通过该功能在后台进程中播放广播,即他们不必保持应用程序打开即可播放广播。
他们可以关闭应用程序,而收音机仍在播放。
我很早以前就读到,Apple 有一个私有 API,应用程序可以通过该 API 在后台运行无线电,但由于它是私有的,所以我无法使用它。
有什么建议吗?
I just need to confirm if an iPhone app can play or stream radio in the background.
I created a radio app which is working fine.
I want to add a feature by which the user can play radio in a background process, i.e. they don't have to keep the application open to play the radio.
They can close the app, and the radio is still playing.
I read a long time back that Apple has a private API by which an app can run radio in the background, but since it is private, I can't use it.
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
iOS SDK需4.0以上;
首先在您的委托代码中:
然后,
我用的是MPMoviePlayerController,AVPlayer也可以;
PS:我的英语很差,我希望这对你有帮助:)
iOS SDK should be above 4.0;
first in your delegate codes:
then,
I used MPMoviePlayerController, and AVPlayer is OK;
PS:my english is poor, I hope this could be helpful to you :)
您可以使用这些音频流媒体之一在后台播放
https://github.com/mattgallagher/AudioStreamer
https://github.com/DigitalDJ/AudioStreamer
它可能对您有帮助。
You can use one of these audio streamer for play in background
https://github.com/mattgallagher/AudioStreamer
https://github.com/DigitalDJ/AudioStreamer
it might help you.
这对我来说就是这样的。
将以下内容添加到 app-info.plist 文件
然后在 application:didFinishLaunchingWithOptions 添加以下内容
This is how it works for me.
Add following to you app-info.plist file
Then in application:didFinishLaunchingWithOptions add following