错误信息:
wx.setInnerAudioOption is not a function. (In 'wx.setInnerAudioOption("obeyMuteSwitch",!1)', 'wx.setInnerAudioOption' is undefined);at ***** page lifeCycleMethod onLoad function
wx.setInnerAudioOption is not a function;at ***** page lifeCycleMethod onLoad function
Demo
/**
* 页面的初始数据
*/
data: {
innerAudioContext: null,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var that = this;
//注册事件放在load中,注册一次即可。
that.data.innerAudioContext = wx.createInnerAudioContext();
that.data.innerAudioContext.volume = 0.3;
wx.setInnerAudioOption('obeyMuteSwitch', false);
that.data.innerAudioContext.onEnded(() => {
console.log('自然停止')
});
},
微信小程序开发问题解答
微信小程序开发者回答:
是不是基础库太低了
本文网址:http://www.91bianli.com/weixinxiaochengxu/41865.html