HlsMediaSource.Factory
class HlsMediaSource.Factory : MediaSourceFactory
Factory for HlsMediaSources.
Summary
Public constructors |
|---|
Factory(dataSourceFactory: DataSource.Factory!)Creates a new factory for |
Factory(hlsDataSourceFactory: HlsDataSourceFactory!)Creates a new factory for |
Public functions |
|
|---|---|
HlsMediaSource! |
createMediaSource(mediaItem: MediaItem!)Returns a new |
HlsMediaSource.Factory! |
@CanIgnoreReturnValueThis function is deprecated. This method (and all support for 'legacy' subtitle decoding during rendering) will be removed in a future release. |
HlsMediaSource.Factory! |
@CanIgnoreReturnValueSets the set of video codecs for which within GOP sample dependency information should be parsed as part of extraction. |
IntArray<Int>! |
Returns the |
HlsMediaSource.Factory! |
@CanIgnoreReturnValueSets whether chunkless preparation is allowed. |
HlsMediaSource.Factory! |
@CanIgnoreReturnValueSets the |
HlsMediaSource.Factory! |
@CanIgnoreReturnValueSets the factory to create composite |
HlsMediaSource.Factory! |
@CanIgnoreReturnValueSets a supplier for an |
HlsMediaSource.Factory! |
@CanIgnoreReturnValueSets the |
HlsMediaSource.Factory! |
@CanIgnoreReturnValueSets the factory for |
HlsMediaSource.Factory! |
@CanIgnoreReturnValueSets an optional |
HlsMediaSource.Factory! |
@CanIgnoreReturnValueSets the type of metadata to extract from the HLS source (defaults to |
HlsMediaSource.Factory! |
@CanIgnoreReturnValueSets the factory from which playlist parsers will be obtained. |
HlsMediaSource.Factory! |
@CanIgnoreReturnValueSets the |
HlsMediaSource.Factory! |
@CanIgnoreReturnValueSets the |
HlsMediaSource.Factory! |
@CanIgnoreReturnValueSets the timeout for the loading thread to wait for the timestamp adjuster to initialize, in milliseconds.The default value is zero, which is interpreted as an infinite timeout. |
HlsMediaSource.Factory! |
@CanIgnoreReturnValueSets whether to use #EXT-X-SESSION-KEY tags provided in the multivariant playlist. |
Inherited Constants |
||
|---|---|---|
|
||
|
Public constructors
Factory
Factory(dataSourceFactory: DataSource.Factory!)
Creates a new factory for HlsMediaSources.
The factory will use the following default components:
DefaultDrmSessionManagerProviderDefaultHlsPlaylistParserFactoryFACTORYDefaultHlsExtractorFactoryDefaultLoadErrorHandlingPolicyDefaultCompositeSequenceableLoaderFactory
| Parameters | |
|---|---|
dataSourceFactory: DataSource.Factory! |
A data source factory that will be wrapped by a |
Factory
Factory(hlsDataSourceFactory: HlsDataSourceFactory!)
Creates a new factory for HlsMediaSources.
The factory will use the following default components:
DefaultDrmSessionManagerProviderDefaultHlsPlaylistParserFactoryFACTORYDefaultHlsExtractorFactoryDefaultLoadErrorHandlingPolicyDefaultCompositeSequenceableLoaderFactory
| Parameters | |
|---|---|
hlsDataSourceFactory: HlsDataSourceFactory! |
An |
Public functions
createMediaSource
fun createMediaSource(mediaItem: MediaItem!): HlsMediaSource!
Returns a new HlsMediaSource using the current parameters.
| Returns | |
|---|---|
HlsMediaSource! |
The new |
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
experimentalParseSubtitlesDuringExtraction
@CanIgnoreReturnValue
funexperimentalParseSubtitlesDuringExtraction(
parseSubtitlesDuringExtraction: Boolean
): HlsMediaSource.Factory!
Sets whether subtitles should be parsed as part of extraction (before being added to the sample queue) or as part of rendering (when being taken from the sample queue). Defaults to true (i.e. subtitles will be parsed during extraction).
This method is experimental and will be renamed or removed in a future release.
| Parameters | |
|---|---|
parseSubtitlesDuringExtraction: Boolean |
Whether to parse subtitles during extraction or rendering. |
| Returns | |
|---|---|
HlsMediaSource.Factory! |
This factory, for convenience. |
experimentalSetCodecsToParseWithinGopSampleDependencies
@CanIgnoreReturnValue
fun experimentalSetCodecsToParseWithinGopSampleDependencies(
@C.VideoCodecFlags codecsToParseWithinGopSampleDependencies: Int
): HlsMediaSource.Factory!
Sets the set of video codecs for which within GOP sample dependency information should be parsed as part of extraction. Defaults to 0 - empty set of codecs.
Having access to additional sample dependency information can speed up seeking. See FLAG_READ_WITHIN_GOP_SAMPLE_DEPENDENCIES.
This method is experimental and will be renamed or removed in a future release.
| Parameters | |
|---|---|
@C.VideoCodecFlags codecsToParseWithinGopSampleDependencies: Int |
The set of codecs for which to parse within GOP sample dependency information. |
| Returns | |
|---|---|
HlsMediaSource.Factory! |
This factory, for convenience. |
getSupportedTypes
@C.ContentType
fun getSupportedTypes(): IntArray<Int>!
Returns the content types supported by media sources created by this factory.
setAllowChunklessPreparation
@CanIgnoreReturnValue
fun setAllowChunklessPreparation(allowChunklessPreparation: Boolean): HlsMediaSource.Factory!
Sets whether chunkless preparation is allowed. If true, preparation without chunk downloads will be enabled for streams that provide sufficient information in their multivariant playlist.
| Parameters | |
|---|---|
allowChunklessPreparation: Boolean |
Whether chunkless preparation is allowed. |
| Returns | |
|---|---|
HlsMediaSource.Factory! |
This factory, for convenience. |
setCmcdConfigurationFactory
@CanIgnoreReturnValue
fun setCmcdConfigurationFactory(
cmcdConfigurationFactory: CmcdConfiguration.Factory!
): HlsMediaSource.Factory!
Sets the CmcdConfiguration.Factory used to obtain a CmcdConfiguration for a MediaItem.
| Returns | |
|---|---|
HlsMediaSource.Factory! |
This factory, for convenience. |
setCompositeSequenceableLoaderFactory
@CanIgnoreReturnValue
fun setCompositeSequenceableLoaderFactory(
compositeSequenceableLoaderFactory: CompositeSequenceableLoaderFactory!
): HlsMediaSource.Factory!
Sets the factory to create composite SequenceableLoaders for when this media source loads data from multiple streams (video, audio etc...).
| Parameters | |
|---|---|
compositeSequenceableLoaderFactory: CompositeSequenceableLoaderFactory! |
A factory to create composite |
| Returns | |
|---|---|
HlsMediaSource.Factory! |
This factory, for convenience. |
setDownloadExecutor
@CanIgnoreReturnValue
fun setDownloadExecutor(downloadExecutor: Supplier<ReleasableExecutor!>!): HlsMediaSource.Factory!
Sets a supplier for an ReleasableExecutor that is used for loading the media.
| Parameters | |
|---|---|
downloadExecutor: Supplier<ReleasableExecutor!>! |
A |
| Returns | |
|---|---|
HlsMediaSource.Factory! |
This factory, for convenience. |
setDrmSessionManagerProvider
@CanIgnoreReturnValue
fun setDrmSessionManagerProvider(
drmSessionManagerProvider: DrmSessionManagerProvider!
): HlsMediaSource.Factory!
Sets the DrmSessionManagerProvider used to obtain a DrmSessionManager for a MediaItem.
| Returns | |
|---|---|
HlsMediaSource.Factory! |
This factory, for convenience. |
setExtractorFactory
@CanIgnoreReturnValue
fun setExtractorFactory(extractorFactory: HlsExtractorFactory?): HlsMediaSource.Factory!
Sets the factory for Extractors for the segments. The default value is DefaultHlsExtractorFactory.
Any values passed to setSubtitleParserFactory or experimentalParseSubtitlesDuringExtraction will be forwarded to the provided HlsExtractorFactory instance during createMediaSource.
| Parameters | |
|---|---|
extractorFactory: HlsExtractorFactory? |
An |
| Returns | |
|---|---|
HlsMediaSource.Factory! |
This factory, for convenience. |
setLoadErrorHandlingPolicy
@CanIgnoreReturnValue
fun setLoadErrorHandlingPolicy(
loadErrorHandlingPolicy: LoadErrorHandlingPolicy!
): HlsMediaSource.Factory!
Sets an optional LoadErrorHandlingPolicy.
| Returns | |
|---|---|
HlsMediaSource.Factory! |
This factory, for convenience. |
setMetadataType
@CanIgnoreReturnValue
fun setMetadataType(@HlsMediaSource.MetadataType metadataType: Int): HlsMediaSource.Factory!
Sets the type of metadata to extract from the HLS source (defaults to METADATA_TYPE_ID3).
HLS supports in-band ID3 in both TS and fMP4 streams, but in the fMP4 case the data is wrapped in an EMSG box [spec].
If this is set to METADATA_TYPE_ID3 then raw ID3 metadata of will be extracted from TS sources. From fMP4 streams EMSGs containing metadata of this type (in the variant stream only) will be unwrapped to expose the inner data. All other in-band metadata will be dropped.
If this is set to METADATA_TYPE_EMSG then all EMSG data from the fMP4 variant stream will be extracted. No metadata will be extracted from TS streams, since they don't support EMSG.
| Parameters | |
|---|---|
@HlsMediaSource.MetadataType metadataType: Int |
The type of metadata to extract. |
| Returns | |
|---|---|
HlsMediaSource.Factory! |
This factory, for convenience. |
setPlaylistParserFactory
@CanIgnoreReturnValue
fun setPlaylistParserFactory(
playlistParserFactory: HlsPlaylistParserFactory!
): HlsMediaSource.Factory!
Sets the factory from which playlist parsers will be obtained.
| Parameters | |
|---|---|
playlistParserFactory: HlsPlaylistParserFactory! |
| Returns | |
|---|---|
HlsMediaSource.Factory! |
This factory, for convenience. |
setPlaylistTrackerFactory
@CanIgnoreReturnValue
fun setPlaylistTrackerFactory(
playlistTrackerFactory: HlsPlaylistTracker.Factory!
): HlsMediaSource.Factory!
Sets the HlsPlaylistTracker factory.
| Parameters | |
|---|---|
playlistTrackerFactory: HlsPlaylistTracker.Factory! |
A factory for |
| Returns | |
|---|---|
HlsMediaSource.Factory! |
This factory, for convenience. |
setSubtitleParserFactory
@CanIgnoreReturnValue
fun setSubtitleParserFactory(subtitleParserFactory: SubtitleParser.Factory!): HlsMediaSource.Factory!
Sets the SubtitleParser.Factory to be used for parsing subtitles during extraction.
| Parameters | |
|---|---|
subtitleParserFactory: SubtitleParser.Factory! |
The |
| Returns | |
|---|---|
HlsMediaSource.Factory! |
This factory, for convenience. |
setTimestampAdjusterInitializationTimeoutMs
@CanIgnoreReturnValue
fun setTimestampAdjusterInitializationTimeoutMs(
timestampAdjusterInitializationTimeoutMs: Long
): HlsMediaSource.Factory!
Sets the timeout for the loading thread to wait for the timestamp adjuster to initialize, in milliseconds.The default value is zero, which is interpreted as an infinite timeout.
| Parameters | |
|---|---|
timestampAdjusterInitializationTimeoutMs: Long |
The timeout in milliseconds. A timeout of zero is interpreted as an infinite timeout. |
| Returns | |
|---|---|
HlsMediaSource.Factory! |
This factory, for convenience. |
setUseSessionKeys
@CanIgnoreReturnValue
fun setUseSessionKeys(useSessionKeys: Boolean): HlsMediaSource.Factory!
Sets whether to use #EXT-X-SESSION-KEY tags provided in the multivariant playlist. If enabled, it's assumed that any single session key declared in the multivariant playlist can be used to obtain all of the keys required for playback. For media where this is not true, this option should not be enabled.
| Parameters | |
|---|---|
useSessionKeys: Boolean |
Whether to use #EXT-X-SESSION-KEY tags. |
| Returns | |
|---|---|
HlsMediaSource.Factory! |
This factory, for convenience. |