时间:2019-05-07 来源:小程序工厂
L***:
你好,这个错误信息应该只出现在微信小程序在后台且被其他音乐占用了音乐播放器的时候。你描述的这个情况属于预期之外,可能是 bug,麻烦提供一下详细调用流程以及版本信息。
A***:
@Link
具体情况:我在开发一个音乐点播分享功能,用背景音频wx.getBackgroundAudioManager()播放音乐。
在音乐播放详情页musicDetail.js的onLoad()事件代码如下:
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var that = this;
if (options.music) {//如果有传入歌曲信息,说明来自点播分享
app.globalData.currentMusic = JSON.parse(options.music);
wx.getBackgroundAudioManager().src = app.globalData.currentMusic.src;
wx.getBackgroundAudioManager().coverImgUrl = app.globalData.currentMusic.poster;
wx.getBackgroundAudioManager().singer = app.globalData.currentMusic.author;
wx.getBackgroundAudioManager().title = app.globalData.currentMusic.name;
}
……其它代码
}
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
var that = this;
if (that.data.onDemandContent == '') {
return;
}
return {
title: that.data.onDemandTitle,
path: '/pages/musicDetail/musicDetail?music=' + JSON.stringify(app.globalData.currentMusic)
}
}
正常在微信小程序进入音乐播放详情页面musicDetail.js时onLoad()无参数
当通过分享时页面进入时,路径携带参数music。
测试操作流程:我是在一台手机上同一个微信帐号进行测试,
1、用自己的手机进入微信小程序音乐播放详情,然后分享给自己(同一微信帐号)的‘文件传输助手’
2、退出到聊天界面,进入‘文件传输助手’,点开刚刚分享的音乐详情页面
3、出现如题所述错误。
请教,是何问题,如何解决?
第三方平台代微信小程序实现业务时,怎么配置web-view的安全域名呢+微信小程序教程 ...
A***:
版本是最新的1.7.0