Jetpack Media3 is the new home for media libraries that enables Android apps to display rich audio and visual experiences. It introduces a simpler architecture that is familiar to current developers, and which allows you to more easily build and maintain your apps. Media3 also includes ExoPlayer as the default player implementation.
This document provides an introduction to the changes that Media3 introduces and directs you onwards to other Media3 docs.
A media app that uses Media3 is comprised of several key components. The classes that make up these components will be familiar to you if you have worked with previous Android media libraries.
||Media sessions enable your app to interact with an audio or video player. They advertise media playback externally and receive playback commands from external sources.||In Media3, the
||The player is an interface that defines traditional high-level functionality, such as the ability to play, pause, and seek.||In Media3, the default
The following diagram clearly delineates how these components come together in a typical app.
For the Media3 beta release, you will find a series of documents that examine in
detail some of the key features in Media3. Namely, these documents outline how
media sessions and media controllers now interact with the
ExoPlayer class and
Player interface, as this is perhaps the key difference between Media3 and
previous media APIs.
When Media3 reaches its stable release, these documents will expand to cover the full breadth of the Media3 API and how to best implement it.
Media sessions are a crucial component to any media app. The key change to media
sessions in Media3 is that the
MediaSession class now directly takes a
Player, such as
ExoPlayer. This reduces the need for connectors, such as the
MediaSessionConnector from the previous
exoplayer2 library, and both
simplifies and deepens the interaction between the MediaSession class and other
core classes like MediaController.
For more information, read this guide that covers how you can use the Media3 media sessions to control and advertise playback within your app.
It is very common for media apps to play media in the background, such as with
music apps, or video apps that offer picture-in-picture. This is achieved with a
For more information, please see the Media3 background playback guide.
ExoPlayer is at the core of Media3 as the chosen implementation for the API’s media player. To facilitate this, ExoPlayer is now an AndroidX library. This means that it now has an API surface that will remain stable through future upgrades. It is therefore far easier to upgrade between new versions of ExoPlayer.
For the primary ExoPlayer documentation, please see exoplayer.dev.
See the video below for an introduction to Media3 from the engineers who built it.