# ScrubbingModeParameters.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/ScrubbingModeParameters.java+class:androidx.media3.exoplayer.ScrubbingModeParameters.Builder)

*** ** * ** ***


```
class ScrubbingModeParameters.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters` instances.

This builder defines some defaults that may change in future releases of the library, and new properties may be added that default to enabled.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters.Builder#Builder()()` Creates an instance. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters.Builder#build()()` Returns the built `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters.Builder#setAllowSkippingKeyFrameReset(boolean)(allowSkippingKeyFrameReset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether to avoid resetting to a keyframe and flushing the decoder if seeking forwards within the same group of pictures(GOP). |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters.Builder#setAllowSkippingMediaCodecFlush(boolean)(allowSkippingMediaCodecFlush: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether to avoid flushing the decoder (where possible) in scrubbing mode. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters.Builder#setDisabledTrackTypes(java.util.Set<java.lang.Integer>)(disabledTrackTypes: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<@https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!>!)` Sets which track types should be disabled in scrubbing mode. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters.Builder#setFractionalSeekTolerance(java.lang.Double,java.lang.Double)( toleranceBefore: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0, to = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html?, toleranceAfter: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0, to = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html? )` Sets the fraction of the media duration to use for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/SeekParameters#toleranceBeforeUs()` and `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/SeekParameters#toleranceAfterUs()` when scrubbing. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html [setIsMediaCodecFlushEnabled](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters.Builder#setIsMediaCodecFlushEnabled(boolean))(isMediaCodecFlushEnabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` **This function is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters.Builder#setAllowSkippingMediaCodecFlush(boolean)` instead (but note that the value it takes is inverted). <br /> |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters.Builder#setShouldEnableDynamicScheduling(boolean)( shouldEnableDynamicScheduling: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Sets whether ExoPlayer's `https://developer.android.com/reference/kotlin/androidx/media3/common/Flags#FLAG_DYNAMIC_SCHEDULING()` should be enabled in scrubbing mode. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters.Builder#setShouldIncreaseCodecOperatingRate(boolean)( shouldIncreaseCodecOperatingRate: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Sets whether the codec operating rate should be increased in scrubbing mode. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters.Builder#setUseDecodeOnlyFlag(boolean)(useDecodeOnlyFlag: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether to use `https://developer.android.com/reference/android/media/MediaCodec.html#BUFFER_FLAG_DECODE_ONLY` in scrubbing mode. |

## Public constructors

### Builder

```
Builder()
```

Creates an instance.

## Public functions

### build

```
fun build(): ScrubbingModeParameters!
```

Returns the built `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters`.

### setAllowSkippingKeyFrameReset

```
@CanIgnoreReturnValue
fun setAllowSkippingKeyFrameReset(allowSkippingKeyFrameReset: Boolean): ScrubbingModeParameters.Builder!
```

Sets whether to avoid resetting to a keyframe and flushing the decoder if seeking forwards within the same group of pictures(GOP).

Setting this to `true` will skip flushing the decoder and decoding previously processed frames.

Defaults to `true`.

| Parameters |
|---|---|
| `allowSkippingKeyFrameReset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether to skip resetting to the keyframe when seeking forwards in the same group of pictures in scrubbing mode. |

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

### setAllowSkippingMediaCodecFlush

```
@CanIgnoreReturnValue
fun setAllowSkippingMediaCodecFlush(allowSkippingMediaCodecFlush: Boolean): ScrubbingModeParameters.Builder!
```

Sets whether to avoid flushing the decoder (where possible) in scrubbing mode.

Setting this to `true` will avoid flushing the decoder when a new seek starts decoding from a key-frame in compatible content.

Defaults to `true` (this may change in a future release).

| Parameters |
|---|---|
| `allowSkippingMediaCodecFlush: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether skip flushing the decoder (where possible) in scrubbing mode. |

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

### setDisabledTrackTypes

```
@CanIgnoreReturnValue
fun setDisabledTrackTypes(disabledTrackTypes: (Mutable)Set<@C.TrackType Int!>!): ScrubbingModeParameters.Builder!
```

Sets which track types should be disabled in scrubbing mode.

Defaults to `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TRACK_TYPE_AUDIO()` and `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TRACK_TYPE_METADATA()` (this may change in a future release).

