addIceCandidateToSubscriber method
Implementation
@override
Future<void> addIceCandidateToSubscriber(
String targetId,
RTCIceCandidate candidate,
) async {
if (targetId.isEmpty && _remoteSubscribers.length != 1) {
return;
}
late String participantId;
if (targetId.isEmpty) {
participantId = _remoteSubscribers.keys.first;
} else {
participantId = targetId;
}
if (_remoteSubscribers[participantId] != null &&
_remoteSubscribers[participantId]!.connectionType == _connectionType) {
await _remoteSubscribers[participantId]?.addCandidate(candidate);
} else {
_iceCandidateQueueForSubscribers
.putIfAbsent(participantId, () => [])
.add(candidate);
}
}