I cloned a project about real-time image processing on a web browser from this link: Then I could not allow my browser to access my camera. I got this javascript alert:
Are you accessing the webpage that is served over HTTP, on localhost? If you are accessing it from http://localhost/... , Chrome will ask for your permission to use the camera.

If you are opening the web page directly, i.e. /Users/Methuz/Documents/index.html then it will not work, even if you explicitly allows it permission

In this case, the workaround I use is to host the HTML file on a webserver. A quick hack is to use python, in the folder where the HTML page is lcoated: python -m SimpleHTTPServer