See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters#disabledTrackTypes()`.

| Parameters |
|---|---|
| `disabledTrackTypes: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<@https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!>!` | The track types to disable in scrubbing mode. |

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

### setFractionalSeekTolerance

```
@CanIgnoreReturnValue
fun setFractionalSeekTolerance(
    toleranceBefore: @FloatRange(from = 0, to = 1) Double?,
    toleranceAfter: @FloatRange(from = 0, to = 1) Double?
): ScrubbingModeParameters.Builder!
```

Sets the fraction of the media duration to use for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/SeekParameters#toleranceBeforeUs()` and `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/SeekParameters#toleranceAfterUs()` when scrubbing.

Pass `null` for both values to use the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer#getSeekParameters()` when scrubbing.

Defaults to {code null} for both values, so all seeks are exact (this may change in a future release).

See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters#fractionalSeekToleranceBefore()` and `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters#fractionalSeekToleranceAfter()`.

| Parameters |
|---|---|
| `toleranceBefore: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0, to = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html?` | The fraction of the media duration to use for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/SeekParameters#toleranceBeforeUs()`, or null to use the player-level seek parameters. |
| `toleranceAfter: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0, to = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html?` | The fraction of the media duration to use for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/SeekParameters#toleranceAfterUs()`, or null to use the player-level seek parameters. |

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

### setIsMediaCodecFlushEnabled

```
@CanIgnoreReturnValue
fun [setIsMediaCodecFlushEnabled](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters.Builder#setIsMediaCodecFlushEnabled(boolean))(isMediaCodecFlushEnabled: Boolean): ScrubbingModeParameters.Builder!
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters.Builder#setAllowSkippingMediaCodecFlush(boolean)` instead (but note that the value it takes is inverted).

### setShouldEnableDynamicScheduling

```
@CanIgnoreReturnValue
fun setShouldEnableDynamicScheduling(
    shouldEnableDynamicScheduling: Boolean
): ScrubbingModeParameters.Builder!
```

Sets whether ExoPlayer's `https://developer.android.com/reference/kotlin/androidx/media3/common/Flags#FLAG_DYNAMIC_SCHEDULING()` should be enabled in scrubbing mode.

When used with `https://developer.android.com/reference/android/media/MediaCodec.html` in async mode, this can result in available output buffers being handled more quickly when seeking.

If dynamic scheduling is enabled for all playback (which is the default), this method is a no-op (i.e. you cannot disable dynamic scheduling when scrubbing using this method).

Defaults to `true` (this may change in a future release).

| Parameters |
|---|---|
| `shouldEnableDynamicScheduling: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether dynamic scheduling should be enabled in scrubbing mode. |

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

### setShouldIncreaseCodecOperatingRate

```
@CanIgnoreReturnValue
fun setShouldIncreaseCodecOperatingRate(
    shouldIncreaseCodecOperatingRate: Boolean
): ScrubbingModeParameters.Builder!
```

Sets whether the codec operating rate should be increased in scrubbing mode.

Defaults to `true` (this may change in a future release).

See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ScrubbingModeParameters#shouldIncreaseCodecOperatingRate()`.

| Parameters |
|---|---|
| `shouldIncreaseCodecOperatingRate: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | whether the codec operating rate should be increased in scrubbing mode. |

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

### setUseDecodeOnlyFlag

```
@CanIgnoreReturnValue
fun setUseDecodeOnlyFlag(useDecodeOnlyFlag: Boolean): ScrubbingModeParameters.Builder!
```

Sets whether to use `https://developer.android.com/reference/android/media/MediaCodec.html#BUFFER_FLAG_DECODE_ONLY` in scrubbing mode.

When playback is using `https://developer.android.com/reference/android/media/MediaCodec.html` on API 34+, this flag can speed up seeking by signalling that the decoded output of buffers between the previous keyframe and the target frame is not needed by the player.

If the decode-only flag is `https://developer.android.com/reference/kotlin/androidx/media3/common/Flags#FLAG_ENABLE_MEDIACODEC_BUFFER_DECODE_ONLY()` (which may become the default in a future release), this method is a no-op (i.e. you cannot disable usage of the decode-only flag when scrubbing using this method).

Defaults to `true` (this may change in a future release).