addSubscriberCandidate method

  1. @override
Future<void> addSubscriberCandidate(
  1. String targetId,
  2. RTCIceCandidate candidate
)
override

Implementation

@override
Future<void> addSubscriberCandidate(
  String targetId,
  RTCIceCandidate candidate,
) async {
  if (_subscribers[targetId] != null) {
    await _subscribers[targetId]?.addCandidate(candidate);
  } else {
    final List<RTCIceCandidate> candidates =
        _queueRemoteSubCandidates[targetId] ?? [];

    candidates.add(candidate);

    _queueRemoteSubCandidates[targetId] = candidates;
  }
}