Merge pull request #874 from GetStream/fix/860

fix(ui): fix cast error while compressing video.
This commit is contained in:
Salvatore Giordano
2022-01-25 10:46:28 +01:00
committed by GitHub
2 changed files with 8 additions and 6 deletions
+4 -3
View File
@@ -2,8 +2,9 @@
🐞 Fixed
- SVG rendering fixes
- Use file extension instead of mimeType for downloading files
- SVG rendering fixes.
- Use file extension instead of mimeType for downloading files.
- [[#860]](https://github.com/GetStream/stream-chat-flutter/issues/860) CastError while compressing Videos.
✅ Added
@@ -23,7 +24,7 @@
🐞 Fixed
- [[#766]]`AttachmentActionsModal` now has customisation options for actions.
- [[#766]](https://github.com/GetStream/stream-chat-flutter/issues/766) `AttachmentActionsModal` now has customisation options for actions.
- Fixed `MessageWidget` null errors associated with `channel.memberCount`.
- Fixed adding attachments on web.
- [[#767]](https://github.com/GetStream/stream-chat-flutter/issues/767): Fix `MessageInput` focus behaviour when sending messages.
@@ -1129,13 +1129,14 @@ class MessageInputState extends State<MessageInput> {
if (file.size! > widget.maxAttachmentSize) {
if (medium.type == AssetType.video && file.path != null) {
final mediaInfo = await (VideoService.compressVideo(
final mediaInfo = await VideoService.compressVideo(
file.path!,
frameRate: widget.compressedVideoFrameRate,
quality: widget.compressedVideoQuality,
) as FutureOr<MediaInfo>);
);
if (mediaInfo.filesize! > widget.maxAttachmentSize) {
if (mediaInfo == null ||
mediaInfo.filesize! > widget.maxAttachmentSize) {
_showErrorAlert(
context.translations.fileTooLargeAfterCompressionError(
widget.maxAttachmentSize / (1024 * 1024),