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

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.


-- 
Alexey Feldgendler <alexey at feldgendler.ru>
[ICQ: 115226275] http://feldgendler.livejournal.com

Received on Sunday, 18 March 2007 15:58:24 UTC