IOS 微信 6.5.2 自动播放音乐 解决方案

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码测试:

原文地址:https://www.cnblogs.com/luoeeyang/p/6237891.html