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

Users with multiple webcams cannot select which one to use for QR code scanning (Polkadot Vault) #1275

Open
alecdwm opened this issue Jan 25, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@alecdwm
Copy link
Member

alecdwm commented Jan 25, 2024

It should be possible to get a list of video inputs using the enumerateDevices api.

With that list, we can show a dropdown when # of video inputs > 1.

If the user selects a device with the dropdown, we can use the deviceId parameter to getUserMedia:

getUserMedia({
  video: {
    deviceId: {
      exact: myExactCameraOrBustDeviceId,
    },
  },
})

The tricky part, is that our call to getUserMedia is nested inside of react-qr-reader, which in turn is nested inside of @polkadot/react-qr.

So, we need to fork react-qr-reader to add a deviceId property to its QrReader component (which is imported as just Reader inside of @polkadot/react-qr).

Then, we need to fork @polkadot/react-qr to expose this new property on the QrScanAddress and QrScanSignature components.

Maybe we can even get our forks PR'd back upstream?

@alecdwm alecdwm added enhancement New feature or request good first issue Good for newcomers labels Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant