setTrack method

  1. @override
Future<void> setTrack(
  1. MediaStreamTrack track, {
  2. bool takeOwnership = true,
})
override

Implementation

@override
Future<void> setTrack(MediaStreamTrack track,
    {bool takeOwnership = true}) async {
  try {
    await WebRTC.invokeMethod('rtpSenderSetTrack', <String, dynamic>{
      'peerConnectionId': _peerConnectionId,
      'rtpSenderId': _id,
      'trackId': track.id,
      'takeOwnership': takeOwnership,
    });
  } on PlatformException catch (e) {
    throw 'Unable to RTCRtpSender::setTrack: ${e.message}';
  }
}