如何获取HTML5播放Shoutcast中的流 [英] How to get HTML5 to play a stream from Shoutcast

查看:107
本文介绍了如何获取HTML5播放Shoutcast中的流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我正在使用Flash播放器播放我的直播流.我希望移动设备上的人也能够收听,并且HTML5似乎是必经之路.我该如何在HTML5中使用此广播流"stardust.wavestreamer.com:3353"?

Currently I am using a flash player to play my shoutcast stream. I would like people on mobile devices to be able to listen as well, and it seems HTML5 is the way to go. How would I go about getting this shoutcast stream "stardust.wavestreamer.com:3353" working in HTML5?

我尝试使用

但这似乎与shoutcast不兼容.

but that does not seem to be compatible with shoutcast.

推荐答案

如果使用Web浏览器连接到SHOUTcast服务器,它将检测到您的浏览器,因为它的User-Agent标头中包含Mozilla,并向您发送仍然可以访问流的管理页面.您只需转到 http://stardust.wavestreamer.com:3353/即可自己进行测试.

If you connect to a SHOUTcast server with a web browser, it will detect your browser because it has Mozilla in the User-Agent header, and send you to the admin page for the stream anyway. You can test this yourself by simply going to http://stardust.wavestreamer.com:3353/.

幸运的是,SHOUTcast服务器提供了一种强制流加载的方法.只需在URL的末尾添加分号;.

Fortunately, SHOUTcast servers provide a way to force the loading of the stream. Just add a semicolon ; to the end of the URL.

http://stardust.wavestreamer.com:3353/;

在SHOUTcast服务器内部,它现在将User-Agent字符串显示为MPEG OVERRIDE,不再包含Mozilla,因此您可以获得实际的媒体流.

Internally in the SHOUTcast server, it will now see your User-Agent string as MPEG OVERRIDE, which no longer contains Mozilla, so you get the actual media stream.

这篇关于如何获取HTML5播放Shoutcast中的流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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