MediaSourcepublic final class ProgressiveMediaSource extends BaseMediaSource
Uri and extracted using an Extractor.
If the possible input stream container formats are known, pass a factory that instantiates
extractors for them to the constructor. Otherwise, pass a DefaultExtractorsFactory to use
the default extractors. When reading a new stream, the first Extractor in the array of
extractors created by the factory that returns true from Extractor.sniff(com.google.android.exoplayer2.extractor.ExtractorInput) will be
used to extract samples from the input stream.
Note that the built-in extractor for FLV streams does not support seeking.
| Modifier and Type | Class | Description |
|---|---|---|
static class |
ProgressiveMediaSource.Factory |
Factory for
ProgressiveMediaSources. |
MediaSource.MediaPeriodId, MediaSource.MediaSourceCaller| Modifier and Type | Field | Description |
|---|---|---|
static int |
DEFAULT_LOADING_CHECK_INTERVAL_BYTES |
The default number of bytes that should be loaded between each each invocation of
SequenceableLoader.Callback.onContinueLoadingRequested(SequenceableLoader). |
| Modifier and Type | Method | Description |
|---|---|---|
MediaPeriod |
createPeriod(MediaSource.MediaPeriodId id,
Allocator allocator,
long startPositionUs) |
Returns a new
MediaPeriod identified by periodId. |
MediaItem |
getMediaItem() |
Returns the
MediaItem whose media is provided by the source. |
Object |
getTag() |
Deprecated.
Use
getMediaItem() and MediaItem.PlaybackProperties.tag instead. |
void |
maybeThrowSourceInfoRefreshError() |
Throws any pending error encountered while loading or refreshing source information.
|
void |
onSourceInfoRefreshed(long durationUs,
boolean isSeekable,
boolean isLive) |
|
protected void |
prepareSourceInternal(TransferListener mediaTransferListener) |
Starts source preparation and enables the source, see
BaseMediaSource.prepareSource(MediaSourceCaller,
TransferListener). |
void |
releasePeriod(MediaPeriod mediaPeriod) |
Releases the period.
|
protected void |
releaseSourceInternal() |
Releases the source, see
BaseMediaSource.releaseSource(MediaSourceCaller). |
addDrmEventListener, addEventListener, createDrmEventDispatcher, createDrmEventDispatcher, createEventDispatcher, createEventDispatcher, createEventDispatcher, disable, disableInternal, enable, enableInternal, isEnabled, prepareSource, refreshSourceInfo, releaseSource, removeDrmEventListener, removeEventListenergetInitialTimeline, isSingleWindowpublic static final int DEFAULT_LOADING_CHECK_INTERVAL_BYTES
SequenceableLoader.Callback.onContinueLoadingRequested(SequenceableLoader).@Deprecated @Nullable public Object getTag()
getMediaItem() and MediaItem.PlaybackProperties.tag instead.getTag in interface MediaSourcepublic MediaItem getMediaItem()
MediaSourceMediaItem whose media is provided by the source.getMediaItem in interface MediaSourceprotected void prepareSourceInternal(@Nullable
TransferListener mediaTransferListener)
BaseMediaSourceBaseMediaSource.prepareSource(MediaSourceCaller,
TransferListener). This method is called at most once until the next call to BaseMediaSource.releaseSourceInternal().prepareSourceInternal in class BaseMediaSourcemediaTransferListener - The transfer listener which should be informed of any media data
transfers. May be null if no listener is available. Note that this listener should usually
be only informed of transfers related to the media loads and not of auxiliary loads for
manifests and other data.public void maybeThrowSourceInfoRefreshError()
MediaSourceShould not be called directly from application code.
Must only be called after MediaSource.prepareSource(MediaSourceCaller, TransferListener).
maybeThrowSourceInfoRefreshError in interface MediaSourcepublic MediaPeriod createPeriod(MediaSource.MediaPeriodId id, Allocator allocator, long startPositionUs)
MediaSourceMediaPeriod identified by periodId.
Should not be called directly from application code.
Must only be called if the source is enabled.
createPeriod in interface MediaSourceid - The identifier of the period.allocator - An Allocator from which to obtain media buffer allocations.startPositionUs - The expected start position, in microseconds.MediaPeriod.public void releasePeriod(MediaPeriod mediaPeriod)
MediaSourceShould not be called directly from application code.
releasePeriod in interface MediaSourcemediaPeriod - The period to release.protected void releaseSourceInternal()
BaseMediaSourceBaseMediaSource.releaseSource(MediaSourceCaller). This method is called
exactly once after each call to BaseMediaSource.prepareSourceInternal(TransferListener).releaseSourceInternal in class BaseMediaSourcepublic void onSourceInfoRefreshed(long durationUs,
boolean isSeekable,
boolean isLive)