I want to listen to some of the events fired by HTML5 <audio>
element. Some of event attributes for <audio>
element are : onplaying, onprogress, onseeked, onseeking etc.,
I tried to listen to these events in jquery using conventional live()
function like below, but it didn't work.
$('audio#voice').live('progress', function(){
$('a#play').replaceWith("Playing...")
});
I also tried with
$('audio#voice').live('onprogress', function(){
$('a#play').replaceWith("Playing...")
});
Is there any other way I can listen to these HTML5 media events in jQuery?
You can only use live()
and delegate()
for events that bubble. The audio events probably don't so you can only bind()
them on existing elements.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With