Back to Exoplayer

MaskingMediaSource (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/source/MaskingMediaSource.html

latest13.6 KB
Original Source

Package com.google.android.exoplayer2.source

Class MaskingMediaSource


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classMaskingMediaSourceextends[WrappingMediaSource](WrappingMediaSource.html "class in com.google.android.exoplayer2.source")

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.

A MediaSource that masks the Timeline 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 requested MediaPeriod. | | protected MediaSource.MediaPeriodId | getMediaPeriodIdForChildMediaPeriodId​(MediaSource.MediaPeriodId mediaPeriodId) | Deprecated.

Returns the MediaSource.MediaPeriodId in the wrapping source corresponding to the specified MediaSource.MediaPeriodId in a child source. | | Timeline | getTimeline() | Deprecated.

Returns the Timeline. | | 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, see BaseMediaSource.prepareSource(MediaSourceCaller, TransferListener, PlayerId). | | void | releasePeriod​(MediaPeriod mediaPeriod) | Deprecated.

Releases a MediaPeriod. | | void | releaseSourceInternal() | Deprecated.

Releases the source, see BaseMediaSource.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

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

- 

MaskingMediaSource

public MaskingMediaSource​([MediaSource](MediaSource.html "interface in com.google.android.exoplayer2.source")mediaSource,
                          boolean useLazyPreparation)

Deprecated.

Creates the masking media source. Parameters:mediaSource - A MediaSource.useLazyPreparation - Whether the mediaSource 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

- 

getTimeline

public[Timeline](../Timeline.html "class in com.google.android.exoplayer2")getTimeline()

Deprecated.

Returns the Timeline.

- 

prepareSourceInternal

public void prepareSourceInternal()

Deprecated.

Description copied from class: WrappingMediaSource

Starts source preparation and enables the source, see BaseMediaSource.prepareSource(MediaSourceCaller, TransferListener, PlayerId). This method is called at most once until the next call to CompositeMediaSource.releaseSourceInternal(). Overrides:prepareSourceInternal in class WrappingMediaSource

- 

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 interface MediaSourceOverrides:maybeThrowSourceInfoRefreshError in class CompositeMediaSource<Void>

- 

createPeriod

public[MaskingMediaPeriod](MaskingMediaPeriod.html "class in com.google.android.exoplayer2.source")createPeriod​([MediaSource.MediaPeriodId](MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")id,[Allocator](../upstream/Allocator.html "interface in com.google.android.exoplayer2.upstream")allocator,
                                       long startPositionUs)

Deprecated.

Description copied from class: WrappingMediaSource

Creates the requested MediaPeriod.

This method typically forwards to the wrapped media source and optionally wraps the returned MediaPeriod.

Specified by:createPeriod in interface MediaSourceOverrides:createPeriod in class WrappingMediaSourceParameters:id - The identifier of the period.allocator - An Allocator 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.html "interface in com.google.android.exoplayer2.source")mediaPeriod)

Deprecated.

Description copied from class: WrappingMediaSource

Releases a MediaPeriod.

This method typically forwards to the wrapped media source and optionally unwraps the provided MediaPeriod.

Specified by:releasePeriod in interface MediaSourceOverrides:releasePeriod in class WrappingMediaSourceParameters:mediaPeriod - The period to release.See Also:MediaSource.releasePeriod(MediaPeriod)

- 

releaseSourceInternal

public void releaseSourceInternal()

Deprecated.

Description copied from class: BaseMediaSource

Releases the source, see BaseMediaSource.releaseSource(MediaSourceCaller). This method is called exactly once after each call to BaseMediaSource.prepareSourceInternal(TransferListener). Overrides:releaseSourceInternal in class CompositeMediaSource<Void>

- 

onChildSourceInfoRefreshed

protected void onChildSourceInfoRefreshed​([Timeline](../Timeline.html "class in com.google.android.exoplayer2")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 using ForwardingTimeline. The Timeline for the wrapping source needs to be published with BaseMediaSource.refreshSourceInfo(Timeline).

Overrides:onChildSourceInfoRefreshed in class WrappingMediaSourceParameters:newTimeline - The timeline of the child source.

- 

getMediaPeriodIdForChildMediaPeriodId

@Nullable
protected[MediaSource.MediaPeriodId](MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")getMediaPeriodIdForChildMediaPeriodId​([MediaSource.MediaPeriodId](MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId)

Deprecated.

Description copied from class: WrappingMediaSource

Returns the MediaSource.MediaPeriodId in the wrapping source corresponding to the specified MediaSource.MediaPeriodId in a child source. The default implementation does not change the media period id. Overrides:getMediaPeriodIdForChildMediaPeriodId in class WrappingMediaSourceParameters:mediaPeriodId - A MediaSource.MediaPeriodId of the child source.Returns:The corresponding MediaSource.MediaPeriodId in the wrapping source. Null if no corresponding media period id can be determined.