-
Notifications
You must be signed in to change notification settings - Fork 1.7k
getUserMedia(mediaConstraints) does not consider deviceId and always open the default camera #43802
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
Comments
The problem come from constraints parameter is converted to JS object using convertDartToNative_Dictionary which does not work recursive as you can see in its implementation. |
do you have some ETA for this fix? using convertDartToNative_SerializedScriptValue instead works fine |
same problem was noticed for MediaStreamTrack.applyConstraints() also and I believe there is much more broken APIs like these ones according to this issue :( |
Talked this over a bit. cc @sigmundch @rakudrama
This is possible, can you point to the other ones you're coming across? It would be very useful to understand where recursive maps can be expected but aren't. Thanks! |
Hi @srujzs The only one I'm think about right now: |
Bug: #43802 convertDartToNative_Dictionary relied on the input being flat, which failed since it was being used for some APIs which allowed for nested dictionaries. Modifies it so that it converts any map or list values in the provided map. Change-Id: I9a404f4cd1f582cd88d43a57fbee0e07b0ee7e76 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171805 Commit-Queue: Srujan Gaddam <srujzs@google.com> Reviewed-by: Stephen Adams <sra@google.com>
|
I am having the same problem, I'm defining the map itself explicitly without any methods or references and it still does not load the desired camera:
|
That map is recursively copied as expected when I try it locally. Is the |
When you pass the constraint to the getUserMedia(mediaConstraints), it always open the default camera and do not considerer the deviceId pass in the constraints. To test this you can change the default camera in Chrome and you will see that It will open the default one.
This tracker is for issues related to:
dart2js
Dart SDK Version (dart --version)
Dart SDK version: 2.10.1 (stable) (Tue Oct 6 10:54:20 2020 +0200) on "windows_x64"
Whether you are using Windows, MacOSX, or Linux (if applicable)
Windows
Whether you are using Chrome, Safari, Firefox, Edge (if applicable)
Chrome
The text was updated successfully, but these errors were encountered: