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

I want enumerateDevices() filter argument. :-) #522

Closed
gtk2k opened this issue Jun 18, 2018 · 4 comments
Closed

I want enumerateDevices() filter argument. :-) #522

gtk2k opened this issue Jun 18, 2018 · 4 comments

Comments

@gtk2k
Copy link

gtk2k commented Jun 18, 2018

Like this.

const videoInputDevices = await navigator.mediaDevices.enumerateDevices({kind: 'videoinput'});
@alvestrand
Copy link
Contributor

what's wrong with

navigator.mediaDevices.enumerateDevices()
.then(list) { return list.filter(dev => dev.kind='videoinput') };

? (apologies for errors in Javascript syntax)

@gtk2k
Copy link
Author

gtk2k commented Jun 18, 2018

@alvestrand
Thank you for the reply.
Yes, I know .filter ().
When writing enumerateDevices(), in most cases write .filter().
So it was convenient if enumerateDevices() had filtering function.

@fippo
Copy link
Contributor

fippo commented Jun 18, 2018

i suspect the effort of specifying this is (for example: does enumerateDevices('videoinput') try to enumerate video devices and the kind is only run as a filter afterwards?) is much higher than the impact.

Its pretty easy to shim so there wouldn't be that many backward compability issues at least.

@alvestrand
Copy link
Contributor

closing as "not worth the specification effort, usefulness can be achieved by other means".

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

3 participants