BackgroundAudioManager真机测试异常?
发布于 7 年前 作者 jieyao 12262 次浏览 来自 问答

真机测试音乐不能继续播放,会从开头重新播放,编辑工具测试正常

let bgAudioManager = wx.getBackgroundAudioManager(),

postId = this.data.postId,

postsData = this.data.postsData

if (this.data.isPlayingMusic) {

bgAudioManager.pause()

this.setData({

isPlayingMusic: false

})

} else {

bgAudioManager.title = postsData[postId].music.title

bgAudioManager.coverImgUrl = postsData[postId].music.coverImg

// 设置了 src 之后会自动播放

bgAudioManager.src = postsData[postId].music.url

this.setData({

isPlayingMusic: true

})

}

2 回复

请具体描述问题出现的流程,并提供能复现问题的简单代码片段https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

用出现问题的手机扫码提供下截图



回到顶部