android-oss icon indicating copy to clipboard operation
android-oss copied to clipboard

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

Open ycheng-kickstarter opened this issue 8 months ago • 6 comments

📲 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

https://github.com/user-attachments/assets/52002e20-c46a-4068-935f-cb2328701fe1

📋 QA

Access via: Internal Tools > Mobile Visioning

Story 📖

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

ycheng-kickstarter avatar Jun 02 '25 20:06 ycheng-kickstarter

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

Arkariang avatar Jun 02 '25 22:06 Arkariang

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

ycheng-kickstarter avatar Jun 03 '25 14:06 ycheng-kickstarter

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

ycheng-kickstarter avatar Jun 03 '25 15:06 ycheng-kickstarter

@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! :)

Arkariang avatar Jun 03 '25 16:06 Arkariang

Sure! Standalone app should be easy enough to do.

ycheng-kickstarter avatar Jun 03 '25 17:06 ycheng-kickstarter

@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

ycheng-kickstarter avatar Jun 03 '25 17:06 ycheng-kickstarter