Skip to content

[DO NOT MERGE] Test out video using Media3 ExoPlayer in Internal Tools menu #2339

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

Conversation

ycheng-kickstarter
Copy link
Contributor

📲 What

Playing around with Media3 ExoPlayer in our existing native app for mobile visioning.

Currently using videos from https://gist.github.com/jsturgis/3b19447b304616f18657 rather than real Project videos.

🤔 Why

🛠 How

👀 See

Screen_recording_20250602_152833.mp4

📋 QA

Access via:
Internal Tools > Mobile Visioning

Story 📖

https://kickstarter.atlassian.net/browse/MBL-2475

@Arkariang
Copy link
Contributor

Question! on Google IO (attached screenshot), seems we can use full compose and not rely any longer on AndroidView, if the objective is to compare the performance level between what can be achieved with different technologies, could we explore any of this topics presented? It could very well mean that what is shown in the video will be available only on Android 16

Screenshot 2025-06-02 at 3 44 57 PM

Here the video -> https://youtu.be/IaNpcrCSDiI

@ycheng-kickstarter
Copy link
Contributor Author

@Arkariang Let me look into it! This video looks a lot more helpful than the IO video I watched.

@ycheng-kickstarter
Copy link
Contributor Author

@Arkariang Getting error: Class 'androidx.media3.ui. compose. PlayerSurfaceKt' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.0.0, expected version is 1.8.0.

@Arkariang
Copy link
Contributor

@Arkariang Getting error: Class 'androidx.media3.ui. compose. PlayerSurfaceKt' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.0.0, expected version is 1.8.0.

No entirely surprised here tbh, was assuming already everything presented on Google IO will require us to be able to explore some in-advance work to get the latests compose-kotlin. To avoid all that work we chatted with @tonyteate to create an android project from scratch potentially using the Android 16 preview is required (since april it is in platform stability phase so whatever exploration we wanna do will be useful later once officially released) -> https://developer.android.com/about/versions/16/overview

Said so I'll let you guys decide if it is worth or not continuing that route! :)

@ycheng-kickstarter
Copy link
Contributor Author

Sure! Standalone app should be easy enough to do.

@ycheng-kickstarter
Copy link
Contributor Author

ycheng-kickstarter commented Jun 3, 2025

@Arkariang Played around with a standalone app using all the latest libraries and made this swap per the IO video:

//        AndroidView(
//            factory = {
//                PlayerView(it).apply {
//                    player = exoPlayer
//                    useController = false
//                    layoutParams = FrameLayout.LayoutParams(
//                        ViewGroup.LayoutParams.MATCH_PARENT,
//                        ViewGroup.LayoutParams.MATCH_PARENT
//                    )
//                    resizeMode = AspectRatioFrameLayout.RESIZE_MODE_ZOOM // Crop landscape video to fill portrait
//                }
//            },
//            modifier = modifier
//        )
        PlayerSurface(exoPlayer)

While playing just 1 or 2 videos worked fine, unfortunately not getting performant behavior with a long list of videos. Will read into and compare against the official demo app to see if there's something I'm doing wrong: https://github.com/androidx/media/tree/release/demos/compose

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