Thursday, 5 September 2013

How to track end of sound file played using EMBED html tag

How to track end of sound file played using EMBED html tag

I want to track the END of sound file played by using EMBED tag. I tried
adding "onend" event same as we do for AUDIO tag, but it didn't work..!!
I'm able to get the "END" event with AUDIO tag, so can anyone please help
me out what I'm doing wrong with EMBED.
below is the js code I'm using to make EMBED tag.
var sound = $("<embed id='sound' type='audio/mpeg' width='1' height='1'
/>");
sound.attr('src', url_toplay);
sound.attr('loop', false);
sound.addEventListener("ended", playNext);
sound.attr('autostart', true);
$('#divEmbedded').append(sound);
function playNext()
{
alert('d');
}
Thanks in Advance..

No comments:

Post a Comment