createAnswerForSubscribing method

Future<void> createAnswerForSubscribing(
  1. RemoteParticipant remoteParticipant,
  2. String streamId,
  3. Map<String, dynamic> constraints
)

Creates an answer for subscribing

Implementation

Future<void> createAnswerForSubscribing(RemoteParticipant remoteParticipant,
    String streamId, Map<String, dynamic> constraints) async {
  RTCSessionDescription answer =
      await remoteParticipant.peerConnection!.createAnswer(constraints);
  await remoteParticipant.peerConnection!.setLocalDescription(answer).then(
      (_) => websocket.receiveVideoFrom(answer, remoteParticipant, streamId));
}