Cordova cordova-plugin-qrscanner plugin preview not showing
I am wrapping my application with cordova, and want to use the
I added the
preparefn in their docs to the
mountedlifecycle hook, and at one buttons @click calling a method, which executes the
Now the functionality is there, it scans with the camera, i get back my QRs decoded value, but I cant see the preview.
I tried making my whole app (<html>, <body> and all children) transparent, opaque, but that didn’t help either.
After I trigger the
.scan(), the background of my
layout-contenttag gets removed, and I have a black (transparent until <html>?) background until I call the
.hide(), which restores the colors. I guess that black is where I should see the video.
I am using crosswalk, but tried without too, the behavior remained the same.
I read somewhere, that the plugin should add an underlying video tag, which should be seeable on the DOM (couldn’t spot that with inspect).
I tested it on different Android devices. (Huawei P8 Lite, Google Pixel), same behavior.
I found these also, indicating there is a problem between vue/quasar and the plugin:
Any of you guys have any idea about what I should do to make this plugin work?
Or can you recommending me another one (this seems to be the “best practice” one).
( I got the functionality working with the barcode scanner, but thats not the UI that has been sold to our client, and they are quite adamant on it )
So in the end I solved it with the
phonegap-plugin-barcodescanner, which is very similar to the
cordova-plugin-barcodescanner, but you can configure it, so it feels more like a QR scanner.
Be aware that it the two above internally (in cordova) register/use the same name, so before changing from the cordova plugin to the phonegap one, remove it with the command below before adding the another one, so the build process won’t break.
$ cordova plugin rm cordova-plugin-barcodescanner