# Representation.MultiSegmentRepresentation

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/manifest/Representation.java+class:androidx.media3.exoplayer.dash.manifest.Representation.MultiSegmentRepresentation)

*** ** * ** ***


```
class Representation.MultiSegmentRepresentation : Representation, DashSegmentIndex
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.media3.exoplayer.dash.manifest.Representation](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation) ||
|   | ↳ | [androidx.media3.exoplayer.dash.manifest.Representation.MultiSegmentRepresentation](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation.MultiSegmentRepresentation) |

*** ** * ** ***

A DASH representation consisting of multiple segments.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation.MultiSegmentRepresentation#MultiSegmentRepresentation(long,androidx.media3.common.Format,java.util.List<androidx.media3.exoplayer.dash.manifest.BaseUrl>,androidx.media3.exoplayer.dash.manifest.SegmentBase.MultiSegmentBase,java.util.List<androidx.media3.exoplayer.dash.manifest.Descriptor>,java.util.List<androidx.media3.exoplayer.dash.manifest.Descriptor>,java.util.List<androidx.media3.exoplayer.dash.manifest.Descriptor>)( revisionId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, format: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!, baseUrls: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/BaseUrl!>!, segmentBase: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase!, inbandEventStreams: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Descriptor!>?, essentialProperties: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Descriptor!>!, supplementalProperties: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Descriptor!>! )` Creates the multi-segment Representation. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation.MultiSegmentRepresentation#getAvailableSegmentCount(long,long)(periodDurationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, nowUnixTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Returns the number of available segments in the index. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation.MultiSegmentRepresentation#getCacheKey()()` Returns a cache key for the representation if set, or null. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation.MultiSegmentRepresentation#getDurationUs(long,long)(segmentNum: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, periodDurationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Returns the duration of a segment. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation.MultiSegmentRepresentation#getFirstAvailableSegmentNum(long,long)(periodDurationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, nowUnixTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Returns the segment number of the first available segment in the index. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation.MultiSegmentRepresentation#getFirstSegmentNum()()` Returns the segment number of the first defined segment in the index. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashSegmentIndex!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation.MultiSegmentRepresentation#getIndex()()` Returns an index if the representation provides one directly, or null otherwise. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation.MultiSegmentRepresentation#getIndexUri()()` Returns a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri` defining the location of the representation's segment index, or null if the representation provides an index directly. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation.MultiSegmentRepresentation#getNextSegmentAvailableTimeUs(long,long)( periodDurationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, nowUnixTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` Returns the time, in microseconds, at which a new segment becomes available, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if not applicable. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation.MultiSegmentRepresentation#getSegmentCount(long)(periodDurationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Returns the number of segments defined in the index, or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashSegmentIndex#INDEX_UNBOUNDED()`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation.MultiSegmentRepresentation#getSegmentNum(long,long)(timeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, periodDurationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Returns `getFirstSegmentNum()` if the index has no segments or if the given media time is earlier than the start of the first segment. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation.MultiSegmentRepresentation#getSegmentUrl(long)(segmentNum: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Returns a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri` defining the location of a segment. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation.MultiSegmentRepresentation#getTimeUs(long)(segmentNum: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Returns the start time of a segment. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation.MultiSegmentRepresentation#isExplicit()()` Returns true if segments are defined explicitly by the index. |

### Inherited Constants

From [androidx.media3.exoplayer.dash.DashSegmentIndex](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashSegmentIndex) `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashSegmentIndex#INDEX_UNBOUNDED() = -1` From [androidx.media3.exoplayer.dash.manifest.Representation](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation) `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation#REVISION_ID_DEFAULT() = -1`

A default value for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation#revisionId()`.

### Inherited functions

From [androidx.media3.exoplayer.dash.manifest.Representation](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation) `java-static https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation!` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation#newInstance(long,androidx.media3.common.Format,java.util.List<androidx.media3.exoplayer.dash.manifest.BaseUrl>,androidx.media3.exoplayer.dash.manifest.SegmentBase)(
revisionId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html,
format: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!,
baseUrls: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/BaseUrl!>!,
segmentBase: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase!
)`

Constructs a new instance.
`java-static https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation!` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation#newInstance(long,androidx.media3.common.Format,java.util.List<androidx.media3.exoplayer.dash.manifest.BaseUrl>,androidx.media3.exoplayer.dash.manifest.SegmentBase,java.util.List<androidx.media3.exoplayer.dash.manifest.Descriptor>,java.util.List<androidx.media3.exoplayer.dash.manifest.Descriptor>,java.util.List<androidx.media3.exoplayer.dash.manifest.Descriptor>,java.lang.String)(
revisionId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html,
format: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!,
baseUrls: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/BaseUrl!>!,
segmentBase: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase!,
inbandEventStreams: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Descriptor!>?,
essentialProperties: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Descriptor!>!,
supplementalProperties: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Descriptor!>!,
cacheKey: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?
)`

Constructs a new instance.

### Inherited properties

From [androidx.media3.exoplayer.dash.manifest.Representation](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation) `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/BaseUrl!>!` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation#baseUrls()`

The base URLs of the representation.
`(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Descriptor!>!` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation#essentialProperties()`

Essential properties in the representation.
`https://developer.android.com/reference/kotlin/androidx/media3/common/Format!` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation#format()`

The format of the representation.
`(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Descriptor!>!` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation#inbandEventStreams()`

The in-band event streams in the representation.
`https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri?` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation#initializationUri()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation#presentationTimeOffsetUs()`

The offset of the presentation timestamps in the media stream relative to media time.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation#revisionId()`

