-
Notifications
You must be signed in to change notification settings - Fork 864
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
Support front/back-facing cameras #33
Comments
Any updates on this? |
What do you think about passing constraints to
This could also be a way to fix #22, but then it would require to pass the resolution contraints to If it seems ok to anyone, I'm willing to submit a PR ;) |
My workaround, until this fixed by allowing some king of custom Camera settings, is to set the first camera which contains "back" inside its
It always selects the rear camera. |
my end its working but when i try to use the rear camera it flip horizontally.. how to put it back on the usual position? thanks |
I am having an unusual problem. It doesn't matter which camera I start, it always show the front camera. I can clearly see both cameras on the array and I force to start the back camera, still, the script always start the front camera. Also not loading camera on Chrome and Firefox for same device/OS. Any ideas? Thanks |
I am having the same issue. Were you able to select the rear camera on IOS Thanks |
@cbnt @schmich First of all thank you sooo much for this awesome project! :) Secondly, do you have any information on whether this is a common Iphone issue or how this can be fixed? Note: Using iphone 7 with iOS 11 |
Hi @Smux , Yes followed the steps in Issue #54 git clone git@github.com:schmich/instascan.git Much thanks @schmich for this awesome project also. |
I fixed the issue using this fork: https://github.com/PallasKatze/instascan But it is working fine. |
Hi @cbnt, I know this is a basic question and a bit off topic but I have been trying to produce a release js and haven't been able - installed npm on my test server but npm keeps giving errors when I try to publish. |
@clytras nice solution! But what happens if the mobile phone has more than one back camera? I've tried this solution and with the first back camera of the array the vision is horrible with a lot of zoom. I am not able to scan anything. But, if I use the second back camera returned it works perfectly and I can scan everything. My question is if exists a a way to detect which is the main back camera? Imagine if the website is used by different users, which means they will have different devices and the number of back cameras will be different and the order returned. Thanks a lot. |
German Iphone have different language of "Back" |
@ashu4code this is a workaround, not the solution to the problem, thus we have to adapt it to our needs. If you face these kind of different language cases and your audience is mainly targeted on specific locales, then you can easily change the So, instead of |
Hi guys, I have the solution and is possible set back camera for default.
|
pls help me. how to use this code to my js? |
For the new ones, I will explain step-by-step how to solve it:
async start() {
let constraints = {
audio: false,
video: {
facingMode: { exact: "environment" },
mandatory: {
sourceId: this.id,
minWidth: 600,
maxWidth: 800,
minAspectRatio: 1.6
},
optional: []
}
};
this._stream = await Camera._wrapErrors(async () => {
return await navigator.mediaDevices.getUserMedia(constraints);
});
return this._stream;
}
P.S.: To generate the instascan.min.js again you need the BONUS:I have created a new Instascan.min.js with this capabillity. The gist is that: https://gist.github.com/brunoinds/4466253d4ec667280074c6aa3bd2dd19 And you can include it on your code using: |
@brunoinds I'm using your instascan.min.js but I have this error: do you know why? thanks |
{ video: { facingMode: "user" } }
{ video: { facingMode: { exact: "environment" } } }
The text was updated successfully, but these errors were encountered: