Friday 11 January 2013

[JS] Webcam in HTML5



Webcam in HTML5



Introduction
HTML5 has introduced a few months ago this opportunity to access your personal webcam from a webpage, in that way you can avoid to use any flash plugin to grab a snapshot.
You might asking about compatibility with browsers and this is a bad point for this technology because IE still a step behind from other browsers, you can check to this website.

HTML part
You need to add two tags on your page that are the follow:








JS part
The follow part of code is made that will work cross-broswer:




The next part is to get a snapshot when you press on the video object, that is the follow part:



Testing
Now your are ready to try to grab your first snapshot from your webcam, just put everything together and you should see yourself.