ScrubbingModeParameters.Builder


class ScrubbingModeParameters.Builder


Builder for 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

Creates an instance.

Public functions

ScrubbingModeParameters!

Returns the built ScrubbingModeParameters.

ScrubbingModeParameters.Builder!

Sets which track types should be disabled in scrubbing mode.

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

Sets the fraction of the media duration to use for toleranceBeforeUs and toleranceAfterUs when scrubbing.

ScrubbingModeParameters.Builder!

Sets whether the decoder is flushed in scrubbing mode.

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

Sets whether ExoPlayer's dynamic scheduling should be enabled in scrubbing mode.

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

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

ScrubbingModeParameters.Builder!

Sets whether to use BUFFER_FLAG_DECODE_ONLY in scrubbing mode.

Public constructors

Builder

Builder()

Creates an instance.

Public functions

build

fun build(): ScrubbingModeParameters!

Returns the built ScrubbingModeParameters.

setDisabledTrackTypes

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

Sets which track types should be disabled in scrubbing mode.

Defaults to TRACK_TYPE_AUDIO and TRACK_TYPE_METADATA (this may change in a future release).

See disabledTrackTypes.

Parameters
disabledTrackTypes: (Mutable)Set<@C.TrackType Int!>!

The track types to disable in scrubbing mode.

Returns
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 toleranceBeforeUs and toleranceAfterUs when scrubbing.

Pass null for both values to use the player-level seek parameters when scrubbing.

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

See fractionalSeekToleranceBefore and fractionalSeekToleranceAfter.

Parameters
toleranceBefore: @FloatRange(from = 0, to = 1) Double?

The fraction of the media duration to use for toleranceBeforeUs, or null to use the player-level seek parameters.

toleranceAfter: @FloatRange(from = 0, to = 1) Double?

The fraction of the media duration to use for toleranceAfterUs, or null to use the player-level seek parameters.

Returns
ScrubbingModeParameters.Builder!

This builder for convenience.

setIsMediaCodecFlushEnabled

@CanIgnoreReturnValue
fun setIsMediaCodecFlushEnabled(isMediaCodecFlushEnabled: Boolean): ScrubbingModeParameters.Builder!

Sets whether the decoder is flushed in scrubbing mode.

Setting this to false will disable flushing the decoder when a new seek starts decoding from a key-frame.

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

Parameters
isMediaCodecFlushEnabled: Boolean

Whether to enable flushing of decoder in scrubbing mode.

Returns
ScrubbingModeParameters.Builder!

This builder for convenience.

setShouldEnableDynamicScheduling

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

Sets whether ExoPlayer's dynamic scheduling should be enabled in scrubbing mode.

When used with MediaCodec in async mode, this can result in available output buffers being handled more quickly when seeking.

If dynamic scheduling is enabled for all playback in ExoPlayer.Builder (which may become the default in a future release), 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: Boolean

Whether dynamic scheduling should be enabled in scrubbing mode.

Returns
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 shouldIncreaseCodecOperatingRate.

Parameters
shouldIncreaseCodecOperatingRate: Boolean

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

Returns
ScrubbingModeParameters.Builder!

This builder for convenience.

setUseDecodeOnlyFlag

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

Sets whether to use BUFFER_FLAG_DECODE_ONLY in scrubbing mode.

When playback is using MediaCodec 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 enabled (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).