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.AMediaSourcethat masks theTimelinewith a placeholder until the actual media structure is known.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMaskingMediaSource.PlaceholderTimelineDeprecated.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 MaskingMediaPeriodcreatePeriod(MediaSource.MediaPeriodId id, Allocator allocator, long startPositionUs)Deprecated.Creates the requestedMediaPeriod.protected MediaSource.MediaPeriodIdgetMediaPeriodIdForChildMediaPeriodId(MediaSource.MediaPeriodId mediaPeriodId)Deprecated.Returns theMediaSource.MediaPeriodIdin the wrapping source corresponding to the specifiedMediaSource.MediaPeriodIdin a child source.TimelinegetTimeline()Deprecated.Returns theTimeline.voidmaybeThrowSourceInfoRefreshError()Deprecated.Throws any pending error encountered while loading or refreshing source information.protected voidonChildSourceInfoRefreshed(Timeline newTimeline)Deprecated.Called when the child source info has been refreshed.voidprepareSourceInternal()Deprecated.Starts source preparation and enables the source, seeBaseMediaSource.prepareSource(MediaSourceCaller, TransferListener, PlayerId).voidreleasePeriod(MediaPeriod mediaPeriod)Deprecated.Releases aMediaPeriod.voidreleaseSourceInternal()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 themediaSourceis 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:WrappingMediaSourceStarts 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:
prepareSourceInternalin classWrappingMediaSource
-
maybeThrowSourceInfoRefreshError
public void maybeThrowSourceInfoRefreshError()
Deprecated.Description copied from interface:MediaSourceThrows 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:
maybeThrowSourceInfoRefreshErrorin interfaceMediaSource- Overrides:
maybeThrowSourceInfoRefreshErrorin classCompositeMediaSource<Void>
-
createPeriod
public MaskingMediaPeriod createPeriod(MediaSource.MediaPeriodId id, Allocator allocator, long startPositionUs)
Deprecated.Description copied from class:WrappingMediaSourceCreates the requestedMediaPeriod.This method typically forwards to the wrapped media source and optionally wraps the returned
MediaPeriod.- Specified by:
createPeriodin interfaceMediaSource- Overrides:
createPeriodin classWrappingMediaSource- Parameters:
id- The identifier of the period.allocator- AnAllocatorfrom 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:WrappingMediaSourceReleases aMediaPeriod.This method typically forwards to the wrapped media source and optionally unwraps the provided
MediaPeriod.- Specified by:
releasePeriodin interfaceMediaSource- Overrides:
releasePeriodin classWrappingMediaSource- Parameters:
mediaPeriod- The period to release.- See Also:
MediaSource.releasePeriod(MediaPeriod)
-
releaseSourceInternal
public void releaseSourceInternal()
Deprecated.Description copied from class:BaseMediaSourceReleases the source, seeBaseMediaSource.releaseSource(MediaSourceCaller). This method is called exactly once after each call toBaseMediaSource.prepareSourceInternal(TransferListener).- Overrides:
releaseSourceInternalin classCompositeMediaSource<Void>
-
onChildSourceInfoRefreshed
protected void onChildSourceInfoRefreshed(Timeline newTimeline)
Deprecated.Description copied from class:WrappingMediaSourceCalled when the child source info has been refreshed.This
Timelinecan be amended if needed, for example usingForwardingTimeline. TheTimelinefor the wrapping source needs to be published withBaseMediaSource.refreshSourceInfo(Timeline).- Overrides:
onChildSourceInfoRefreshedin classWrappingMediaSource- Parameters:
newTimeline- The timeline of the child source.
-
getMediaPeriodIdForChildMediaPeriodId
@Nullable protected MediaSource.MediaPeriodId getMediaPeriodIdForChildMediaPeriodId(MediaSource.MediaPeriodId mediaPeriodId)
Deprecated.Description copied from class:WrappingMediaSourceReturns theMediaSource.MediaPeriodIdin the wrapping source corresponding to the specifiedMediaSource.MediaPeriodIdin a child source. The default implementation does not change the media period id.- Overrides:
getMediaPeriodIdForChildMediaPeriodIdin classWrappingMediaSource- Parameters:
mediaPeriodId- AMediaSource.MediaPeriodIdof the child source.- Returns:
- The corresponding
MediaSource.MediaPeriodIdin the wrapping source. Null if no corresponding media period id can be determined.
-
-