An app playing media requires user interface components for displaying media and controlling playback. The Media3 library includes two UI modules that contain a number of UI components.
To use the Views-based UI module, add the following dependency:
Kotlin
implementation("androidx.media3:media3-ui:1.9.0")
Groovy
implementation "androidx.media3:media3-ui:1.9.0"
To depend on the Jetpack Compose-based UI module, add the following dependency:
Kotlin
implementation("androidx.media3:media3-ui-compose:1.9.0")
Groovy
implementation "androidx.media3:media3-ui-compose:1.9.0"
To depend on the Jetpack Compose-based UI module with Material3, add the following dependency:
Kotlin
implementation("androidx.media3:media3-ui-compose-material3:1.9.0")
Groovy
implementation "androidx.media3:media3-ui-compose-material3:1.9.0"
We highly encourage you to develop your app in a Compose-first fashion or migrate from using Views.
Note: The media3-ui-compose and media3-ui-compose-material3 modules are
not yet at parity with the media3-ui module.