Skip to content

MediaStreamTrack.getCapabilities() return a Map where some values are NativeJavaScriptObject #44319

Closed
@wer-mathurin

Description

@wer-mathurin

This tracker is for issues related to:

  • dart2js

If you aren't sure, file the issue here and we'll find the right home for it.
In your issue, please include:

  • Dart SDK Version (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

final mediaConstraints = <String, dynamic>{
    'audio': true,
    'video': {
      'mandatory': {
        'minWidth': '1280',
        'minHeight': '720',
        'minFrameRate': '30',
      },
    }
  };
var stream = await navigator.getUserMedia(mediaConstraints);
var _capabilities = stream.getVideoTracks()[0].getCapabilities();

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

Metadata

Metadata

Labels

area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.library-htmlweb-librariesIssues impacting dart:html, etc., libraries

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions