Notes: - The way this works is that every time the player needs to select some tracks it invokes the TrackSelector. When a track selection is actually activated (i.e. "hits the screen") it gets passed back to the TrackSelector, which allows it to expose the current tracks through an API that it may choose to define. Since playlist support doesn't exist yet, it's currently the case that the pass-back always occurs immediately. - A TrackSelector can invalidate its previous selections if its selection criteria changes. This will force the player to invoke it again to make a new selection. If the new selection is the same as the previous one for a renderer then the player handles this efficiently (i.e. turns it into a no-op). - DefaultTrackSelector supports disabling/enabling of renderers. Separately, it supports overrides to select specific formats. Since formats may change (playlists/periods), overrides are specific to not only the renderer but also the set of formats that are available to it. If the formats available to a renderer change then the override will no longer apply. If the same set of formats become available at some point later, it will apply once more. This will nicely handle cases like ad-insertion where the ads have different formats, but all segments of main content use the same set of formats. - In general, in multi-period or playlist cases, the preferred way of selecting formats will be via constraints (e.g. "don't play HD", "prefer higher quality audio") rather than explicit format selections. The ability to set various constraints on DefaultTrackSelector is future work. Note about the demo app: - I've removed the verbose log toggle. I doubt anyone has ever used it! I've also removed the background audio option. Without using a service it can't be considered a reference implementation, so it's probably best to leave developers to figure this one out. Finally, listening to AudioCapabilities has also gone. This will be replaced by having the player detect and handle the capabilities change internally in a future CL. This will work by allowing a renderer to invalidate the track selections when its capabilities change, much like how a selector is able to invalidate the track selections in this CL. - It's now possible to enable ABR with an arbitrary subset of tracks. - Unsupported tracks are shown grayed out in the UI. I'm not showing tracks that aren't associated to any renderer, but we could optionally add that later. - Every time the tracks change, there's logcat output showing all of the tracks and which ones are enabled. Unassociated tracks are displayed in this output. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=117122202 |
||
|---|---|---|
| demo | ||
| gradle/wrapper | ||
| library | ||
| playbacktests/src/main | ||
| third_party | ||
| .gitignore | ||
| build.gradle | ||
| CONTRIBUTING.md | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| LICENSE | ||
| README.md | ||
| RELEASENOTES.md | ||
| settings.gradle | ||
ExoPlayer
ExoPlayer is an application level media player for Android. It provides an alternative to Android’s MediaPlayer API for playing audio and video both locally and over the Internet. ExoPlayer supports features not currently supported by Android’s MediaPlayer API, including DASH and SmoothStreaming adaptive playbacks. Unlike the MediaPlayer API, ExoPlayer is easy to customize and extend, and can be updated through Play Store application updates.
News
Read news, hints and tips on the news page.
Documentation
- The developer guide provides a wealth of information to help you get started.
- The class reference documents the ExoPlayer library classes.
- The release notes document the major changes in each release.
Using ExoPlayer
Via jCenter
The easiest way to get started using ExoPlayer is by including the following in
your project's build.gradle file:
gradle
compile 'com.google.android.exoplayer:exoplayer:rX.X.X'
where rX.X.X is the your preferred version. For the latest version, see the
project's Releases. For more details, see the project on Bintray.
As source
ExoPlayer can also be built from source using Gradle. You can include it as a dependent project like so:
gradle
// settings.gradle
include ':app', ':..:ExoPlayer:library'
// app/build.gradle
dependencies {
compile project(':..:ExoPlayer:library')
}
As a jar
If you want to use ExoPlayer as a jar, run:
sh
./gradlew jarRelease
and copy library.jar to the libs folder of your new project.
Developing ExoPlayer
Project branches
- The
masterbranch holds the most recent minor release. - Most development work happens on the
devbranch. - Additional development branches may be established for major features.
Using Android Studio
To develop ExoPlayer using Android Studio, simply open the ExoPlayer project in the root directory of the repository.
Using Eclipse
To develop ExoPlayer using Eclipse:
- Install Eclipse and setup the Android SDK.
- Open Eclipse and navigate to File->Import->General->Existing Projects into Workspace.
- Select the root directory of the repository.
- Import the projects.