0
嘗試將停止功能的JavaScript添加到音頻對象這樣添加功能,音頻對象
//Give the Audio object a stop function
Audio.prototype.stop = function()
{
this.pause();
this.currentTime = 0.0;
}
可以像這樣使用
var aud = new Audio();
aud.src = 'background.ogg';
aud.play();
aud.stop();
作品在谷歌瀏覽器,但不能在Firefox 。有任何想法嗎 ?
是的,這在鉻和Firefox的作品。謝謝!! –