MAX-Object-Detector icon indicating copy to clipboard operation
MAX-Object-Detector copied to clipboard

Docker: camera cannot be used in embedded sample application

Open ptitzler opened this issue 4 years ago • 1 comments

The console log contains the following error message if a browser is used that requires a secure context to access navigator.mediaDevices as documented here https://developer.mozilla.org/en-US/docs/Web/API/Navigator/mediaDevices

webapp.js:179 Uncaught TypeError: Cannot read property 'getUserMedia' of undefined
    at HTMLButtonElement.runWebcam (webapp.js:179)
    at HTMLButtonElement.dispatch (jquery-3.3.1.min.js:2)
    at HTMLButtonElement.y.handle (jquery-3.3.1.min.js:2)

ptitzler avatar Apr 02 '20 15:04 ptitzler

Making a note here after a convo with @ptitzler over slack. This error is thrown by all browsers (in some manner) when hitting the http url of the web app. This does not occur if you hit the https url. Users can bypass this in their browser using developer tools/settings though (method differs by browser). This is a security feature and cannot be solved "server-side" in the web app code, only "client-side" in a browser.

A "solution" to this may be to disable the button or add a dialog of some sort if the web app is loaded on http

ajbozarth avatar Apr 20 '20 22:04 ajbozarth