Does anybody managed to use succesfully pausePreview()
method from cordova-plugin-qrscanner ?
Mine does not seem to be working, i am expecting to see preview being freeze? or it does have different feature?
My code is exactly as on here: https://ionicframework.com/docs/native/qr-scanner/
with addition of
this.qrScanner.pausePreview()
// Optionally request the permission early
this.qrScanner.prepare()
.then((status: QRScannerStatus) => {
if (status.authorized) {
// camera permission was granted
this.qrScanner.show();
// start scanning
let scanSub = this.qrScanner.scan().subscribe((text: string) => {
this.qrScanner.pausePreview();
console.log('Scanned something', text);
this.qrScanner.hide(); // hide camera preview
scanSub.unsubscribe(); // stop scanning
});
} else if (status.denied) {
// camera permission was permanently denied
// you must use QRScanner.openSettings() method to guide the user to the settings page
// then they can grant the permission from there
} else {
// permission was denied, but not permanently. You can ask for permission again at a later time.
}
})
.catch((e: any) => console.log('Error is', e));
Thanks in advance.