从iPhone上的流中获取ID3标签 [英] Get ID3 tags from stream on iPhone

查看:91
本文介绍了从iPhone上的流中获取ID3标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法从HTTP Live Stream(使用m3u,m3u8播放列表文件)获取iPhone上的歌曲标题和作曲家名称.我已经尝试从此网站 tempomix广播上获取它.这是流媒体的链接- http://stream21.group-network.net:9012

I can not get title of song and name of composer on iPhone from HTTP Live Stream (using m3u, m3u8 playlist files). I've tried get it from this site tempomix radio. this is link to streaming - http://stream21.group-network.net:9012

我正在尝试使用下一个代码:

I'm trying use next code:

        AVPlayerItem *playerItem = [AVPlayerItem playerItemWithURL:url];
    _player = [[AVPlayer playerWithPlayerItem:playerItem] retain];

    _player.actionAtItemEnd = AVPlayerActionAtItemEndNone;
    [_player addObserver:self forKeyPath:@"status" options:NSKeyValueObservingOptionNew context:NULL];
    [_player addObserver:self forKeyPath:@"currentItem" options:NSKeyValueObservingOptionNew context:NULL];
    [_player addObserver:self forKeyPath:@"timedMetadata" options:NSKeyValueObservingOptionNew context:NULL];

然后在这里等待回调:

- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {

当回调发生时-我检查AVPlayerStatus并运行播放. 收音机播放得很好-但是永远不会去观察ValueForKeyPath.

When callback comes - I check AVPlayerStatus and run play. Radio plays fine - but never comes to observeValueForKeyPath.

我知道这个问题类似于这个问题但描述的方法对我不起作用.

I know this question looks similar to this question but described methods don't work for me.

有什么想法吗?谢谢.

推荐答案

ID3标签与您链接到的流无关. SHOUTcast/Icecast不使用ID3标签.

ID3 tags have nothing to do with the stream that you linked to. SHOUTcast/Icecast doesn't use ID3 tags.

您将必须解析SHOUTcast元数据协议.我已经在这里为PHP回答了这个问题: https://stackoverflow.com/a/4914538/362536 主体是不管什么语言都一样.

You will have to parse the SHOUTcast metadata protocol. I've answered this question for PHP here: https://stackoverflow.com/a/4914538/362536 The principals are identical, no matter what the language.

另请参见 http://www.smackfu.com/stuff/programming/shoutcast .html

这篇关于从iPhone上的流中获取ID3标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