Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
changfu2021 opened this issue Dec 16, 2021 · 2 comments

Comments

@changfu2021
Copy link

<script type="text/javascript" src="https://unpkg.com/webcam-easy/dist/webcam-easy.min.js"></script> <script> window.addEventListener('load', function() { //js代码 const webcamElement = document.getElementById('webcam'); const canvasElement = document.getElementById('canvas'); //const snapSoundElement = document.getElementById('snapSound'); const webcam = new Webcam(webcamElement, 'environment', canvasElement); webcam.flip(); webcam.start() .then(result =>{ console.log("webcam started"); }) .catch(err => { console.log(err); }); }); </script>

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
Copy link
Author

image

@MV-GH
Copy link

MV-GH commented Dec 23, 2021

There is a typo in the source code, (enviroment vs environment)

this._facingMode = (this._facingMode == 'user')? 'enviroment': 'user';

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants