js
进入小程序就自动播放音频
onShow:function(){
const innerAudioContext = wx.createInnerAudioContext();
innerAudioContext.autoplay = true;
innerAudioContext.src = "http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E06DCBDC9AB7C49FD713D632D313AC4858BACB8DDD29067D3C601481D36E62053BF8DFEAF74C0A5CCFADD6471160CAF3E6A&fromtag=46" //音频路径
innerAudioContext.onPlay(() => {
console.log('开始播放')
});
innerAudioContext.onError(res => {
console.log(rees.errCode)
console.log(res.errMsg)
});
}