[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 21:53:53 EST 2009


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

> I was just playing around w/ it and I found the media.load() method
>
> loading audio remotely still doesn't work on chromium -- argh but works
> fine on FF 3.5. I need to go complain about that.
>
mmm, interesting, what version/os are u using?
I have tested loading audio files (ogg files) from remote and it works.
The html, the js and the ogg files are in the same domain (localhost)

tested with ff 3.5.5 and google chrome 4.0.223.16 both under windows


> http://karma-testing.sugarlabs.org/tests/index.html
>
> I add to put this code here
>
> http://git.sugarlabs.org/projects/karma/repos/mainline/blobs/jkjs-refactor/js/karma.js#line324
>
> after I added the event handlers
>
>        if (this._type === "sound"){
>            this.media.load();
>         }
>
yeah, I had the same "problem", but believe it or not.. it is the
default behavior (as the standard draft says)
here is the KSound code (with the little fix)
http://git.sugarlabs.org/projects/karma/repos/mainline/blobs/master/js/jquery.karma.js#line1041

btw. chrome does not need that line

>
>
>
> On Wed, 2009-11-18 at 14:21 -0600, Felipe López Toledo wrote:
> > 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
>
>

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


More information about the Sugar-devel mailing list