Do not remove the media attribute from the source element

Back in October 2012 a bug was submitted to remove the media attribute from
<source> "if it isn't used":
https://www.w3.org/Bugs/Public/show_bug.cgi?id=19619.

Unfortunately this has now been adopted, and Hixie has removed it (
https://www.w3.org/Bugs/Public/show_bug.cgi?id=19619#c34) from the WHATWG
specification (saying "no-one uses it" and calling it "essentially
useless") and Philip Jägenstadt has marked it for removal from Blink (
https://www.w3.org/Bugs/Public/show_bug.cgi?id=19619#c33).
It has also been adopted by the HTML 5.1 specification in the WHATWG
"cherry-pick" on the 7th of February:
http://lists.w3.org/Archives/Public/public-html/2014Feb/0021.html.

In the bug report some usage data has been provided which indicates that
this attribute has not been used much, and this data was used in making the
decision to remove it.

I will admit to not having any any counter data to this but I disagree with
this attribute being "useless" and I have always thought that not enough
people know about this attribute, its implementation and what it can do.
 <philipj@opera.com>

An argument against the attribute's usefulness has been put forth in the
bug thread stating that it isn't responsive and doesn't react to changes in
the browser size etc. Whilst this is true, I think that it is a moot point
given the problem that the media attribute is used to solve.

If you use the media attribute to serve a lower quality video with smaller
file size based on a smaller screen size (based on the oft used assumption
that a smaller browser width probably means a mobile device and lower
bandwith - we all know this is not that accurate but we developers use it
all the time) you are not going to want to serve a larger, higher quality
video file when/if the user flips their device into landscape mode. Nor
will the user be resizing their browser.

At the moment the media attribute is the only native way to serve smaller
audio and video files to smaller browser sizes. Indeed it could be used to
only serve an audio or video file when the browser size is above certain
dimensions, and coupled with a "normal" media query which hides the
video/audio element, not serve audio or video at all and thus preventing an
unwanted http request.

I think that the media attribute should remain in the specification and we
need to do more to advertise its existence, availablity, and functionality.

Received on Tuesday, 11 February 2014 12:10:49 UTC