收藏
回答

有关音频audio(疑似bug)

getInnerAudioContext:function(entry){
      if (this.audioCtx && this.audioSrc == entry.src){
        console.log(1111111);
        this.audioCtx.seek = this.duration;
        this.audioPlay();
        return;
      }
      if (this.audioCtx && (entry.src != this.audioSrc || !entry.src)){
        this.audioCtx.destroy;
        console.log(222222);
      }
      console.log(33333333);
      this.audioCtx = wx.createInnerAudioContext();
      this.audioCtx.autoplay = true;
      this.audioCtx.src = entry.src;
      this.audioSrc = entry.src
    },
 
    audioPlay:function(){
      this.audioCtx.play();
      this.audioCtx.onPlay(()=>{
        console.log('开始播放');
      });
    },
 
    audioPause:function(){
      if (!this.audioCtx){
        return;
      }
      this.audioCtx.pause();
      this.audioCtx.onPause(() => {
        console.log('暂停播放');
        this.duration = this.audioCtx.duration;
      });
    },

外部直接调用getInnerAudioContext并传src

我连续播放暂停,看以下日志


问题在于:多次打印

@大神、@官方。我问题出在哪?文档说明有点少,第一次做没点头绪,望告知,感激不尽

回答关注问题邀请回答
收藏

3 个回答

  • GaleLiu
    GaleLiu
    2017-12-01

    还没搞懂

    2017-12-01
    有用
    回复
  • 好腻诺
    好腻诺
    2017-11-30

    问题解决了吗 我也想知道为什么会多次打印

    2017-11-30
    有用
    回复
  • GaleLiu
    GaleLiu
    2017-11-17

    起来

    2017-11-17
    有用
    回复
登录 后发表内容