pauseRecording method
Pauses a video recording.
startRecording
must have been called before.
Call resumeRecording to resume the capture.
Implementation
Future<void> pauseRecording(MediaCapture currentCapture) async {
if (!currentCapture.isVideo) {
throw "Trying to pause a video while currentCapture is not a video (${currentCapture.captureRequest.when(
single: (single) => single.file!.path,
multiple: (multiple) => multiple.fileBySensor.values.first!.path,
)})";
}
if (currentCapture.status != MediaCaptureStatus.capturing) {
throw "Trying to pause a media capture in status ${currentCapture.status} instead of ${MediaCaptureStatus.capturing}";
}
await CamerawesomePlugin.pauseVideoRecording();
_mediaCapture = MediaCapture.capturing(
captureRequest: currentCapture.captureRequest,
videoState: VideoState.paused);
}