HTML5音频livestreaming [英] html5 audio livestreaming
问题描述
我创造我自己的声音,没有浏览器的控制。
I'm creating my own audio, without controls of the browser.
<audio src="http://50.7.98.194:8081/~dl3/cgi-bin/dl.cgi/bqmu5mltxcqy43mxecgo4gnw743qr7fd7io22q5xj4/gl1mwvp6b326.mp3" id="audio">
</audio>
我有这些功能,调用时点击几个按钮:
I have these functions, called when clicked some buttons:
function play()
{
audio.play();
}
function play()
{
audio.pause
}
function stop()
{
audio.pause();
audio.src = audio.src;
}
不过,现在我只可以重现MP3或OGG文件,而不是实时流广播。
我读到一些插件,但我需要用纯HTML5做。
But for now, I only can reproduce mp3 or ogg files, but not a live stream radio. I read about some plugins, but I need do it with pure html5.
你能帮助我吗?
非常感谢,
Could you help me, please? Thanks very much,
推荐答案
不幸的是,仍然没有单一的视频和音频codeC,这是所有的浏览器都支持!程序员必须确保有后备提供使用情况,其中一个浏览器不支持codeC B和,反之亦然。
Unfortunately, there is still no single video and audio codec, which is supported by all browsers! The programmers have to ensure that there is fallback provided for use-cases where browser A doesn't support codec B and vice versa.
您可以看看这个兼容性表,桌面和移动浏览器。
You can take a look at this compatibility table, for both desktop and mobile browsers.
桌面:
- 的Internet Explorer(9.0以上版本)支持MP3和AAC codeCS
- 浏览器(6.0以上版本)支持的Ogg Vorbis,MP3,WAV +
- 火狐(3.6+)支持的Ogg Vorbis,WAV
- Safari浏览器(5.0以上)支持MP3,AAC,WAV
- 歌剧(10.0+)支持的Ogg Vorbis,WAV
移动
- Opera移动(11.0以上)支持codeCS与设备有关
- 的Android(2.3以上版本)支持codeCS与设备有关
- 移动Safari浏览器(与iOS 3.0+的iDevices)支持MP3,AAC
- 黑莓(6.0以上版本)支持MP3,AAC
由于Flash仍然是wides $ P $垫就够了,这是最安全的probaly回落。
Since flash is still widespread enough, it's probaly safest fallback.
另外,我想OT注意到,有nothng更糟使用一些图书馆,他们中的一些(例如 jPlayer )提供了非常强大的接口,这不仅能帮助您得到更佳的code!
Also, I want ot note that there's nothng worse to use some library, some of them (e.g. jPlayer) provides very powerful interface and this only can help you to produce better code!
我觉得你可以发现在下面的文章,你想知道的一切: HTML5音频广播由歌剧离散事件球员
I think you can found everything you want to know in the following article: HTML5 Audio Radio Player by Opera Devs
这篇关于HTML5音频livestreaming的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!