Pages

Sunday, 1 September 2013

WebRTC and the open web

The why, the how, and its pressing need today.

-

Almost all of us have used video and voice chatting services on the Internet. Right since the days of Google Talk - on to Skype and now Google Hangouts - voice and video chat have become a cornerstone of a user's web experience. With big firms moving to massive video conferencing solutions involving telepresence to ease the burden of globe-trotting; and more and more families and friends using social networking sites to keep in touch across the world, there never has been a more pronounced need for a universal standard that will make video chatting even more streamlined and efficient.

Enter HTML 5.

HTML 5, for the ones who have been keeping to the dungeons of technological ignorance for the past few years, is essentially the latest buzzword when we're talking web technologies. It builds upon the quintessential mark-up language, HTML and adds more features that can, in a word, make a sufficiently advanced web-browser, only slightly less magical than a bubbling cauldron from Grimm's fairy tales.

One of the ideas behind it was simple. Till before HTML 5, the only way to make a web page interactive and lively - with videos and animations and transition-effects - was by using Adobe Flash.

Yes, Adobe had nailed this one business real well when they had spotted the need to take web pages to the next level, at a time when all the tools web developers had were some mark up languages and JavaScript, and then later JQuery. Adobe's Flash had thus, become an instant hit, and had ruled an absolutist monopoly in Web media for a long time. And it still does. All the video you see on the internet today, for example, are mostly Flash based - (that's changing now, we'll come to that later).

Flash wasn't popular because it was good technology. It was popular because it was the only way to do certain things on the internet. It was proprietary, woefully buggy, had a million security loopholes and most developers avoided it, as a result of which JavaScript and CSS became the chosen tool to get stuff done cleanly on the Web. In 2006, the first version of JQuery was released - and with its very apt tagline "Write less, do more", it packaged extensive JavaScript libraries together, which developers could simply include in their pages and let cool things happen on the browser.

But even with JQuery, JavaScript (which became an industry standard in 1996) had severe short-comings, primarily when it came to media-rich Web applications.

To replace the proprietary piece of trash.. oops Flash, that Adobe had been stuffing down everyone's throats for the past few decades, the Internet Jedis at the World Wide Web Consortium and the Web Hypertext Application Technology Working Group began work in 2004 to give the ageing markup language, a fresh revamp. In all honesty, the reason they began work on HTML 5 was not to grind some old axes with Adobe, but to standardise media-support for the Web. That is because, the moment you have a proprietary prick in an open ecosystem like the Web, it doesn't bode well for anyone, save for the proprietary prick itself. Keeping proprietary pricks in business leads to Goliaths like Microsoft - which is never a good thing for an industry like software.

Today, most browsers support certain elements of HTML 5, but not all - because HTML 5 is still work-in-progress. The HTML 5 project has been promoted extensively by the fine folks at Mozilla, Google and Opera, as a result of which Firefox, Chrome and Opera's latest browsers happen to have the best support as of today. Of course Chrome is a mile ahead of Firefox, but yeah, this triumvirate of Jedis has made possible certain things using an open format that was, till a few years back, solely Adobe's cup of tea.

Here I pause for a second to clarify a few things. One, HTML 5 alone, is definitely NOT a replacement for Flash. HTML 5 allows you to watch videos and audio pieces on the Internet, which was something only Flash could do, but HTML 5 is still bereft of several features that Flash had. But then, targeting Flash was never an objective. The greater goal was to make open formats which can supplement each other to develop media rich applications on the Web without resorting to proprietary pricks. Thus, with HTML 5, CSS 3 and JS together, you can pretty much do everything that one could do in Flash.  Thus, earlier while you had to almost always use Flash to play games on the Internet, today you can play better, far better games using HTML 5. YouTube is shifting to an HTML 5 video player, something which you can opt for right away!

Now, coming back to the topic that I started out with: video chatting. Our open formats still had one glaring discrepancy - and that was real time communication support.

Till today, to initiate a video chat, you had two alternatives: use a native application like Google Talk or Skype, which could access your webcam and microphone. OR, use an online browser-based service that uses Flash. The problem with this state of affairs is that, there was no way that a browser could access the webcam or the microphone by itself! You had to either use a native software, or you had to use Flash (if on a browser). With the rising use of such chat services - which was essentially based on the Web, it was a pity that there was no technology good enough to make a browser - which is our window to the web - support such services as is. Even with the voice chat in online Google services, you had to install the google-voice-chat plugin. Which was proprietary and was thus... well, boo.

Do we have a solution today?

It finally, and certainly does looks like that.  *drumroll*

WebRTC - or Web Real Time Communication.

This is one of the latest features to be added to HTML 5 and this marks a huge leap in the history of web development. WebRTC saw the light of day in early 2013, and was given a huge boost at Google's annual developer conference - Google I/O of this year.

WebRTC adds a few cool functions to HTML 5 which now makes it possible to access your webcam and microphone directly and natively by a browser. Now how cool is that?

getUserMedia() is the crucial function we are talking about. Plug it in to an html page today, and if you have a sufficiently advanced browser, you'll be able to record yourself using your webcam with nothing but the browser and just the browser. This technology is still bleeding edge, and is supported only by Chrome 23 onwards and only new versions of Firefox (whichever that is) and Opera browsers, but it makes for some insanely cool things that you can now do with it. Using your webcam is therefore, not an install away anymore. It's just a function call away. When chat services begin to use this bit of awesomeness - you won't need to install Flash or Google Talk Plugin or the other million proprietary pricks that you have been using all these days to exercise a basic Internet right that you've been born with - viz video chat.

Now, the thing is to make WebRTC a standard, because if it's not standardised, it's not of much use for the general internet populace. Internet Explorer and Safari are still woefully backwards when it comes to HTML 5 support, and unless these unfortunately big players are forced to accept this as a standard, you won't find quality web services that run only on HTML 5. Google for example, didn't make their recent revamp of Talk ie Hangout, HTML 5 compatible. They received a lot of flak for this, but then they really didn't have any option. If they're targeting a browser based chat service and if they want Windows and Mac users to use it as well, then it's stupid to make something strictly HTML 5 as of now; there just won't be enough users - and I'm glaring at the ones who use IE and Safari at the moment. (What is funny is, Apple were one of the early voices against Adobe's tyranny - when they blocked Flash on the iPad. How their browser is still far from being the HTML 5 haven that people had expected it to be is perplexing.)

Standardising HTML 5 thus remains, to be the need of the hour, and as of today, it has been designated to be a Candidate Recommendation by the W3C. The next step in its path to becoming a standard is to be designated "W3C Recommendation" for which we have to simply wait and watch.

What are the obstructions in the way? The biggest obstruction will certainly be Microsoft because they still have a 56% browser market share. So their voice matters. A lot. And more importantly, they'll want to keep HTML 5 from becoming an industry standard because the moment it does, and lots of HTML 5 based video chat services mushroom online - it will prove to be death knell for their $8.5 billion business move in 2011, which was buying Skype.

--

Here are some links to follow if you're interested in HTML 5.

http://www.w3.org/html/wg/drafts/html/master/ - The W3C abstract.

http://www.html5rocks.com/ - get a low down on the latest cool things you can do with HTML 5.

http://html5test.com/ - find out how well your browser supports HTML 5.

http://www.shinydemos.com/facekat/ - a brilliant game to show you the potential of HTML 5 and the function getUserMedia().

Post a Comment