如何使用 MPMoviePlayerController 播放背景模式
使用IIS7的音频直播服务已准备就绪。 Audio Live流媒体服务器设置很复杂,但是已经成功了。
我获得了这样的流媒体URL(@“http://xxx.xxx.xx.xx/liveStream.isml/manifest(format=m3u8-aapl).m3u8”)。
我的使用代码出乎意料地简单。
self.theURL = [NSURL URLWithString:@"http://xxx.xxx.xx.xx/liveStream.isml/manifest(format=m3u8-aapl).m3u8"];
if(moviePlayer == nil)
{
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:theURL];
}
[moviePlayer play];
嗯...我无法按照自己的意愿控制音乐播放器。
问题是这样的。
即使背景模式,我也不想停止播放音乐。
请告诉我一些建议。谢谢。
Audio Live Streaming Service using IIS7 is prepared.
Audio Live streaming server setting is very complex, but have succeeded.
I obtained a URL for streaming like this(@"http://xxx.xxx.xx.xx/liveStream.isml/manifest(format=m3u8-aapl).m3u8").
My using code is unexpectedly simple.
self.theURL = [NSURL URLWithString:@"http://xxx.xxx.xx.xx/liveStream.isml/manifest(format=m3u8-aapl).m3u8"];
if(moviePlayer == nil)
{
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:theURL];
}
[moviePlayer play];
Hm... I can't control music player as I wished.
Question is like this.
I don't want to stop to play music even though backgroundMode.
Please tell me some advice. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请仅签入设备。我也在我的应用程序中完成了。我的代码如下所示。我正在谈论 iOS5
在 plist 中,我创建了一个名为“所需背景模式”的数组,并在数组名称中插入一个项目“应用程序播放音频”。有时会出现网址问题,请检查此网址MPMoviePlayer 声音工作在模拟器和 ipad 设备,但无法在 iPhone 设备中工作
please check in only device.I have also done in my Application. My code is given below.i am talking about iOS5
And in plist i made an array named "Required background mode" and insert an item in array name, "App Plays Audio". some times URL problem is occurs check this URL MPMoviePlayer sound working in Simulators and ipad device, but not Working in iPhone Device