Stop playback in HTML5 audio using Javascript
You may wanted to stop playback of an audio playing via audio HTML5 tag.
Here is the code :
Here is the code :
document.getElementById('audio').currentTime = 0;//By IDIt's that simple. Just use currentTime = 0.
document.getElementsByTagName('audio').currentTime = 0;//By Tag
No comments:
Post a Comment
Leave the comments