Provide volume control

You can set up a user interface control for sound volume.

  1. Wait for the MediaPlayer instance to be in a valid state for this command, which is any except RELEASED or ERROR.

  2. Call setVolume on the MediaPlayer instance to set the audio volume.

    void setVolume(int volume) throws IllegalStateException;
    

    The value for the volume represents the requested volume expressed as a proportion of the maximum volume, where 0 is silent and 100 is the maximum volume.

On this page

Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free
Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now