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

How to switch the camera to front or back? #90

Open
vupham79 opened this issue Nov 8, 2024 · 2 comments
Open

How to switch the camera to front or back? #90

vupham79 opened this issue Nov 8, 2024 · 2 comments
Labels

Comments

@vupham79
Copy link

vupham79 commented Nov 8, 2024

No description provided.

@igorya76
Copy link

You can toggle this a few ways, use contraints to set preferred camera or use useDevices to select the camera you want (add code to to select the camera you want)

`

export function QrCodeScanner(p: {
onScan: (decoded: string) => void;
onError: (error: string) => void;
}) {
let x = useDevices();
return (
<Scanner
onScan={(res) => {
console.log({ res });
p.onScan(res[0].rawValue);
}}
onError={(err) => {
console.log({ err });
}}
paused={false}
components={{
onOff: true,
audio: true,
finder: true,
zoom: true,
torch: true,
tracker: outline,
}}
constraints={{
facingMode: {
ideal: "environment",
},
deviceId: "",
}}
/>
);
}

`

Copy link

stale bot commented Dec 25, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants