- 播放音频太频繁导致手机卡
我在页面里面用wx.createInnerAudioContext()创建了一个context播放英文单词的音频,然后添加了一个“下一个”按钮点击切换音频的src。当切换到40-50个的时候,会导致内存泄漏。(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit. 11,请问有什么方法可以解决这个问题吗?代码基本如下: [代码]var[代码] [代码]innerAudioContext = wx.createInnerAudioContext()[代码][代码]//播放音频[代码][代码] [代码][代码]playVoice: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码] [代码][代码]if[代码] [代码](that.data.playStatus == 2){[代码][代码] [代码][代码]return[代码] [代码]false[代码][代码] [代码][代码]}[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]playStatus: 2[代码][代码] [代码][代码]})[代码][代码] [代码][代码]innerAudioContext.obeyMuteSwitch = [代码][代码]false[代码][代码] [代码][代码]innerAudioContext.autoplay = [代码][代码]true[代码][代码] [代码][代码]innerAudioContext.src = [代码][代码]this[代码][代码].data.question.word_voice[代码][代码] [代码][代码]innerAudioContext.play()[代码][代码] [代码][代码]innerAudioContext.onEnded(() => {[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]playStatus: 1[代码][代码] [代码][代码]})[代码][代码] [代码][代码]})[代码][代码] [代码][代码]innerAudioContext.onError((res) => {[代码][代码] [代码][代码]wx.showModal({[代码][代码] [代码][代码]title: [代码][代码]'温馨提示'[代码][代码],[代码][代码] [代码][代码]content: res.errMsg,[代码][代码] [代码][代码]showCancel: [代码][代码]false[代码][代码],[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]playStatus: 1[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码]//下一个[代码][代码] [代码][代码]chooseNext: [代码][代码]function[代码] [代码](e) {[代码][代码] [代码][代码]innerAudioContext.stop()[代码][代码] [代码][代码]var[代码] [代码]nindex = [代码][代码]this[代码][代码].data.questionIndex + 1[代码][代码] [代码][代码]var[代码] [代码]nquestion = [代码][代码]this[代码][代码].data.questionArr[nindex][代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]questionIndex: nindex,[代码][代码] [代码][代码]question: nquestion,[代码][代码] [代码][代码]playStatus: 1[代码][代码] [代码][代码]})[代码][代码] [代码][代码]this[代码][代码].playVoice()[代码][代码] [代码][代码]},[代码]
2018-07-16 - 代码审核不通过
代码提交审核之后提示我审核不通过,不通过原因:(1):页面无内容,请上架完整内容再提交审核。 但是,其实我这次只是小改动,基本跟线上的是一致的,为什么之前每次都能通过,这次不通过呢。而且我看了页面是有内容的啊,而且我们的小程序是有学生身份限制的,不是我们的学生,我们是不允许他们使用的。现在难道改了审核机制吗? [图片]
2018-07-11 - INNERERRCODE:-11850
用户在使用小程序的过程中弹出来一个报错信息,如下图:[图片] 请问一下这是什么原因导致的,在网上没有找到相关的资料。
2018-06-13