简体   繁体   English

Shoutcast流媒体和HTML5音频播放器

[英]Shoutcast Streaming & HTML5 Audio Player

This is really driving me crazy 这真让我疯狂

I am trying t make audio tag stream a shoutcast stream 我正在努力使音频标签流成为一个shoutcast流

I am shooting on this since two days and the best result I got is making it working on Safari 我两天以来一直在拍摄,我得到的最好结果就是让它在Safari上工作

I read all the questions on stackoverflow about this I read all the tutorials I tested all the players and I need to make it work on Mobile phones and specifically on iOS so I can't use flash tried a lot 我在stackoverflow上阅读了关于这个的所有问题我阅读了所有教程,我测试了所有的播放器,我需要让它在手机上工作,特别是在iOS上,所以我不能使用flash试了很多

<audio controls src="http://a7lafm.callu.ps:8000/;" autoplay></audio>

This snippet works on Safari ONLY 此代码段仅适用于Safari

I tried the ; 我试过了; semicolon and stream.ogg I think I tried everything so I am posting the question here 分号和stream.ogg我想我尝试了一切,所以我在这里发布问题

Any help are really appreciated 任何帮助都非常感谢

This problem has nothing to do with your code. 此问题与您的代码无关。 There are two problems. 有两个问题。

The first is browser codec support. 首先是浏览器编解码器支持。 Check out the MDN page for updated info on codec support per browser. 查看MDN页面,了解有关每个浏览器的编解码器支持的更新信息

The second problem is that SHOUTcast returns an oddball status line. 第二个问题是SHOUTcast返回一个奇怪的状态行。 It will send ICY 200 OK instead of HTTP/1.0 200 OK . 它将发送ICY 200 OK而不是HTTP/1.0 200 OK Some browsers will not accept this header. 有些浏览器不接受此标头。 The only way around it is to use something else for your streaming server, such as Icecast . 解决它的唯一方法是为您的流媒体服务器使用其他东西,例如Icecast (If you're interested, I also run a streaming service that can relay your existing SHOUTcast stream in a standards-compliant HTTP stream that has better compatibility. E-mail preview@audiopump.co if you are interested.) (如果您有兴趣,我还运行一个流媒体服务,可以将您现有的SHOUTcast流转发到符合标准的HTTP流中,该流具有更好的兼容性。如果您有兴趣,请发送电子邮件至preview@audiopump.co。)

Here is an example I found on a shoutcast radio station website: 这是我在shoutcast电台网站上找到的一个例子:

<audio autoplay preload="auto" controls src="http://174.137.50.51:16504/;"></audio>

Works fine in various browsers. 适用于各种浏览器。 I tested Firefox, Chrome and Safari. 我测试了Firefox,Chrome和Safari。

<!--listen2myradio.com SHOUTcast Flash Player-->
    <p id='preview'></p><script id='myscript' language='javascript' src='http://flashplayer.listen2myradio.com/getInfo.js?id=17733c2862180eaa3883250ab04087609ae4'></script>
    <!--End Player-->

This is your radio and where we pray every time we enter the Internet open and a window to the .Flm 这是你的收音机,每当我们进入互联网时,我们祈祷的地方和.Flm的窗​​口

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM