MediaSource.Factory
public interface MediaSource.Factory
ExternallyLoadedMediaSource.Factory |
Factory for |
HlsInterstitialsAdsLoader.AdsMediaSourceFactory |
A |
ImaServerSideAdInsertionMediaSource.Factory |
Factory for creating |
MediaSourceFactory |
This interface is deprecated. Use |
PreloadMediaSource.Factory |
Factory for |
DashMediaSource.Factory |
Factory for |
DefaultMediaSourceFactory |
The default |
FakeMediaSourceFactory |
Fake |
HlsMediaSource.Factory |
Factory for |
ProgressiveMediaSource.Factory |
Factory for |
RtspMediaSource.Factory |
Factory for |
SsMediaSource.Factory |
Factory for |
Factory for creating MediaSources from MediaItems.
Summary
Constants |
|
|---|---|
default static final MediaSource.Factory |
An instance that throws |
Public methods |
|
|---|---|
abstract MediaSource |
@UnstableApiCreates a new |
default MediaSource.Factory |
@UnstableApiThis method is deprecated. This method (and all support for 'legacy' subtitle decoding during rendering) will be removed in a future release. |
default MediaSource.Factory |
@UnstableApiSets the set of video codecs for which within GOP sample dependency information should be parsed as part of extraction. |
abstract int[] |
Returns the |
default MediaSource.Factory |
@UnstableApiSets the |
default MediaSource.Factory |
@UnstableApiSets a supplier for an |
abstract MediaSource.Factory |
@UnstableApiSets the |
abstract MediaSource.Factory |
@UnstableApiSets an optional |
default MediaSource.Factory |
@UnstableApiSets the |
Constants
UNSUPPORTED
@UnstableApi
default static final MediaSource.Factory UNSUPPORTED
An instance that throws UnsupportedOperationException from createMediaSource and getSupportedTypes.
Public methods
createMediaSource
@UnstableApi
abstract MediaSource createMediaSource(MediaItem mediaItem)
Creates a new MediaSource with the specified MediaItem.
| Parameters | |
|---|---|
MediaItem mediaItem |
The media item to play. |
| Returns | |
|---|---|
MediaSource |
The new |
experimentalParseSubtitlesDuringExtraction
@UnstableApi
default MediaSource.FactoryexperimentalParseSubtitlesDuringExtraction(
boolean parseSubtitlesDuringExtraction
)
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 | |
|---|---|
boolean parseSubtitlesDuringExtraction |
Whether to parse subtitles during extraction or rendering. |
| Returns | |
|---|---|
MediaSource.Factory |
This factory, for convenience. |
experimentalSetCodecsToParseWithinGopSampleDependencies
@UnstableApi
@CanIgnoreReturnValue
default MediaSource.Factory experimentalSetCodecsToParseWithinGopSampleDependencies(
@C.VideoCodecFlags int codecsToParseWithinGopSampleDependencies
)
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 int codecsToParseWithinGopSampleDependencies |
The set of codecs for which to parse within GOP sample dependency information. |
| Returns | |
|---|---|
MediaSource.Factory |
This factory, for convenience. |
getSupportedTypes
@UnstableApi
@C.ContentType
abstract int[] getSupportedTypes()
Returns the content types supported by media sources created by this factory.
setCmcdConfigurationFactory
@UnstableApi
default MediaSource.Factory setCmcdConfigurationFactory(
CmcdConfiguration.Factory cmcdConfigurationFactory
)
Sets the CmcdConfiguration.Factory used to obtain a CmcdConfiguration for a MediaItem.
| Returns | |
|---|---|
MediaSource.Factory |
This factory, for convenience. |
setDownloadExecutor
@UnstableApi
@CanIgnoreReturnValue
default MediaSource.Factory setDownloadExecutor(Supplier<ReleasableExecutor> downloadExecutor)
Sets a supplier for an ReleasableExecutor that is used for loading the media.
| Parameters | |
|---|---|
Supplier<ReleasableExecutor> downloadExecutor |
A |
| Returns | |
|---|---|
MediaSource.Factory |
This factory, for convenience. |
setDrmSessionManagerProvider
@UnstableApi
abstract MediaSource.Factory setDrmSessionManagerProvider(
DrmSessionManagerProvider drmSessionManagerProvider
)
Sets the DrmSessionManagerProvider used to obtain a DrmSessionManager for a MediaItem.
| Returns | |
|---|---|
MediaSource.Factory |
This factory, for convenience. |
setLoadErrorHandlingPolicy
@UnstableApi
abstract MediaSource.Factory setLoadErrorHandlingPolicy(
LoadErrorHandlingPolicy loadErrorHandlingPolicy
)
Sets an optional LoadErrorHandlingPolicy.
| Returns | |
|---|---|
MediaSource.Factory |
This factory, for convenience. |
setSubtitleParserFactory
@UnstableApi
default MediaSource.Factory setSubtitleParserFactory(SubtitleParser.Factory subtitleParserFactory)
Sets the SubtitleParser.Factory to be used for parsing subtitles during extraction.
| Parameters | |
|---|---|
SubtitleParser.Factory subtitleParserFactory |
The |
| Returns | |
|---|---|
MediaSource.Factory |
This factory, for convenience. |