public final class HlsMediaSource extends com.google.android.exoplayer2.source.BaseMediaSource implements HlsPlaylistTracker.PrimaryPlaylistListener
MediaSource.| Modifier and Type | Class and Description |
|---|---|
static class |
HlsMediaSource.Factory
Factory for
HlsMediaSources. |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MIN_LOADABLE_RETRY_COUNT
The default minimum number of times to retry loading data prior to failing.
|
| Constructor and Description |
|---|
HlsMediaSource(android.net.Uri manifestUri,
com.google.android.exoplayer2.upstream.DataSource.Factory dataSourceFactory,
android.os.Handler eventHandler,
com.google.android.exoplayer2.source.MediaSourceEventListener eventListener)
Deprecated.
Use
HlsMediaSource.Factory instead. |
HlsMediaSource(android.net.Uri manifestUri,
com.google.android.exoplayer2.upstream.DataSource.Factory dataSourceFactory,
int minLoadableRetryCount,
android.os.Handler eventHandler,
com.google.android.exoplayer2.source.MediaSourceEventListener eventListener)
Deprecated.
Use
HlsMediaSource.Factory instead. |
HlsMediaSource(android.net.Uri manifestUri,
HlsDataSourceFactory dataSourceFactory,
HlsExtractorFactory extractorFactory,
int minLoadableRetryCount,
android.os.Handler eventHandler,
com.google.android.exoplayer2.source.MediaSourceEventListener eventListener,
com.google.android.exoplayer2.upstream.ParsingLoadable.Parser<HlsPlaylist> playlistParser)
Deprecated.
Use
HlsMediaSource.Factory instead. |
| Modifier and Type | Method and Description |
|---|---|
com.google.android.exoplayer2.source.MediaPeriod |
createPeriod(com.google.android.exoplayer2.source.MediaSource.MediaPeriodId id,
com.google.android.exoplayer2.upstream.Allocator allocator) |
void |
maybeThrowSourceInfoRefreshError() |
void |
onPrimaryPlaylistRefreshed(HlsMediaPlaylist playlist)
Called when the primary playlist changes.
|
void |
prepareSourceInternal(com.google.android.exoplayer2.ExoPlayer player,
boolean isTopLevelSource) |
void |
releasePeriod(com.google.android.exoplayer2.source.MediaPeriod mediaPeriod) |
void |
releaseSourceInternal() |
public static final int DEFAULT_MIN_LOADABLE_RETRY_COUNT
@Deprecated
public HlsMediaSource(android.net.Uri manifestUri,
com.google.android.exoplayer2.upstream.DataSource.Factory dataSourceFactory,
android.os.Handler eventHandler,
com.google.android.exoplayer2.source.MediaSourceEventListener eventListener)
HlsMediaSource.Factory instead.manifestUri - The Uri of the HLS manifest.dataSourceFactory - An HlsDataSourceFactory for DataSources for manifests,
segments and keys.eventHandler - A handler for events. May be null if delivery of events is not required.eventListener - A MediaSourceEventListener. May be null if delivery of events is
not required.@Deprecated
public HlsMediaSource(android.net.Uri manifestUri,
com.google.android.exoplayer2.upstream.DataSource.Factory dataSourceFactory,
int minLoadableRetryCount,
android.os.Handler eventHandler,
com.google.android.exoplayer2.source.MediaSourceEventListener eventListener)
HlsMediaSource.Factory instead.manifestUri - The Uri of the HLS manifest.dataSourceFactory - An HlsDataSourceFactory for DataSources for manifests,
segments and keys.minLoadableRetryCount - The minimum number of times loads must be retried before errors
are propagated.eventHandler - A handler for events. May be null if delivery of events is not required.eventListener - A MediaSourceEventListener. May be null if delivery of events is
not required.@Deprecated
public HlsMediaSource(android.net.Uri manifestUri,
HlsDataSourceFactory dataSourceFactory,
HlsExtractorFactory extractorFactory,
int minLoadableRetryCount,
android.os.Handler eventHandler,
com.google.android.exoplayer2.source.MediaSourceEventListener eventListener,
com.google.android.exoplayer2.upstream.ParsingLoadable.Parser<HlsPlaylist> playlistParser)
HlsMediaSource.Factory instead.manifestUri - The Uri of the HLS manifest.dataSourceFactory - An HlsDataSourceFactory for DataSources for manifests,
segments and keys.extractorFactory - An HlsExtractorFactory for Extractors for the segments.minLoadableRetryCount - The minimum number of times loads must be retried before errors
are propagated.eventHandler - A handler for events. May be null if delivery of events is not required.eventListener - A MediaSourceEventListener. May be null if delivery of events is
not required.playlistParser - A ParsingLoadable.Parser for HLS playlists.public void prepareSourceInternal(com.google.android.exoplayer2.ExoPlayer player,
boolean isTopLevelSource)
prepareSourceInternal in class com.google.android.exoplayer2.source.BaseMediaSourcepublic void maybeThrowSourceInfoRefreshError()
throws java.io.IOException
maybeThrowSourceInfoRefreshError in interface com.google.android.exoplayer2.source.MediaSourcejava.io.IOExceptionpublic com.google.android.exoplayer2.source.MediaPeriod createPeriod(com.google.android.exoplayer2.source.MediaSource.MediaPeriodId id,
com.google.android.exoplayer2.upstream.Allocator allocator)
createPeriod in interface com.google.android.exoplayer2.source.MediaSourcepublic void releasePeriod(com.google.android.exoplayer2.source.MediaPeriod mediaPeriod)
releasePeriod in interface com.google.android.exoplayer2.source.MediaSourcepublic void releaseSourceInternal()
releaseSourceInternal in class com.google.android.exoplayer2.source.BaseMediaSourcepublic void onPrimaryPlaylistRefreshed(HlsMediaPlaylist playlist)
HlsPlaylistTracker.PrimaryPlaylistListeneronPrimaryPlaylistRefreshed in interface HlsPlaylistTracker.PrimaryPlaylistListenerplaylist - The primary playlist new snapshot.