[whatwg] Delaying the media load event

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