在安卓真机上onLoad里面监听音乐播放状态失效
onLoad: function (options) { this.playMusic() // 播放事件监听测试 wx.onBackgroundAudioPause(()=>{ console.log(11111); }); wx.onBackgroundAudioPlay(()=>{ console.log(222); }); wx.onBackgroundAudioStop(()=>{ console.log(3333) }); }, playMusic:function(){ wx.playBackgroundAudio({ dataUrl: data.s_url, title:'空', coverImgUrl:'https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJTZwzWjb0xEjEBV6ibH2rmxCtzeDrO3HM5UicukufUZo88WevL1KLjfiatmwxY5cJd9gic1FicCIYLedw/0', success:function(){ wx.seekBackgroundAudio({ position: 30, success: function () { console.log(4444) } }) } }) } |
在onLoad中监听的音乐播放状态打出的console.log,在电脑上运行没问题,在安卓真机上控制台没有输出,求解答