[Sugar-devel] [karma] when does an audio element created w/ new Audio() emit the onload event?

Felipe López Toledo zer.subzero at gmail.com
Wed Nov 18 15:21:27 EST 2009


hi man

It doesn't emit that event at the same time that a new Image() does. I

need a way to throw an error to the user if the audio file isn't

accessible. I do this for the images and it works quite well.

I have used "load" and "error" and others events for new Image and new Audio
and it seems that work fine, could you explain the event that you want to
catch?

I think audio.addEventListener("error", function(e) {....}, false );
will do the work.

btw. here is the list of events for media elements, section 4.8.10.12:
http://dev.w3.org/html5/spec/Overview.html

greetings!

2009/11/18 Bryan Berry <bryan at olenepal.org>

> Hey subzero,
>
> Do you know when does an audio element created w/ new Audio() emit the
> onload event?
>
> It doesn't emit that event at the same time that a new Image() does. I
> need a way to throw an error to the user if the audio file isn't
> accessible. I do this for the images and it works quite well.
>
> I also need to this for svgs but haven't figured out the mechanism
>
> --
> Bryan W. Berry
> Senior Engineer
> OLE Nepal, http://www.olenepal.org
>
>


-- 
Felipe López Toledo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sugarlabs.org/archive/sugar-devel/attachments/20091118/fecdf9b0/attachment.htm 


More information about the Sugar-devel mailing list