createOffer method

Future<RTCSessionDescription?>? createOffer()

Implementation

Future<RTCSessionDescription?>? createOffer() async {
  final RTCSessionDescription? sdp;
  if (rtcPeerConnection != null) {
    try {
      sdp = await rtcPeerConnection!.createOffer(offerSdpConstraints);
      await rtcPeerConnection!.setLocalDescription(sdp);
      return sdp;
    } catch (error) {
      print(error);
    }
  }
}