[whatwg] Some media element details

On Fri, 23 May 2008, Bonner, Matt (IPG) wrote:
> > > > > 
> > > > > Knowing if the playback is progressing is necessary for 
> > > > > implementing basic playback UIs with JS. It is clumsy and not 
> > > > > very obvious that you need to do "var playing = !video.paused && 
> > > > > !video.ended && video.readyState >= HTMLMediaElement.CAN_PLAY" 
> > > > > to get this information.
> > > >
> > > > What's the use case?
> > >
> > > Wouldn't you want something like that to know, for example, whether 
> > > to display a "play" or a "pause" button?
> > 
> > We have that -- the "paused" attribute. When it's true, show play, and 
> > when it's paused, show false. You don't want to show play when the 
> > reason you aren't playing is that you're buffered or seeking for 
> > instance. The client is trying to play. It can't.
> 
> Well I said "for example," so let's pick another example. Wouldn't you 
> need the state described to figure out whether enabling the 
> pause/fast-forward/rewind buttons makes sense?

Why would you disable the pause button when playing? Or when seeking? The 
pause button's disable state, as far as I can tell, need only be related 
to whether there is any media at all and whether the media playback is 
paused, not whether it is actively playing.

Similarly for fast-forward. You can fast-forward from the paused state and 
from the playing state. It doesn't matter whether the media is actually 
playing or not.

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

Received on Wednesday, 11 June 2008 17:46:16 UTC