audio tag not working in IE9

和自甴很熟 提交于 2019-12-03 03:13:31

Add the HTML5 doctype to the page and it should trigger standards mode in IE9. You should also add a title element to make the document valid:

<!DOCTYPE html>
<html>
  <head>
    <title>Add a title</title>
  </head>
  <body>
    <audio controls="controls" src="c:\concerto.mp3" >
       audio tag not supported.
    </audio>            
  </body>
</html>

If you're still having trouble, try adding this meta tag to the head:

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

If 'audio' is working in chrome, safari, etc. but not in IE, check your meta tags. I had one that referred to IE8 which stopped the 'audio' from functioning. It was quite frustrating until I found the problem at which point the lights went on.

IE plays files in your PC if you give full path as as a URL "file://c:/concert.mp3" or only file name "concert.mp3" if the file is in the same folder as the html file. Firefox also requires full path for files in other folders while Chrome seems to add 'file://' if it is not in the URL. This is a problem if you want to use the to play local files if they are in other folders. The FileAPI does not allow you to find the path of the file.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!