sendAnswerSdp method

void sendAnswerSdp(
  1. String? otherUserId,
  2. RTCSessionDescription? sdp
)

Implementation

void sendAnswerSdp(String? otherUserId, RTCSessionDescription? sdp) async {
  final connection = getConnection(otherUserId!);
  if (connection != null) {
    await connection.setOfferSdp(sdp!);
    final answerSdp = await connection.createAnswer();
    sendMessage('answer-sdp', {
      'userId': userId,
      'otherUserId': otherUserId,
      'sdp': answerSdp!.toMap(),
    });
  }
}