收藏
回答

怎么会报这样的错误??

问题模块
API和组件

  goPlay: function (e) {

    var that = this;

    that.setData({

      audioIndex: e.target.dataset.current

    })

    wx.getBackgroundAudioPlayerState({

      success: function (res) {

        var status = res.status

        var dataUrl = res.dataUrl

        if (status == "0" || dataUrl != that.data.audioList.tracks.list[e.target.dataset.current].playPathAacv164){

          that.playAudio(e.target.dataset.current);

        }else{

          wx.pauseBackgroundAudio();

          that.setData({

            audioIndex: -1

          })

        }

      },

      fail:function (){

        that.playAudio(e.target.dataset.current);

      }

    })

  },

  playAudio:function(index){

    wx.playBackgroundAudio({

      dataUrl: that.data.audioList.tracks.list[index].playPathAacv164,

      title: that.data.audioList.tracks.list[index].title,

      coverImgUrl: that.data.audioList.tracks.list[index].smallLogo

    })

  },




这是什么问题

最后一次编辑于  2017-06-11  (未经腾讯允许,不得转载)
回答关注问题邀请回答
收藏

1 个回答