Package com.jwplayer.pub.api
Enum Class AudioFocusChange
- All Implemented Interfaces:
Serializable,Comparable<AudioFocusChange>,Constable
Audio-focus changes reported to an
AudioFocusListener.
Only reported while the SDK manages audio focus, i.e. when
ExoPlayerSettings.setAudioFocusHandlingEnabled(boolean) is true.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAnother app asked the player to lower its volume.The player holds audio focus: the focus request was granted, or focus came back after a transient loss.Focus was lost permanently (for example another media app started playing), or a focus request was refused.Focus was lost for a short time (for example a voice-assistant prompt or a phone call). -
Method Summary
Modifier and TypeMethodDescriptionstatic AudioFocusChangeReturns the enum constant of this class with the specified name.static AudioFocusChange[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
GAINED
The player holds audio focus: the focus request was granted, or focus came back after a transient loss. -
LOST
Focus was lost permanently (for example another media app started playing), or a focus request was refused. The player pauses withPauseReason.AUDIO_INTERRUPTIONand does not resume by itself. -
LOST_TRANSIENT
Focus was lost for a short time (for example a voice-assistant prompt or a phone call). The player pauses withPauseReason.AUDIO_INTERRUPTIONand resumes when focus returns, unless playback was paused or played by the user or the app in between. -
DUCK
Another app asked the player to lower its volume. On Android 8.0 (API 26) and later the system ducks the player automatically and this is not reported. On older versions the player pauses and resumes as forLOST_TRANSIENT.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-