# SimpleBasePlayer.PeriodData.Builder

Artifact: [androidx.media3:media3-common](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/common/SimpleBasePlayer.java+class:androidx.media3.common.SimpleBasePlayer.PeriodData.Builder)

*** ** * ** ***


```
public final class SimpleBasePlayer.PeriodData.Builder
```

<br />

*** ** * ** ***

A builder for `https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PeriodData` objects.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PeriodData.Builder#Builder(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html uid)` Creates the builder. |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PeriodData` | `https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PeriodData.Builder#build()()` Builds the `https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PeriodData`. |
| `https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PeriodData.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PeriodData.Builder#setAdPlaybackState(androidx.media3.common.AdPlaybackState)(https://developer.android.com/reference/androidx/media3/common/AdPlaybackState adPlaybackState)` Sets the `https://developer.android.com/reference/androidx/media3/common/AdPlaybackState`. |
| `https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PeriodData.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PeriodData.Builder#setDurationUs(long)(long durationUs)` Sets the total duration of the period, in microseconds, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_UNSET()` if unknown. |
| `https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PeriodData.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PeriodData.Builder#setIsPlaceholder(boolean)(boolean isPlaceholder)` Sets whether this period contains placeholder information because the real information has yet to be loaded |
| `https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PeriodData.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PeriodData.Builder#setOriginalDurationUs(long)(long originalDurationUs)` Sets the original duration of the period before any modification of its end, in microseconds, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_UNSET()` if unknown. |
| `https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PeriodData.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PeriodData.Builder#setUid(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html uid)` Sets the unique identifier of the period within its media item. |

## Public constructors

### Builder

```
public Builder(Object uid)
```

Creates the builder.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/Object.html uid` | The unique identifier of the period within its media item. |

## Public methods

### build

```
public SimpleBasePlayer.PeriodData build()
```

Builds the `https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PeriodData`.

### setAdPlaybackState

```
@CanIgnoreReturnValue
public SimpleBasePlayer.PeriodData.Builder setAdPlaybackState(AdPlaybackState adPlaybackState)
```

Sets the `https://developer.android.com/reference/androidx/media3/common/AdPlaybackState`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/AdPlaybackState adPlaybackState` | The `https://developer.android.com/reference/androidx/media3/common/AdPlaybackState`, or `https://developer.android.com/reference/androidx/media3/common/AdPlaybackState#NONE()` if there are no ads. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PeriodData.Builder` | This builder. |

### setDurationUs

```
@CanIgnoreReturnValue
public SimpleBasePlayer.PeriodData.Builder setDurationUs(long durationUs)
```

Sets the total duration of the period, in microseconds, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_UNSET()` if unknown.

Only the last period in a media item can have an unknown duration.

| Parameters |
|---|---|
| `long durationUs` | The total duration of the period, in microseconds, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_UNSET()` if unknown. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PeriodData.Builder` | This builder. |

### setIsPlaceholder

```
@CanIgnoreReturnValue
public SimpleBasePlayer.PeriodData.Builder setIsPlaceholder(boolean isPlaceholder)
```

Sets whether this period contains placeholder information because the real information has yet to be loaded

| Parameters |
|---|---|
| `boolean isPlaceholder` | Whether this period contains placeholder information because the real information has yet to be loaded. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PeriodData.Builder` | This builder. |

### setOriginalDurationUs

```
@CanIgnoreReturnValue
public SimpleBasePlayer.PeriodData.Builder setOriginalDurationUs(long originalDurationUs)
```

Sets the original duration of the period before any modification of its end, in microseconds, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_UNSET()` if unknown.

| Parameters |
|---|---|
| `long originalDurationUs` | The original duration of the period before any modification of its end, in microseconds, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_UNSET()` if unknown. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PeriodData.Builder` | This builder. |

### setUid

```
@CanIgnoreReturnValue
public SimpleBasePlayer.PeriodData.Builder setUid(Object uid)
```

Sets the unique identifier of the period within its media item.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/Object.html uid` | The unique identifier of the period within its media item. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/SimpleBasePlayer.PeriodData.Builder` | This builder. |