startVideoRecording method

Future<void> startVideoRecording()

Implementation

Future<void> startVideoRecording() async {
  if (!initialized) {
    _uiHandler.showSnackBar('Couldn\'t find the camera!');
    return;
  }

  if (value.isRecordingVideo) {
    _uiHandler.showSnackBar('Recording is already started!');
    return;
  }

  try {
    await controller.startVideoRecording();
    value = value.copyWith(
      isRecordingVideo: true,
      isRecordingPaused: false,
    );
  } on CameraException catch (e) {
    _uiHandler.showExceptionSnackbar(e);
    value = value.copyWith(isRecordingVideo: false);
    return;
  }
}