toggleCamera method

bool toggleCamera({
  1. String? callId,
})

Implementation

bool toggleCamera({String? callId}) {
  if (callId == null) {
    if (!callCurrentIsEmpty()) {
      Call? call = _sipuaHelper.findCall(_callIdCurrent!);
      if (call != null) {
        if (_videoIsOff) {
          call.unmute(false, true);
        } else {
          call.mute(false, true);
        }
        return true;
      }
      return false;
    } else {
      _logger.error('You have to set callIdCurrent or pass param callId');
      return false;
    }
  } else {
    Call? call = _sipuaHelper.findCall(callId);
    if (call != null) {
      if (_videoIsOff) {
        call.unmute(false, true);
      } else {
        call.mute(false, true);
      }
      return true;
    }
    return false;
  }
}