mozmorris / react-webcam

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

Webcam Not Displaying on Mobile Browsers if Permissions not Enabled #340

Open rachel-elas-ai opened 2 years ago

rachel-elas-ai commented 2 years ago

Please follow the general troubleshooting steps first:

image

Bug reports:

If you can provide a minimal reproducible demo (CodePen, CodeSandbox, etc) or a GitHub repository, that will greatly help us to solve your problem. Many of the issues posted are questions about react-webcam usage. We don't discourage you posting a question, it's just a lot easier to help you if we can see your code.

If the browser on mobile has Camera permissions set to "Don't Allow", there is no message or anything that pops up, the "Take Photo" button that should launch the webcam component simply stays in an "active" state and the webcam never appears, though the "Capture photo" button will. If I manually change the browser's permission to "Always Ask" or "Always Allow", it works fine. So the issue is the webcam not working if the browser doesn't have camera permissions set. However, b/c there's no message, it is not at all clear why the webcam isn't working or how to resolve it (I was stuck trying to debug for a long time). App should either ask for a permissions change or post a notification that permission is denied so webcam won't work.

Features:

Please note by far the quickest way to get a new feature is to file a Pull Request.

We will consider your request but it may be closed if it's something we're not actively planning to work on.

hypo-thesis commented 1 year ago

+1