getUserMedia
gives JavaScript access to a user's audio and video inputs. This is an example that gets the video input and allows you to take a photo, all in the browser.
You need Opera 12 or Chrome Canary (with the media stream flag turned on) to run the example.