On Mon, 18 Oct 2010 01:01:00 + 0200, Chris Pearce <chris@pearce.org.nz> wrote:
In the description of the media ready states for have_enough_data [1],
The spec says:
If the autoplaying flag
Http://www.whatwg.org/specs/Web-apps/current-work/Multipage/video.html #Autoplaying-flag> is true, and the | paused
Http://www.whatwg.org/specs/Web-apps/current-work/Multipage/video.html # dom-Media-paused> | attribute is true, and the media Element
Http://www.whatwg.org/specs/Web-apps/current-work/Multipage/video.html # media-Element>
Has an | Autoplay
Http://www.whatwg.org/specs/Web-apps/current-work/Multipage/video.html # ATTR-Media-Autoplay> | attribute specified, and the media Element
Http://www.whatwg.org/specs/Web-apps/current-work/Multipage/video.html # media-Element>
Is in a | document
Http://www.whatwg.org/specs/Web-apps/current-work/Multipage/infrastructure.html #Document> |
Whose browsing Context
Http://www.whatwg.org/specs/Web-apps/current-work/Multipage/browsers.html #Browsing-context> did not have the sandboxed automatic features browsing context flag
Http://www.whatwg.org/specs/Web-apps/current-work/Multipage/The-IFRAME-element.Html # sandboxed-automatic-Features-browsing-context-flag>
Set when the | document
Http://www.whatwg.org/specs/Web-apps/current-work/Multipage/infrastructure.html #Document> | was created, then the user agent may also set the | paused
Http://www.whatwg.org/specs/Web-apps/current-work/Multipage/video.html # dom-Media-paused> | attribute to false, queue a task
Http://www.whatwg.org/specs/Web-apps/current-work/Multipage/webappapis.html #Queue-a-task> to fire a simple event
Http://www.whatwg.org/specs/Web-apps/current-work/Multipage/webappapis.html #Fire-a-simple-event>
Named | play
Http://www.whatwg.org/specs/Web-apps/current-work/Multipage/video.html # event-Media-play> |,
And queue a task
Http://www.whatwg.org/specs/Web-apps/current-work/Multipage/webappapis.html #Queue-a-task> to fire a simple event
Http://www.whatwg.org/specs/Web-apps/current-work/Multipage/webappapis.html #Fire-a-simple-event>
Named | playing
Http://www.whatwg.org/specs/Web-apps/current-work/Multipage/video.html # event-Media-playing> |.
This means that we'll will only autoplay if a media element is in
Document. Why do we prevent media elements not in a document from
Autoplaying? We allow audio from a media element not in a document
Play, why not allow autoplay to work while not in a document too?
I note that Firefox, chrome, Safari and opera all autoplay when a media
Element is not in a document. It looks like ie9 beta never autoplays
Unless the media element is hard coded in the HTML file with an Autoplay
Attribute; ie9 doesn't seem to honor autoplay set from script.
Unless there's a good reason not to, and since most browsers have
Implemented autoplay when not in a document anyway, perhaps we shoshould
Update the spec to match the implemented behaviour?
Regards,
Chris Pearce.
[1]
Http://www.whatwg.org/specs/Web-apps/current-work/Multipage/video.html # dom-Media-have_enough_data
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 shocould 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 ".
--
Philip J ägenstedt
core developer
Opera Software