新的Audio()未在Internet Explorer中实现 [英] new Audio() not Implemented in Internet explorer
问题描述
我正在尝试播放一系列mp3声音。我的html中有一个音频文件,并在我的JavaScript中使用 document.CreateElement()
获取它。
I am trying to play an array of mp3 sound. I have an audio file in my html and get it using document.CreateElement()
in my JavaScript.
我尝试设置src属性( setAttribute(src,string)
)我在IE中收到错误,说未实现。
When I try to set the src attribute (setAttribute("src", string)
) I get an error in IE saying "Not Implemented".
我尝试使用新的Audio(),我在IE中得到了同样的错误,Not Implemented。这两种方法都适用于Google Chrome和Firefox。
I tried using the new Audio(), I get the same error in IE, "Not Implemented". Both approaches works in Google chrome and Firefox.
有人可以帮忙吗?
<audio id="audio1" >Not supported</audio>
audioElm = document.getElementById("audio1");
audioElm.setAttribute("src", aud[count]);
audioElm.play();
推荐答案
HTML5音频无法在IE中播放(最新版本)?
HTML5 Audio not playing in IE (recent versions)?
这可能是兼容性视图问题(怪癖模式)
It could be a compatibility view issue (quirks mode)
- 是您在IE浏览器兼容性视图列表中的网站吗?
- 或您的网页是否嵌入iframe?
可能是因为在服务器上运行IE而造成的
It could be caused by running IE on a server
- IE服务器版本不支持音频/视频(增强保护模式)
- IE server versions don't support audio/video (enhanced protected mode)
可能是因为在Windows 8.1企业版上运行IE as8.1 N。
It could be caused by running IE on a Windows 8.1 Enterprise version such as "8.1 N".
- 此修复方法是为N和KN版本的Windows 8.1安装Media Feature Pack
您还可以访问 html5test.com 并查看MP3支持的音频部分。
Also you can go to html5test.com and look in the audio section at the "MP3 support".
这篇关于新的Audio()未在Internet Explorer中实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!