getLocalDescription method

  1. @override
Future<RTCSessionDescription?> getLocalDescription()
override

Implementation

@override
Future<RTCSessionDescription?> getLocalDescription() async {
  try {
    final response =
        await WebRTC.invokeMethod('getLocalDescription', <String, dynamic>{
      'peerConnectionId': _peerConnectionId,
    });

    if (null == response) {
      return null;
    }
    String sdp = response['sdp'];
    String type = response['type'];
    return RTCSessionDescription(sdp, type);
  } on PlatformException catch (e) {
    throw 'Unable to RTCPeerConnection::getLocalDescription: ${e.message}';
  }
}