> Documentation index: https://developer.android.com/reference/llms.txt

# SegmentBase

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

*** ** * ** ***


```
@UnstableApi
public abstract class SegmentBase
```

<br />

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

|---|---|
| `SegmentBase.MultiSegmentBase` | A `SegmentBase` that consists of multiple segments. |
| `SegmentBase.SingleSegmentBase` | A `SegmentBase` that defines a single segment. |

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

|---|---|
| `SegmentBase.SegmentList` | A `MultiSegmentBase` that uses a SegmentList to define its segments. |
| `SegmentBase.SegmentTemplate` | A `MultiSegmentBase` that uses a SegmentTemplate to define its segments. |

*** ** * ** ***

An approximate representation of a SegmentBase manifest element.

## Summary

| ### Nested types |
|---|
| `public abstract class SegmentBase.MultiSegmentBase extends SegmentBase` A `SegmentBase` that consists of multiple segments. |
| `public final class SegmentBase.SegmentList extends SegmentBase.MultiSegmentBase` A `MultiSegmentBase` that uses a SegmentList to define its segments. |
| `public final class SegmentBase.SegmentTemplate extends SegmentBase.MultiSegmentBase` A `MultiSegmentBase` that uses a SegmentTemplate to define its segments. |
| `public final class SegmentBase.SegmentTimelineElement` Represents a timeline segment from the MPD's SegmentTimeline list. |
| `public class SegmentBase.SingleSegmentBase extends SegmentBase` A `SegmentBase` that defines a single segment. |

| ### Public constructors |
|---|
| `SegmentBase( @Nullable RangedUri initialization, long timescale, long presentationTimeOffset )` |

| ### Public methods |
|---|---|
| `abstract SegmentBase` | `copyWithPresentationTimeOffset(long newPresentationTimeOffset)` Returns a copy of this `SegmentBase` with its presentation time offset replaced by ` newPresentationTimeOffset`. |
| `@Nullable RangedUri` | `getInitialization( @UnderInitialization(value = Representation) @UnderInitialization(value = Representation) Representation representation )` Returns the `RangedUri` defining the location of initialization data for a given representation, or null if no initialization data exists. |
| `long` | `getPresentationTimeOffsetUs()` Returns the presentation time offset, in microseconds. |

## Public constructors

### SegmentBase

```
public SegmentBase(
    @Nullable RangedUri initialization,
    long timescale,
    long presentationTimeOffset
)
```

| Parameters |
|---|---|
| `@Nullable RangedUri initialization` | A `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`. |

## Public methods

### copyWithPresentationTimeOffset

```
public abstract SegmentBase copyWithPresentationTimeOffset(long newPresentationTimeOffset)
```

Returns a copy of this `SegmentBase` with its presentation time offset replaced by `
newPresentationTimeOffset`.

### getInitialization

```
public @Nullable RangedUri getInitialization(
    @UnderInitialization(value = Representation) @UnderInitialization(value = Representation) Representation representation
)
```

Returns the `RangedUri` defining the location of initialization data for a given representation, or null if no initialization data exists.

| Parameters |
|---|---|
| `@UnderInitialization(value = Representation) @UnderInitialization(value = Representation) Representation representation` | The `Representation` for which initialization data is required. |

| Returns |
|---|---|
| `@Nullable RangedUri` | A `RangedUri` defining the location of the initialization data, or null. |

### getPresentationTimeOffsetUs

```
public long getPresentationTimeOffsetUs()
```

Returns the presentation time offset, in microseconds.