bensonruan / webcam-easy

javascript access webcam stream and take photo
https://bensonruan.com/how-to-access-webcam-and-take-photo-with-javascript
MIT License
241 stars 110 forks source link

why in my code "environment" parameter doesn't work to solve reverse problems #32

Open changfu2021 opened 2 years ago

changfu2021 commented 2 years ago

the code always streaming video reversed, i tried webcam.flip() or set the 'environment' parameter to webcam but doesn't work: const webcam = new Webcam(webcamElement, 'environment', canvasElement);

is anybody solved this problem?

2
changfu2021 commented 2 years ago

image

MV-GH commented 2 years ago

There is a typo in the source code, (enviroment vs environment) https://github.com/bensonruan/webcam-easy/blob/0ebfea62fec456c9b618d5f17c72386124e753b5/src/webcam-easy.js#L78

i made a fork with a bunch changes from unmerged PRs, which inludes fixes for this