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

Unable to use back camera on mobile #144

Open
MrRaam opened this issue Oct 8, 2020 · 2 comments
Open

Unable to use back camera on mobile #144

MrRaam opened this issue Oct 8, 2020 · 2 comments

Comments

@MrRaam
Copy link

MrRaam commented Oct 8, 2020

I'm trying to use the back camera. However, I'm unable to find the fix to use the back camera for mobile. Webcam seems to work.

@derm1ch1
Copy link

Here you go my friend, just extending the webcam.setup() parameter in the example code snippet worked perfectly for me:
await webcam.setup({ facingMode: "environment" });

Alternatively use facingMode: "user" for front camera.

Have a good day and, in case of interest, make sure to read my answer here to make the webcam work on iOS devices as well. Just two extra-lines of code :-)

Let me know if it works for you!

@MrRaam
Copy link
Author

MrRaam commented Nov 18, 2020

@derm1ch1 Thanks, this seems to be working fine for android now. Will look into the ios as well. Thanks again, mate.

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