public interface MediaSource
MediaPeriod
s.Modifier and Type | Interface and Description |
---|---|
static interface |
MediaSource.Listener
Listener for source events.
|
Modifier and Type | Method and Description |
---|---|
MediaPeriod |
createPeriod(int index,
Allocator allocator,
long positionUs)
Returns a
MediaPeriod corresponding to the period at the specified index. |
void |
maybeThrowSourceInfoRefreshError()
Throws any pending error encountered while loading or refreshing source information.
|
void |
prepareSource(MediaSource.Listener listener)
Starts preparation of the source.
|
void |
releasePeriod(MediaPeriod mediaPeriod)
Releases the period.
|
void |
releaseSource()
Releases the source.
|
void prepareSource(MediaSource.Listener listener)
listener
- The listener for source events.void maybeThrowSourceInfoRefreshError() throws IOException
IOException
MediaPeriod createPeriod(int index, Allocator allocator, long positionUs)
MediaPeriod
corresponding to the period at the specified index.index
- The index of the period.allocator
- An Allocator
from which to obtain media buffer allocations.positionUs
- The player's current playback position.MediaPeriod
.void releasePeriod(MediaPeriod mediaPeriod)
mediaPeriod
- The period to release.void releaseSource()
This method should be called when the source is no longer required. It may be called in any state.