Chunk
@UnstableApi
abstract class Chunk : Loader.Loadable
DataChunk |
A base class for |
InitializationChunk |
A |
MediaChunk |
An abstract base class for |
BaseMediaChunk |
A base implementation of |
ContainerMediaChunk |
A |
FakeMediaChunk |
Fake |
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 Loadable implementations that load chunks of data required for the playback of streams.
Summary
Public constructors |
|---|
Chunk( |
Public functions |
|
|---|---|
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 |
Uri! |
getUri() |
Public properties |
|
|---|---|
DataSpec! |
The |
Long |
The end time of the media contained by the chunk, or |
Long |
Identifies the load task for this loadable. |
Long |
The start time of the media contained by the chunk, or |
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 |
Int |
The |
Protected properties |
|
|---|---|
StatsDataSource! |
Inherited functions |
|---|
Public constructors
Chunk
Chunk(
dataSource: DataSource!,
dataSpec: DataSpec!,
@C.DataType type: Int,
trackFormat: Format!,
@C.SelectionReason trackSelectionReason: Int,
trackSelectionData: Any?,
startTimeUs: Long,
endTimeUs: Long
)
| Parameters | |
|---|---|
dataSource: DataSource! |
The source from which the data should be loaded. |
dataSpec: DataSpec! |
Defines the data to be loaded. |
@C.DataType type: Int |
See |
trackFormat: Format! |
See |
@C.SelectionReason trackSelectionReason: Int |
See |
trackSelectionData: Any? |
See |
startTimeUs: Long |
See |
endTimeUs: Long |
See |
Public functions
bytesLoaded
fun bytesLoaded(): Long
Returns the number of bytes that have been loaded. Must only be called after the load completed, failed, or was canceled.
getResponseHeaders
fun getResponseHeaders(): (Mutable)Map<String!, (Mutable)List<String!>!>!
Returns the response headers associated with the last open call. Must only be called after the load completed, failed, or was canceled.
| See also | |
|---|---|
getResponseHeaders |
Public properties
endTimeUs
val endTimeUs: Long
The end time of the media contained by the chunk, or TIME_UNSET if the data being loaded does not contain media samples.
startTimeUs
val startTimeUs: Long
The start time of the media contained by the chunk, or TIME_UNSET if the data being loaded does not contain media samples.
trackSelectionData
val trackSelectionData: Any?
Optional data associated with the selection of the track to which this chunk belongs. Null if the chunk does not belong to a track, or if there is no associated track selection data.
trackSelectionReason
@C.SelectionReason
val trackSelectionReason: Int
One of the selection reasons if the chunk belongs to a track. SELECTION_REASON_UNKNOWN if the chunk does not belong to a track, or if the selection reason is unknown.