[whatwg] Assigning media resources represented as DOM objects to a media element

Glenn Maynard glenn at zewt.org
Fri Feb 15 06:46:02 PST 2013

On Tue, Jan 22, 2013 at 9:19 PM, Robert O'Callahan <robert at ocallahan.org>wrote:

> Currently the only way to use one of these objects as the source of a media
> element is via "element.src = URL.createObjectURL(object)". This is
> problematic because the URLs minted by createObjectURL require manual
> revocation. (Forms of auto-revocation have been proposed but a) they seem
> difficult to spec in a rational way and b) we will not be able to make
> auto-revocation the default.)

a) This isn't the case.  The tricky bit was defining precisely when
autorevocation happens; this has been resolved (the "global script clean-up
jobs list").  There's a remaining piece (
https://www.w3.org/Bugs/Public/show_bug.cgi?id=17765), but while it'll take
some thought to do that in a clean way (so it can be applied to different
APIs concisely), there's nothing magic there.
b) Even if we can't make it the default, there are much cleaner solutions
than bloating other APIs.  For example, a separate method can default to
auto-revoke, so you can say eg. img.src = blob.createRevokingURL().  I
don't like adding APIs that are just copies of other APIs with different
defaults, but it's much less evil than adding a whole separate mechanism.
In any case, explicitly saying img.src = URL.createObjectURL(blob,
{autoRevoke: true}) isn't actually that painful.

Glenn Maynard

More information about the whatwg mailing list