This method may only work with pages opened with a browser ...
<audio id="A" src= "Bg.mp3" AutoPlay></Audio >
< Span class= "S4" > < Span class= "S1" > first step: < Span class= "S3" > introduce JS
<script src= "Http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
Step Two: Wx.config
Wx.config ({
Debug:false,///Open debug mode, call the return value of all the API will be on the client alert out, to see the incoming parameters can be opened on the PC side, the parameter information will be typed through log, only on the PC side will be printed.
AppId: ",//required, unique identification of the public number
Timestamp:,//required, time stamp for signature generation
NONCESTR: ',//required, generate a random string of signatures
Signature: ',//required, signature, see Appendix 1
Jsapilist: []//required, the JS interface list to use, all JS interface list See Appendix 2
});
Fill in the corresponding parameters
Step three: Call play in Wx.ready ()
<script>
function autoPlayAudio1 () {
wx.ready (function() {
document.getElementById (' a '). Play ();
}
}
autoPlayAudio1 ();
</script>
The test OK can be played automatically.
There is no way to troubleshoot auto-playback of mobile audio