mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-24 14:32:37 +01:00
chore: FIx video compress
This commit is contained in:
parent
f522c81834
commit
7c88ce89b1
@ -22,16 +22,15 @@ extension ResizeImage on MatrixFile {
|
||||
Future<MatrixVideoFile> resizeVideo() async {
|
||||
final tmpDir = await getTemporaryDirectory();
|
||||
final tmpFile = File(tmpDir.path + '/' + name);
|
||||
final compressedFile = File(tmpDir.path + '/compressed_' + name);
|
||||
MediaInfo? mediaInfo;
|
||||
await tmpFile.writeAsBytes(bytes);
|
||||
try {
|
||||
mediaInfo = await VideoCompress.compressVideo(compressedFile.path);
|
||||
mediaInfo = await VideoCompress.compressVideo(tmpFile.path);
|
||||
} catch (e, s) {
|
||||
SentryController.captureException(e, s);
|
||||
}
|
||||
return MatrixVideoFile(
|
||||
bytes: await compressedFile.readAsBytes(),
|
||||
bytes: (await mediaInfo?.file?.readAsBytes()) ?? bytes,
|
||||
name: name,
|
||||
mimeType: mimeType,
|
||||
width: mediaInfo?.width,
|
||||
|
Loading…
Reference in New Issue
Block a user