# DefaultLivePlaybackSpeedControl.Builder

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

*** ** * ** ***


```
class DefaultLivePlaybackSpeedControl.Builder
```

<br />

*** ** * ** ***

Builder for a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder#Builder()()` Creates a builder. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder#build()()` Builds an instance. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder#setFallbackMaxPlaybackSpeed(float)(fallbackMaxPlaybackSpeed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Sets the maximum playback speed that should be used if no maximum playback speed is defined by the media. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder#setFallbackMinPlaybackSpeed(float)(fallbackMinPlaybackSpeed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Sets the minimum playback speed that should be used if no minimum playback speed is defined by the media. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder#setMaxLiveOffsetErrorMsForUnitSpeed(long)( maxLiveOffsetErrorMsForUnitSpeed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` Sets the maximum difference between the current live offset and the target live offset, in milliseconds, for which unit speed (1.0f) is used. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder#setMinPossibleLiveOffsetSmoothingFactor(float)( minPossibleLiveOffsetSmoothingFactor: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` Sets the smoothing factor when smoothing the minimum possible live offset that can be achieved during playback. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder#setMinUpdateIntervalMs(long)(minUpdateIntervalMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets the minimum interval between playback speed changes, in milliseconds. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder#setProportionalControlFactor(float)(proportionalControlFactor: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Sets the proportional control factor used to adjust the playback speed. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder#setTargetLiveOffsetIncrementOnRebufferMs(long)( targetLiveOffsetIncrementOnRebufferMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` Sets the increment applied to the target live offset each time the player is rebuffering, in milliseconds. |

## Public constructors

### Builder

```
Builder()
```

Creates a builder.

## Public functions

### build

```
fun build(): DefaultLivePlaybackSpeedControl!
```

Builds an instance.

### setFallbackMaxPlaybackSpeed

```
@CanIgnoreReturnValue
fun setFallbackMaxPlaybackSpeed(fallbackMaxPlaybackSpeed: Float): DefaultLivePlaybackSpeedControl.Builder!
```

Sets the maximum playback speed that should be used if no maximum playback speed is defined by the media.

The default is `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl#DEFAULT_FALLBACK_MAX_PLAYBACK_SPEED()`.

| Parameters |
|---|---|
| `fallbackMaxPlaybackSpeed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The fallback maximum factor by which playback can be sped up. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder!` | This builder, for convenience. |

### setFallbackMinPlaybackSpeed

```
@CanIgnoreReturnValue
fun setFallbackMinPlaybackSpeed(fallbackMinPlaybackSpeed: Float): DefaultLivePlaybackSpeedControl.Builder!
```

Sets the minimum playback speed that should be used if no minimum playback speed is defined by the media.

The default is `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl#DEFAULT_FALLBACK_MIN_PLAYBACK_SPEED()`.

| Parameters |
|---|---|
| `fallbackMinPlaybackSpeed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The fallback minimum factor by which playback can be sped up. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder!` | This builder, for convenience. |

### setMaxLiveOffsetErrorMsForUnitSpeed

```
@CanIgnoreReturnValue
fun setMaxLiveOffsetErrorMsForUnitSpeed(
    maxLiveOffsetErrorMsForUnitSpeed: Long
): DefaultLivePlaybackSpeedControl.Builder!
```

Sets the maximum difference between the current live offset and the target live offset, in milliseconds, for which unit speed (1.0f) is used.

The default is `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl#DEFAULT_MAX_LIVE_OFFSET_ERROR_MS_FOR_UNIT_SPEED()`.

| Parameters |
|---|---|
| `maxLiveOffsetErrorMsForUnitSpeed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The maximum live offset error for which unit speed is used, in milliseconds. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder!` | This builder, for convenience. |

### setMinPossibleLiveOffsetSmoothingFactor

```
@CanIgnoreReturnValue
fun setMinPossibleLiveOffsetSmoothingFactor(
    minPossibleLiveOffsetSmoothingFactor: Float
): DefaultLivePlaybackSpeedControl.Builder!
```

Sets the smoothing factor when smoothing the minimum possible live offset that can be achieved during playback.

The live playback speed control keeps track of the minimum possible live offset achievable during playback to know whether it can reduce the current target live offset. The minimum possible live offset is defined as `currentLiveOffset - bufferedDuration`. As the minimum possible live offset is constantly changing, it is smoothed over recent samples by applying exponential smoothing: `smoothedMinPossibleOffset = smoothingFactor x
smoothedMinPossibleOffset + (1-smoothingFactor) x currentMinPossibleOffset`.

| Parameters |
|---|---|
| `minPossibleLiveOffsetSmoothingFactor: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The smoothing factor. Must be ≥ 0 and \<1. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder!` | This builder, for convenience. |

### setMinUpdateIntervalMs

```
@CanIgnoreReturnValue
fun setMinUpdateIntervalMs(minUpdateIntervalMs: Long): DefaultLivePlaybackSpeedControl.Builder!
```

Sets the minimum interval between playback speed changes, in milliseconds.

The default is `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl#DEFAULT_MIN_UPDATE_INTERVAL_MS()`.

| Parameters |
|---|---|
| `minUpdateIntervalMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The minimum interval between playback speed changes, in milliseconds. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder!` | This builder, for convenience. |

### setProportionalControlFactor

```
@CanIgnoreReturnValue
fun setProportionalControlFactor(proportionalControlFactor: Float): DefaultLivePlaybackSpeedControl.Builder!
```

Sets the proportional control factor used to adjust the playback speed.

The factor by which playback will be sped up is calculated as `1.0 +
proportionalControlFactor x (currentLiveOffsetSec - targetLiveOffsetSec)`.

The default is `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl#DEFAULT_PROPORTIONAL_CONTROL_FACTOR()`.

| Parameters |
|---|---|
| `proportionalControlFactor: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The proportional control factor used to adjust the playback speed. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder!` | This builder, for convenience. |

### setTargetLiveOffsetIncrementOnRebufferMs

```
@CanIgnoreReturnValue
fun setTargetLiveOffsetIncrementOnRebufferMs(
    targetLiveOffsetIncrementOnRebufferMs: Long
): DefaultLivePlaybackSpeedControl.Builder!
```

Sets the increment applied to the target live offset each time the player is rebuffering, in milliseconds.

| Parameters |
|---|---|
| `targetLiveOffsetIncrementOnRebufferMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The increment applied to the target live offset when the player is rebuffering, in milliseconds |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DefaultLivePlaybackSpeedControl.Builder!` | This builder, for convenience. |