如何在Flash中播放shoutcast无线电广播(Shoutcast Flash Player) [英] How to stream a shoutcast radio broadcast in Flash (Shoutcast Flash Player)

查看:194
本文介绍了如何在Flash中播放shoutcast无线电广播(Shoutcast Flash Player)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

多年来我一直在寻找解决方案,但没有任何结论性的文件。有很多Shoutcast Flash播放器(例如radio.de),所以我知道这是可能的。然而,我的大部分研究都是这样的:

  s = new Sound(); 
s.loadSound(url.of.shoutcaststream:8003,true);

在FireFox中适用于我,但不适用于IE。我不想购买一个组件,我想知道这些组件是如何实现的,以便我可以构建自己的自定义播放器。 解决方案

你几乎在那里。完整的口头禅是:

  s = new Sound(); 
s.loadSound(http://url.of.shoutcaststream:8003 /;,true);

注意斜线和分号。 Shoutcast服务器(DNAS)查看请求的使用情况,以检测响应中要发送的内容。如果它是一个浏览器,那么它会提供一个HTML页面。如果它不是浏览器UA,它将发送流。尾随分号(出于某些无证的原因)导致DNAS忽略UA并始终发送流。

播放AAC流没有令人满意的解决方案,尽管Flash有设备因为某些原因,AAC的API是完全不同的,不能播放AAC Shoutcast。

b
$ b

查看我的博客获取更多信息:

http://www.flexiblefactory.co.uk/flexible/?p=51


I've been looking for a solution to this for years, but nothing is conclusively documented. There are many Shoutcast Flash players out there (e.g. radio.de) so I know it's possible. However, most of my research leads to this:

s = new Sound();
s.loadSound ("url.of.shoutcaststream:8003",true);

Which works for me in FireFox but not in IE. I don't want to buy a component, I want to know how those components do it so that I can build my own custom player.

解决方案

You're almost there. The full mantra is:

s = new Sound();
s.loadSound ("http://url.of.shoutcaststream:8003/;",true);

Notice the trailing slash and semicolon. Shoutcast servers (DNAS) look at the useragent of a request to detect what to send back in the response. If it's a broswer then it serves a page of HTML. If it's not a browser UA, it sends the stream. Trailing semicolon (for some undocumented reason) causes DNAS to ignore the UA and always send a stream.

There's no satisfactory solution to playing AAC streams, although Flash has the equipment to do so, for some reason the API for AAC is completely different and cannot play AAC Shoutcast.

The NetStream solution here is unlikely to provide a solution.

See my blog for more info:

http://www.flexiblefactory.co.uk/flexible/?p=51

这篇关于如何在Flash中播放shoutcast无线电广播(Shoutcast Flash Player)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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