react-webcam icon indicating copy to clipboard operation
react-webcam copied to clipboard

Webcam Not Displaying on Mobile Browsers if Permissions not Enabled

Open rachel-elas-ai opened this issue 2 years ago • 1 comments

Please follow the general troubleshooting steps first:

  • [ YES ] Is your app running over HTTPS? (please provide the URL if possible --- not possible currently)
  • [ YES ] Have you tried running the demo (https://codepen.io/mozmorris/pen/JLZdoP) on your device? It just shows a white screen

image

  • [ YES ] Checked the latest "Can I use" compatbility table? (https://caniuse.com/stream)

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.

rachel-elas-ai avatar Mar 18 '22 03:03 rachel-elas-ai

+1

hypo-thesis avatar Jun 12 '23 08:06 hypo-thesis