我可以在桌面Chrome上玩多个 但我不能使用iOS / Android版本的Chrome。 有谁解决了这个问题?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8" />
<title>multiple track test</title>
</head>
<body onload="init()">
<button id="button">play</button>
<script type="text/javascript">
//<![CDATA[
var player = null;
var count = 0;
function play() {
var currentPlayer = player;
currentPlayer.addEventListener('ended',function(){
currentPlayer.pause();
play();
},false);
currentPlayer.play();
player = new Audio(count + ".mp3");
player.load();
count += 1;
}
function init() {
player = new Audio("0.mp3");
var button = document.getElementById("button");
button.addEventListener('click',function(){
play();
},false);
}
//]]>
</script>
</body>
</html>