如何在需要时停止此循环音频? (它一直在谷歌Chrome稳定,金丝雀测试中继续玩)
var song = null;
function a() {
song = new Audio("audio/ring.wav");
song.controls = false;
song.loop = true;
song.autoplay = true;
document.body.appendChild(song);
}
a();
答案 0 :(得分:1)
var song = null;
function a() {
song = new Audio("audio/ring.wav");
song.controls = false;
song.loop = true;
song.autoplay = true;
document.body.appendChild(song);
}
a();
// Pause the audio, please note there is no stop event
song.pause();