flyerhq / flutter_chat_ui

Actively maintained, community-driven chat UI implementation with an optional Firebase BaaS.
https://flyer.chat
1.66k stars 717 forks source link

when trying to send Video Message it successful but the video is invisible #578

Closed Borath99 closed 2 weeks ago

Borath99 commented 7 months ago

Hello 👋 i want to enable the chat to send the video and as i investigate in the code i saw a model types.VideoMessage and I'm using it. it seem work fine but the video is invisible in the message. is anyone face the same issues please help me I'm new to flutter.

leeyisoft commented 7 months ago

When I used flutter_chatui, there was no types.VideoMessage, I only defined the VideoMessage myself with the types.CustomMessage extension;

I here video message, in the message list inside the display, just load the video thumbnail, the display effect is good;

I guess your problem is that you loaded the video file directly, due to the limited Internet speed, the loading appeared white screen, resulting in the effect of not showing

You can refer to my code and logic, my project is open source

https://github.com/imboy-pub/imboy-flutter/blob/main/lib/page/chat/chat/chat_view.dart line 379

        } else if (entity.type == AssetType.video) {
          Map<String, dynamic> metadata = {
            'custom_type': 'video',
            'thumb': (resp['thumb'] as EntityImage).toJson(),
            'video': (resp['video'] as EntityVideo).toJson(),
          };
          debugPrint("> on upload metadata: ${metadata.toString()}");
          final message = types.CustomMessage(
            author: currentUser,
            createdAt: DateTimeHelper.currentTimeMillis(),
            id: Xid().toString(),
            remoteId: widget.peerId,
            status: types.Status.sending,
            metadata: metadata,
          );
          _addMessage(message);
        }
Borath99 commented 7 months ago

@leeyisoft thank you so much for your time i will check it out.

demchenkoalex commented 7 months ago

yeah I added it to types so you can build your own video message. Default implementation will be included in v2

demchenkoalex commented 2 weeks ago

closing in favour of https://github.com/flyerhq/flutter_chat_ui/discussions/171 - will be picking tasks from Discussions.