JsQRScanner
JsQRScanner copied to clipboard
Scanner API not working
HI, I face some problem on the Scanner API. Please help.
var jbScanner = {};
function onQRCodeScanned(scannedText)
{
var scannedTextMemo = document.getElementById("scannedTextMemo");
if(scannedTextMemo)
{
scannedTextMemo.value = scannedText;
}
}
//this function will be called when JsQRScanner is ready to use
function JsQRScannerReady()
{
//create a new scanner passing to it a callback function that will be invoked when
//the scanner succesfully scan a QR code
jbScanner = new JsQRScanner(onQRCodeScanned);
//reduce the size of analyzed images to increase performance on mobile devices
jbScanner.setSnapImageMaxSize(300);
var scannerParentElement = document.getElementById("scanner");
if(scannerParentElement)
{
//append the jbScanner to an existing DOM element
jbScanner.appendTo(scannerParentElement);
}
}
jbScanner.isScanning(); jbScanner.isActive();
This 2 api always return true even without camera permission.
jbScanner.stopScanning() jbScanner.resumeScanning()
.stopScanning API not working so i assume that .resumeScanning also not working
Declare jbScanner =""; Don't write "var"