public static final class HlsMediaSource.Factory
extends java.lang.Object
implements com.google.android.exoplayer2.source.ads.AdsMediaSource.MediaSourceFactory
HlsMediaSources.| Constructor and Description |
|---|
Factory(com.google.android.exoplayer2.upstream.DataSource.Factory dataSourceFactory)
Creates a new factory for
HlsMediaSources. |
Factory(HlsDataSourceFactory hlsDataSourceFactory)
Creates a new factory for
HlsMediaSources. |
| Modifier and Type | Method and Description |
|---|---|
HlsMediaSource |
createMediaSource(android.net.Uri playlistUri)
Returns a new
HlsMediaSource using the current parameters. |
HlsMediaSource |
createMediaSource(android.net.Uri playlistUri,
android.os.Handler eventHandler,
com.google.android.exoplayer2.source.MediaSourceEventListener eventListener)
Returns a new
HlsMediaSource using the current parameters. |
int[] |
getSupportedTypes() |
HlsMediaSource.Factory |
setAllowChunklessPreparation(boolean allowChunklessPreparation)
Sets whether chunkless preparation is allowed.
|
HlsMediaSource.Factory |
setCompositeSequenceableLoaderFactory(com.google.android.exoplayer2.source.CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory)
Sets the factory to create composite
SequenceableLoaders for when this media source
loads data from multiple streams (video, audio etc...). |
HlsMediaSource.Factory |
setExtractorFactory(HlsExtractorFactory extractorFactory)
Sets the factory for
Extractors for the segments. |
HlsMediaSource.Factory |
setMinLoadableRetryCount(int minLoadableRetryCount)
Sets the minimum number of times to retry if a loading error occurs.
|
HlsMediaSource.Factory |
setPlaylistParser(com.google.android.exoplayer2.upstream.ParsingLoadable.Parser<HlsPlaylist> playlistParser)
Sets the parser to parse HLS playlists.
|
public Factory(com.google.android.exoplayer2.upstream.DataSource.Factory dataSourceFactory)
HlsMediaSources.dataSourceFactory - A data source factory that will be wrapped by a DefaultHlsDataSourceFactory to create DataSources for manifests, segments and
keys.public Factory(HlsDataSourceFactory hlsDataSourceFactory)
HlsMediaSources.hlsDataSourceFactory - An HlsDataSourceFactory for DataSources for
manifests, segments and keys.public HlsMediaSource.Factory setExtractorFactory(HlsExtractorFactory extractorFactory)
Extractors for the segments. The default value is HlsExtractorFactory.DEFAULT.extractorFactory - An HlsExtractorFactory for Extractors for the
segments.java.lang.IllegalStateException - If one of the create methods has already been called.public HlsMediaSource.Factory setMinLoadableRetryCount(int minLoadableRetryCount)
HlsMediaSource.DEFAULT_MIN_LOADABLE_RETRY_COUNT.minLoadableRetryCount - The minimum number of times to retry if a loading error occurs.java.lang.IllegalStateException - If one of the create methods has already been called.public HlsMediaSource.Factory setPlaylistParser(com.google.android.exoplayer2.upstream.ParsingLoadable.Parser<HlsPlaylist> playlistParser)
HlsPlaylistParser.playlistParser - A ParsingLoadable.Parser for HLS playlists.java.lang.IllegalStateException - If one of the create methods has already been called.public HlsMediaSource.Factory setCompositeSequenceableLoaderFactory(com.google.android.exoplayer2.source.CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory)
SequenceableLoaders for when this media source
loads data from multiple streams (video, audio etc...). The default is an instance of DefaultCompositeSequenceableLoaderFactory.compositeSequenceableLoaderFactory - A factory to create composite SequenceableLoaders for when this media source loads data from multiple streams (video,
audio etc...).java.lang.IllegalStateException - If one of the create methods has already been called.public HlsMediaSource.Factory setAllowChunklessPreparation(boolean allowChunklessPreparation)
allowChunklessPreparation - Whether chunkless preparation is allowed.java.lang.IllegalStateException - If one of the create methods has already been called.public HlsMediaSource createMediaSource(android.net.Uri playlistUri)
HlsMediaSource using the current parameters. Media source events will
not be delivered.HlsMediaSource.public HlsMediaSource createMediaSource(android.net.Uri playlistUri, @Nullable android.os.Handler eventHandler, @Nullable com.google.android.exoplayer2.source.MediaSourceEventListener eventListener)
HlsMediaSource using the current parameters.createMediaSource in interface com.google.android.exoplayer2.source.ads.AdsMediaSource.MediaSourceFactoryplaylistUri - The playlist Uri.eventHandler - A handler for events.eventListener - A listener of events.HlsMediaSource.public int[] getSupportedTypes()
getSupportedTypes in interface com.google.android.exoplayer2.source.ads.AdsMediaSource.MediaSourceFactory