微信audio自動播放
阿新 • • 發佈:2017-12-12
element aud scrip res var blog event eve play
<!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>
微信audio自動播放