The Broken Web
As usual, opinions vary, and you, as well as I, are entitled to our opinions. This post is one of those rants that might tick you off. If that’s the case, I truly apologize and hope you can see beyond the frustration and harsh tone into the abyss of open discussion.
Let’s talk about the broken Web.
It all began with a small project
I was working on a prototype version of an HTML5 audio player the other day, and wanted to find a good library that bridges the gap between the varying audio-coded support of different browsers.
- No jQuery (or any other library) dependency - I intended the final code to work on both mobile and desktop, and thought using Zepto instead of jQuery on the mobile version will make a lot of sense
- Solid HTML5 audio API emulation - Since MP3 support on FF / Opera requires a Flash bridge, I wanted the library to seamlessly emulate the HTML5 audio API in the Flash bridge, to be able to take full advantage of whatever is available in HTML5 (audio events for example)
Without boring you with all the tests and details, I ended up choosing the fabulous MediaElement library, which comes with a full-fledged jQuery player & UI or as a bare bones audio library to use as one sees fit.
During this tedious soul (and code) searching, I did stumble upon two very sore points which seem, in my mind, to break the Web.
The ugly face of Codec war
Forget about browser war. Media codec war is in full rage, and has been long before Chrome reared its open-source head and joined the battle.
In one camp, are the open-source enthusiasts, like Firefox and Opera, who righteously support open source codecs like Ogg/Vorbis, Opus and WebM/Vorbis.
In the other camp, are the closed-source dictators like Apple’s Safari and Microsoft’s Internet Explorer who support MP3 and AAC.
And, in the middle we have Google’s Chrome, which supports just about anything you throw at it.
So far, nothing is new under the sun and we, the developers, are doomed to either encode audio in multiple formats or devise clever contraptions to bridge this idiotic gap.
To add insult to injury, there’re claims of noticeable differences in sound quality between the aforementioned formats. AAC is supposedly better than MP3. Ogg/Opus is claimed to be much better than Ogg/Vorbis and given the right podium, I’m confident Microsoft will swear by its own WMA format as superior to the rest (which, by the way, is an excellent audio format, so I hear).
The outcome of these petty rivalries and indecision is twofold.
First, people like me, who want to provide high-quality, browser-based, audio-driven applications, slowly and surely learn to hate those who stand in our way. Curious why Web developers hate Microsoft and Apple or are frustrated with Firefox? Here’s one of the reasons. Want to know why we love Chrome? Same reason but in reverse. The thing is, we one day might end up deciding not to support your poor excuse for a browser, because we can, while you go on producing silly ads about “the browser you love to hate”. Why not take that money and do something positive with it?
Second, the same users browser vendors chase after are the ones being punished. Either by poorer audio quality, plugin dependency or the very remote risk of infringing on those precious patents browser vendors hold so dear.
The solution to all this closed-source / open-source, good-mediocre-bad, audio-codec nonsense is simple. The Web is open. Media on the Web should be open. Move your arse for a change and do something real for your users. Decide on the best open-source candidate and integrate it to your browser. And, in the meantime, adding WebM/Vorbis or dare I say Ogg/Vorbis support to your browsers won’t kill you. Keep on supporting your cherished closed-sourced codecs to your hearts content, and let us developers and end-users the freedom to create and enjoy beautiful things.
There… I’ve said it and feel a bit better now, and that’s even without touching on the same topic in the mobile browser world.
However, before you go all berserk, I am not criticising jQuery or you personally. This was just a preface.
And why all this sudden interest in jQuery you ask? Well, mobile Web is all the rage these days. Despite jQuery’s awesomeness, to me, it doesn’t feel like a natural first-choice for mobile Web applications. I want something smaller, nimbler and more polite. A “jQu” or an “ery” but not both.
Yup… and it’s also 32KB without the trimmings.
Let’s admit it, writing $ is much more concise that writing document.querySelectorAll, and writing $.get is much more readable that the multi-line XMLHttpRequest object spaghetti.
One can only sigh and hope…