[whatwg] Audio and Video APIs

Lachlan Hunt lachlan.hunt at lachy.id.au
Sat Mar 17 20:09:57 PDT 2007


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/



More information about the whatwg mailing list