# DefaultDashChunkSource.RepresentationSegmentIterator

Artifact: [androidx.media3:media3-exoplayer-dash](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/dash/DefaultDashChunkSource.java+class:androidx.media3.exoplayer.dash.DefaultDashChunkSource.RepresentationSegmentIterator)

*** ** * ** ***


```
protected class DefaultDashChunkSource.RepresentationSegmentIterator : BaseMediaChunkIterator
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.media3.exoplayer.source.chunk.BaseMediaChunkIterator](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BaseMediaChunkIterator) ||
|   | ↳ | [androidx.media3.exoplayer.dash.DefaultDashChunkSource.RepresentationSegmentIterator](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.RepresentationSegmentIterator) |

*** ** * ** ***

`https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunkIterator` wrapping a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.RepresentationHolder`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.RepresentationSegmentIterator#RepresentationSegmentIterator(androidx.media3.exoplayer.dash.DefaultDashChunkSource.RepresentationHolder,long,long,long,androidx.media3.exoplayer.dash.DashContentSteeringTracker)( representation: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.RepresentationHolder!, firstAvailableSegmentNum: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, lastAvailableSegmentNum: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, nowPeriodTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, contentSteeringTracker: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashContentSteeringTracker? )` Creates iterator. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.RepresentationSegmentIterator#getChunkEndTimeUs()()` Returns the media end time of the chunk, in microseconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.RepresentationSegmentIterator#getChunkStartTimeUs()()` Returns the media start time of the chunk, in microseconds. |
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSpec!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.RepresentationSegmentIterator#getDataSpec()()` Returns the `https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSpec` used to load the media chunk. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.RepresentationSegmentIterator#getLocationSteeringPriorityIndex()()` Returns the index in the steering priority list of the locations (e.g., DASH service location or HLS pathway) for the current media chunks, or `Integer.MAX_VALUE` if steering is inactive or unavailable. |

### Inherited Constants

From [androidx.media3.exoplayer.source.chunk.MediaChunkIterator](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunkIterator) `const https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunkIterator!` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunkIterator#EMPTY()`

An empty media chunk iterator without available data.

### Inherited functions

From [androidx.media3.exoplayer.source.chunk.BaseMediaChunkIterator](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BaseMediaChunkIterator) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BaseMediaChunkIterator#checkInBounds()()`

Verifies that the iterator points to a valid element.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BaseMediaChunkIterator#isEnded()()`

Returns whether the iteration has reached the end of the available data.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BaseMediaChunkIterator#next()()`

Moves the iterator to the next media chunk.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BaseMediaChunkIterator#reset()()`

Resets the iterator to the initial position.

### Inherited properties

From [androidx.media3.exoplayer.source.chunk.BaseMediaChunkIterator](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BaseMediaChunkIterator) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BaseMediaChunkIterator#currentIndex()`

## Public constructors

### RepresentationSegmentIterator

```
RepresentationSegmentIterator(
    representation: DefaultDashChunkSource.RepresentationHolder!,
    firstAvailableSegmentNum: Long,
    lastAvailableSegmentNum: Long,
    nowPeriodTimeUs: Long,
    contentSteeringTracker: DashContentSteeringTracker?
)
```

Creates iterator.

| Parameters |
|---|---|
| `representation: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.RepresentationHolder!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DefaultDashChunkSource.RepresentationHolder` to wrap. |
| `firstAvailableSegmentNum: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The number of the first available segment. |
| `lastAvailableSegmentNum: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The number of the last available segment. |
| `nowPeriodTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The current time in microseconds since the start of the period used for calculating if segments are available at full network speed. |
| `contentSteeringTracker: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashContentSteeringTracker?` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashContentSteeringTracker`, or `null`. |

## Public functions

### getChunkEndTimeUs

```
fun getChunkEndTimeUs(): Long
```

Returns the media end time of the chunk, in microseconds.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/util/NoSuchElementException.html` | If the method is called before the first call to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunkIterator#next()` or when `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunkIterator#isEnded()` is true. |

### getChunkStartTimeUs

```
fun getChunkStartTimeUs(): Long
```

Returns the media start time of the chunk, in microseconds.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/util/NoSuchElementException.html` | If the method is called before the first call to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunkIterator#next()` or when `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunkIterator#isEnded()` is true. |

### getDataSpec

```
fun getDataSpec(): DataSpec!
```

Returns the `https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSpec` used to load the media chunk.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/util/NoSuchElementException.html` | If the method is called before the first call to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunkIterator#next()` or when `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/MediaChunkIterator#isEnded()` is true. |

### getLocationSteeringPriorityIndex

```
fun getLocationSteeringPriorityIndex(): Int
```

Returns the index in the steering priority list of the locations (e.g., DASH service location or HLS pathway) for the current media chunks, or `Integer.MAX_VALUE` if steering is inactive or unavailable.

The returned index is only meaningful relatively among candidate tracks (i.e. a lower numerical value indicates a higher priority, with `0` being the top priority).