0Pricing
Android Academy · Lesson

Playing Audio and Video

Simple media playback in Android.

Beyond Images: Media Playback

Coil shows images beautifully, but apps also play sound and video: a notification chime, a podcast, a background clip, a video feed. Android has dedicated APIs for media.

The modern recommended library is Media3 (ExoPlayer). It handles streaming, formats, buffering, and playback controls far better than the old MediaPlayer. In this lesson you'll play simple audio and video in a Compose app.

Adding Media3 Dependencies

Media3 is split into modules. For most apps you want media3-exoplayer (the player engine) and media3-ui (ready-made player views). For Compose video you can also use the PlayerView via AndroidView.

// build.gradle.kts (module level)
dependencies {
    implementation("androidx.media3:media3-exoplayer:1.5.0")
    implementation("androidx.media3:media3-ui:1.5.0")
}

All lessons in this course

  1. Loading Images with Coil
  2. Placeholders and Error States
  3. Caching and Performance
  4. Playing Audio and Video
← Back to Android Academy