[whatwg] video tag : loop for ever

Eduard Pascual herenvardo at gmail.com
Wed Oct 29 11:38:12 PDT 2008

On Wed, Oct 29, 2008 at 6:16 PM, Jonas Sicking <jonas at sicking.cc> wrote:
> Maciej (and I think others) have suggested that it would be useful if it was
> possible to allow <audio> to be used such that a single file can be
> downloaded that contains multiple sound effects, and then use javascript to
> play different sound effects contained in that file at various times.
> For example someone creating a shoot-em-up game might create a file that
> contains the sound for "shoot weapon", "enemy exploding", "player dying",
> and "player finishes level". It can then when appropriate use javascript to
> play any one of these sound effects.
Wouldn't multiple <audio> elements be better here? They'd point to the
actual same file, but different fragments. That would even make the
script less bloated (just selecting each element, instead of
explicitly getting the appropriate fragment from the "master" file
each time you need it). This brings the additional advantage that, in
the event the server does support file fragments, only the actually
required fragments will be downloaded. And, if the server doesn't
support fragments, then there is still no reason why the UA would
download the same whole file more than once for a single page (maybe
there is a need to ensure the UA isn't that silly for such cases,
Furthermore, the idea of having multiple sound effects in a single
file is just a matter of "packaging", probably mere convenience, and
multiple <audio> elements would better reflect the actual semantics:
these are separate sound effects actually.

More information about the whatwg mailing list