vue添加背景音乐

vue添加背景音乐
mounted() {
// 播放音乐
document.addEventListener(“touchstart”, this.audioAutoPlay, false);
let oAudio = document.querySelector("#audio");
oAudio.onended = function() {
//播放完毕,重新循环播放
oAudio.load();
oAudio.play();
};
}
vue添加背景音乐
audioAutoPlay() {
let audio = document.getElementById(“audio”);
audio.play();
document.removeEventListener(“touchstart”, this.audioAutoPlay);
}

相关文章:

  • 2021-12-15
  • 2021-08-07
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2021-12-15
  • 2021-05-20
猜你喜欢
  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案