How to use the @zxing/library.BrowserQRCodeReader function in @zxing/library

To help you get started, we’ve selected a few @zxing/library examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github brave / ethereum-remote-client / ui / app / components / app / modals / qr-scanner / qr-scanner.component.js View on Github external
initCamera () {
    this.codeReader = new BrowserQRCodeReader()
    this.codeReader.getVideoInputDevices()
      .then(() => {
        clearTimeout(this.permissionChecker)
        this.checkPermisisions()
        this.codeReader.decodeFromInputVideoDevice(undefined, 'video')
          .then(content => {
            const result = this.parseContent(content.text)
            if (result.type !== 'unknown') {
              this.props.qrCodeDetected(result)
              this.stopAndClose()
            } else {
              this.setState({msg: this.context.t('unknownQrCode')})
            }
          })
          .catch(err => {
            if (err && err.name === 'NotAllowedError') {