# SegmentBase.MultiSegmentBase

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

*** ** * ** ***


```
public abstract class SegmentBase.MultiSegmentBase extends SegmentBase
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.media3.exoplayer.dash.manifest.SegmentBase](https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase) ||
|   | ↳ | [androidx.media3.exoplayer.dash.manifest.SegmentBase.MultiSegmentBase](https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase) |

Known direct subclasses [SegmentBase.SegmentList](https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase.SegmentList), [SegmentBase.SegmentTemplate](https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase.SegmentTemplate)

|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase.SegmentList` | A `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase` that uses a SegmentList to define its segments. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase.SegmentTemplate` | A `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase` that uses a SegmentTemplate to define its segments. |

*** ** * ** ***

A `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase` that consists of multiple segments.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase#MultiSegmentBase(androidx.media3.exoplayer.dash.manifest.RangedUri,long,long,long,long,java.util.List<androidx.media3.exoplayer.dash.manifest.SegmentBase.SegmentTimelineElement>,long,long,long)( @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/RangedUri initialization, long timescale, long presentationTimeOffset, long startNumber, long duration, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase.SegmentTimelineElement> segmentTimeline, long availabilityTimeOffsetUs, long timeShiftBufferDepthUs, long periodStartUnixTimeUs )` |

| ### Public methods |
|---|---|
| `long` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase#getAvailableSegmentCount(long,long)(long periodDurationUs, long nowUnixTimeUs)` See `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashSegmentIndex#getAvailableSegmentCount(long,long)`. |
| `long` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase#getFirstAvailableSegmentNum(long,long)(long periodDurationUs, long nowUnixTimeUs)` See `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashSegmentIndex#getFirstAvailableSegmentNum(long,long)`. |
| `long` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase#getFirstSegmentNum()()` See `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashSegmentIndex#getFirstSegmentNum()`. |
| `long` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase#getNextSegmentAvailableTimeUs(long,long)( long periodDurationUs, long nowUnixTimeUs )` See `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashSegmentIndex#getNextSegmentAvailableTimeUs(long,long)`. |
| `abstract long` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase#getSegmentCount(long)(long periodDurationUs)` See `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashSegmentIndex#getSegmentCount(long)`. |
| `final long` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase#getSegmentDurationUs(long,long)(long sequenceNumber, long periodDurationUs)` See `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashSegmentIndex#getDurationUs(long,long)`. |
| `long` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase#getSegmentNum(long,long)(long timeUs, long periodDurationUs)` See `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashSegmentIndex#getSegmentNum(long,long)`. |
| `final long` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase#getSegmentTimeUs(long)(long sequenceNumber)` See `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashSegmentIndex#getTimeUs(long)`. |
| `abstract https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/RangedUri` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase#getSegmentUrl(androidx.media3.exoplayer.dash.manifest.Representation,long)(https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/Representation representation, long index)` Returns a `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/RangedUri` defining the location of a segment for the given index in the given representation. |
| `boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase#isExplicit()()` See `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashSegmentIndex#isExplicit()` |

| ### Inherited methods |
|---|
| From [androidx.media3.exoplayer.dash.manifest.SegmentBase](https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase) |---|---| | `abstract https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase#copyWithPresentationTimeOffset(long)(long newPresentationTimeOffset)` Returns a copy of this `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase` with its presentation time offset replaced by ` newPresentationTimeOffset`. | | `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/RangedUri` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase#getInitialization(androidx.media3.exoplayer.dash.manifest.Representation)( @https://checkerframework.org/api/org/checkerframework/checker/initialization/qual/UnderInitialization.html(value = https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/Representation) @https://checkerframework.org/api/org/checkerframework/checker/initialization/qual/UnderInitialization.html(value = https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/Representation) https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/Representation representation )` Returns the `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/RangedUri` defining the location of initialization data for a given representation, or null if no initialization data exists. | | `long` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase#getPresentationTimeOffsetUs()()` Returns the presentation time offset, in microseconds. | |

## Public constructors

### MultiSegmentBase

```
public MultiSegmentBase(
    @Nullable RangedUri initialization,
    long timescale,
    long presentationTimeOffset,
    long startNumber,
    long duration,
    @Nullable List<SegmentBase.SegmentTimelineElement> segmentTimeline,
    long availabilityTimeOffsetUs,
    long timeShiftBufferDepthUs,
    long periodStartUnixTimeUs
)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/RangedUri initialization` | A `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/RangedUri` corresponding to initialization data, if such data exists. |
| `long timescale` | The timescale in units per second. |
| `long presentationTimeOffset` | The presentation time offset. The value in seconds is the division of this value and `timescale`. |
| `long startNumber` | The sequence number of the first segment. |
| `long duration` | The duration of each segment in the case of fixed duration segments. The value in seconds is the division of this value and `timescale`. If ` segmentTimeline` is non-null then this parameter is ignored. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/SegmentBase.SegmentTimelineElement> segmentTimeline` | A segment timeline corresponding to the segments. If null, then segments are assumed to be of fixed duration as specified by the `duration` parameter. |
| `long availabilityTimeOffsetUs` | The offset to the current realtime at which segments become available in microseconds, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_UNSET()` if not applicable. |
| `long timeShiftBufferDepthUs` | The time shift buffer depth in microseconds. |
| `long periodStartUnixTimeUs` | The start of the enclosing period in microseconds since the Unix epoch. |

## Public methods

### getAvailableSegmentCount

```
public long getAvailableSegmentCount(long periodDurationUs, long nowUnixTimeUs)
```

See `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashSegmentIndex#getAvailableSegmentCount(long,long)`.

### getFirstAvailableSegmentNum

```
public long getFirstAvailableSegmentNum(long periodDurationUs, long nowUnixTimeUs)
```

See `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashSegmentIndex#getFirstAvailableSegmentNum(long,long)`.

### getFirstSegmentNum

```
public long getFirstSegmentNum()
```

See `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashSegmentIndex#getFirstSegmentNum()`.

### getNextSegmentAvailableTimeUs

```
public long getNextSegmentAvailableTimeUs(
    long periodDurationUs,
    long nowUnixTimeUs
)
```

See `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashSegmentIndex#getNextSegmentAvailableTimeUs(long,long)`.

### getSegmentCount

```
public abstract long getSegmentCount(long periodDurationUs)
```

See `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashSegmentIndex#getSegmentCount(long)`.

### getSegmentDurationUs

```
public final long getSegmentDurationUs(long sequenceNumber, long periodDurationUs)
```

See `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashSegmentIndex#getDurationUs(long,long)`.

### getSegmentNum

```
public long getSegmentNum(long timeUs, long periodDurationUs)
```

See `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashSegmentIndex#getSegmentNum(long,long)`.

### getSegmentTimeUs

```
public final long getSegmentTimeUs(long sequenceNumber)
```

See `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashSegmentIndex#getTimeUs(long)`.

### getSegmentUrl

```
public abstract RangedUri getSegmentUrl(Representation representation, long index)
```

Returns a `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/RangedUri` defining the location of a segment for the given index in the given representation.

See `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashSegmentIndex#getSegmentUrl(long)`.

### isExplicit

```
public boolean isExplicit()
```

See `https://developer.android.com/reference/androidx/media3/exoplayer/dash/DashSegmentIndex#isExplicit()`