// Fix the problem that ios Audio cannot automatically play and loop playback
var music = document.getElementById('video');
var state = 0;
document.addEventListener('touchstart'.function(){
if(state==0){
music.play();
state=1; }},false);
document.addEventListener("WeixinJSBridgeReady".function () {
music.play();
}, false);
// Loop
music.onended = function () {
music.load();
music.play();
}
Copy the code