关于苹果设备微信音乐无法播放 音乐控制代码 play()的问题

     var audio = document.getElementById('audio');
    document.addEventListener("WeixinJSBridgeReady", function() {
        audio.play();
    	audio.pause();
    }, false);
    document.addEventListener('YixinJSBridgeReady', function() {
        audio.play();
    	audio.pause();
    }, false);
$('#audio').trigger('play');
 function audioAutoPlay(id) { var audio = document.getElementById(id), play = function() { audio.play(); document.removeEventListener("touchstart", play, false); }; audio.play(); document.addEventListener("WeixinJSBridgeReady", function() { //微信 audio.play(); }, false); document.addEventListener('YixinJSBridgeReady', function() { //易信 audio.play(); }, false); document.addEventListener("touchstart", play, false); } audioAutoPlay('audio');
THE END
分享
二维码
< <上一篇
下一篇>>