当前位置 : 主页 > 网络编程 > JavaScript >

ios_audio_autoplay.js

来源:互联网 收集:自由互联 发布时间:2021-06-30
ios_audio_autoplay.js function audioAutoPlay(id){ var audio = document.getElementById(id), play = function(){ audio.play(); document.removeEventListener("touchstart",play, false); }; audio.play(); document.addEventListener("WeixinJSBridgeRe
ios_audio_autoplay.js
function audioAutoPlay(id){  
    var audio = document.getElementById(id),  
        play = function(){  
            audio.play();  
            document.removeEventListener("touchstart",play, false);  
        };  
        audio.play();  
        document.addEventListener("WeixinJSBridgeReady", function () {  
            play();  
        }, false);  
        document.addEventListener('YixinJSBridgeReady', function() {  
            play();  
        }, false);  
        document.addEventListener("touchstart",play, false);  
    }
网友评论