html & js代码
<body style="margin: 0px; background: #222; overflow: hidden;"> <audio id="bgm" src="media/bgm.mp3" autoplay loop></audio> <!--ad--> <iframe src="http://heymeo.com/" frameborder="0" width="640" height="1010" style="position:absolute; top:0px; left: 0px; 640px; height: 1010px;"></iframe> </body> <script> window.onload=function() { var au=document.getElementById("bgm"); document.addEventListener("WeixinJSBridgeReady", function () {au.play();}, false); } </script>
微信扫描QR码测试: