Open dalezak opened 5 years ago
Ah-ha! Looks like the canvas
element may not have been fully rendered yet before trying to call Quagga.init.
If I put the Quagga.init
code inside a setTimeout
, it loads the camera:
setTimeout(() => {
Quagga.init(this.quaggaState, function(err) {
if (err) {
return console.error(err);
}
Quagga.start();
});
Quagga.onDetected(this.onDetected);
Quagga.onProcessed(this.onProcessed);
}, 1000);
I'll continue to investigate...
@sin-tanaka is there anything you can do to avoid this TypeError: Cannot read property 'setAttribute' of undefined at Object.o.createLiveStream
?
As I suggested above, simply putting the Quagga.init
code inside a setTimeout
resolves the problem.
I can modify the node_modules
source but it would be better if the module itself were updated to resolve the problem.
Delazak Good morning,
I need assistance with this, I keep getting Error: getUserMedia is not defined and the console is pointing to the same quagga init err line
please assist
I'm getting an error in my Ionic Capacitor Vue app on the line src/Scanner.vue#L112 which is calling
Quagga.init(this.quaggaState, function(err) {
I imported the component in my
main.js
And using the suggested vue tag
Here's what the output of my
quaggaState
looks like:Looks like it's related to https://github.com/serratus/quaggaJS/issues/394?