I am trying to implement a QR-Reader into a Programm, and therefore tried using qr-camera. However, it doesn't work, and even after copying the exact example code from the README, it does not recognize the QR-Code. The module is installed inside the 'node-modules' folder, and it does not throw any errors on building. The Webcam-video the module produces is also working fine.
On the Online-Example provided on the npm page, it works flawlessly with the same camera and QR-Code. I tried giving the cameras video directly to tc-qrcode, which should be able to handle that (and is as far as I know the API qr-camera uses under the hood), but it didn't work either:
import qrcode from 'tc-qrcode';
// ...
console.log(await qrcode.decodeFromVideo(camera.video));
I even deleted everything and used just the example code they provided, but it didn't work either. Am I doing something wrong or is the example the problem. In either case, is there any other documentation on the API (except for the slightly longer one on the projects GitHub page), or another (working) API for decoding QR's from a Webcam video?
Thanks.
Just in case, heres my code as it is now (I am using WebPack):
import {QRCamera} from 'qr-camera';
async function main(){
const camera = new QRCamera({});
document.body.appendChild(camera.video);
console.log(await camera.scanQrcode());
camera.stopScanQrcode();
console.log('Penis');
}
main();