Closed VinayKumarSarda closed 6 years ago
Any help on how to stop camera after scan ??? ## helpneeded @team
HI Please need inputs as my camera is stilla ctive after scanning is done.
Does this work? https://github.com/bitpay/cordova-plugin-qrscanner#destroy
No @HeroCC
any inputs @HeroCC @team
Hi Team,
any inputs on how to close camera ?? in browser once the scan is success still camera is open.
any update @team @HeroCC
I'm having the same issues on Win10/Google Chrome. After successfully scanning the QR code, I hide the qrScanner (even destroy it for good measure) and then transition to the next screen. The app does not release the camera though, which is not expecte behaviour and therefore bad UX -- I don't want my users to think that I am spying on them when they use my app :(
scan(){
let scanSub = this.qrScanner.scan().subscribe((text: string) => {
//here: store scanned text
this.qrScanner.hide();
this.qrScanner.destroy();
scanSub.unsubscribe();
this.navCtrl.push(NextPage);
});
}
I'm not able to reproduce on any local devices, but PRs are certainly welcome. 2.6.0 also includes some big improvements which may help.
Closing this for now, but feel free to open a new issue with more specific details.
This is still an issue with version 3.0.1.
Moreover, this piece of code causes the scanner.destroy
function to raise an exception that cannot be catched
try {
_this.qrScanner.destroy().then(function (status) {
_this.hideCamera();
}).catch(function (error) {
_this.hideCamera();
});
}
catch (error) {
_this.hideCamera();
}
if I debug, the cordova.callbackFromNative
function generates this error
{
code: 6,
name: "SCAN_CANCELED",
_message: "Scan was canceled."
}
which does not really seem an error.
The errore arises from the cordova-plugin-qrscanner/src/browser/plugin.min.js
The destroy
function cannot procede after the cancelScan
call because it calls the cancelNextScan
which in turn throws the code error 6, with the following
cancelNextScan = function(sendError){
window.clearTimeout(nextScan);
nextScan = null;
cancelNextScan = null;
if(sendError){
error(6); // SCAN_CANCELED
}
This is still an issue in current version (browser platform). Camera is not released after invoking .destroy() . Any ideas?
yup, can confirm ... still an issue :/
Have same issue on browser
+1
Does anybody know how to route to another page after the scan is complete?
I call the destroy API but that just makes my screen black.
I am doing this in Vue by calling this.$router.push('/Home')
but it doesn't work.
+1
Hi ,
The camera is still open after scan is successful. Please let me know how to stop camera after success scan.