Some extractor implementations underneath MediaExtractor require a seekTo call after tracks are selected to ensure samples are read from the correct position. De-duplicating logic was preventing this from happening in some cases, causing issues like: https://github.com/google/ExoPlayer/issues/301 Note that seeking all tracks a side effect of track selection sucks if you already have one or more tracks selected, because it introduces discontinuities to the already selected tracks. However, in general, it *is* necessary to specify the position for the track being selected, because the underlying extractor doesn't have enough information to know where to start reading from. It can't determine this based on the read positions of the already selected tracks, because the samples in these tracks might be very sparse with respect to time. I think a more optimal fix would be to change the SampleExtractor interface to receive the current position as an argument to selectTrack. For our own extractors, we'd seek the newly selected track to that position, whilst the already enabled tracks would be left in their current positions (if possible). For FrameworkSampleExtractor we'd still have no choice but to call seekTo on the extractor to seek all of the tracks. This solution ends up being more complex though, because: - The SampleExtractor then needs a way of telling DefaultSampleSource which tracks were actually seeked, so that the pendingDiscontinuities flags can be set correctly. - It's a weird API that requires the "current playback position to seek only the track being enabled" So it may not be worth it! I think this fix is definitely good for now, in any case. Issue: #301 |
||
|---|---|---|
| demo | ||
| demo_misc | ||
| extensions | ||
| gradle/wrapper | ||
| library | ||
| .gitignore | ||
| build.gradle | ||
| CONTRIBUTING.md | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| LICENSE | ||
| README.md | ||
| settings.gradle | ||
ExoPlayer Readme
Description
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 (as of KitKat), including DASH and SmoothStreaming adaptive playbacks, persistent caching and custom renderers. Unlike the MediaPlayer API, ExoPlayer is easy to customize and extend, and can be updated through Play Store application updates.
Developer guide
The ExoPlayer developer guide provides a wealth of information to help you get started.
Reference documentation
Class reference (Documents the ExoPlayer library classes).
Project branches
- The master branch holds the most recent minor release.
- Most development work happens on the dev branch.
- Additional development branches may be established for major features.
Using Eclipse
The repository includes Eclipse projects for both the ExoPlayer library and its accompanying demo application. To get started:
-
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 ExoPlayerDemo and ExoPlayerLib projects.
Using Gradle
ExoPlayer can also be built using Gradle. You can include it as a dependent project and build from source. e.g.
// settings.gradle
include ':app', ':..:ExoPlayer:library'
// app/build.gradle
dependencies {
compile project(':..:ExoPlayer:library')
}
If you want to use ExoPlayer as a jar, run:
./gradlew jarRelease
and copy library.jar to the libs-folder of your new project.