public final class DashMediaSource extends Object implements MediaSource
MediaSource
.MediaSource.Listener
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_LIVE_PRESENTATION_DELAY_FIXED_MS
A fixed default presentation delay for live streams.
|
static long |
DEFAULT_LIVE_PRESENTATION_DELAY_PREFER_MANIFEST_MS
A constant indicating that the presentation delay for live streams should be set to
DashManifest.suggestedPresentationDelay if specified by the manifest, or
DEFAULT_LIVE_PRESENTATION_DELAY_FIXED_MS otherwise. |
static int |
DEFAULT_MIN_LOADABLE_RETRY_COUNT
The default minimum number of times to retry loading data prior to failing.
|
Constructor and Description |
---|
DashMediaSource(Uri manifestUri,
DataSource.Factory manifestDataSourceFactory,
DashChunkSource.Factory chunkSourceFactory,
Handler eventHandler,
AdaptiveMediaSourceEventListener eventListener) |
DashMediaSource(Uri manifestUri,
DataSource.Factory manifestDataSourceFactory,
DashChunkSource.Factory chunkSourceFactory,
int minLoadableRetryCount,
long livePresentationDelayMs,
Handler eventHandler,
AdaptiveMediaSourceEventListener eventListener) |
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 |
replaceManifestUri(Uri manifestUri)
Manually replaces the manifest
Uri . |
public static final int DEFAULT_MIN_LOADABLE_RETRY_COUNT
public static final long DEFAULT_LIVE_PRESENTATION_DELAY_PREFER_MANIFEST_MS
DashManifest.suggestedPresentationDelay
if specified by the manifest, or
DEFAULT_LIVE_PRESENTATION_DELAY_FIXED_MS
otherwise. The presentation delay is the
duration by which the default start position precedes the end of the live window.public static final long DEFAULT_LIVE_PRESENTATION_DELAY_FIXED_MS
public DashMediaSource(Uri manifestUri, DataSource.Factory manifestDataSourceFactory, DashChunkSource.Factory chunkSourceFactory, Handler eventHandler, AdaptiveMediaSourceEventListener eventListener)
public DashMediaSource(Uri manifestUri, DataSource.Factory manifestDataSourceFactory, DashChunkSource.Factory chunkSourceFactory, int minLoadableRetryCount, long livePresentationDelayMs, Handler eventHandler, AdaptiveMediaSourceEventListener eventListener)
public void replaceManifestUri(Uri manifestUri)
Uri
.manifestUri
- The replacement manifest Uri
.public void prepareSource(MediaSource.Listener listener)
MediaSource
prepareSource
in interface MediaSource
listener
- The listener for source events.public void maybeThrowSourceInfoRefreshError() throws IOException
MediaSource
maybeThrowSourceInfoRefreshError
in interface MediaSource
IOException
public MediaPeriod createPeriod(int index, Allocator allocator, long positionUs)
MediaSource
MediaPeriod
corresponding to the period at the specified index.createPeriod
in interface MediaSource
index
- The index of the period.allocator
- An Allocator
from which to obtain media buffer allocations.positionUs
- The player's current playback position.MediaPeriod
.public void releasePeriod(MediaPeriod mediaPeriod)
MediaSource
releasePeriod
in interface MediaSource
mediaPeriod
- The period to release.public void releaseSource()
MediaSource
This method should be called when the source is no longer required. It may be called in any state.
releaseSource
in interface MediaSource