请教一下,我现在使用wx.createInnerAudioContext这个接口,进行播放mp3格式的音频文件,src是http://www.xxx.com/xxx.mp3,现在经常出现点了不播方法,触发了onplay事件(输出了onplay is running),但是不触发onended事件(未输出onEnded is running) 情况(也没有声音)我在开发工具中怎么点都能播放,在真机上就概率性(较大概率)出现上述情况手机是iPhonese。piker组件怎么在提交的时候携带一个隐藏值供后台搜索-微信小程序教程 ...。麻烦指导下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 }) }}})
微信小程序开发相关问题解答;本文来自微信小程序工厂 http://www.xcxgc.com 转载请保留。
微信小程序开发者回答:
范***:
谁能看看……
D***:
我也遇到了,ios上调用wx.playVoice()或者innerAudioContext.play()偶发性失败,并且即使播放成功也是没有声音。android上更是直接走fail分支,就没有成功过。微信版本6.6.2,调试基础库版本1.9.1
【】wx.seekBackgroundAudio真机无效#微信小程序教程
本文网址:http://www.91bianli.com/kaifazhinan/71522.html