mozmorris / react-webcam

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

It's always the camera with the wide angle that opens with android device #365

Open armin-shareid opened 1 year ago

armin-shareid commented 1 year ago

When I use React-Webcam on Chrome with an Android device that has multiple rear-facing cameras, such as Samsung Galaxy S10, it's always the camera with the wide angle that opens when I specify the "facingMode: environment".

Is it possible to ensure that it is always the basic rear camera that opens regardless of the device used?

schonee commented 1 year ago

You need to also specify the facingMode on the getUserMedia API. const constraints = { video: { facingMode: { ideal: "environment", }, },