addRemoteTrack method

Future<RTCRtpTransceiver> addRemoteTrack(
  1. dynamic media,
  2. List<MediaStream> streams

Add remote receving track.

media - Media kind ('audio' | 'video'). streams - Streams the track will belong to. Future that will be resolved when the RTCRtpTransceiver is assigned an mid value.


Future<RTCRtpTransceiver> addRemoteTrack(
    media, List<MediaStream> streams) async {
  try {
    RTCRtpTransceiver transceiverLocal = await peer!.addTransceiver(
        kind: media,
        init: RTCRtpTransceiverInit(
            direction: TransceiverDirection.RecvOnly, streams: streams));

    RTCRtpTransceiverCompleter completer = RTCRtpTransceiverCompleter();
    Future<RTCRtpTransceiver> t =
    return t;
  } catch (e) {
    throw Exception(e);