Looking for the old docs? Go here

API

Audio Gain

An overview on requesting and tracking audio gain changes.

The player will use the GainNode interface on the HTMLMediaElement to apply a gain to audio output. The gain value is a float that represents the amount of gain to apply. The default is 1, setting it to 1.5 will increase volume by 50%, 2 will increase volume by 100%, and so on.

You can request audio gain changes by using the audio gain slider, remote control, or via methods on the player instance.

The media remote provides methods for dispatching media-audio-gain-change-request request events like so:

    
    

The setAudioGain() method is available on the player component instance for requesting changes:

    
    

The following audio gain properties are available on the media store:

  • canSetAudioGain: Whether audio gain is supported by the current browser and provider.
  • audioGain: The current audio gain.
    
    

The following events are available for detecting audio gain changes:

    
    

Previous