Skip to content

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

nicolasbraun commented Jun 5, 2025

@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.

@nicolasbraun nicolasbraun marked this pull request as ready for review July 21, 2025 07:34
@nicolasbraun
Copy link
Contributor Author

@demchenkoalex

This PR is ready too. Like i said the tap currently overrides the global onMessageTap but this could be easily changed if you prefer:

  • either by just removing the whole full screen player
  • or by exposing a showFullScreenPlayerPage method (a bit like the showReactionDialog from Feat/reactions #838) to let the player decice, but this would mean the player is part of this package dependencies

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