最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - new Audio() not Implemented in Internet explorer - Stack Overflow

programmeradmin0浏览0评论

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.

When I try to set the src attribute (setAttribute("src", string)) I get an error in IE saying "Not Implemented".

I tried using the new Audio(), I get the same error in IE, "Not Implemented". Both approaches works in Google chrome and Firefox.

Can anyone help?

<audio id="audio1" >Not supported</audio>
audioElm = document.getElementById("audio1");
audioElm.setAttribute("src", aud[count]); 
audioElm.play();

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.

When I try to set the src attribute (setAttribute("src", string)) I get an error in IE saying "Not Implemented".

I tried using the new Audio(), I get the same error in IE, "Not Implemented". Both approaches works in Google chrome and Firefox.

Can anyone help?

<audio id="audio1" >Not supported</audio>
audioElm = document.getElementById("audio1");
audioElm.setAttribute("src", aud[count]); 
audioElm.play();
Share Improve this question edited May 6, 2015 at 8:00 user1693593 asked May 5, 2015 at 19:43 BenBen 614 bronze badges 6
  • may you show the code?, please – Jose Ricardo Bustos M. Commented May 5, 2015 at 19:55
  • HTML <audio id="audio1" >Not supported</audio> JS audioElm = document.getElementById("audio1"); audioElm.setAttribute("src", aud[count]); audioElm.play(); This works with Chrome and FF but not for IE. when I debug It says NOT IMPLEMENTED – Ben Commented May 5, 2015 at 20:19
  • What is the format of the audio file? IE only supports .mp3. – jaket Commented May 5, 2015 at 22:21
  • MP3. and it is not working – Ben Commented May 6, 2015 at 1:13
  • IE supports mp3 and aac audio files, so it is probably not a file type issue. – MEC Commented May 6, 2015 at 7:45
 |  Show 1 more ment

2 Answers 2

Reset to default 8

HTML5 Audio not playing in IE (recent versions)?

It could be a patibility view issue (quirks mode)

  • is your site on the patibility view list in IE?
  • or is your page embedded in an iframe?

It could be caused by running IE on a server

  • IE server versions don't support audio/video (enhanced protected mode)

It could be caused by running IE on a Windows 8.1 Enterprise version such as "8.1 N".

  • The fix for this would be installing the Media Feature Pack for N and KN versions of Windows 8.1

Also you can go to html5test. and look in the audio section at the "MP3 support".

I was working in a windows server and I had the same problem playing MP3 audios in internet explorer.

The only solution I found was installing the "Desktop Experience Feature" in my server.

Start -> Search for "Server manager" -> Features -> Add features -> Select "Desktop experience" -> Next and Install

Once installation is pleted, you need to restart the puter and then the feature gets enabled.

发布评论

评论列表(0)

  1. 暂无评论