Class ImaServerSideAdInsertionMediaSource.Factory
- java.lang.Object
-
- com.google.android.exoplayer2.ext.ima.ImaServerSideAdInsertionMediaSource.Factory
-
- All Implemented Interfaces:
MediaSource.Factory
- Enclosing class:
- ImaServerSideAdInsertionMediaSource
public static final class ImaServerSideAdInsertionMediaSource.Factory extends Object implements MediaSource.Factory
Factory for creatingImaServerSideAdInsertionMediaSources.Apps can use the
ImaServerSideAdInsertionMediaSource.Factoryto customized theDefaultMediaSourceFactorythat is used to build a player:
-
-
Field Summary
-
Fields inherited from interface com.google.android.exoplayer2.source.MediaSource.Factory
UNSUPPORTED
-
-
Constructor Summary
Constructors Constructor Description Factory(ImaServerSideAdInsertionMediaSource.AdsLoader adsLoader, MediaSource.Factory contentMediaSourceFactory)Creates a new factory forImaServerSideAdInsertionMediaSources.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MediaSourcecreateMediaSource(MediaItem mediaItem)Creates a newMediaSourcewith the specifiedMediaItem.int[]getSupportedTypes()Returns thecontent typessupported by media sources created by this factory.MediaSource.FactorysetDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider)MediaSource.FactorysetLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy)Sets an optionalLoadErrorHandlingPolicy.
-
-
-
Constructor Detail
-
Factory
public Factory(ImaServerSideAdInsertionMediaSource.AdsLoader adsLoader, MediaSource.Factory contentMediaSourceFactory)
Creates a new factory forImaServerSideAdInsertionMediaSources.- Parameters:
adsLoader- TheImaServerSideAdInsertionMediaSource.AdsLoader.contentMediaSourceFactory- The content media source factory to create content sources.
-
-
Method Detail
-
setLoadErrorHandlingPolicy
public MediaSource.Factory setLoadErrorHandlingPolicy(@Nullable LoadErrorHandlingPolicy loadErrorHandlingPolicy)
Description copied from interface:MediaSource.FactorySets an optionalLoadErrorHandlingPolicy.- Specified by:
setLoadErrorHandlingPolicyin interfaceMediaSource.Factory- Parameters:
loadErrorHandlingPolicy- ALoadErrorHandlingPolicy, ornullto use theDefaultLoadErrorHandlingPolicy.- Returns:
- This factory, for convenience.
-
setDrmSessionManagerProvider
public MediaSource.Factory setDrmSessionManagerProvider(@Nullable DrmSessionManagerProvider drmSessionManagerProvider)
Description copied from interface:MediaSource.FactorySets theDrmSessionManagerProviderused to obtain aDrmSessionManagerfor aMediaItem.If not set,
DefaultDrmSessionManagerProvideris used.- Specified by:
setDrmSessionManagerProviderin interfaceMediaSource.Factory- Returns:
- This factory, for convenience.
-
getSupportedTypes
public int[] getSupportedTypes()
Description copied from interface:MediaSource.FactoryReturns thecontent typessupported by media sources created by this factory.- Specified by:
getSupportedTypesin interfaceMediaSource.Factory
-
createMediaSource
public MediaSource createMediaSource(MediaItem mediaItem)
Description copied from interface:MediaSource.FactoryCreates a newMediaSourcewith the specifiedMediaItem.- Specified by:
createMediaSourcein interfaceMediaSource.Factory- Parameters:
mediaItem- The media item to play.- Returns:
- The new
media source.
-
-