Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Borath99 opened this issue Mar 25, 2024 · 3 comments
Open
Labels
question Further information is requested

Comments

@Borath99
Copy link

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.

@Borath99 Borath99 added the question Further information is requested label Mar 25, 2024
@leeyisoft
Copy link
Contributor

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
Copy link
Author

Borath99 commented Mar 25, 2024

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

@demchenkoalex
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants