onAccept method
Implementation
@override
Future<InspectionVideo> onAccept(CameraInternalMedia media) async {
/*if(shouldCompress) {
final mediaInfo = await VideoCompress.compressVideo(
media.imageFile.path,
startTime: 0,
includeAudio: true,
frameRate: 30,
duration: 0,
deleteOrigin: true,
);
return InspectionVideo(
captureConfig: this,
locationData: media.locationData,
timestamp: media.dateTime,
data: XFile(mediaInfo?.path ?? media.imageFile.path),
);
}*/
XFile? file;
if (!kIsWeb) {
final stopwatch = Stopwatch();
stopwatch.start();
file = await edit(media);
stopwatch.stop();
(cameraModuleCallbacks as VideoCaptureCallbacks?)
?.videoProcessingTime
.call(
Duration(
milliseconds: stopwatch.elapsedMilliseconds,
),
);
}
print(file?.path);
if (shouldCompress) {
final mediaInfo = await VideoCompress.compressVideo(
file?.path ?? media.imageFile.path,
startTime: 0,
includeAudio: true,
frameRate: 30,
duration: 0,
deleteOrigin: true,
);
return InspectionVideo(
captureConfig: this,
locationData: media.locationData,
timestamp: media.dateTime,
data: XFile(mediaInfo?.path ?? media.imageFile.path),
);
}
return InspectionVideo(
captureConfig: this,
locationData: media.locationData,
timestamp: media.dateTime,
data: file ?? media.imageFile,
);
}