Closed vanthao-github closed 2 months ago
In the new version presented, it is possible to access in the following way
import { Scanner, boundingBox, } from "@yudiel/react-qr-scanner";
const [enabled, setEnabled] = useState(false);
<Scanner onScan={handleScanWebCam} paused={enabled} constraints={{facingMode: cameraFacingMode}} components={{ audio: false, onOff: false, // the onOff controls the scanner torch: false, tracker: getTracker() }} />
At least that's what I understand until now when the official documentation isn't out. rsrs...
Thank for replied @BrunoTeixeiraNDB , let me try your method. Thanks again!
If what you want is to start with the camera off, you could try to pass false
to the pause
prop. Please let me know.
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.
Sorry, but I don't know how to turn the browser's camera off/on using setState. I could do it in version 1.2.10, but it seems unstable. Sometimes I can turn off the camera, but sometimes I can't.