MediaSource.Factory
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 |
|
|---|---|
const MediaSource.Factory! |
An instance that throws |
Constants
UNSUPPORTED
@UnstableApi
const val UNSUPPORTED: MediaSource.Factory!
An instance that throws UnsupportedOperationException from createMediaSource and getSupportedTypes.
Public functions
createMediaSource
@UnstableApi
fun createMediaSource(mediaItem: MediaItem!): MediaSource!
Creates a new MediaSource with the specified MediaItem.
| Parameters | |
|---|---|
mediaItem: MediaItem! |
The media item to play. |
| Returns | |
|---|---|
MediaSource! |
The new |
experimentalParseSubtitlesDuringExtraction
@UnstableApi
funexperimentalParseSubtitlesDuringExtraction(
parseSubtitlesDuringExtraction: Boolean
): MediaSource.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 | |
|---|---|
MediaSource.Factory! |
This factory, for convenience. |
experimentalSetCodecsToParseWithinGopSampleDependencies
@UnstableApi
@CanIgnoreReturnValue
fun experimentalSetCodecsToParseWithinGopSampleDependencies(
@C.VideoCodecFlags codecsToParseWithinGopSampleDependencies: Int
): MediaSource.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 | |
|---|---|
MediaSource.Factory! |
This factory, for convenience. |
getSupportedTypes
@UnstableApi
@C.ContentType
fun getSupportedTypes(): IntArray<Int>!
Returns the content types supported by media sources created by this factory.
setCmcdConfigurationFactory
@UnstableApi
fun setCmcdConfigurationFactory(
cmcdConfigurationFactory: CmcdConfiguration.Factory!
): MediaSource.Factory!
Sets the CmcdConfiguration.Factory used to obtain a CmcdConfiguration for a MediaItem.
| Returns | |
|---|---|
MediaSource.Factory! |
This factory, for convenience. |
setDownloadExecutor
@UnstableApi
@CanIgnoreReturnValue
fun setDownloadExecutor(downloadExecutor: Supplier<ReleasableExecutor!>!): MediaSource.Factory!
Sets a supplier for an ReleasableExecutor that is used for loading the media.
| Parameters | |
|---|---|
downloadExecutor: Supplier<ReleasableExecutor!>! |
A |
| Returns | |
|---|---|
MediaSource.Factory! |
This factory, for convenience. |
setDrmSessionManagerProvider
@UnstableApi
fun setDrmSessionManagerProvider(
drmSessionManagerProvider: DrmSessionManagerProvider!
): MediaSource.Factory!
Sets the DrmSessionManagerProvider used to obtain a DrmSessionManager for a MediaItem.
| Returns | |
|---|---|
MediaSource.Factory! |
This factory, for convenience. |
setLoadErrorHandlingPolicy
@UnstableApi
fun setLoadErrorHandlingPolicy(
loadErrorHandlingPolicy: LoadErrorHandlingPolicy!
): MediaSource.Factory!
Sets an optional LoadErrorHandlingPolicy.
| Returns | |
|---|---|
MediaSource.Factory! |
This factory, for convenience. |
setSubtitleParserFactory
@UnstableApi
fun setSubtitleParserFactory(subtitleParserFactory: SubtitleParser.Factory!): MediaSource.Factory!
Sets the SubtitleParser.Factory to be used for parsing subtitles during extraction.
| Parameters | |
|---|---|
subtitleParserFactory: SubtitleParser.Factory! |
The |
| Returns | |
|---|---|
MediaSource.Factory! |
This factory, for convenience. |