Webcam js Error in Chrome: Could not access webcam Webcam js Error in Chrome: Could not access webcam google-chrome google-chrome

Webcam js Error in Chrome: Could not access webcam


Chrome 47 requires that the site be HTTPS in order for user media / webcam to work! This is a brand new requirement that I didn't see coming...

Chromium Docs on the topic:https://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features

This means I'll have to buy a SSL cert. The library should work fine in Chrome 47, as long as you are using it on 127.0.0.1, or over HTTPS.

Issue Discussion

Solution


You can permitted a specific site or port:

To ignore Chrome’s secure origin policy, follow these steps.

  • Navigate to chrome://flags/#unsafely-treat-insecure-origin-as-secure in Chrome.

  • Find and enable the Insecure origins treated as secure section (see below).

  • Add any addresses you want to ignore the secure origin policy for. Remember to include the port number too (if required).

  • Save and restart Chrome.

See here!


If you can't provide a secure connection yet, all you can do is use the fallback to flash. Use the config code in that lib:

 Webcam.set({        force_flash: true });