How to remove "Allow Permission to Camera" and set the camera selection to only "facing back" #858
TaimaticaJCarvalho
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear Mebjas,
I am currently developing a React app for tablet device and i chose your Html5codescanner to scan barcodes.
I have followed the guidelines to using it in react
`import { Html5Qrcode, Html5QrcodeScanner } from "html5-qrcode";
import { useEffect } from "react";
const qrcodeRegionId = "html5qr-code-full-region";
// Creates the configuration object for Html5QrcodeScanner.
const createConfig = (props) => {
let config = {};
if (props.fps) {
config.fps = props.fps;
}
if (props.qrbox) {
config.qrbox = props.qrbox;
}
if (props.aspectRatio) {
config.aspectRatio = props.aspectRatio;
}
if (props.disableFlip !== undefined) {
config.disableFlip = props.disableFlip;
}
if (props.rememberLastUsedCamera) {
config.rememberLastUsedCamera = props.rememberLastUsedCamera;
}
if (props.supportedScanTypes) {
config.supportedScanTypes = props.supportedScanTypes;
}
config.videoConstraints = { facingMode: { exact: "user" } };
return config;
};
const Html5QrcodePlugin = (props) => {
useEffect(() => {
// when component mounts
const config = createConfig(props);
const verbose = props.verbose === true;
// Suceess callback is required.
if (!props.qrCodeSuccessCallback) {
throw new Error("qrCodeSuccessCallback is required callback");
}
}, [props.isPaused, props.hasCode]);
return
};
export default Html5QrcodePlugin;
`
Could you please advice how to set the camera selection to only environment and how to remove the "Allow Permission to camera" notifications as my customer would like it not to appear?
Best regards,
João Carvalho
Beta Was this translation helpful? Give feedback.
All reactions