File Under: Browsers

Chrome 21 Looks and Listens Thanks to WebRTC Standard

Head to Sketchbots with Chrome 21 and your image will soon appear in the sand. Image: Google

What if web apps could see? What if they could hear?

That’s the far-fetched opening to Google’s latest Chrome update announcement. But as it turns out, it’s not all that far-fetched. In fact Chrome 21, which is now available in the stable channel, can, like coming versions of Firefox and Opera, use your webcam to see and your microphone to listen.

The magic behind Chrome 21′s all-seeing gaze is the getUserMedia JavaScript API, which gives developers access to your webcam and microphone. The getUserMedia API is part of WebRTC, a larger group of proposed standards that will eventually make web apps capable of many of the same feats that currently require platform-native APIs.

Whenever you point Chrome 21 to a web app that wants to access your camera or microphone, Chrome will display a prompt requesting permission, and, assuming you allow it, you’ll also get the option to select which device to use — i.e., a USB headset instead of a built-in mic.

If you’d like to see it in action Google has an impressive new demo to show off Chrome’s getUserMedia capabilities. Sketchbots is an experiment that uses getUserMedia to grab a picture of your face via webcam and then converts the image to a line drawing. The line drawing is then sent to a robot in the Science Museum in London where the robot draws out your portrait in a patch of sand, which you can watch live on YouTube (and is seen by anyone visiting the museum).

Chrome 21 also adds official support for Apple’s new high-res Retina Macbook Pros. This release also introduces support for the Gamepad JavaScript API, which will allow developers to write web-based games that use videogame controllers.