startRecording method

Future<CaptureRequest> startRecording()

You can listen to cameraSetup.mediaCaptureStream to get updates of the photo capture (capturing, success/failure)

Implementation

Future<CaptureRequest> startRecording() async {
  CaptureRequest captureRequest =
      await filePathBuilder(sensorConfig.sensors.whereNotNull().toList());
  _mediaCapture =
      MediaCapture.capturing(captureRequest: captureRequest, videoState: VideoState.started);
  try {
    await CamerawesomePlugin.recordVideo(captureRequest);
  } on Exception catch (e) {
    _mediaCapture = MediaCapture.failure(captureRequest: captureRequest, exception: e);
  }
  cameraContext.changeState(VideoRecordingCameraState.from(cameraContext));
  return captureRequest;
}