removeTrack method
Removes the given MediaStreamTrack object from this MediaStream.
Implementation
@override
Future<void> removeTrack(MediaStreamTrack track,
{bool removeFromNative = true}) async {
if (track.kind == 'audio') {
_audioTracks.removeWhere((it) => it.id == track.id);
} else {
_videoTracks.removeWhere((it) => it.id == track.id);
}
if (removeFromNative) {
await WebRTC.invokeMethod('mediaStreamRemoveTrack',
<String, dynamic>{'streamId': id, 'trackId': track.id});
}
}