In order to access the webcam in Firefox (and more generally in supporting browsers), you should use navigator.getUserMedia
Prompts the user for permission to use a media device such as a camera or microphone. If the user provides permission, the successCallback is invoked on the calling application with a LocalMediaStream object as its argument.
Here is a tutorial on MDN about taking webcam photos.