gotCallFeedsForInvite method

Future<void> gotCallFeedsForInvite(
  1. List<WrappedMediaStream> callFeeds, {
  2. bool requestScreenSharing = false,
})

Implementation

Future<void> gotCallFeedsForInvite(
  List<WrappedMediaStream> callFeeds, {
  bool requestScreenSharing = false,
}) async {
  if (_successor != null) {
    await _successor!.gotCallFeedsForAnswer(callFeeds);
    return;
  }
  if (state == CallState.kEnded) {
    await cleanUp();
    return;
  }

  for (final element in callFeeds) {
    await addLocalStream(await element.stream!.clone(), element.purpose);
  }

  if (requestScreenSharing) {
    await pc!.addTransceiver(
        kind: RTCRtpMediaType.RTCRtpMediaTypeVideo,
        init:
            RTCRtpTransceiverInit(direction: TransceiverDirection.RecvOnly));
  }

  setCallState(CallState.kCreateOffer);

  Logs().d('gotUserMediaForInvite');
  // Now we wait for the negotiationneeded event
}