Class MaskingMediaSource
- java.lang.Object
-
- com.google.android.exoplayer2.source.BaseMediaSource
-
- com.google.android.exoplayer2.source.CompositeMediaSource<Void>
-
- com.google.android.exoplayer2.source.WrappingMediaSource
-
- com.google.android.exoplayer2.source.MaskingMediaSource
-
- All Implemented Interfaces:
MediaSource
@Deprecated public final class MaskingMediaSource extends WrappingMediaSource
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.AMediaSource
that masks theTimeline
with a placeholder until the actual media structure is known.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MaskingMediaSource.PlaceholderTimeline
Deprecated.A timeline with one dynamic window with a period of indeterminate duration.-
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.source.WrappingMediaSource
mediaSource
-
-
Constructor Summary
Constructors Constructor Description MaskingMediaSource(MediaSource mediaSource, boolean useLazyPreparation)
Deprecated.Creates the masking media source.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description MaskingMediaPeriod
createPeriod(MediaSource.MediaPeriodId id, Allocator allocator, long startPositionUs)
Deprecated.Creates the requestedMediaPeriod
.protected MediaSource.MediaPeriodId
getMediaPeriodIdForChildMediaPeriodId(MediaSource.MediaPeriodId mediaPeriodId)
Deprecated.Returns theMediaSource.MediaPeriodId
in the wrapping source corresponding to the specifiedMediaSource.MediaPeriodId
in a child source.Timeline
getTimeline()
Deprecated.Returns theTimeline
.void
maybeThrowSourceInfoRefreshError()
Deprecated.Throws any pending error encountered while loading or refreshing source information.protected void
onChildSourceInfoRefreshed(Timeline newTimeline)
Deprecated.Called when the child source info has been refreshed.void
prepareSourceInternal()
Deprecated.Starts source preparation and enables the source, seeBaseMediaSource.prepareSource(MediaSourceCaller, TransferListener, PlayerId)
.void
releasePeriod(MediaPeriod mediaPeriod)
Deprecated.Releases aMediaPeriod
.void
releaseSourceInternal()
Deprecated.Releases the source, seeBaseMediaSource.releaseSource(MediaSourceCaller)
.-
Methods inherited from class com.google.android.exoplayer2.source.WrappingMediaSource
disableChildSource, enableChildSource, getInitialTimeline, getMediaItem, getMediaPeriodIdForChildMediaPeriodId, getMediaTimeForChildMediaTime, getMediaTimeForChildMediaTime, getWindowIndexForChildWindowIndex, getWindowIndexForChildWindowIndex, isSingleWindow, onChildSourceInfoRefreshed, prepareChildSource, prepareSourceInternal, releaseChildSource
-
Methods inherited from class com.google.android.exoplayer2.source.CompositeMediaSource
disableChildSource, disableInternal, enableChildSource, enableInternal, prepareChildSource, releaseChildSource
-
Methods inherited from class com.google.android.exoplayer2.source.BaseMediaSource
addDrmEventListener, addEventListener, createDrmEventDispatcher, createDrmEventDispatcher, createEventDispatcher, createEventDispatcher, createEventDispatcher, createEventDispatcher, disable, enable, getPlayerId, isEnabled, prepareSource, prepareSource, refreshSourceInfo, releaseSource, removeDrmEventListener, removeEventListener
-
-
-
-
Constructor Detail
-
MaskingMediaSource
public MaskingMediaSource(MediaSource mediaSource, boolean useLazyPreparation)
Deprecated.Creates the masking media source.- Parameters:
mediaSource
- AMediaSource
.useLazyPreparation
- Whether themediaSource
is prepared lazily. If false, all manifest loads and other initial preparation steps happen immediately. If true, these initial preparations are triggered only when the player starts buffering the media.
-
-
Method Detail
-
prepareSourceInternal
public void prepareSourceInternal()
Deprecated.Description copied from class:WrappingMediaSource
Starts source preparation and enables the source, seeBaseMediaSource.prepareSource(MediaSourceCaller, TransferListener, PlayerId)
. This method is called at most once until the next call toCompositeMediaSource.releaseSourceInternal()
.- Overrides:
prepareSourceInternal
in classWrappingMediaSource
-
maybeThrowSourceInfoRefreshError
public void maybeThrowSourceInfoRefreshError()
Deprecated.Description copied from interface:MediaSource
Throws any pending error encountered while loading or refreshing source information.Should not be called directly from application code.
This method must be called on the playback thread and only after
MediaSource.prepareSource(MediaSourceCaller, TransferListener, PlayerId)
.- Specified by:
maybeThrowSourceInfoRefreshError
in interfaceMediaSource
- Overrides:
maybeThrowSourceInfoRefreshError
in classCompositeMediaSource<Void>
-
createPeriod
public MaskingMediaPeriod createPeriod(MediaSource.MediaPeriodId id, Allocator allocator, long startPositionUs)
Deprecated.Description copied from class:WrappingMediaSource
Creates the requestedMediaPeriod
.This method typically forwards to the wrapped media source and optionally wraps the returned
MediaPeriod
.- Specified by:
createPeriod
in interfaceMediaSource
- Overrides:
createPeriod
in classWrappingMediaSource
- Parameters:
id
- The identifier of the period.allocator
- AnAllocator
from which to obtain media buffer allocations.startPositionUs
- The expected start position, in microseconds.- Returns:
- A new
MediaPeriod
. - See Also:
MediaSource.createPeriod(MediaPeriodId, Allocator, long)
-
releasePeriod
public void releasePeriod(MediaPeriod mediaPeriod)
Deprecated.Description copied from class:WrappingMediaSource
Releases aMediaPeriod
.This method typically forwards to the wrapped media source and optionally unwraps the provided
MediaPeriod
.- Specified by:
releasePeriod
in interfaceMediaSource
- Overrides:
releasePeriod
in classWrappingMediaSource
- Parameters:
mediaPeriod
- The period to release.- See Also:
MediaSource.releasePeriod(MediaPeriod)
-
releaseSourceInternal
public void releaseSourceInternal()
Deprecated.Description copied from class:BaseMediaSource
Releases the source, seeBaseMediaSource.releaseSource(MediaSourceCaller)
. This method is called exactly once after each call toBaseMediaSource.prepareSourceInternal(TransferListener)
.- Overrides:
releaseSourceInternal
in classCompositeMediaSource<Void>
-
onChildSourceInfoRefreshed
protected void onChildSourceInfoRefreshed(Timeline newTimeline)
Deprecated.Description copied from class:WrappingMediaSource
Called when the child source info has been refreshed.This
Timeline
can be amended if needed, for example usingForwardingTimeline
. TheTimeline
for the wrapping source needs to be published withBaseMediaSource.refreshSourceInfo(Timeline)
.- Overrides:
onChildSourceInfoRefreshed
in classWrappingMediaSource
- Parameters:
newTimeline
- The timeline of the child source.
-
getMediaPeriodIdForChildMediaPeriodId
@Nullable protected MediaSource.MediaPeriodId getMediaPeriodIdForChildMediaPeriodId(MediaSource.MediaPeriodId mediaPeriodId)
Deprecated.Description copied from class:WrappingMediaSource
Returns theMediaSource.MediaPeriodId
in the wrapping source corresponding to the specifiedMediaSource.MediaPeriodId
in a child source. The default implementation does not change the media period id.- Overrides:
getMediaPeriodIdForChildMediaPeriodId
in classWrappingMediaSource
- Parameters:
mediaPeriodId
- AMediaSource.MediaPeriodId
of the child source.- Returns:
- The corresponding
MediaSource.MediaPeriodId
in the wrapping source. Null if no corresponding media period id can be determined.
-
-