W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2009

[whatwg] Delaying the media load event

From: Matthew Gregan <kinetik@flim.org>
Date: Thu, 28 May 2009 00:16:46 +1200
Message-ID: <20090527121646.GF22769@flim.org>
The load event for an image element fires once the image has been fetched,
is considered available (once it's known to be a supported type and the
image dimensions are known) and complete starts returning true.  So once
load fires, you can do useful things like paint the image into a canvas.

For a media element, the load event may fire before loadedmetadata and
loadeddata.  So load does not mean that it's possible to paint into a canvas
yet.

Does it make sense to delay the load event until after loadeddata is fired?
I don't have a particularly strong argument for doing this, other than:

- the document load event is delayed by media elements until loadeddata
  fires, so firing the media's load event earlier seems unusual

- it seems more consistent with the behaviour of image, and being less
  surprising is a nice property

Firefox's current implementation will not fire load before loadeddata.  This
happens because we deliberately delay load until after loadedmetadata, and
we fire loadedmetadata and loadeddata at the same time.

Cheers,
-mjg
-- 
Matthew Gregan                     |/
                                  /|                    kinetik at flim.org
Received on Wednesday, 27 May 2009 05:16:46 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:49 UTC