Interface MediaSource.Factory
-
- All Known Subinterfaces:
MediaSourceFactory
- All Known Implementing Classes:
DashMediaSource.Factory
,DefaultMediaSourceFactory
,FakeMediaSourceFactory
,HlsMediaSource.Factory
,ImaServerSideAdInsertionMediaSource.Factory
,ProgressiveMediaSource.Factory
,RtspMediaSource.Factory
,SsMediaSource.Factory
- Enclosing interface:
- MediaSource
public static interface MediaSource.Factory
Factory for creatingMediaSources
fromMediaItems
.
-
-
Field Summary
Fields Modifier and Type Field Description static MediaSource.Factory
UNSUPPORTED
An instance that throwsUnsupportedOperationException
fromcreateMediaSource(com.google.android.exoplayer2.MediaItem)
andgetSupportedTypes()
.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description MediaSource
createMediaSource(MediaItem mediaItem)
Creates a newMediaSource
with the specifiedMediaItem
.@com.google.android.exoplayer2.C.ContentType int[]
getSupportedTypes()
Returns thecontent types
supported by media sources created by this factory.default MediaSource.Factory
setCmcdConfigurationFactory(CmcdConfiguration.Factory cmcdConfigurationFactory)
MediaSource.Factory
setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider)
MediaSource.Factory
setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy)
Sets an optionalLoadErrorHandlingPolicy
.
-
-
-
Field Detail
-
UNSUPPORTED
static final MediaSource.Factory UNSUPPORTED
An instance that throwsUnsupportedOperationException
fromcreateMediaSource(com.google.android.exoplayer2.MediaItem)
andgetSupportedTypes()
.
-
-
Method Detail
-
setCmcdConfigurationFactory
default MediaSource.Factory setCmcdConfigurationFactory(CmcdConfiguration.Factory cmcdConfigurationFactory)
- Returns:
- This factory, for convenience.
-
setDrmSessionManagerProvider
MediaSource.Factory setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider)
- Returns:
- This factory, for convenience.
-
setLoadErrorHandlingPolicy
MediaSource.Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy)
Sets an optionalLoadErrorHandlingPolicy
.- Returns:
- This factory, for convenience.
-
getSupportedTypes
@ContentType @com.google.android.exoplayer2.C.ContentType int[] getSupportedTypes()
Returns thecontent types
supported by media sources created by this factory.
-
createMediaSource
MediaSource createMediaSource(MediaItem mediaItem)
Creates a newMediaSource
with the specifiedMediaItem
.- Parameters:
mediaItem
- The media item to play.- Returns:
- The new
media source
.
-
-