Back to Exoplayer

FakeMediaSourceFactory (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/testutil/FakeMediaSourceFactory.html

latest6.2 KB
Original Source

Package com.google.android.exoplayer2.testutil

Class FakeMediaSourceFactory

  • java.lang.Object

    • com.google.android.exoplayer2.testutil.FakeMediaSourceFactory
  • All Implemented Interfaces:MediaSource.Factory, MediaSourceFactory


public final classFakeMediaSourceFactoryextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[MediaSourceFactory](../source/MediaSourceFactory.html "interface in com.google.android.exoplayer2.source")

Fake MediaSourceFactory that creates a FakeMediaSource.

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | static Object | DEFAULT_WINDOW_UID | The 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 | 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. | | MediaSourceFactory | setDrmSessionManagerProvider​(DrmSessionManagerProvider drmSessionManagerProvider) | Sets the DrmSessionManagerProvider used to obtain a DrmSessionManager for a MediaItem. | | MediaSourceFactory | setLoadErrorHandlingPolicy​(LoadErrorHandlingPolicy loadErrorHandlingPolicy) | Sets an optional LoadErrorHandlingPolicy. |

- 

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.MediaSource.Factory

setCmcdConfigurationFactory

Field Detail

- 

DEFAULT_WINDOW_UID

public static final[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")DEFAULT_WINDOW_UID

The window UID used by media sources that are created by the factory.

Constructor Detail

- 

FakeMediaSourceFactory

public FakeMediaSourceFactory()

Method Detail

- 

setDrmSessionManagerProvider

public[MediaSourceFactory](../source/MediaSourceFactory.html "interface in com.google.android.exoplayer2.source")setDrmSessionManagerProvider​([DrmSessionManagerProvider](../drm/DrmSessionManagerProvider.html "interface in com.google.android.exoplayer2.drm")drmSessionManagerProvider)

Description copied from interface: MediaSource.Factory

Sets the DrmSessionManagerProvider used to obtain a DrmSessionManager for a MediaItem. Specified by:setDrmSessionManagerProvider in interface MediaSource.FactoryReturns:This factory, for convenience.

- 

setLoadErrorHandlingPolicy

public[MediaSourceFactory](../source/MediaSourceFactory.html "interface in com.google.android.exoplayer2.source")setLoadErrorHandlingPolicy​([LoadErrorHandlingPolicy](../upstream/LoadErrorHandlingPolicy.html "interface in com.google.android.exoplayer2.upstream")loadErrorHandlingPolicy)

Description copied from interface: MediaSource.Factory

Sets an optional LoadErrorHandlingPolicy. Specified by:setLoadErrorHandlingPolicy in interface MediaSource.FactoryReturns:This factory, for convenience.

- 

getSupportedTypes

[@ContentType](../C.ContentType.html "annotation in com.google.android.exoplayer2")public @com.google.android.exoplayer2.C.ContentType int[] getSupportedTypes()

Description copied from interface: MediaSource.Factory

Returns the content types supported by media sources created by this factory. Specified by:getSupportedTypes in interface MediaSource.Factory

- 

createMediaSource

public[MediaSource](../source/MediaSource.html "interface in com.google.android.exoplayer2.source")createMediaSource​([MediaItem](../MediaItem.html "class in com.google.android.exoplayer2")mediaItem)

Description copied from interface: MediaSource.Factory

Creates a new MediaSource with the specified MediaItem. Specified by:createMediaSource in interface MediaSource.FactoryParameters:mediaItem - The media item to play.Returns:The new media source.