- Notifications
You must be signed in to change notification settings - Fork0
Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
License
ultrasonic/media
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
AndroidX Media is a collection of libraries for implementing media use cases onAndroid, including local playback (via ExoPlayer) and media sessions.
- Thedeveloper guide provides a wealth of information.
- Theclass reference documents the classes and methods.
- Therelease notes document the major changes in each release.
- Follow ourdeveloper blog to keep up to date with the latestdevelopments!
You'll find amigration guide for existing ExoPlayer and MediaSession userson developer.android.com.
AndroidX Media releases provide API stability guarantees, ensuring that the APIsurface remains backwards compatible for the most commonly used APIs. APIsintended for more advanced use cases are marked as unstable. To use an unstablemethod or class without lint warnings, you’ll need to add the OptIn annotationbefore using it. For more information see theUnstableApi documentation.
You can get the libraries fromthe Google Maven repository. It'salso possible to clone this GitHub repository and depend on the modules locally.
The easiest way to get started using AndroidX Media is to add gradledependencies on the libraries you need in thebuild.gradle
file of your appmodule.
For example, to depend on ExoPlayer with DASH playback support and UI componentsyou can add dependencies on the modules like this:
implementation'androidx.media3:media3-exoplayer:1.X.X'implementation'androidx.media3:media3-exoplayer-dash:1.X.X'implementation'androidx.media3:media3-ui:1.X.X'
where1.X.X
is your preferred version. All modules must be the same version.
Please see theAndroidX Media3 developer.android.com page for moreinformation, including a full list of library modules.
This repository includes some modules that depend on external libraries thatneed to be built manually, and are not available from the Maven repository.Please see the individual READMEs under thelibraries directory for moredetails.
If not enabled already, you also need to turn on Java 8 support in allbuild.gradle
files depending on AndroidX Media, by adding the following to theandroid
section:
compileOptions { targetCompatibilityJavaVersion.VERSION_1_8}
If your GradleminSdkVersion
is 20 or lower, you shouldenable multidex in orderto prevent build errors.
Cloning the repository and depending on the modules locally is required whenusing some libraries. It's also a suitable approach if you want to make localchanges, or if you want to use themain
branch.
First, clone the repository into a local directory:
git clone https://github.com/androidx/media.gitcd media
Next, add the following to your project'ssettings.gradle
file, replacingpath/to/media
with the path to your local copy:
gradle.ext.androidxMediaModulePrefix='media-'applyfrom: file("path/to/media/core_settings.gradle")
You should now see the AndroidX Media modules appear as part of your project.You can depend on them as you would on any other local module, for example:
implementation project(':media-lib-exoplayer')implementation project(':media-lib-exoplayer-dash')implementation project(':media-lib-ui')
Development work happens on themain
branch. Pull requests should normally bemade to this branch.
Therelease
branch holds the most recent stable release.
To develop AndroidX Media using Android Studio, simply open the project in theroot directory of this repository.