SingleSampleMediaSource


@UnstableApi
public final class SingleSampleMediaSource extends BaseMediaSource


Summary

Nested types

This class is deprecated. Deprecated in Java

Public fields

final MediaItem

This field is deprecated. Deprecated in Java

Public methods

MediaPeriod
createPeriod(
    MediaSource.MediaPeriodId id,
    Allocator allocator,
    long startPositionUs
)

This method is deprecated. Deprecated in Java

MediaItem

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

Protected methods

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

Inherited fields

From androidx.media3.exoplayer.source.BaseMediaSource
@Nullable BandwidthMeter

This field is deprecated. Deprecated in Java

@Nullable PlayerId

This field is deprecated. Deprecated in Java

Inherited methods

From androidx.media3.exoplayer.source.BaseMediaSource
final void
@UnstableApi
addDrmEventListener(
    Handler handler,
    DrmSessionEventListener eventListener
)

This method is deprecated. Deprecated in Java

final void
@UnstableApi
addEventListener(
    Handler handler,
    MediaSourceEventListener eventListener
)

This method is deprecated. Deprecated in Java

final DrmSessionEventListener.EventDispatcher

This method is deprecated. Deprecated in Java

final DrmSessionEventListener.EventDispatcher
createDrmEventDispatcher(
    int windowIndex,
    @Nullable MediaSource.MediaPeriodId mediaPeriodId
)

This method is deprecated. Deprecated in Java

final MediaSourceEventListener.EventDispatcher

This method is deprecated. Deprecated in Java

final MediaSourceEventListener.EventDispatcher
createEventDispatcher(
    MediaSource.MediaPeriodId mediaPeriodId,
    long mediaTimeOffsetMs
)

This method is deprecated.

Use createEventDispatcher instead.

final MediaSourceEventListener.EventDispatcher
createEventDispatcher(
    int windowIndex,
    @Nullable MediaSource.MediaPeriodId mediaPeriodId
)

This method is deprecated. Deprecated in Java

final MediaSourceEventListener.EventDispatcher
createEventDispatcher(
    int windowIndex,
    @Nullable MediaSource.MediaPeriodId mediaPeriodId,
    long mediaTimeOffsetMs
)

This method is deprecated.

Use createEventDispatcher instead.

final void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

final void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

final BandwidthMeter

This method is deprecated. Deprecated in Java

final PlayerId

This method is deprecated. Deprecated in Java

final boolean

This method is deprecated. Deprecated in Java

final void
@UnstableApi
prepareSource(
    MediaSource.MediaSourceCaller caller,
    PlayerId playerId,
    BandwidthMeter bandwidthMeter
)

This method is deprecated. Deprecated in Java

final boolean

This method is deprecated. Deprecated in Java

final void

This method is deprecated. Deprecated in Java

final void

This method is deprecated. Deprecated in Java

final void

This method is deprecated. Deprecated in Java

final void

This method is deprecated. Deprecated in Java

final void

This method is deprecated. Deprecated in Java

final void

This method is deprecated. Deprecated in Java

From androidx.media3.exoplayer.source.MediaSource
boolean

This method is deprecated. Deprecated in Java

@Nullable Timeline

This method is deprecated. Deprecated in Java

boolean

This method is deprecated. Deprecated in Java

void
@UnstableApi
prepareSource(
    MediaSource.MediaSourceCaller caller,
    @Nullable TransferListener mediaTransferListener,
    PlayerId playerId
)

This method is deprecated.

Use prepareSource instead.

void

This method is deprecated. Deprecated in Java

Public fields

mediaItem

public final MediaItem mediaItem

Public methods

createPeriod

public MediaPeriod createPeriod(
    MediaSource.MediaPeriodId id,
    Allocator allocator,
    long startPositionUs
)

Returns a new MediaPeriod identified by periodId.

Should not be called directly from application code.

This method must be called on the playback thread and only if the source is enabled.

Parameters
MediaSource.MediaPeriodId id

The identifier of the period.

Allocator allocator

An Allocator from which to obtain media buffer allocations.

long startPositionUs

The expected start position, in microseconds.

Returns
MediaPeriod

A new MediaPeriod.

getMediaItem

public MediaItem getMediaItem()

Returns the MediaItem whose media is provided by the source.

Should not be called directly from application code.

This method must be called on the application thread.

maybeThrowSourceInfoRefreshError

public void maybeThrowSourceInfoRefreshError()

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 prepareSource.

releasePeriod

public void releasePeriod(MediaPeriod mediaPeriod)

Releases the period.

Should not be called directly from application code.

This method must be called on the playback thread.

Parameters
MediaPeriod mediaPeriod

The period to release.

Protected methods

prepareSourceInternal

protected void prepareSourceInternal(@Nullable TransferListener mediaTransferListener)

Starts source preparation and enables the source, see prepareSource. This method is called at most once until the next call to releaseSourceInternal.

This method is called on the playback thread.

Parameters
@Nullable TransferListener mediaTransferListener

The transfer listener which should be informed of any media data transfers. May be null if no listener is available. Note that this listener should usually be only informed of transfers related to the media loads and not of auxiliary loads for manifests and other data.

releaseSourceInternal

protected void releaseSourceInternal()

Releases the source, see releaseSource. This method is called exactly once after each call to prepareSourceInternal.

This method is called on the playback thread.