I need to access the replaceTrack method of the RtcRtpSender, however, it is not defined in the dart2js file:
@Native("RTCRtpSender")
class RtcRtpSender extends Interceptor {
// To suppress missing implicit constructor warnings.
factory RtcRtpSender._() {
throw new UnsupportedError("Not supported");
}
MediaStreamTrack? get track native;
}
The replaceTrack method is defined here: https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/replaceTrack
How can I call the RtcRtpSender.replaceTrack()?
I've tried the below and it threw _DartObject method not found:
JsObject.fromBrowserObject(myRtcRtpSender).callMethod('replaceTrack',
[null]);
thanks to @sunbreak in gitter he reminded me of
dart:js_util: