-
Notifications
You must be signed in to change notification settings - Fork 1.7k
MediaStreamTrack.getCapabilities() return a Map where some values are NativeJavaScriptObject #44319
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
Yup, it seems identical to #43802, with the problem being we don't handle nested dictionaries. The fix here will likely involve converting recursively for the same group of accepted types. |
@srujzs: according to the specification: aspectRatio is a double specifying the video aspect ratio or range of aspect ratios which are acceptable and/or required. Not a tree of objects! Same for other properties describe in the bug description. |
Is there are update about solving this issue? I'm trying to port this code to Dart but I couldn't succeed: (javascript) const userMedia = await navigator.mediaDevices.getUserMedia({video: true, audio: true});
const videoTrack = userMedia.getVideoTracks()[0];
const capabilities = videoTrack.getCapabilities();
const aspectRatio = capabilities.aspectRatio;
console.log(aspectRatio.max); (dart) final userMedia = await window.navigator.mediaDevices!
.getUserMedia({'video': true, 'audio': false});
final videoTrack = userMedia.getVideoTracks().first;
final capabilities = videoTrack.getCapabilities();
final aspectRatio = capabilities['aspectRatio'];
print(aspectRatio['max']); // Here this is thrown:
/*
Uncaught (in promise) Error: NoSuchMethodError: '[]'
Dynamic call of null.
Receiver: Instance of 'NativeJavaScriptObject'
*/ Any suggested solutions/workarounds? Check here for the full error stacktrace: https://stackoverflow.com/questions/67375720/call-to-videotrack-getcapabilities-returns-an-instance-of-nativejavascriptobje |
Hi, Sorry for a lack of update on solving this issue. You can workaround this using
|
@srujzs would you recommend updating |
I'd say update it. We had the same convo around |
One thing to maybe add a check for is recursive lists or maps. |
This tracker is for issues related to:
If you aren't sure, file the issue here and we'll find the right home for it.
In your issue, please include:
dart --version
)Dart SDK version: 2.11.0-242.0.dev (dev) (Wed Oct 21 00:38:45 2020 -0700) on "windows_x64"
When calling
If you inspect the map, you will have for example a NativeJavaScriptObject
_capabilities['aspectRatio']
_capabilities['width']
_capabilities['frameRate']
etc...
Seems to me a problem converting javascript type to dart equivalent.(double and int)
I just want to mention: @srujzs
Since the last commit was involving a similar problem, but in the opposite direction :-)
The method that is doing the conversion is:
convertNativeToDart_Dictionary
The text was updated successfully, but these errors were encountered: