Open vallemar opened 3 years ago
Any ideas on this @EddyVerbruggen ? Now I have changed the design of my application, I have put MLKitBarcodeScanner in a BottomNavigation and every time the user clicks on the scanner I have to do Frame.reloadPage()
and return to the TabContentItem of the scanner since it returns to 0. With these traps the application it gets quite slow
I have created a very basic project with the firebase configuration already added. If you download it you can see the error in question: https://github.com/vallemar/firebase-mlkitcamera
Error reproduction instructions Enter the scan tab, go back to home and go back to the scan, it will no longer work
I have found the solution to this problem, it is not the best solution but it works. I have implemented it in vue:
Important: with v-if this doesn't work, it has to be v-show
<template>
<MLKitBarcodeScanner
v-show="!clearViewML"
@loaded="loadedMLKitBarcodeScanner"
:pause="pause"
.
.
.
>
</MLKitBarcodeScanner>
</template>
<script>
export default {
data() {
return {
ml: null,
pause: false,
clearViewML: false,
};
},
methods: {
loadedMLKitBarcodeScanner(args) {
if (isAndroid) {
if (this.ml == null) {
this.ml = args.object;
} else {
this.pause = true;
this.clearViewML = true;
setTimeout(() => {
this.clearViewML = false;
this.pause = false;
}, 50);
}
}
}
}
};
</script>
When performing a scan and navigating to another activity, if back is pressed the camera does not initialize again, the camera appears black. This behavior only happens in android, in ios it works correctly I am using it over vue and the following configuration: