@UnstableApi
abstract class MediaChunk : Chunk

Known direct subclasses
BaseMediaChunk

A base implementation of MediaChunk that outputs to a BaseMediaChunkOutput.

FakeMediaChunk

Fake MediaChunk.

Known indirect subclasses
ContainerMediaChunk

A BaseMediaChunk that uses an Extractor to decode sample data.

SingleSampleMediaChunk

This class is deprecated.

The only use for this class is subtitle playback, but it is only compatible with legacy subtitle decoding, which is not supported by default.


An abstract base class for Chunks that contain media samples.

Summary

Public constructors

MediaChunk(
    dataSource: DataSource!,
    dataSpec: DataSpec!,
    trackFormat: Format!,
    @C.SelectionReason trackSelectionReason: Int,
    trackSelectionData: Any?,
    startTimeUs: Long,
    endTimeUs: Long,
    chunkIndex: Long
)

Public functions

Long

Returns the next chunk index or INDEX_UNSET if it is not known.

abstract Boolean

Returns whether the chunk has been fully loaded.

Public properties

Long

The chunk index, or INDEX_UNSET if it is not known.

Inherited functions

From androidx.media3.exoplayer.source.chunk.Chunk
Long

Returns the number of bytes that have been loaded.

Long

Returns the duration of the chunk in microseconds.

(Mutable)Map<String!, (Mutable)List<String!>!>!

Returns the response headers associated with the last open call.

Uri!

Returns the Uri associated with the last open call.

From androidx.media3.exoplayer.upstream.Loader.Loadable
abstract Unit

Cancels the load.

abstract Unit

Performs the load, returning on completion or cancellation.

Inherited properties

From androidx.media3.exoplayer.source.chunk.Chunk
StatsDataSource!
DataSpec!

The DataSpec that defines the data to be loaded.

Long

The end time of the media contained by the chunk, or TIME_UNSET if the data being loaded does not contain media samples.

Long

Identifies the load task for this loadable.

Long

The start time of the media contained by the chunk, or TIME_UNSET if the data being loaded does not contain media samples.

Format!

The format of the track to which this chunk belongs.

Any?

Optional data associated with the selection of the track to which this chunk belongs.

Int

One of the selection reasons if the chunk belongs to a track.

Int

The data type of the chunk.

Public constructors

MediaChunk

MediaChunk(
    dataSource: DataSource!,
    dataSpec: DataSpec!,
    trackFormat: Format!,
    @C.SelectionReason trackSelectionReason: Int,
    trackSelectionData: Any?,
    startTimeUs: Long,
    endTimeUs: Long,
    chunkIndex: Long
)
Parameters
dataSource: DataSource!

The source from which the data should be loaded.

dataSpec: DataSpec!

Defines the data to be loaded.

trackFormat: Format!

See trackFormat.

@C.SelectionReason trackSelectionReason: Int

See trackSelectionReason.

trackSelectionData: Any?

See trackSelectionData.

startTimeUs: Long

The start time of the media contained by the chunk, in microseconds.

endTimeUs: Long

The end time of the media contained by the chunk, in microseconds.

chunkIndex: Long

The index of the chunk, or INDEX_UNSET if it is not known.

Public functions

getNextChunkIndex

fun getNextChunkIndex(): Long

Returns the next chunk index or INDEX_UNSET if it is not known.

isLoadCompleted

abstract fun isLoadCompleted(): Boolean

Returns whether the chunk has been fully loaded.

Public properties

chunkIndex

val chunkIndexLong

The chunk index, or INDEX_UNSET if it is not known.