解决iOS音乐不自动播放的问题

//音乐播放
function audioAutoPlay() {
play = function () {
audio.play();
document.removeEventListener("touchstart", play, false);
};
audio.play();
}
audioAutoPlay();
setTimeout(function(){
$(window).scrollTop(1);
},0);
document.getElementById('audio').play();
document.addEventListener("WeixinJSBridgeReady", function () {
WeixinJSBridge.invoke('getNetworkType', {}, function (e) {
document.getElementById('audio').play();
});
}, false);
})

posted @ 2018-03-09 10:05  金牛座的女孩  阅读(432)  评论(0编辑  收藏  举报