Skip to content

MBL-2619: upgrade to media3 exoplayer #2389

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 18 commits into
base: master
Choose a base branch
from

Conversation

Arkariang
Copy link
Contributor

@Arkariang Arkariang commented Jul 24, 2025

📲 What

  • Exoplayer update -> from exoplayer:2.17.1 to media3-exoplayer:1.7.1 (latest)
  • Gradle 8.7.2 to 8.10
  • ⚠️ do not merge until release candidate has been created!

🤔 Why

  • We were still using quite a few deprecated items, on preparation of mobile visioning, where we likely will use media3 exoplayer compose style

🛠 How

📥 the interface for Player.Listener is marked with @unsableapi , but heads up is correct to use it, It's not deprecated or broken—it works now, but will likely have changes on following versions

object : Player.Listener {
                override fun onPlaybackStateChanged(playbackState: Int) {
                    if (playbackState == Player.STATE_READY) {
                        isPrepared = true
                        prepareMediaPlayer()
                    } else if (playbackState == Player.STATE_ENDED) {
                        resetPlayer()
                    }
                }

👀 See

ProjectsWeLove.mp4

| | |

📋 QA

  • Load some projects, play/pause video, test each button on the controls, go to full-screen, com back from full screen (back gesture on bottom/right of the screen).

Story 📖

MBL-2619

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good news here, seems there is no longer an option on the creator side of things to add other media to Project Story apart from images/gifs (or via URL) mp3 or mp4 formats are not allowed (attached screenshot of what I see trying to add that type of media file to the project). Meaning basically that we can potentially get rid of AudioElementViewHolder and VideoElementViewHolder

Screenshot 2025-07-24 at 1 55 08 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forget about my previous comment! still need to support old projects despite apparently the new story editor does not support uploading mp3-mp4 media, here an project example -> https://www.kickstarter.com/projects/airlok/airlok-high-security-bike-storage-hanger-store-loc

@Arkariang Arkariang changed the title Imartin/migrate to media3 exoplayer MBL-2619: upgrade to media3 exoplayer Jul 24, 2025
…starter/android-oss into imartin/migrate-to-media3-exoplayer
fullscreenButton?.setImageResource(R.drawable.ic_fullscreen_close)
}

private fun getMediaSource(videoUrl: String): MediaSource {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Substituted for MediaItem.Builder()

@codecov-commenter
Copy link

codecov-commenter commented Jul 24, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.38%. Comparing base (a93894c) to head (cd66130).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2389      +/-   ##
============================================
- Coverage     66.38%   66.38%   -0.01%     
+ Complexity     2349     2348       -1     
============================================
  Files           378      378              
  Lines         27904    27904              
  Branches       4230     4230              
============================================
- Hits          18524    18523       -1     
  Misses         7118     7118              
- Partials       2262     2263       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

val fileType = Util.inferContentType(videoUri)

return if (fileType == C.TYPE_HLS) {
HlsMediaSource.Factory(dataSourceFactory).createMediaSource(MediaItem.fromUri(videoUri))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hence using media3-exoplayer-hls no need to make any special configurations (will question though at some point if we use hls formats (project story video element high-quality))

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.

2 participants