vue-barcode-reader
vue-barcode-reader copied to clipboard
How do we choose between back and front camera of celphones?
It is currently not implemented as the code of the package shows. You might have to create a PR / your own package based on https://github.com/zxing-js/library
How did you get it working on your phone ? I'm stuck as #12
Don't really know anymore what the issue was but here is the code how I implemented it.
<template>
<StreamBarcodeReader
@decode="onDecode"
></StreamBarcodeReader>
</template>
<script>
import {StreamBarcodeReader} from "vue-barcode-reader";
export default {
components: {
StreamBarcodeReader
},
data() {
return {
scanned: false,
code: ''
}
},
methods: {
onDecode(result) {
if (this.scanned) return;
this.scanned = true;
let parts = result.split('/');
let token = parts[parts.length - 1];
console.log(token)
}
}
}
</script>
Nope, that is pretty much what I had, no sign of it on mobile, tried to enable camera permissions as default with no luck aswell Thanks
Just added a PR so you can select the camera you preferred.
Regarding @rzfzr problem, did you already meet the requirements? Read the following stackoverflow situation.
TLDR: You can't access Microphone or Camera without a secure connection (website displayed over https).
You can use in develope enviroment by port forwarding to your phone. Connect your phone to your computer Enable ADB on your phone (search how to do it on google if u don't know) Go to dev tools in chrome "chrome://inspect/#devices" Add the ports you want to forward and open the localhost page on you phone (e.g. localhost:8080)