Identifies the revision of the media contained within the representation.
`(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Descriptor!>!` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation#supplementalProperties()`

Supplemental properties in the adaptation set.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation#timescale()`

The timescale of the representation in units per second.

## Public constructors

### MultiSegmentRepresentation

```
MultiSegmentRepresentation(
    revisionId: Long,
    format: Format!,
    baseUrls: (Mutable)List<BaseUrl!>!,
    segmentBase: SegmentBase.MultiSegmentBase!,
    inbandEventStreams: (Mutable)List<Descriptor!>?,
    essentialProperties: (Mutable)List<Descriptor!>!,
    supplementalProperties: (Mutable)List<Descriptor!>!
)
```

Creates the multi-segment Representation.

| Parameters |
|---|---|
| `revisionId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | Identifies the revision of the content. |
| `format: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!` | The format of the representation. |
| `baseUrls: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/BaseUrl!>!` | The base URLs of the representation. |
| `segmentBase: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase!` | The segment base underlying the representation. |
| `inbandEventStreams: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Descriptor!>?` | The in-band event streams in the representation. May be null. |
| `essentialProperties: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Descriptor!>!` | Essential properties in the representation. May be empty. |
| `supplementalProperties: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Descriptor!>!` | Supplemental properties in the representation. May be empty. |

## Public functions

### getAvailableSegmentCount

```
fun getAvailableSegmentCount(periodDurationUs: Long, nowUnixTimeUs: Long): Long
```

Returns the number of available segments in the index.

| Parameters |
|---|---|
| `periodDurationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The duration of the enclosing period in microseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if the period's duration is not yet known. |
| `nowUnixTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The current time in milliseconds since the Unix epoch. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The number of available segments in the index. |

### getCacheKey

```
fun getCacheKey(): String?
```

Returns a cache key for the representation if set, or null.

### getDurationUs

```
fun getDurationUs(segmentNum: Long, periodDurationUs: Long): Long
```

Returns the duration of a segment.

| Parameters |
|---|---|
| `segmentNum: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The segment number. |
| `periodDurationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The duration of the enclosing period in microseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if the period's duration is not yet known. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The duration of the segment, in microseconds. |

### getFirstAvailableSegmentNum

```
fun getFirstAvailableSegmentNum(periodDurationUs: Long, nowUnixTimeUs: Long): Long
```

Returns the segment number of the first available segment in the index.

| Parameters |
|---|---|
| `periodDurationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The duration of the enclosing period in microseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if the period's duration is not yet known. |
| `nowUnixTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The current time in milliseconds since the Unix epoch. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The number of the first available segment. |

### getFirstSegmentNum

```
fun getFirstSegmentNum(): Long
```

Returns the segment number of the first defined segment in the index.

### getIndex

```
fun getIndex(): DashSegmentIndex!
```

Returns an index if the representation provides one directly, or null otherwise.

### getIndexUri

```
fun getIndexUri(): RangedUri?
```

Returns a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri` defining the location of the representation's segment index, or null if the representation provides an index directly.

### getNextSegmentAvailableTimeUs

```
fun getNextSegmentAvailableTimeUs(
    periodDurationUs: Long,
    nowUnixTimeUs: Long
): Long
```

Returns the time, in microseconds, at which a new segment becomes available, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if not applicable.

| Parameters |
|---|---|
| `periodDurationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The duration of the enclosing period in microseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if the period's duration is not yet known. |
| `nowUnixTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The current time in milliseconds since the Unix epoch. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The time, in microseconds, at which a new segment becomes available, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if not applicable. |

### getSegmentCount

```
fun getSegmentCount(periodDurationUs: Long): Long
```

Returns the number of segments defined in the index, or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashSegmentIndex#INDEX_UNBOUNDED()`.

An unbounded index occurs if a dynamic manifest uses SegmentTemplate elements without a SegmentTimeline element, and if the period duration is not yet known. In this case the caller can query the available segment using `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashSegmentIndex#getFirstAvailableSegmentNum(long,long)` and `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashSegmentIndex#getAvailableSegmentCount(long,long)`.

| Parameters |
|---|---|
| `periodDurationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The duration of the enclosing period in microseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if the period's duration is not yet known. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The number of segments in the index, or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/DashSegmentIndex#INDEX_UNBOUNDED()`. |

### getSegmentNum

```
fun getSegmentNum(timeUs: Long, periodDurationUs: Long): Long
```

Returns `getFirstSegmentNum()` if the index has no segments or if the given media time is earlier than the start of the first segment. Returns `getFirstSegmentNum() +
getSegmentCount() - 1` if the given media time is later than the end of the last segment. Otherwise, returns the segment number of the segment containing the given media time.

| Parameters |
|---|---|
| `timeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The time in microseconds. |
| `periodDurationUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The duration of the enclosing period in microseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if the period's duration is not yet known. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The segment number of the corresponding segment. |

### getSegmentUrl

```
fun getSegmentUrl(segmentNum: Long): RangedUri!
```

Returns a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri` defining the location of a segment.

| Parameters |
|---|---|
| `segmentNum: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The segment number. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri` defining the location of the data. |

### getTimeUs

```
fun getTimeUs(segmentNum: Long): Long
```

Returns the start time of a segment.

| Parameters |
|---|---|
| `segmentNum: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The segment number. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The corresponding start time in microseconds. |

### isExplicit

```
fun isExplicit(): Boolean
```

Returns true if segments are defined explicitly by the index.

If true is returned, each segment is defined explicitly by the index data, and all of the listed segments are guaranteed to be available at the time when the index was obtained.

If false is returned then segment information was derived from properties such as a fixed segment duration. If the presentation is dynamic, it's possible that only a subset of the segments are available.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether segments are defined explicitly by the index. |