<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script> </head> <body> <audio id="music" src="music/music.mp3" autoplay="autoplay" loop></audio> <script> audioAutoPlay1(‘music‘); function audioAutoPlay1(id){ var audio = document.getElementById(id); audio.play(); document.addEventListener("WeixinJSBridgeReady", function () { audio.play(); }, false); } </script> </body> </html>