W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2007

[whatwg] Audio and Video APIs

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Sun, 18 Mar 2007 14:09:57 +1100
Message-ID: <45FCAD85.9020907@lachy.id.au>
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

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:53 UTC