I want to run a scan in ionic-angular of qrcode

Viewed 15

I want to run a scan in ionic-angular of qrcode, on the pc everything works but when I build the android apk, the scan button doesn't work anymore.

Le ts

async startScan(){
    this.scanResult = null;
      const  stream = await navigator.mediaDevices.getUserMedia({
        video:{facingMode: 'environment'}
      });
      this.videoElement.srcObject = stream;
      this.videoElement.setAttribute('playinline', true);
      this.videoElement.play();

      this.loading = await this.loadingCtrl.create({});
      await this.loading.present();
      requestAnimationFrame(this.scan.bind(this));
  }

Le html

 <ion-fab vertical="bottom" horizontal="center" slot="fixed">
    <ion-fab-button color="danger" expand="full" (click)="startScan()">
      <ion-icon name="scan-circle-outline" color="light"></ion-icon>
    </ion-fab-button>
  </ion-fab>

I am using "@capacitor/status-bar": "4.0.1" dependency

0 Answers
Related