onHide
发布于 5 年前 作者 fangluo 422 次浏览 来自 问答

onHide: function () {

var that = this;

if (that.data.quid == 0) {

wx.stopBackgroundAudio();

}

},

onUnload: function () {

var that = this;

if (that.data.quid == 0) {

wx.stopBackgroundAudio();

}

}

安卓版本5.1版本中 卸载页面中就可以终止音频 隐藏页面就不可以终止音频 两段代码一样

1 回复

你的意思是说 wx.stopBackgroundAudio() 在 onUnload 中无效?

回到顶部