Skip to content

[AND-487] (xml): Replace VideoView with ExoPlayer + PlayerView. #5767

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: develop
Choose a base branch
from

Conversation

VelikovPetar
Copy link
Contributor

@VelikovPetar VelikovPetar commented May 8, 2025

🎯 Goal

Introduces media3.exoplayer to the xml SDK to improve playing of video (and audio) attachments.

🛠 Implementation details

  • Adds androidx.media3:media3-exoplayer and androidx.media3:media3-ui dependencies.
  • Rework the MediaGalleryVideoPage to use PlayerView + ExoPlayer (instead of VideoView)
  • Rework the AttachmentMediaActivity to user PlayerView + ExoPlayer (instead of VideoView). Important: Here I kept the appearance of the controls same as the old ones. The reason is that because for audio files, we actually show an 'audio file' image in the middle of it, which is already public and customizable via the StreamUi.MediaActivity.Icon style. Removing this would be a breaking change for customers using/customizing this field. We can remove this and align it to the compose implementation in the next major release.

🎨 UI Changes

Scenario Before After
Video
video-before.mp4
video-after.mp4
Audio
audio-before.mp4
audio-after.mp4

🧪 Testing

  1. Open compose sample app
  2. Open channel with Video attachments
  3. Play the video attachment (the performance should be much better than previously)

PetarVelikov and others added 18 commits April 25, 2025 12:01
…hem follow the parent Box size (MediaGalleryVideoPage).
…ture/introduce-exoplayer-for-video-xml

# Conflicts:
#	CHANGELOG.md
Copy link
Contributor

github-actions bot commented May 8, 2025

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 3.16 MB 3.16 MB 0.00 MB 🟢
stream-chat-android-offline 3.38 MB 3.38 MB 0.00 MB 🟢
stream-chat-android-ui-components 7.89 MB 10.36 MB 2.46 MB 🔴
stream-chat-android-compose 9.94 MB 12.38 MB 2.44 MB 🔴

@VelikovPetar VelikovPetar changed the title [AND-462] (xml): Replace VideoView with ExoPlayer + PlayerView. [AND-487] (xml): Replace VideoView with ExoPlayer + PlayerView. May 8, 2025
Copy link

sonarqubecloud bot commented May 8, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

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