answer method

Future<void> answer({
  1. VICallSettings? settings,
})

Answers the incoming call.

Additional call parameters are set up via settings: video direction for the call, preferred video codec, custom data.

Optional settings - Additional call parameters like video direction for the call, preferred video codec, custom data.

Throws VIException, if an error occurred.

Errors:

Implementation

Future<void> answer({VICallSettings? settings}) async {
  try {
    if (settings == null) {
      settings = VICallSettings();
    }
    await _channel.invokeMethod<void>('Call.answerCall', <String, dynamic>{
      'callId': _callId,
      'sendVideo': settings.videoFlags.sendVideo,
      'receiveVideo': settings.videoFlags.receiveVideo,
      'videoCodec': settings.preferredVideoCodec.toString(),
      'customData': settings.customData,
      'extraHeaders': settings.extraHeaders
    });
  } on PlatformException catch (e) {
    throw VIException(e.code, e.message);
  }
}