Skip to content

Feat/video message #801

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

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft

Conversation

nicolasbraun
Copy link
Contributor

@nicolasbraun nicolasbraun commented Jun 2, 2025

Implementation notes

  • I do not rely on Chewie's player for the bubble because I did not manage to have only the play button and entering fullScreen with chewie's can break device orientation
  • I did not allow to go "real fullscreen" (what will make the app eventually go landscape) because it adds a lot of complexity but we could look into it.

Maybe remaining points

  • Caching, not sure how and if we should for videos
  • Maybe videoMessage could have a thumbnail but we can do this later
  • I'm not sure it works with a local video, especially on web
  • Note the tap overrides the one from ChatMessage (at least on the bubble). But if we want to prevent that the user would have to handle video playback.
Recording.at.2025-06-03.00.17.18.mp4

@nicolasbraun nicolasbraun marked this pull request as draft June 5, 2025 08:18
@nicolasbraun
Copy link
Contributor Author

@demchenkoalex Putin this on draft to get your input, as integrating in my app, especially with a thumbnail raised quite a lot of questions I wanna discuss with you.

  • Most chat apps videoMessage only display a preview image (maybe coverImage is a good name), and open a extended player when taping the message.
    • That's what i currently do
    • I generate the cover image in the lib (since 67842d5, before i was just displaying a static player, see point 2 below)
    • I handle the click to navigate to a full screen player.
  1. Should be allow user to pass a the coverImage in high resolution too? something like
                    final fullSizeimageBytes =
                        await VideoThumbnail.thumbnailData(
                          video: videoUrl,
                          imageFormat: ImageFormat.WEBP,
                          quality: 1,
                        );
                    highResCover= base64.encode(fullSizeimageBytes);
// Then pass it to VideoMessage
  1. In my commit 67842d5 I switched tovideo_thumbnail to generate the cover. It's much lighter than instanciating a player just for it but does not work for web.
  • Should we revert player but it's quite heavy to instanciate N players
  • Should we use player for web only, but i don't really like adding a dependency just or it (useless for mobile only apps).
    Maybe we can do 2 packages and use switches in the builder.
  1. Should we not handle the click in the lib, so user can do whatever he wants in the onMessageTap? and just provide guidance in the docs.

Note that if we want to do this, and maybe also for other message types, maybe we could wrap the message (or at least the part the is not dependent on Provider (cf issues in the reactions PR)) into a Hero widget so users can build hero transitions.

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

Successfully merging this pull request may close these issues.

1 participant