[whatwg] Autoplaying media elements not in a document

On Mon, 18 Oct 2010, Chris Pearce wrote:
>
> In the description of the media ready states for HAVE_ENOUGH_DATA [1], 
> the spec says:
>
| If the autoplaying flag is true, and the paused attribute is true, and 
| the media element has an autoplay attribute specified, and the media 
| element is in a Document whose browsing context did not have the 
| sandboxed automatic features browsing context flag set when the Document 
| was created, then the user agent may also set the paused attribute to 
| false, queue a task to fire a simple event named play, and queue a task 
| to fire a simple event named playing.
> 
> This means that we'll will only autoplay if a media element is in a 
> document. Why do we prevent media elements not in a document from 
> autoplaying? We allow audio from a media element not in a document to 
> play, why not allow autoplay to work while not in a document too?

It was a mistake (see Philip's comment below).


> Unless there's a good reason not to, and since most browsers have 
> implemented autoplay when not in a document anyway, perhaps we should 
> update the spec to match the implemented behaviour?

I don't know that I'd say we have interop here.

   http://www.hixie.ch/tests/adhoc/html/audio/001.html

Opera plays the sound for a second or so (exposing GC).
Mozilla plays it once (ignoring the loop attribute).
Chrome plays it forever.
If your description of IE9 is right, it doesn't play it at all.


On Mon, 18 Oct 2010, Philip J?genstedt wrote:
> 
> Subversion is too slow to say exactly when, but "and the media element 
> is in a Document whose browsing context did not have the sandboxed 
> automatic features browsing context flag set when the Document was 
> created" was added to the spec quite recently, after Opera implemented 
> autoplay anyway.
> 
> Assuming the change in behavior was accidental, the spec should instead 
> say "and the media element is not in a Document whose browsing context 
> had the sandboxed automatic features browsing context flag set when the 
> Document was created".

Yeah, this was not quite what the change was meant to be. Fixed to go back 
to the earlier behaviour, with the new restriction more appropriately 
phrased.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Friday, 10 December 2010 13:51:51 UTC