Action.SetAudioAttributes


public final class Action.SetAudioAttributes extends Action


Calls setAudioAttributes.

Summary

Public constructors

SetAudioAttributes(
    String tag,
    AudioAttributes audioAttributes,
    boolean handleAudioFocus
)

Protected methods

void
doActionImpl(
    ExoPlayer player,
    DefaultTrackSelector trackSelector,
    @Nullable Surface surface
)

Called by doActionAndScheduleNextImpl to perform the action.

Public constructors

SetAudioAttributes

public SetAudioAttributes(
    String tag,
    AudioAttributes audioAttributes,
    boolean handleAudioFocus
)
Parameters
String tag

A tag to use for logging.

AudioAttributes audioAttributes

The attributes to use for audio playback.

boolean handleAudioFocus

True if the player should handle audio focus, false otherwise.

Protected methods

doActionImpl

protected void doActionImpl(
    ExoPlayer player,
    DefaultTrackSelector trackSelector,
    @Nullable Surface surface
)

Called by doActionAndScheduleNextImpl to perform the action.

Parameters
ExoPlayer player

The player to which the action should be applied.

DefaultTrackSelector trackSelector

The track selector to which the action should be applied.

@Nullable Surface surface

The surface to use when applying actions, or null if no surface is needed.