diff --git a/lib/src/media_stream_track_impl.dart b/lib/src/media_stream_track_impl.dart index 39f6b70..1c4b8d9 100644 --- a/lib/src/media_stream_track_impl.dart +++ b/lib/src/media_stream_track_impl.dart @@ -37,7 +37,9 @@ class MediaStreamTrackWeb extends MediaStreamTrack { @override Map getConstraints() { - return jsTrack.getConstraints() as Map; + final c = jsTrack.getConstraints(); + final jso = (c as JSObject).dartify(); + return (jso as Map).cast(); } @override @@ -47,7 +49,8 @@ class MediaStreamTrackWeb extends MediaStreamTrack { final arg = js.jsify(constraints ?? {}); final _val = await js.promiseToFuture( - js.callMethod(jsTrack, 'applyConstraints', [arg])); + js.callMethod(jsTrack, 'applyConstraints', [arg]), + ); return _val; }