小编Tob*_*rff的帖子

Internet Explorer 10中的HTML5音频标记的"错误:不支持的音频类型或无效的文件路径"

我有以下带有音频标签的html5文档,以及不支持它的浏览器的Flash回退:

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  </head>
  <body>
    <audio autoplay controls preload="auto" autobuffer> 
      <source src="trumpet.ogg" type="audio/ogg">
      <source src="trumpet.mp3" type="audio/mp3">
      <source src="trumpet.wav" type="audio/wav">
      <source src="trumpet.m4a" type="audio/aac">

      <!-- Flash fallback -->
      <object width="1" height="1" type="application/x-shockwave-flash" data="player.swf">
        <param name="movie" value="player.swf">
        <param name="flashvars" value="file=trumpet.mp3">
      </object>
    </audio>
  </body>
</html>
Run Code Online (Sandbox Code Playgroud)

服务返回所有文件,并在http标头中使用正确的MIME类型.该解决方案适用于除Internet Explorer 9和10 之外的所有浏览器(兼容模式除外,因为Flash文件将播放).

在这两个浏览器中,我可以看到播放器控件,其中显示错误消息"错误:不支持的音频类型或无效的文件路径".我试图改变源标签的顺序,但找不到解决方案来让它玩任何一个.

有没有人提示要检查什么或这里出了什么问题?

有关上述标记的实际操作,请参阅http://l.urff.at/html5audioexample.

提前感谢任何有用的提示或提示!:)

html5 internet-explorer html5-audio internet-explorer-9 internet-explorer-10

7
推荐指数
1
解决办法
9226
查看次数