Modernizing ExoPlayer with Media3’s Compose UI
Article Summary
For years, video playback was the one piece of Android UI that refused to go fully declarative. That changed when Google shipped Media3's Compose UI module.
Ioannis Anifantakis walks through migrating ExoPlayer from the old AndroidView + PlayerView pattern to Media3's native Compose components. This is a practical, code-heavy guide showing what changed in Media3 1.6.0 and 1.8.0, and why it matters for Compose-first apps.
Key Takeaways
- PlayerSurface replaces AndroidView wrapping, making video just another Composable
- State holders like rememberPlayPauseButtonState eliminate manual Player.Listener boilerplate
- Media3 1.8.0 includes workarounds for Android 14 SurfaceView bugs
- Custom overlays and scrubbers become trivial with standard Box layouts
- Lifecycle management aligns with Compose patterns using DisposableEffect
Critical Insight
Media3's Compose UI module eliminates the View-Compose interop tax for video playback, making ExoPlayer a first-class citizen in declarative Android apps.