是否可以从 HTML5 音频元素获取 Icecast 元数据? [英] Is it possible to get Icecast metadata from HTML5 audio element?

查看:23
本文介绍了是否可以从 HTML5 音频元素获取 Icecast 元数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用音频元素从 icecast 服务器流式传输 ogg 源.音频元素是否提取了冰冷的元数据,有没有办法通过 javascript 访问它?

I am using audio element to stream an ogg source from an icecast server. Does the audio element extract icy metadata and is there a way to access it through javascript?

基本上,我想显示我正在播放的广播电台的当前播放"信息.我有哪些选择?

Basically, I want to show "currently playing" information of a radio station I am streaming. What are my options?

谢谢!

推荐答案

不,你的 HTML5 元素只知道流数据,甚至没有发出适当的请求来获取元数据.

No, your HTML5 elements are only aware of the stream data, and aren't even making the appropriate request to fetch the metadata.

查看这些帖子:

从使用 PHP 的音频流

http://www.smackfu.com/stuff/programming/Shoutcast.html

现在,这无论如何都不是不可能的.你只需要在服务器端做.(请特别参阅第二个链接.)

Now, this isn't impossible by any means. You just have to do it server-side. (See that second link in particular.)

我还应该指出,在成熟的 SHOUTcast 服务器上(尚未使用 Icecast 进行测试,但值得一试)生成7.html",其中包含有关侦听器数量、最大侦听器、峰值侦听器的数据、立体声/单声道、比特率和当前轨道名称作为逗号分隔值.像这样:

I should also point out that on a full-blown SHOUTcast Server (haven't tested with Icecast, but its worth a try) generates "7.html" which contains data on the number of listeners, max listeners, peak listeners, stereo/mono, bitrate, and current track name as comma-separated values. Like this:

2,1,33,625,2,128,J Mascis - 不够

如果你可以获取http://yourstreamingserver:port/7.html,那么你就可以很容易地获取这些数据.

If you can fetch http://yourstreamingserver:port/7.html, then you can get this data very easily.

这篇关于是否可以从 HTML5 音频元素获取 Icecast 元数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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