Open hmbadhon opened 1 year ago
.mp4 file compression is pretty good but when i pick .mov file to compress it's couldn't able to compress and file path throwing null exception.
IOS|Android|Both|Other
for (var element in dto.media) { var file = await PhotoGallery.getFile(mediumId: element.id); Uint8List? data; if (element.mediumType == MediumType.image) { data = await AppUtils.compressToUint8List( file.path, element.height, element.width, 50); files.add(MultipartFile.fromBytes(data!, filename: getFileName(element.filename!))); } else { log("File name ===========> ${file.path}"); log("Compress Start ===========> ${DateTime.now()}"); try { showProgressDialogStatus(0); final response = await vc.VideoCompress.compressVideo( file.path, quality: vc.VideoQuality.MediumQuality, // deleteOrigin: false, // It's false by default ); log("File path ===========> ${response!.path}"); log("Compress end ===========> ${DateTime.now()}"); var multipart = await MultipartFile.fromFile(response.path!, filename: getFileName(response.path!)); files.add(multipart); } catch (e) { log("compress error ===========> $e"); } } }
Description
.mp4 file compression is pretty good but when i pick .mov file to compress it's couldn't able to compress and file path throwing null exception.
Platform
IOS|Android|Both|Other
Code Example (if has)