带有 JavaScript 的 Html5 音频无法在 Chrome 以外的任何浏览器中运行
基本上在按下按钮时,我希望能够将当前曲目切换到另一个曲目。这在 Chrome 中可以正常工作,但在任何其他浏览器中都不能?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>MediaPlayer Won't Work in Any browser other than chrome</title>
<script type="text/javascript">
function Test(){
var Mp3Me= document.getElementById('Mp3Me');
Mp3Me.src = "http://media.rolandus.com/mp3/v-piano_vintage_piano_1.mp3";
}
</script>
</head>
<body>
<audio id="Mp3Me" autoplay autobuffer controls>
<source src="Batman.mp3" type="audio/mpeg">
</audio>
<a href="javascript:Test()">Start Piano Track</a>
</body>
</html>