Share via


VideoView.SetAudioFocusRequest(AudioFocus) Method

Definition

Sets which type of audio focus will be requested during the playback, or configures playback to not request audio focus.

[Android.Runtime.Register("setAudioFocusRequest", "(I)V", "GetSetAudioFocusRequest_IHandler", ApiSince=26)]
public virtual void SetAudioFocusRequest (Android.Media.AudioFocus focusGain);
[<Android.Runtime.Register("setAudioFocusRequest", "(I)V", "GetSetAudioFocusRequest_IHandler", ApiSince=26)>]
abstract member SetAudioFocusRequest : Android.Media.AudioFocus -> unit
override this.SetAudioFocusRequest : Android.Media.AudioFocus -> unit

Parameters

focusGain
AudioFocus

the type of audio focus gain that will be requested, or AudioManager#AUDIOFOCUS_NONE to disable the use audio focus during playback.

Attributes

Remarks

Sets which type of audio focus will be requested during the playback, or configures playback to not request audio focus. Valid values for focus requests are AudioManager#AUDIOFOCUS_GAIN, AudioManager#AUDIOFOCUS_GAIN_TRANSIENT, AudioManager#AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK, and AudioManager#AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE. Or use AudioManager#AUDIOFOCUS_NONE to express that audio focus should not be requested when playback starts. You can for instance use this when playing a silent animation through this class, and you don't want to affect other audio applications playing in the background.

Java documentation for android.widget.VideoView.setAudioFocusRequest(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to