I want to mix MediaStreamTrack objects in Dart using the package:universal_html/js.dart
library.
JsAudioContext audioContext = JsAudioContext();
audioContext.initialize();
var senders = await call!.peerConnection!.getSenders();
for (var sender in senders) {
for (var track in senderTracks) {
if (sender.track!.id != track.id) {
audioContext.connect(track);
}
}
}
But WebRtc hides the jsTrack native object inside the MediaStreamTrackWeb object. How can I access this object ? Is there anyone have an idea ?
I found the solution using the js_bindings library. The library's MediaStream.getTracks() method throws a type error. I solved this problem using js_util interop.
JsAudioContext.dart:
sip_call_event_service.dart: