[whatwg] When to stop <video> elements from playing

On Mon, 29 Oct 2007, Jonas Sicking wrote:
> > > 
> > > I believe the best solution here is to say that step 5 should throw 
> > > an exception. I.e. you can't start playing a media element whose 
> > > .ownerDocument is not a displayed document.
> > 
> > What do you think of what the spec says at the moment?
> 
> Are you referring to "When a media element is actively playing and its 
> owner Document is an active document, its current playback position must 
> increase monotonically at playbackRate units of media time per unit time 
> of wall clock time"?
> 
> First of all, that'll mean that calling .play() on a 
> in-non-active-document element will silently fail. It'd probably be 
> better to throw an exception.
> 
> It's also something that's easier to miss for an implementor. Might be a 
> good idea to put it in the steps for play() and change the 
> removed-from-document paragraph to say:
> 
> When a media element is removed from a Document, or the .ownerDocument 
> stops being an active document, the user agent must act as if the 
> pause() method had been invoked.

Throwing an exception means that you can't start a video without first 
checking if the document is visible, and pausing when the document is made 
not active means that when you return to the document the video won't be 
playing. Neither of these seems desireable.

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

Received on Wednesday, 14 May 2008 02:38:11 UTC