We had to look into this: the only way to do it in a cross-browser/OS way is to use Flash. Fortunately, it's fairly simple to write a bare-bones Flash app that just creates JS hooks for all webcam functions (though the permission dialog and any video preview still needs to be in the Flash window).