Class FakeMediaSourceFactory
- java.lang.Object
-
- com.google.android.exoplayer2.testutil.FakeMediaSourceFactory
-
- All Implemented Interfaces:
MediaSourceFactory
public class FakeMediaSourceFactory extends Object implements MediaSourceFactory
FakeMediaSourceFactorythat creates aFakeMediaSource.
-
-
Field Summary
Fields Modifier and Type Field Description static ObjectDEFAULT_WINDOW_UIDThe window UID used by media sources that are created by the factory.-
Fields inherited from interface com.google.android.exoplayer2.source.MediaSourceFactory
UNSUPPORTED
-
-
Constructor Summary
Constructors Constructor Description FakeMediaSourceFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated 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.MediaSourceFactorysetDrmHttpDataSourceFactory(HttpDataSource.Factory drmHttpDataSourceFactory)Deprecated.MediaSourceFactorysetDrmSessionManager(DrmSessionManager drmSessionManager)Deprecated.MediaSourceFactorysetDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider)MediaSourceFactorysetDrmUserAgent(String userAgent)Deprecated.MediaSourceFactorysetLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy)Sets an optionalLoadErrorHandlingPolicy.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.google.android.exoplayer2.source.MediaSourceFactory
createMediaSource, setStreamKeys
-
-
-
-
Field Detail
-
DEFAULT_WINDOW_UID
public static final Object DEFAULT_WINDOW_UID
The window UID used by media sources that are created by the factory.
-
-
Method Detail
-
setDrmSessionManagerProvider
public MediaSourceFactory setDrmSessionManagerProvider(@Nullable DrmSessionManagerProvider drmSessionManagerProvider)
Description copied from interface:MediaSourceFactorySets theDrmSessionManagerProviderused to obtain aDrmSessionManagerfor aMediaItem.If not set,
DefaultDrmSessionManagerProvideris used.If set, calls to the following (deprecated) methods are ignored:
- Specified by:
setDrmSessionManagerProviderin interfaceMediaSourceFactory- Returns:
- This factory, for convenience.
-
setDrmSessionManager
@Deprecated public MediaSourceFactory setDrmSessionManager(@Nullable DrmSessionManager drmSessionManager)
Deprecated.Description copied from interface:MediaSourceFactorySets theDrmSessionManagerto use for all media items regardless of theirMediaItem.DrmConfiguration.Calling this with a non-null
drmSessionManageris equivalent to callingsetDrmSessionManagerProvider(unusedMediaItem -> drmSessionManager).- Specified by:
setDrmSessionManagerin interfaceMediaSourceFactory- Parameters:
drmSessionManager- TheDrmSessionManager, ornullto use theDefaultDrmSessionManager.- Returns:
- This factory, for convenience.
-
setDrmHttpDataSourceFactory
@Deprecated public MediaSourceFactory setDrmHttpDataSourceFactory(@Nullable HttpDataSource.Factory drmHttpDataSourceFactory)
Deprecated.Description copied from interface:MediaSourceFactorySets theHttpDataSource.Factoryto be used for creatingHttpMediaDrmCallbacksto execute key and provisioning requests over HTTP.Calls to this method are ignored if either a
DrmSessionManager providerorconcrete DrmSessionManagerare provided.- Specified by:
setDrmHttpDataSourceFactoryin interfaceMediaSourceFactory- Parameters:
drmHttpDataSourceFactory- The HTTP data source factory, ornullto useDefaultHttpDataSource.Factory.- Returns:
- This factory, for convenience.
-
setDrmUserAgent
@Deprecated public MediaSourceFactory setDrmUserAgent(@Nullable String userAgent)
Deprecated.Description copied from interface:MediaSourceFactorySets the optional user agent to be used for DRM requests.Calls to this method are ignored if any of the following are provided:
- Specified by:
setDrmUserAgentin interfaceMediaSourceFactory- Parameters:
userAgent- The user agent to be used for DRM requests, ornullto use the default.- Returns:
- This factory, for convenience.
-
setLoadErrorHandlingPolicy
public MediaSourceFactory setLoadErrorHandlingPolicy(@Nullable LoadErrorHandlingPolicy loadErrorHandlingPolicy)
Description copied from interface:MediaSourceFactorySets an optionalLoadErrorHandlingPolicy.- Specified by:
setLoadErrorHandlingPolicyin interfaceMediaSourceFactory- Parameters:
loadErrorHandlingPolicy- ALoadErrorHandlingPolicy, ornullto use theDefaultLoadErrorHandlingPolicy.- Returns:
- This factory, for convenience.
-
getSupportedTypes
public int[] getSupportedTypes()
Description copied from interface:MediaSourceFactoryReturns thecontent typessupported by media sources created by this factory.- Specified by:
getSupportedTypesin interfaceMediaSourceFactory
-
createMediaSource
public MediaSource createMediaSource(MediaItem mediaItem)
Description copied from interface:MediaSourceFactoryCreates a newMediaSourcewith the specifiedMediaItem.- Specified by:
createMediaSourcein interfaceMediaSourceFactory- Parameters:
mediaItem- The media item to play.- Returns:
- The new
media source.
-
-