mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-17 08:15:09 +00:00
chore: Fix video compress
This commit is contained in:
parent
b6195e617e
commit
18e6ed3855
1 changed files with 3 additions and 2 deletions
|
@ -22,15 +22,16 @@ 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(tmpFile.path);
|
||||
mediaInfo = await VideoCompress.compressVideo(compressedFile.path);
|
||||
} catch (e, s) {
|
||||
SentryController.captureException(e, s);
|
||||
}
|
||||
return MatrixVideoFile(
|
||||
bytes: await tmpFile.readAsBytes(),
|
||||
bytes: await compressedFile.readAsBytes(),
|
||||
name: name,
|
||||
mimeType: mimeType,
|
||||
width: mediaInfo?.width,
|
||||
|
|
Loading…
Reference in a new issue