如何使用 MPMusicPlayerController 播放 .pls 播放列表 url
我有一个实时广播流播放列表 url,当我在 UIWebView 中打开该 url 时,应用程序会自动打开一个看起来像 MPMoviePlayer 的播放器,不确定它是什么播放器,但它可以通过流媒体播放 iPod。我可以设置音量增大/减小 [[MPMusicPlayerController iPodMusicPlayer] setVolume:音量];
我想用 MPMusicPlayerController 完成所有工作,以便我可以控制应用程序中的流媒体。 我尝试使用 URL 创建 MPMediaItemCollection 并将其设置为 MusicController,但它不起作用。
任何帮助将不胜感激。
谢谢。
I have a live radio streaming playlist url, when I open that url in UIWebView, the app automatically opens a player looks like MPMoviePlayer, not sure what player it is, but it plays iPod with the streaming. I was able to set volume up/down with
[[MPMusicPlayerController iPodMusicPlayer] setVolume:volume];
I wanted to do all with MPMusicPlayerController so that I can control the streaming in my app.
I tried creating MPMediaItemCollection with the URL and set it to the MusicController, but it didn't work.
Any Help would be appreciated.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先解析 .pls 文件然后播放它。
看看 https://github.com/drodriguez/globradio/blob /master/Classes/RRQPLSParser.m 用于解析,并在整个项目中进行播放。
然而,要播放流音频,这个项目是更新的:https://github.com/mattgallagher/AudioStreamer
希望这有帮助。
first parse the .pls file then play it.
Have a look at https://github.com/drodriguez/globradio/blob/master/Classes/RRQPLSParser.m for parsing, and at the entire project for playing.
To play a streaming audio, however, this project is more recent: https://github.com/mattgallagher/AudioStreamer
Hope this helps.