[whatwg] Audio and Video APIs

Hi,
   I think the audio and video APIs should be mostly identical because 
that would make them easier for authors to learn both.

Presently, the APIs have the following:

       <video>      |     Audio()
src                | new Audio("file");
videoWidth         |
videoHeight        |
length             | length **
                    |
state              |
buffering          |
seeking            |
ended              |
bufferingRate      |
buffered           |
begin **           |
position           |
played             |
                    |
ui **              |
volume             | volume **
                    | pan **
                    |
play()             | play()
stop()             | stop()
pause()            | pause() **
togglePause()      |
seek(offset)       | seek() **
                    | loop([count])
                    |
addEventListener() | onload
addEventListener() | onerror
addEventListener() | onprogress **

** Features currently mentioned in a comment in the spec.

Most of those APIs could apply equally well to both audio and video, 
with the exception of height and width.

However, as the spec says, the Audio() API is only designed for simple 
sound effects, not streaming audio.  Perhaps that is a use case for a 
more fully featured <audio> element that does that, while keeping 
Audio() for simple sound effects.

-- 
Lachlan Hunt
http://lachy.id.au/

Received on Saturday, 17 March 2007 20:09:57 UTC