Native webcam support to come with HTML5
By
Kshitij Sobti |
Updated on 16-Dec-2009
HTML5 seems to be tackling plugins head on! Nearly all new features which have been introduced for HTML5 seem to tackle one or the other common scenarios where plugins are usually required.
With localStorage, geolocation, pluginless video and audio, canvas support, nearly everything is covered. However Flash still has a lot more to offer, and it seems HTML5 is going to slowly steal a larger piece of the cake.
A new HTML5 “devices” specification will now allow web developers to enable video conferencing via HTML applications without the need for any installed plugins. The abstract of the new specification is simply “This specification defines the HTML device element, to enable video conferencing from HTML applications.”
However the specification at WHATWG is a little more… evolved. The device specification adds an element to an HTML5 page which will allow one to select a device to get the data from, example: a webcam.
Taking a look at what this specification might have to offer, here is an example from the draft which allows the user to select a webcam and then displays the video stream from it in a video element:
<p>To start chatting, select a video camera: <device type=media onchange="update(this.data)"></p> <video></video> <script> function update(stream) { document.getElementsByTagName('video')[0].src = stream.URL; }</script>
HTML5 is treading further further into Flash’s domain, yet with nearly a decade to go till the specification becomes formalized, Adobe isn’t going to be sleeping.