Class FakeAdaptiveMediaSource
- java.lang.Object
-
- com.google.android.exoplayer2.source.BaseMediaSource
-
- com.google.android.exoplayer2.testutil.FakeMediaSource
-
- com.google.android.exoplayer2.testutil.FakeAdaptiveMediaSource
-
- All Implemented Interfaces:
MediaSource
public class FakeAdaptiveMediaSource extends FakeMediaSource
FakeMediaSource
that provides a given timeline. Creating the period returns aFakeAdaptiveMediaPeriod
from the givenTrackGroupArray
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.android.exoplayer2.testutil.FakeMediaSource
FakeMediaSource.InitialTimeline
-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.source.MediaSource
MediaSource.Factory, MediaSource.MediaPeriodId, MediaSource.MediaSourceCaller
-
-
Field Summary
-
Fields inherited from class com.google.android.exoplayer2.testutil.FakeMediaSource
FAKE_MEDIA_ITEM
-
-
Constructor Summary
Constructors Constructor Description FakeAdaptiveMediaSource(Timeline timeline, TrackGroupArray trackGroupArray, FakeChunkSource.Factory chunkSourceFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MediaPeriod
createMediaPeriod(MediaSource.MediaPeriodId id, TrackGroupArray trackGroupArray, Allocator allocator, MediaSourceEventListener.EventDispatcher mediaSourceEventDispatcher, DrmSessionManager drmSessionManager, DrmSessionEventListener.EventDispatcher drmEventDispatcher, TransferListener transferListener)
Creates aMediaPeriod
for this media source.void
releaseMediaPeriod(MediaPeriod mediaPeriod)
-
Methods inherited from class com.google.android.exoplayer2.testutil.FakeMediaSource
assertMediaPeriodCreated, assertReleased, createPeriod, createWithWindowId, getCreatedMediaPeriods, getInitialTimeline, getMediaItem, getTimeline, isPrepared, isSingleWindow, maybeThrowSourceInfoRefreshError, prepareSourceInternal, releasePeriod, releaseSourceInternal, setAllowPreparation, setNewSourceInfo, setNewSourceInfo
-
Methods inherited from class com.google.android.exoplayer2.source.BaseMediaSource
addDrmEventListener, addEventListener, createDrmEventDispatcher, createDrmEventDispatcher, createEventDispatcher, createEventDispatcher, createEventDispatcher, disable, disableInternal, enable, enableInternal, getPlayerId, isEnabled, prepareSource, refreshSourceInfo, releaseSource, removeDrmEventListener, removeEventListener
-
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
prepareSource
-
-
-
-
Constructor Detail
-
FakeAdaptiveMediaSource
public FakeAdaptiveMediaSource(Timeline timeline, TrackGroupArray trackGroupArray, FakeChunkSource.Factory chunkSourceFactory)
-
-
Method Detail
-
createMediaPeriod
protected MediaPeriod createMediaPeriod(MediaSource.MediaPeriodId id, TrackGroupArray trackGroupArray, Allocator allocator, MediaSourceEventListener.EventDispatcher mediaSourceEventDispatcher, DrmSessionManager drmSessionManager, DrmSessionEventListener.EventDispatcher drmEventDispatcher, @Nullable TransferListener transferListener)
Description copied from class:FakeMediaSource
Creates aMediaPeriod
for this media source.- Overrides:
createMediaPeriod
in classFakeMediaSource
- Parameters:
id
- The identifier of the period.trackGroupArray
- TheTrackGroupArray
supported by the media period.allocator
- AnAllocator
from which to obtain media buffer allocations.mediaSourceEventDispatcher
- AnMediaSourceEventListener.EventDispatcher
to dispatch media source events.drmEventDispatcher
- AnMediaSourceEventListener.EventDispatcher
to dispatch DRM events.transferListener
- The transfer listener which should be informed of any data transfers. May be null if no listener is available.- Returns:
- A new
FakeMediaPeriod
.
-
releaseMediaPeriod
public void releaseMediaPeriod(MediaPeriod mediaPeriod)
Description copied from class:FakeMediaSource
Releases a media period created byFakeMediaSource.createMediaPeriod(MediaPeriodId, TrackGroupArray, Allocator, MediaSourceEventListener.EventDispatcher, DrmSessionManager, DrmSessionEventListener.EventDispatcher, TransferListener)
.- Overrides:
releaseMediaPeriod
in classFakeMediaSource
-
-