Improve MediaSource/MediaPeriod documentation

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165628229
This commit is contained in:
olly 2017-08-17 14:19:41 -07:00 committed by Oliver Woodman
parent 38bc289e71
commit d824aa9db7
2 changed files with 17 additions and 2 deletions

View file

@ -16,12 +16,15 @@
package com.google.android.exoplayer2.source;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.trackselection.TrackSelection;
import java.io.IOException;
/**
* A source of a single period of media.
* Loads media corresponding to a {@link Timeline.Period}, and allows that media to be read. All
* methods are called on the player's internal playback thread, as described in the
* {@link ExoPlayer} Javadoc.
*/
public interface MediaPeriod extends SequenceableLoader {

View file

@ -23,7 +23,19 @@ import com.google.android.exoplayer2.upstream.Allocator;
import java.io.IOException;
/**
* A source of media consisting of one or more {@link MediaPeriod}s.
* Defines and provides media to be played by an {@link ExoPlayer}. A MediaSource has two main
* responsibilities:
* <ul>
* <li>To provide the player with a {@link Timeline} defining the structure of its media, and to
* provide a new timeline whenever the structure of the media changes. The MediaSource provides
* these timelines by calling {@link Listener#onSourceInfoRefreshed} on the {@link Listener}
* passed to {@link #prepareSource(ExoPlayer, boolean, Listener)}.</li>
* <li>To provide {@link MediaPeriod} instances for the periods in its timeline. MediaPeriods are
* obtained by calling {@link #createPeriod(MediaPeriodId, Allocator)}, and provide a way for the
* player to load and read the media.</li>
* </ul>
* All methods are called on the player's internal playback thread, as described in the
* {@link ExoPlayer} Javadoc.
*/
public interface MediaSource {