I'm making an app that makes use of a QR code scanner. I'm using the ngx-scanner component which is a ported version of Google's ZXing scanning library for Angular. The problem: Everytime I'm using the scanner component I get no errors but the camera view for the scanner won't load and I will just get the same screen I have as a background in my app.
Here's my HTML and my TS export class
<zxing-scanner [enable]="scannerEnabled" (scanSuccess)="onScanSuccess($event)"></zxing-scanner>
<h1><strong> {{ result }} </strong></h1>
export class QrScannerComponent implements OnInit {
scannerEnabled = true;
result: string
constructor() {}
ngOnInit(): void {}
onScanSuccess(result: string) {
this.result = result
}
}
Just in case, have you tried to log the scan failure even from that component?
At the template, define the formats to read, in my case, I only want to read QR Codes or EAN as well.
At the component:
Which version are you using by the way?
EDIT