[whatwg] Quality Values for Media Source Elements

Aryeh Gregor Simetrical+w3c at gmail.com
Mon Dec 14 07:59:51 PST 2009

On Mon, Dec 14, 2009 at 2:59 AM, Hugh Guiney <hugh.guiney at gmail.com> wrote:
> JavaScript is a crutch that far too many applications are relying on
> for major functionality lately. JavaScript should enhance a Web
> experience, not supplant it.

It depends on the application.  But in any event, HTML can never
possibly do everything JavaScript does, so at some point the answer
needs to be "use JavaScript".

> If no one uses content negotiation then there is no need to have the
> <source> element at all.

I don't follow.  If authors *were* willing to use content negotiation,
to the contrary, there would be no need for <source>.  You could just
write <video src=foo></video> in your markup, and configure your
server to serve foo.mp4 or foo.ogg depending on the incoming HTTP
headers.  But nobody wants to do that, so the configuration has to be
done in HTML instead.

> XHTML and HTML are interchangeable with any other two technologies in
> that example. PDF and Word, HTML and RSS, RSS and XHTML... the point
> isn't whether most site authors are offering those two in particular;
> the point is that on a platform that supports content negotiation, it
> makes no sense to outsource it to another technology, making authors
> reinvent the wheel simply because not enough people are using wheels.

It makes sense to reinvent the wheel if the wheel is square.  HTTP
content negotiation is a square wheel.

> It's simple for an end-user; not necessarily so simple for authors to implement.

Two or three different URLs with different versions of the resource
would do it.  You don't even need JavaScript.  But if you do use
JavaScript, it should be as simple as

<a href=lower_quality.html
onclick="document.getElementById('myvideo').src =
'lower-quality.ogg'">Lower-quality version</a>

(disclaimer: not tested).

More information about the whatwg mailing list