Hi
Has anyone succeded in using UiPath apps and a webcam/phone camera to scan QR codes/barcodes?
Iv’e tried several javascripts, and all of them is denied access to the camera.
Using the code on Codepen it works fine, but putting it into the Custom HTML gives permission errors when trying to reach the camera.
At the moment I’ve had best luck with the HTML5 version
HTML
QR Code ScannerCSS
main {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
#reader {
width: 600px;
}
#result {
text-align: center;
font-size: 1.5rem;
margin-top: 20px;
}
And Javascript
const scanner = new Html5QrcodeScanner(‘reader’, {
qrbox: { width: 250, height: 250 },
fps: 20,
});
scanner.render(success, error);
function success(result) {
document.getElementById(‘result’).innerHTML = <h2>Success!</h2> <p><a href="${result}">${result}</a></p>
;
scanner.clear();
document.getElementById(‘reader’).remove();
}
function error(err) {
console.error(err);
}
Scanning images works really well, but not through the camera it self.
This is when I choose to scan an image file
It doesn’t matter if I use, Edge, Chrome, inkognito, mobilephone or laptop.
Any good ideas to get it to work?