Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

about constraints width and height #31

Open
zhengfen opened this issue Jun 2, 2020 · 1 comment
Open

about constraints width and height #31

zhengfen opened this issue Jun 2, 2020 · 1 comment

Comments

@zhengfen
Copy link

zhengfen commented Jun 2, 2020

to be able to set the width and height of video area, I had to change the code:

          constraints: {
            width:  this.readerSize.width ,
            height: this.readerSize.height ,

          },

I wonder why min is used here:

          constraints: {
            width: { min: this.readerSize.width },
            height: { min: this.readerSize.height },
            facingMode: 'environment',
            aspectRatio: { min: 1, max: 2 },
          },
@mmichealjroberts
Copy link

I can confirm that the above solution by @zhengfen works, this.quaggaState needs to be updated to the following to work correctly:

quaggaState: {
        inputStream: {
          type: 'LiveStream',
          constraints: {
            width: this.readerSize.width,
            height: this.readerSize.height
          }
        },
        locator: {
          patchSize: 'medium',
          halfSample: true
        },
        numOfWorkers: 2,
        frequency: 10,
        decoder: {
          readers: this.readerTypes
        },
        locate: true
      }

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

No branches or pull requests

2 participants