[whatwg] <video>: togglePause() versus pause()

Dan Brickley danbri at danbri.org
Sun Mar 18 16:39:48 PDT 2007

Alexey Feldgendler wrote:
> On Sun, 18 Mar 2007 22:09:02 +0100, Magnus Kristiansen 
> <magnusrk+whatwg at pvv.org> wrote:
>>> I just played some more with our internal implementation (Opera's) 
>>> and noticed that our pause() really is like togglePause() in the 
>>> HTML5 proposal. Looking at the specification I don't see much need 
>>> for pause() there. Perhaps togglePause() should just become pause() 
>>> and pause() be removed?
>> I would suggest the opposite. For basic actions like play and pause, 
>> play() and pause() are the most natural options. I question whether we 
>> need a command to toggle between play/pause at all. Any UI which uses 
>> a combined play/resume button has to know which state it is, so it 
>> already knows which command is relevant.
> +1
> What's good for UI (a play/pause toggle button) isn't necessarily good 
> for API. play() should only start playback (and do nothing if it's 
> already playing), pause() should only pause (and do nothing if it's 
> stopped). The spec also mentions a property to find out the current state.

This is an important point. Pause UI is a well known slippery issue 
(state vs action). An API shouldn't dictate the UI...


More information about the whatwg mailing list