wx.pauseBackgroundAudio()不能暂停音乐咋回事
来源:19-12 playBackgroundAudio-音乐播放基本实现

楼上楼下
2018-11-30
onMusicTap: function (event) {
var currentPostId = this.data.currentPostId;
var postData = postsData.post_list[currentPostId];
var isPlayingMusic = this.isPlayingMusic;
if (isPlayingMusic) {
wx.pauseBackgroundAudio();
this.setData({
isPlayingMusic: false
});
} else {
wx.playBackgroundAudio({
dataUrl: postData.music.url,
title: postData.music.title,
coverImgUrl: postData.music.coverImg
});
this.setData({
isPlayingMusic : true
});
}
},
播放是正常的
写回答
2回答
-
念着你
2019-05-05
1111
00 -
7七月
2018-12-01
这个需要调试下的,不能暂停肯定是状态错了,调试打印排除下。看这代码是看不出来的。
00
相似问题