<body> <div> <audio controls="true" autoplay="true" id="audio"> <source src="http://i.dxlfile.com/app/music/27.mp3" /> <!-- <source src="http://i.dxlfile.com/app/music/27.ogg" /> --> <!-- <source src="http://i.dxlfile.com/app/music/27.ogg" /> --> </audio> </div> <script> var audio=document.getElementById("audio"); audio.addEventListener("canplay", function() { console.log("canplay"); audio.play(); console.log(1111); }); console.log(audio.canPlayType("audio/mp3")); console.log(audio.readyState); if (audio.readyState==0) { console.log("readyState"); audio.play(); } </script></body>然而 手机上的 音乐状态一直 都是 不自动播放 , 必须手动点击一下才能播放
添加回答
举报
0/150
提交
取消