Provide a volume control

You can set up a user interface control for the player’s volume.

  1. Wait for the PSDK to call your PlaybackEventListener.onPrepared callback.

    This ensures that the media resource has successfully loaded. If the player is not in the PREPARED state, attempting to call the following methods throws an IllegalStateException.

  2. Call setVolume to set the audio volume.

    The parameter for the setVolume method represents the requested actual volume level expressed as a percentage of the maximum level, where 0 is silent and 100 is full volume. The default is 1.

    void setVolume(int volume) throws IllegalStateException;
    Your player can be in any state except RELEASED or ERROR to use this method.