Skip to content
New issue

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

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

Already on GitHub? # to your account

Allow custom device id chooser function to be provided as prop #32

Merged
merged 1 commit into from
Jul 13, 2017

Conversation

phillipj
Copy link
Contributor

When zero devices matches the wanted facingMode, the first video device found is chosen. That might not always be the wanted behaviour. In a project I'm working, it seems we consistently has to choose the last device.

These changes allows a custom function to be provided in the chooseDeviceId prop on the <QrReader> component. That function will allowed to choose which device should be used of the possibly matched video devices or all the video devices discovered.

The default behaviour stays as before, so this has no effect on projects that doesn't provide the chooseDeviceId prop.

Any thoughts?

When zero devices matches the wanted `facingMode`, the first video device
found is chosen. That might not always be the wanted behaviour.

These changes allows a custom function to be provided in the `chooseDeviceId`
prop on the `<QrReader>` component. That function will allowed to choose
which device should be used of the possibly matched video devices or all the
video devices discovered.

The default behaviour stays as before, so this has no effect on projects
that doesn't provide the `chooseDeviceId` prop.
@JodusNodus
Copy link
Owner

👍 Looks good on first sight, i'll test it out.

@JodusNodus JodusNodus merged commit bb4eee4 into JodusNodus:master Jul 13, 2017
@phillipj phillipj deleted the use-last-device branch August 3, 2017 20:15
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants