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 to use full width and height camera? #14

Open
ripper2hl opened this issue Mar 22, 2016 · 4 comments
Open

how to use full width and height camera? #14

ripper2hl opened this issue Mar 22, 2016 · 4 comments

Comments

@ripper2hl
Copy link

No description provided.

@diegobill
Copy link

👍

@wucop
Copy link

wucop commented Sep 13, 2016

Full width and height can be used with

<qr-scanner width="100%" height="100%" ng-success="onSuccess(data)" ng-error="onError(data)" />

But the problem is that the QR code will not get detected...

@Overdrivr
Copy link

I dont think using 100% is solving anything, instead the following config should be passed to the getUserMedia function when creating the stream

video: {
        optional: [
          {minWidth: 320},
          {minWidth: 640},
          {minWidth: 1024},
          {minWidth: 1280},
          {minWidth: 1920},
          {minWidth: 2560},
        ]
      }

But since this is encapsulated inside the html5-qrcode lib I'm not sure this can be solved here

@ggarbereder
Copy link

@wucop the problem here is that the canvas will not have the correct size. One can change the code to

canvas.setAttribute('width', video.clientWidth);
canvas.setAttribute('height', video.clientHeight);

In this solution the video element has to be added to the DOM tree before.

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

5 participants