stopRecording method

Future<void> stopRecording()

Implementation

Future<void> stopRecording() async {
  var currentCapture = cameraContext.mediaCaptureController.value;
  if (currentCapture == null) {
    return;
  }
  final result = await CamerawesomePlugin.stopRecordingVideo();
  if (result) {
    _mediaCapture = MediaCapture.success(filePath: currentCapture.filePath);
  } else {
    _mediaCapture = MediaCapture.failure(filePath: currentCapture.filePath);
  }
  await CamerawesomePlugin.setCaptureMode(CaptureMode.video);
  cameraContext.changeState(VideoCameraState.from(cameraContext));
}