I have the following html5 document with audio tag and a fallback to Flash for browsers that don't support it:
<!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>
All of the files are returned by the service with the correct MIME type in the http header. The solution works fine for all browsers that except Internet Explorer 9 and 10 (except for compatibility mode because there the Flash file will play).
In those two browsers I can see the player controls with an error message that reads "Error: Unsupported audio type or invalid file path". I tried to shuffle around the order of the source tags, but couldn't find a solution to get it to play any of them.
Does anyone have a hint what to check or what it going wrong here?
Please see http://l.urff.at/html5audioexample for the above markup in action.
Thanks in advance for any helpful tips or hints! :)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…