Skip to content

Commit

Permalink
LA-1267 Remove time limit for video recording
Browse files Browse the repository at this point in the history
  • Loading branch information
KhaledNjim authored and hoangdat committed Nov 21, 2024
1 parent 6175fee commit a2462b7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/presentation/util/media_picker_from_camera.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class MediaPickerFromCamera {
createPickerState: () => cameraPickerState,
context,
pickerConfig: CameraPickerConfig(
maximumRecordingDuration: null,
onError: (
exception,
stacktrace,
Expand All @@ -92,7 +93,7 @@ class MediaPickerFromCamera {
xFile,
view,
) {
CameraPickerViewer.pushToViewer(
var entity = CameraPickerViewer.pushToViewer(
context,
pickerConfig: CameraPickerConfig(
shouldDeletePreviewFile: true,
Expand All @@ -111,7 +112,12 @@ class MediaPickerFromCamera {
previewXFile: xFile,
createViewerState: () => CustomCameraPickerViewer(),
);
cameraPickerState.controller.resumePreview();
entity.then((value) {
if (value == null) {
resumeCameraPreview(cameraPickerState);
}
});

return true;
},
shouldDeletePreviewFile: true,
Expand Down Expand Up @@ -181,4 +187,8 @@ class MediaPickerFromCamera {
);
}
}

void resumeCameraPreview(CameraPickerState cameraPickerState) async {
await cameraPickerState.controller.resumePreview();
}
}

0 comments on commit a2462b7

Please sign in to comment.