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

Facing mode environment is only flipping the camera horizontally #49

Open
andregoncalvesdev opened this issue Jan 7, 2022 · 3 comments

Comments

@andregoncalvesdev
Copy link

andregoncalvesdev commented Jan 7, 2022

Hello @JonatanSalas !

I´m trying to use the back camera of the phone to scan, and to do that i am changing the default constraints to { facingMode: 'environment' }.

The camera that is used is still the front one, and it only flips the video horizontally. I can reproduce this on my project aswell as on the demo of the package. Tried on different phones aswell.

I also tried { facingMode: { exact: 'environment' } } and { facingMode: { ideal: 'environment' } } but with no success.

@AndreyPatseiko
Copy link

I have the same problem.
Tried { facingMode: "user" and "environment" } and got only horizontal flip. :(

@gabrielbrrll
Copy link

Same, I'm having this problem as well.

@ralphievolt
Copy link

Try this. Works for me!!

const qrStyle = {
  width: "80%",
  height: "60%",
  top: "0",
  left: "0",
  overflowY: "hidden",
  overflowX: "hidden",
  objectFit: "cover"
}
 <QrReader
            onResult={(result, error) => {
              if (!!result) {
                setData(result?.text);
              }

              if (!!error) {
                console.info(error);
              }
            }}

            videoContainerStyle={qrStyle}
            scanDelay={100}
            constraints={{ facingMode: facingMode }}
            className="flex align-items-center justify-content-center mt-2"
          />

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

4 participants