mozmorris / react-webcam

Webcam component
https://codepen.io/mozmorris/pen/JLZdoP
MIT License
1.63k stars 281 forks source link

not asking for permission (chrome only) #377

Closed rattkin closed 1 year ago

rattkin commented 1 year ago

When I run the app during development (react-scripts start), it all works fine.

However when I commit the code and deploy it to production, the webcam does not ask for permission when using Chrome and the element is empty <video autoplay="" playsinline=""></video>.

The error returned from onUserMediaError is {} - can I do something to debug it? We tried Mac, Windows, Linux, Android operating systems. Always chrome has problem and other browsers work.

It works in Firefox and Safari, I guess it can be a chrome bug?.

if I enumerate video devices navigator.mediaDevices.enumerateDevices() I get one videoinput device, but with no data:

{
    "deviceId": "",
    "kind": "videoinput",
    "label": "",
    "groupId": ""
}
jroeglin commented 1 year ago

I think we have the same problem with an ionic app on android. In the backend the webapp is rendered in a chrome using the webView API of android. All of our packages that use the mediaDevices API seem to have the issue. I will search the chrome forum, maybe the problem is known.

I also tried our app in chrome and there is no issue, seems to be another issue.

rattkin commented 1 year ago

The problem was not react-webcam. It was caused by server headers