H5加音乐播放

    playMusic() {
      var audio = document.getElementById('music')

      if (audio !== null) {
        if (this.playFlag) {
          audio.pause()
          this.playFlag = false
        } else {
          audio.currentTime = 0
          audio.play()
          this.playFlag = true
        }
      }
    },

你可能感兴趣的:(H5加音乐播放)