public final class

TrackSelectionParameters.AudioOffloadPreferences.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.media3.common.TrackSelectionParameters.AudioOffloadPreferences.Builder

Overview

A builder for TrackSelectionParameters.AudioOffloadPreferences. See the TrackSelectionParameters.AudioOffloadPreferences documentation for explanations of the parameters that can be configured using this builder.

Summary

Constructors
publicBuilder()

Methods
public TrackSelectionParameters.AudioOffloadPreferencesbuild()

Builds a TrackSelectionParameters instance with the selected values.

public TrackSelectionParameters.AudioOffloadPreferences.BuildersetAudioOffloadMode(int audioOffloadMode)

Sets the audio offload mode preferences.

public TrackSelectionParameters.AudioOffloadPreferences.BuildersetIsGaplessSupportRequired(boolean isGaplessSupportRequired)

Sets a constraint on audio offload enablement.

public TrackSelectionParameters.AudioOffloadPreferences.BuildersetIsSpeedChangeSupportRequired(boolean isSpeedChangeSupportRequired)

Sets a constraint on audio offload enablement.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Methods

public TrackSelectionParameters.AudioOffloadPreferences.Builder setAudioOffloadMode(int audioOffloadMode)

Sets the audio offload mode preferences. For instance if the preferred mode is enabled/disabled or if offload is required for playback. Default value is TrackSelectionParameters.AudioOffloadPreferences.AUDIO_OFFLOAD_MODE_DISABLED.

Parameters:

audioOffloadMode: for enabling/disabling offload. One of TrackSelectionParameters.AudioOffloadPreferences.AUDIO_OFFLOAD_MODE_REQUIRED, TrackSelectionParameters.AudioOffloadPreferences.AUDIO_OFFLOAD_MODE_ENABLED, or TrackSelectionParameters.AudioOffloadPreferences.AUDIO_OFFLOAD_MODE_DISABLED.

Returns:

This builder.

public TrackSelectionParameters.AudioOffloadPreferences.Builder setIsGaplessSupportRequired(boolean isGaplessSupportRequired)

Sets a constraint on audio offload enablement. If true then audio offload will be enabled only if the device supports gapless transitions during offload or the selected audio is not gapless. Default value is false.

Parameters:

isGaplessSupportRequired: for playing gapless audio offloaded.

Returns:

This builder.

public TrackSelectionParameters.AudioOffloadPreferences.Builder setIsSpeedChangeSupportRequired(boolean isSpeedChangeSupportRequired)

Sets a constraint on audio offload enablement. If true, then audio offload will be enabled only if the device supports changing playback speed during offload. Default value is false.

Parameters:

isSpeedChangeSupportRequired: for playing audio offloaded.

Returns:

This builder.

Builds a TrackSelectionParameters instance with the selected values.