[英]How can I make my Radio Streaming Application keep singing when the user press the home button?
I just finished my Radio station IOS application but I have 1 problem here .. when you are listening to the streaming and press the home button the application stop working .... I did some research and found some application keep the streaming after pressing the Home Button. 我刚刚完成了我的Radio Station IOS应用程序,但是这里有1个问题..当您在收听流媒体时,按下主屏幕按钮,该应用程序停止工作.....主页按钮。
is it an option in the Xcode I can enable it? 我可以启用Xcode中的选项吗?
You need to set the audio session category correctly: 您需要正确设置音频会话类别:
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
check also this question: iPhone OS 4 Multitasking - Playing Audio In background 还要检查以下问题: iPhone OS 4多任务处理-在后台播放音频
我解决了这个问题,我只是在Plist中设置了一个条目
Required background modes : App plays audio
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.