- ios播放音频慢
音频在android和开发者工具里播放很快 ,在ios里就很慢 @官方 代码片段 wechatide://minicode/BtwtGZmf6fYL
2018-05-03 - 小程序音频在ios里播放不了
start: function (e) { // if (res.platform == 'ios') { // this.audioCtx = wx.getBackgroundAudioManager(); // console.log(123); // } else { // this.audioCtx = wx.createInnerAudioContext(); // } this.audioCtx.title=123; let that=this; let imgSrc = e.currentTarget.dataset.src; this.audioCtx.src = imgSrc; let sort = e.currentTarget.dataset.sort; if (that.data.isplay==true){ this.audioCtx.play(); console.log(that.data.isplay); that.setData({ isplay: false, activeIndex:sort }) }else{ wx.pauseBackgroundAudio() this.audioCtx.pause(); that.setData({ isplay: true, activeIndex: null }) } this.audioCtx.onEnded(()=>{ that.setData({ isplay: true, activeIndex: null }) }) }, <block wx:for="{{dataList}}" wx:key="{{item.id}}"> <audio src="{{path}}{{item.path}}" bindplay="funplay" id="myAudio"> <view class="audio"> <view class="one"> <navigator url="/pages/voice_details/voice_details?id={{item.id}}&&teacherId={{item.teacherId}}" class="score link">{{item.sex}}-{{item.teacherName}}-{{item.cateName}}</navigator> <view>{{item.name}}</view> </view> <image bindtap='start' data-src="{{path}}{{item.path}}" data-sort="{{item.sort}}" data-id="{{item.id}}" src="{{activeIndex==index?img:img2}}" /> </view> </audio> </block>
2018-04-16