Class FilteringMediaSource
- 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.FilteringMediaSource
-
- All Implemented Interfaces:
MediaSource
@Deprecated public class FilteringMediaSource 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 filters the available track types.Media sources loading muxed media, e.g. progressive streams with muxed video and audio, are still likely to parse all of these streams even if the tracks are not made available to the player.
-
-
Nested Class Summary
-
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 FilteringMediaSource(MediaSource mediaSource, @com.google.android.exoplayer2.C.TrackType int trackType)Deprecated.Creates a filteringMediaSourcethat only publishes tracks of one type.FilteringMediaSource(MediaSource mediaSource, Set<@TrackType Integer> trackTypes)Deprecated.Creates a filteringMediaSourcethat only publishes tracks of the given types.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description MediaPeriodcreatePeriod(MediaSource.MediaPeriodId id, Allocator allocator, long startPositionUs)Deprecated.Creates the requestedMediaPeriod.voidreleasePeriod(MediaPeriod mediaPeriod)Deprecated.Releases aMediaPeriod.-
Methods inherited from class com.google.android.exoplayer2.source.WrappingMediaSource
disableChildSource, enableChildSource, getInitialTimeline, getMediaItem, getMediaPeriodIdForChildMediaPeriodId, getMediaPeriodIdForChildMediaPeriodId, getMediaTimeForChildMediaTime, getMediaTimeForChildMediaTime, getWindowIndexForChildWindowIndex, getWindowIndexForChildWindowIndex, isSingleWindow, onChildSourceInfoRefreshed, onChildSourceInfoRefreshed, prepareChildSource, prepareSourceInternal, prepareSourceInternal, releaseChildSource
-
Methods inherited from class com.google.android.exoplayer2.source.CompositeMediaSource
disableChildSource, disableInternal, enableChildSource, enableInternal, maybeThrowSourceInfoRefreshError, prepareChildSource, releaseChildSource, releaseSourceInternal
-
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
-
FilteringMediaSource
public FilteringMediaSource(MediaSource mediaSource, @com.google.android.exoplayer2.C.TrackType int trackType)
Deprecated.Creates a filteringMediaSourcethat only publishes tracks of one type.- Parameters:
mediaSource- The wrappedMediaSource.trackType- The onlyC.TrackTypeto provide from this source.
-
FilteringMediaSource
public FilteringMediaSource(MediaSource mediaSource, Set<@TrackType Integer> trackTypes)
Deprecated.Creates a filteringMediaSourcethat only publishes tracks of the given types.- Parameters:
mediaSource- The wrappedMediaSource.trackTypes- The track types to provide from this source.
-
-
Method Detail
-
createPeriod
public MediaPeriod 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)
-
-