音频播放概率性失败
请教一下,我现在使用
wx.createInnerAudioContext
这个接口,进行播放mp3格式的音频文件,src是http://www.xxx.com/xxx.mp3,
现在经常出现点了不播方法,触发了onplay事件,但是不触发onended事件 情况
我在开发工具中怎么点都能播放,在真机上就概率性(较大概率)出现上述情况
手机是iPhonese。
麻烦指导下
const app = getApp();const recorderManager = wx.getRecorderManager();const innerAudioContext = wx.createInnerAudioContext();var util = require('../../utils/util.js');Page({ 。。。。。 //语音播放 audioPlay: function (e) { var that = this, innerAudioContext.stop(); innerAudioContext.src = url; innerAudioContext.play(); } },onLoad: function (options) { var that = this; /***音频组件开始 */ innerAudioContext.obeyMuteSwitch = false; innerAudioContext.onPlay(() => { console.log("onplay is running") var i = that.data.i; that.setData({ playID: i }); }) innerAudioContext.onEnded(() => { console.log("onEnded is running") var i = that.data.i; if (that.data.playID > -1) { that.setData({ playID: -1 }) }}}) |
