initializeWebRTCStack method

Future<void> initializeWebRTCStack()

used to initialize/reinitialize entire webrtc stack if it is required for your application purpose

Implementation

Future<void> initializeWebRTCStack() async {
  if (_webRtcConfiguration == null) {
    _context._logger.shout(
        'initializeWebRTCStack:-configuration is null call init before calling me');
    return;
  }
  _context._logger.finest('webRTC stack intialized');
  RTCPeerConnection peerConnection =
      await createPeerConnection(_webRtcConfiguration!, {});
  peerConnection.onRenegotiationNeeded = () {
    _renegotiationNeededController?.sink.add(true);
  };
  //unified plan webrtc tracks emitter
  _handleUnifiedWebRTCTracksEmitter(peerConnection);
  //send ice candidates to janus server on this specific handle
  _handleIceCandidatesSending(peerConnection);
  webRTCHandle = JanusWebRTCHandle(peerConnection: peerConnection);
}