无法检索Shoutcast .pls流(Unable to retrieve Shoutcast .pls stream)

编程入门 行业动态 更新时间:2024-10-21 11:26:30
无法检索Shoutcast .pls流(Unable to retrieve Shoutcast .pls stream)

我正在尝试从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.

更多推荐

本文发布于:2023-08-06 05:29:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1444461.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:pls   Shoutcast   Unable   stream   retrieve

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!