I am working on an HTML5 audio tag and I want to trigger an event when the song is finished. Is this possible with jQuery?
My jQuery code is:
$(document).ready(function(){
var music = new Audio("sample.mp3");
$('#play').click(function(){
music.play();
});
$('#pause').click(function(){
music.pause();
});
});
My HTML5 is:
<input type="button" value="Play" id="play" />
<input type="button" value="Pause" id=pause" />