There is no response when clicking play, and no error is reported; if you do not write to play music, get cannot obtain the music status.
杨茹
杨茹 2019-01-02 14:43:50
0
0
1290

playerMusicTap:function(event){

var that = this;

//获取音乐播放状态

wx.getBackgroundAudioPlayerState({

success:function(res) {

const status = res.status;

if(status != 1){

wx.playBackgroundAudio({

dataUrl: newsData.initData[that.data.newsid].music.url,

title: newsData.initData[that.data.newsid].music.title,

coverImgUrl: ''

})

that.setData({

isPlayer:true

})

}else{

wx.pauseBackgroundAudio();

that.setData({

isPlayer: false

})

}

}

})


}


杨茹
杨茹

reply all(0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template