Package com.google.android.exoplayer2.source

## Class MediaLoadData

- java.lang.Object
- - com.google.android.exoplayer2.source.MediaLoadData

-     public final class MediaLoadData
      extends Object

  Descriptor for data being loaded or selected by a `MediaSource`.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `int` | `dataType` | One of the `C` `DATA_TYPE_*` constants defining the type of data.
    `long` | `mediaEndTimeMs` | The end time of the media in the `MediaPeriod`, or `C.TIME_UNSET` if the data does not belong to a specific `MediaPeriod` or the end time is unknown.
    `long` | `mediaStartTimeMs` | The start time of the media in the `MediaPeriod`, or `C.TIME_UNSET` if the data does not belong to a specific `MediaPeriod`.
    `Format` | `trackFormat` | The format of the track to which the data belongs.
    `Object` | `trackSelectionData` | Optional data associated with the selection of the track to which the data belongs.
    `int` | `trackSelectionReason` | One of the `C` `SELECTION_REASON_*` constants if the data belongs to a track.
    `int` | `trackType` | One of the `C` `TRACK_TYPE_*` constants if the data corresponds to media of a specific type.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `MediaLoadData​(int dataType)` | Creates an instance with the given `dataType`.
    `MediaLoadData​(int dataType, int trackType, Format trackFormat, int trackSelectionReason, Object trackSelectionData, long mediaStartTimeMs, long mediaEndTimeMs)` | Creates media load data.

  - ### Method Summary

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### dataType

          public final int dataType

      One of the `C` `DATA_TYPE_*` constants defining the type of data.

    - #### trackType

          public final int trackType

      One of the `C` `TRACK_TYPE_*` constants if the data corresponds to media of a specific type. `C.TRACK_TYPE_UNKNOWN` otherwise.

    - #### trackFormat

          @Nullable
          public final Format trackFormat

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

    - #### trackSelectionReason

          public final int trackSelectionReason

      One of the `C` `SELECTION_REASON_*` constants if the data belongs to a track. `C.SELECTION_REASON_UNKNOWN` otherwise.

    - #### trackSelectionData

          @Nullable
          public final 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.

    - #### mediaStartTimeMs

          public final long mediaStartTimeMs

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

    - #### mediaEndTimeMs

          public final long mediaEndTimeMs

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

  - ### Constructor Detail

    - #### MediaLoadData

          public MediaLoadData​(int dataType)

      Creates an instance with the given `dataType`.

    - #### MediaLoadData

          public MediaLoadData​(int dataType,
                               int trackType,
                               @Nullable
                               Format trackFormat,
                               int trackSelectionReason,
                               @Nullable
                               Object trackSelectionData,
                               long mediaStartTimeMs,
                               long mediaEndTimeMs)

      Creates media load data.
      Parameters:
        `dataType` - See `dataType`.
        `trackType` - See `trackType`.
        `trackFormat` - See `trackFormat`.
        `trackSelectionReason` - See `trackSelectionReason`.
        `trackSelectionData` - See `trackSelectionData`.
        `mediaStartTimeMs` - See `mediaStartTimeMs`.
        `mediaEndTimeMs` - See `mediaEndTimeMs`.