网络广播中的 AS3-ID3 事件
我正在使用下面的 AS3 代码构建一个在线广播播放器:
private var soundChannel:SoundChannel;
private var stationUrl:String = "h t t p : / /205.188.215.230:8002/";
sound = new Sound();
sound.addEventListener(Event.ID3, onID3Change);
sound.load(new URLRequest(stationUrl));
soundChannel = sound.play();
private function onID3Change(e:Event):void
{
....
}
声音播放成功,但问题是 ID3 事件永远不会被触发!
有谁知道如何解决这个问题?
I'm building an online radio player using the AS3 code below:
private var soundChannel:SoundChannel;
private var stationUrl:String = "h t t p : / /205.188.215.230:8002/";
sound = new Sound();
sound.addEventListener(Event.ID3, onID3Change);
sound.load(new URLRequest(stationUrl));
soundChannel = sound.play();
private function onID3Change(e:Event):void
{
....
}
the sound plays successfully, but the problem is that the ID3 event is never triggered!
Does anyone know how to solve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ID3 不存在于像这样的网络广播流中。我假设您正在谈论 SHOUTcast/IceCast 流。
为此,您需要实现冰冷元数据协议。对于Flash,这通常只是在外部完成。
请参阅此参考:http://www.smackfu.com/stuff/programming/shoutcast.html 。
基本上,您在 GET 请求的标头中发送
icy-metadata: 1
然后,服务器将元数据插入到流的中间,您可以在将数据发送到正在播放流的任何地方之前将其取出。我不确定这在 Flash 中是否可行,但肯定可以在 PHP(或任何服务器端语言)中执行此操作,并让您的 Flash 应用程序向 PHP 脚本发出请求以获取该元数据。ID3 doesn't exist in internet radio streams like this one. I am assuming you're talking about a SHOUTcast/IceCast stream.
For that, you need to implement the icy metadata protocol. For Flash, this is generally just done externally.
See this reference: http://www.smackfu.com/stuff/programming/shoutcast.html
Basically, you send
icy-metadata: 1
in the headers of your GET request. The server then inserts metadata right into the middle of the stream, which you pull out before sending the data on to whatever is playing the stream. I'm not sure if this is even possible in Flash, but it certainly is possible to do this in PHP (or any server-side language really) and have your Flash application make a request to your PHP script to get that metadata.