docs/doc/reference/com/google/android/exoplayer2/source/MediaSource.Factory.html
Package com.google.android.exoplayer2.source
MediaSourceFactoryAll Known Implementing Classes:DashMediaSource.Factory, DefaultMediaSourceFactory, FakeMediaSourceFactory, HlsMediaSource.Factory, ImaServerSideAdInsertionMediaSource.Factory, ProgressiveMediaSource.Factory, RtspMediaSource.Factory, SsMediaSource.FactoryEnclosing interface:MediaSourcepublic static interfaceMediaSource.Factory
Factory for creating MediaSources from MediaItems.
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| static MediaSource.Factory | UNSUPPORTED |
An instance that throws UnsupportedOperationException from createMediaSource(com.google.android.exoplayer2.MediaItem) and getSupportedTypes().
|
All Methods Instance Methods Abstract Methods Default Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| MediaSource | createMediaSource(MediaItem mediaItem) |
Creates a new MediaSource with the specified MediaItem.
|
| @com.google.android.exoplayer2.C.ContentType int[] | getSupportedTypes() |
Returns the content types supported by media sources created by this factory.
|
| default MediaSource.Factory | setCmcdConfigurationFactory(CmcdConfiguration.Factory cmcdConfigurationFactory) |
Sets the CmcdConfiguration.Factory used to obtain a CmcdConfiguration for a MediaItem.
|
| MediaSource.Factory | setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider) |
Sets the DrmSessionManagerProvider used to obtain a DrmSessionManager for a MediaItem.
|
| MediaSource.Factory | setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) |
Sets an optional LoadErrorHandlingPolicy.
|
-
static final[MediaSource.Factory](MediaSource.Factory.html "interface in com.google.android.exoplayer2.source")UNSUPPORTED
An instance that throws UnsupportedOperationException from createMediaSource(com.google.android.exoplayer2.MediaItem) and getSupportedTypes().
-
default[MediaSource.Factory](MediaSource.Factory.html "interface in com.google.android.exoplayer2.source")setCmcdConfigurationFactory([CmcdConfiguration.Factory](../upstream/CmcdConfiguration.Factory.html "interface in com.google.android.exoplayer2.upstream")cmcdConfigurationFactory)
Sets the CmcdConfiguration.Factory used to obtain a CmcdConfiguration for a MediaItem.
Returns:This factory, for convenience.
-
[MediaSource.Factory](MediaSource.Factory.html "interface in com.google.android.exoplayer2.source")setDrmSessionManagerProvider([DrmSessionManagerProvider](../drm/DrmSessionManagerProvider.html "interface in com.google.android.exoplayer2.drm")drmSessionManagerProvider)
Sets the DrmSessionManagerProvider used to obtain a DrmSessionManager for a MediaItem.
Returns:This factory, for convenience.
-
[MediaSource.Factory](MediaSource.Factory.html "interface in com.google.android.exoplayer2.source")setLoadErrorHandlingPolicy([LoadErrorHandlingPolicy](../upstream/LoadErrorHandlingPolicy.html "interface in com.google.android.exoplayer2.upstream")loadErrorHandlingPolicy)
Sets an optional LoadErrorHandlingPolicy.
Returns:This factory, for convenience.
-
[@ContentType](../C.ContentType.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.C.ContentType int[] getSupportedTypes()
Returns the content types supported by media sources created by this factory.
-
[MediaSource](MediaSource.html "interface in com.google.android.exoplayer2.source")createMediaSource([MediaItem](../MediaItem.html "class in com.google.android.exoplayer2")mediaItem)
Creates a new MediaSource with the specified MediaItem.
Parameters:mediaItem - The media item to play.Returns:The new media source.