Package com.google.android.exoplayer2.source.chunk

## Interface MediaChunkIterator

- All Known Implementing Classes:
    `BaseMediaChunkIterator`, `DefaultDashChunkSource.RepresentationSegmentIterator`, `FakeAdaptiveDataSet.Iterator`, `FakeMediaChunkIterator`

      public interface MediaChunkIterator

  Iterator for media chunk sequences.

  The iterator initially points in front of the first available element. The first call to `next()` moves the iterator to the first element. Check the return value of `next()` or `isEnded()` to determine whether the iterator reached the end of the available data.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static MediaChunkIterator` | `EMPTY` | An empty media chunk iterator without available data.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `long` | `getChunkEndTimeUs()` | Returns the media end time of the chunk, in microseconds.
    `long` | `getChunkStartTimeUs()` | Returns the media start time of the chunk, in microseconds.
    `DataSpec` | `getDataSpec()` | Returns the `DataSpec` used to load the media chunk.
    `boolean` | `isEnded()` | Returns whether the iteration has reached the end of the available data.
    `boolean` | `next()` | Moves the iterator to the next media chunk.
    `void` | `reset()` | Resets the iterator to the initial position.

- - ### Field Detail

    - #### EMPTY

          static final MediaChunkIterator EMPTY

      An empty media chunk iterator without available data.

  - ### Method Detail

    - #### isEnded

          boolean isEnded()

      Returns whether the iteration has reached the end of the available data.

    - #### next

          boolean next()

      Moves the iterator to the next media chunk.

      Check the return value or `isEnded()` to determine whether the iterator reached the end of the available data.

      Returns:
        Whether the iterator points to a media chunk with available data.

    - #### getDataSpec

          DataSpec getDataSpec()

      Returns the `DataSpec` used to load the media chunk.
      Throws:
        `NoSuchElementException` - If the method is called before the first call to `next()` or when `isEnded()` is true.

    - #### getChunkStartTimeUs

          long getChunkStartTimeUs()

      Returns the media start time of the chunk, in microseconds.
      Throws:
        `NoSuchElementException` - If the method is called before the first call to `next()` or when `isEnded()` is true.

    - #### getChunkEndTimeUs

          long getChunkEndTimeUs()

      Returns the media end time of the chunk, in microseconds.
      Throws:
        `NoSuchElementException` - If the method is called before the first call to `next()` or when `isEnded()` is true.

    - #### reset

          void reset()

      Resets the iterator to the initial position.