@UnstableApi
public final class MediaLoadData


Descriptor for data being loaded or selected by a MediaSource.

Summary

Public fields

final int

The data type.

final long

The end time of the media in the MediaPeriod, or TIME_UNSET if the data does not belong to a specific MediaPeriod or the end time is unknown.

final long

The start time of the media in the MediaPeriod, or TIME_UNSET if the data does not belong to a specific MediaPeriod.

final @Nullable Format

The format of the track to which the data belongs.

final @Nullable Object

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

final int

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

final int

One of the track types, which is a media track type if the data corresponds to media of a specific type, or TRACK_TYPE_UNKNOWN otherwise.

Public constructors

MediaLoadData(@C.DataType int dataType)

Creates an instance with the given dataType.

MediaLoadData(
    @C.DataType int dataType,
    @C.TrackType int trackType,
    @Nullable Format trackFormat,
    @C.SelectionReason int trackSelectionReason,
    @Nullable Object trackSelectionData,
    long mediaStartTimeMs,
    long mediaEndTimeMs
)

Creates media load data.

Public fields

dataType

@C.DataType
public final int dataType

The data type.

mediaEndTimeMs

public final long mediaEndTimeMs

The end time of the media in the MediaPeriod, or TIME_UNSET if the data does not belong to a specific MediaPeriod or the end time is unknown.

mediaStartTimeMs

public final long mediaStartTimeMs

The start time of the media in the MediaPeriod, or TIME_UNSET if the data does not belong to a specific MediaPeriod.

trackFormat

public final @Nullable Format trackFormat

The format of the track to which the data belongs. Null if the data does not belong to a specific track.

trackSelectionData

public final @Nullable Object trackSelectionData

Optional data associated with the selection of the track to which the data belongs. Null if the data does not belong to a track.

trackSelectionReason

@C.SelectionReason
public final int trackSelectionReason

One of the selection reasons if the data belongs to a track. SELECTION_REASON_UNKNOWN otherwise.

trackType

@C.TrackType
public final int trackType

One of the track types, which is a media track type if the data corresponds to media of a specific type, or TRACK_TYPE_UNKNOWN otherwise.

Public constructors

MediaLoadData

public MediaLoadData(@C.DataType int dataType)

Creates an instance with the given dataType.

MediaLoadData

public MediaLoadData(
    @C.DataType int dataType,
    @C.TrackType int trackType,
    @Nullable Format trackFormat,
    @C.SelectionReason int trackSelectionReason,
    @Nullable Object trackSelectionData,
    long mediaStartTimeMs,
    long mediaEndTimeMs
)

Creates media load data.

Parameters
@C.DataType int dataType

See dataType.

@C.TrackType int trackType

See trackType.

@Nullable Format trackFormat

See trackFormat.

@C.SelectionReason int trackSelectionReason

See trackSelectionReason.

@Nullable Object trackSelectionData

See trackSelectionData.

long mediaStartTimeMs

See mediaStartTimeMs.

long mediaEndTimeMs

See mediaEndTimeMs.