收藏
回答

怎么会报这样的错误??

  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

    })

  },




这是什么问题

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

1 个回答

登录 后发表内容