In the audio tag in HTML 5, there is only a pause button, but no stop button. In fact, it is not troublesome to add it. The method is as follows:
HTMLAudioElement.prototype.stop = function()
{
this.pause();
this.currentTime = 0.0 ;
}
It’s actually very simple, just pause first and then return the time to 0;
Call method :
var aud = new Audio();
aud.src = 'Special him.ogg ';
aud.play();
aud.stop();
The above code can be run under chrome and opera, but not firefox 17
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn