It knows how to word the prompt because we declared this function as only being used for video via the first argument which we set as , nothing else really needs to be done to show your webcam data on the screen.
In cases when there is an error in getting the video stream or the user refused to give your code permission to access the webcam, the error callback will get called.
Now that you have a working example, let's go through our code line-by-line to understand how the verbal overview you saw earlier matches the code that you just added.
To address this with the least amount of code, I took a technique I described in my Vendor Prefixes and Java Script tutorial where we use the OR operator to check for the existence of a single, valid as a function as we are here, the first thing that happens is that your browser displays the prompt asking whether you want to give it permission to access your webcam.
"Our Directshow Filter allows to connect network cameras providing JPEG images or MJPEG streams in application accepting webcam sources like as Skype or Windows Media Encoder." Otherwise, I would look at Many Cam Pro on Windows, and Cam Twist Studio on OS X and see if they would help. It works as advertised except there's some noticeable video delay which may or may not because of my specific setup.
The vendor also provides a Direct Show filter for easier integration with 3rd party apps: dl.filekicker.com/send/file/226163-6E45/IPCamera Cam Twist can, but not nicely - you could open the Axis camera in a web browser, then clip that as an area of the screen to capture as sn input in Cam Twist and refeed it as a fake webcam.
Different browsers do different things when they ask you for permission to use the webcam.
For example, here is what Chrome's prompt looks like: If you denied permission accidentally (or intentionally), just reload this page to get a crack at acing this test again.