Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do we choose between back and front camera of celphones? #2

Open
tkd-itsuki opened this issue Mar 9, 2020 · 5 comments
Open

How do we choose between back and front camera of celphones? #2

tkd-itsuki opened this issue Mar 9, 2020 · 5 comments

Comments

@tkd-itsuki
Copy link

No description provided.

@mrvnklm
Copy link

mrvnklm commented May 28, 2020

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

@rzfzr
Copy link

rzfzr commented Sep 24, 2021

How did you get it working on your phone ? I'm stuck as #12

@mrvnklm
Copy link

mrvnklm commented Sep 24, 2021

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>

@rzfzr
Copy link

rzfzr commented Sep 24, 2021

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

Cristian-Ayala added a commit to Cristian-Ayala/vue-barcode-reader that referenced this issue Nov 17, 2021
@Cristian-Ayala
Copy link

Cristian-Ayala commented Nov 17, 2021

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants