# SegmentBase

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)

*** ** * ** ***


```
@UnstableApi
abstract class SegmentBase
```

<br />

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

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase` that consists of multiple segments. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase.SingleSegmentBase` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase` that defines a single segment. |

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

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

*** ** * ** ***

An approximate representation of a SegmentBase manifest element.

## Summary

| ### Nested types |
|---|
| `abstract class https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase : https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase` A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase` that consists of multiple segments. |
| `class https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase.SegmentList : https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase` A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase` that uses a SegmentList to define its segments. |
| `class https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase.SegmentTemplate : https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase` A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase.MultiSegmentBase` that uses a SegmentTemplate to define its segments. |
| `class https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase.SegmentTimelineElement` Represents a timeline segment from the MPD's SegmentTimeline list. |
| `class https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase.SingleSegmentBase : https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase` A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase` that defines a single segment. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase#SegmentBase(androidx.media3.exoplayer.dash.manifest.RangedUri,long,long)( initialization: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri?, timescale: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, presentationTimeOffset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` |

| ### Public functions |
|---|---|
| `abstract https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase#copyWithPresentationTimeOffset(long)(newPresentationTimeOffset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Returns a copy of this `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase` with its presentation time offset replaced by ` newPresentationTimeOffset`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri?` | `https://developer.android.com/reference/kotlin/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/kotlin/androidx/media3/exoplayer/dash/manifest/Representation) representation: @https://checkerframework.org/api/org/checkerframework/checker/initialization/qual/UnderInitialization.html(value = https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation) https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation! )` Returns the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri` defining the location of initialization data for a given representation, or null if no initialization data exists. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase#getPresentationTimeOffsetUs()()` Returns the presentation time offset, in microseconds. |

## Public constructors

### SegmentBase

```
SegmentBase(
    initialization: RangedUri?,
    timescale: Long,
    presentationTimeOffset: Long
)
```

| Parameters |
|---|---|
| `initialization: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri?` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri` corresponding to initialization data, if such data exists. |
| `timescale: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The timescale in units per second. |
| `presentationTimeOffset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The presentation time offset. The value in seconds is the division of this value and `timescale`. |

## Public functions

### copyWithPresentationTimeOffset

```
abstract fun copyWithPresentationTimeOffset(newPresentationTimeOffset: Long): SegmentBase!
```

Returns a copy of this `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/SegmentBase` with its presentation time offset replaced by `
newPresentationTimeOffset`.

### getInitialization

```
fun getInitialization(
    @UnderInitialization(value = Representation) representation: @UnderInitialization(value = Representation) Representation!
): RangedUri?
```

Returns the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri` defining the location of initialization data for a given representation, or null if no initialization data exists.

| Parameters |
|---|---|
| `@https://checkerframework.org/api/org/checkerframework/checker/initialization/qual/UnderInitialization.html(value = https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation) representation: @https://checkerframework.org/api/org/checkerframework/checker/initialization/qual/UnderInitialization.html(value = https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation) https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/Representation` for which initialization data is required. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri?` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri` defining the location of the initialization data, or null. |

### getPresentationTimeOffsetUs

```
fun getPresentationTimeOffsetUs(): Long
```

Returns the presentation time offset, in microseconds.