在html 5中的audio标识中,仅有中止按钮,但沒有终止按钮,实际上为其提升也不不便,方式以下:
HTMLAudioElement.prototype.stop = function()
{
this.pause();
this.currentTime = 0.0;
}
实际上很简易,便是先中止,随后時间归0;
启用方式:
var aud = new Audio();
aud.src = '独特他.ogg';
aud.play();
aud.stop();
上面编码能够在chrome,opera下跑,但firefox 17不好