HTML5<音频>标记donesn'不能在Firefox和Internet Explorer上工作
HTML5 <audio> tags donesn't work on Firefox and Internet Explorer
我有这个无线电流播放器代码。它在Chrome和iOS Safari上运行良好,但在Firefox和Internet Explorer 11上不起作用。
这有点像我的index.php文件:
<script type="text/javascript"
src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script>
function changeImage() {
var image = document.getElementById('myImage');
if (image.src.match("pause")) {
image.src = "play.png";
document.getElementById('sound1').pause();
} else {
image.src = "pause.png";
document.getElementById('sound1').play();
}
}
</script>
当您进入页面时,默认情况下图像为"play.png"。当你按下它时,它会变为"pause.png",音乐就会开始播放。
这是这个html脚本:
<audio id="sound1" src="http://radiostation.com:8000/stream" type="audio/mpeg"></audio>
<img id="myImage" onclick="changeImage();" src="play.png" style="position: absolute; top: 130px; left: 23px;">
问题仅在于播放流,所有浏览器上的图像都会发生变化。如果有任何帮助,我们将不胜感激。感谢:)
Firefox和Internet explorer不支持音频/aacp内容,这是该流的格式
对于这个流,你可以使用/stream2,它是音频/mpeg,在浏览器中得到了更广泛的支持
注意-firefox的开发者版本确实支持音频/aacp,所以可能在6到12周内发生变化
相关文章:
- JavaScript不适用于internet explorer和Firefox,但适用于谷歌
- 输入类型的图像在Internet Explorer中不起作用,但在Chrome和Firefox中起作用
- 提交按钮不会;不适用于Chrome或Firefox,但适用于Internet Explorer
- Image fadeIn not working with Internet Explorer or Firefox
- Javascript图像动画在Firefox或Internet Explorer中不起作用
- Chrome 和 Internet Explorer 无法离线工作,在 Firefox 上工作正常
- JS幻灯片适用于Firefox和chrome,但不适用于Internet Explorer
- 使用Chrome打开Internet Explorer / Firefox等窗口
- 使用jQuery的Internet Explorer上的Javascript错误,但在Firefox上工作正常
- FadeIn 不适用于 FireFox/Internet Explorer
- 我的代码在Firefox中工作,但不能在Internet Explorer中工作
- 元标记中的JavaScript在Firefox和Internet Explorer上不起作用
- Canvas 元素 + Javascript 在 Chrome 和 Firefox 中工作,而不是在 Internet
- JavaScript脚本适用于Firefox,Chrome,Safari,Internet Explorer< 9,但不
- 使用 jquery 上传文件适用于 Firefox,但不适用于 Internet Explorer
- 提交按钮不会出现在Firefox中,而是出现在Chrome和Internet Explorer上
- HTML5<音频>标记donesn'不能在Firefox和Internet Explorer上工作
- 主页链接'的背景颜色在Internet explorer中发生了变化,但在Mozilla Firefox中不起作
- onclick事件不'不适用于Firefox-适用于Internet Explorer
- getElementsByTagName().length在Firefox / Internet Explorer中不起