mozmorris / react-webcam

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

Could not acquire the stream #344

Closed ice3 closed 2 years ago

ice3 commented 2 years ago

Please follow the general troubleshooting steps first:

Bug reports:

I realized that the issue was coming from requestUserMedia and that step by step debugging could lead to a working camera stream (?!?). Tested on firefox (94.0 (64-bit) Linux) and chrome (Version 94.0.4606.81 (Build officiel) Fedora Project (64 bits)).

Then, I noticed that unmounted / mounted were called several times in a row when the component is first mounted, but the unmounted property was only set to true and never to false (I don't know react enough to estimate if this should happen).

Here are the dependencies of my project:

  "dependencies": {
    "@testing-library/jest-dom": "^5.16.3",
    "@testing-library/react": "^12.1.4",
    "@testing-library/user-event": "^13.5.0",
    "react": "^18.0.0",
    "react-dom": "^18.0.0",
    "react-player": "^2.10.0",
    "react-scripts": "5.0.0",
    "react-webcam": "^7.0.0",
    "web-vitals": "^2.1.4"
  },

I guess this is caused by some new react way of handling stuff.

Features:

Solved doing this : https://github.com/mozmorris/react-webcam/pull/343

ice3 commented 2 years ago

Too fast for me :clap:

Good work by the way, it's really smooth to use :)