Search code examples
localhostclientwebcam

Webcam js Error in Chrome,firefox: Could not access webcam from remote client


I am using webcam.js in my php web based software and when we access using 'localhost/registration/create' then webcam.js works well and correct on the server machine, but when we access this software using

IP('192.168.10.10/registration/create' )

from the client machine in browser it gives error, please see the screenshot.

Webcam.js Error: Could not access webcam: NotReadableError: Failed to allocate videosource NotReadableError: Failed to allocate videosource

I have tried a lot and search a lot but could not find the solution so please suggest me correct solution for this Thanks.


Solution

  • Web browser does not support user media calls from insecure URLs. So you can't use the camera or microphone from a web request that doesn't have SSL. Only these devices are accessible from localhost or HTTPS.

    There is another way (not recommended) to solve this problem manually configure the web browsers.

    chrome://flags/#unsafely-treat-insecure-origin-as-secure