我正在尝试从shoutcast服务器获取.pls流以在我的ios应用程序中播放。 到目前为止,我一直没有成功。 我在stackoverflow上发布了很多帖子但是没有这些帖子有任何帮助。
任何人都可以向我解释,如果它甚至可能,如何获得.pls流?
I'm trying to get a .pls stream from a shoutcast server to play in my ios app. So far i've been unsuccessful. I've red a lot of posts on stackoverflow but non of these were of any help.
Can anyone please explain to me, if its even possible, how to get .pls to stream?
最满意答案
所有你需要的是列出你的无线电端口,这是一个工作的例子:in - (void)viewDidLoad
NSURL *vibes = [NSURL URLWithString:@"http://website.com:8002"]; vPlayer = [[AVPlayer alloc] initWithURL:vibes]; self.myViewVolume = [[MPVolumeView alloc] initWithFrame:CGRectMake(20, 330, 280, 50)]; [self.myViewVolume sizeToFit]; [self.view addSubview:self.myViewVolume];你需要在你的.m文件中创建一个AVPlayer实例,这里是vPlayer不要忘记将AVFoundation框架添加到你的项目中,你可以通过[播放器播放]和[播放器停止]播放和停止流
AVPlayer的一个问题是缺乏简单的音量控制,你可以添加一个mpViewVolume。 我也在使用无线电应用程序,到目前为止AVPlayer是最好的播放shoutcast流。
all you need is to list the port of you radio, here is one working example: in - (void)viewDidLoad
NSURL *vibes = [NSURL URLWithString:@"http://website.com:8002"]; vPlayer = [[AVPlayer alloc] initWithURL:vibes]; self.myViewVolume = [[MPVolumeView alloc] initWithFrame:CGRectMake(20, 330, 280, 50)]; [self.myViewVolume sizeToFit]; [self.view addSubview:self.myViewVolume];you need to create an instance of AVPlayer in your .m file , here it is vPlayer do not forget to add AVFoundation framework to you project, you can play and stop the stream with [player play] and [player stop]
One problem with AVPlayer is the lack of easy volume control, you can add one with mpViewVolume. I am also working on radio app and by far AVPlayer is the best to play shoutcast streams.
更多推荐
发布评论