Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

Builder

class Builder
kotlin.Any
   ↳ androidx.media2.PlaybackParams2.Builder

The builder class that makes it easy to chain setters to create a PlaybackParams2 object.

Summary

Public constructors

Public methods
PlaybackParams2.Builder!
setAudioFallbackMode(audioFallbackMode: Int)

Sets the audio fallback mode.

PlaybackParams2.Builder!
setSpeed(speed: Float)

Sets the speed factor.

PlaybackParams2.Builder!
setPitch(pitch: Float)

Sets the pitch factor.

PlaybackParams2!

Takes the values of the Builder object and creates a PlaybackParams2 object.

Public constructors

<init>

Builder()

Public methods

setAudioFallbackMode

fun setAudioFallbackMode(audioFallbackMode: Int): PlaybackParams2.Builder!

Sets the audio fallback mode.

Return
PlaybackParams2.Builder!: this Builder instance.

setSpeed

fun setSpeed(speed: Float): PlaybackParams2.Builder!

Sets the speed factor.

Return
PlaybackParams2.Builder!: this Builder instance.

setPitch

fun setPitch(pitch: Float): PlaybackParams2.Builder!

Sets the pitch factor.

Return
PlaybackParams2.Builder!: this Builder instance.
Exceptions
IllegalArgumentException if the pitch is negative.

build

fun build(): PlaybackParams2!

Takes the values of the Builder object and creates a PlaybackParams2 object.

Return
PlaybackParams2!: PlaybackParams2 object with values from the Builder.