Skip to main content
Skip table of contents

Audio volume enhancer

To test this feature and view the example code, please see the Android SDK 5 Example Code Quick Start guide.

The application can amplify the content's audio by setting the volume gain value on an OTVVideoView instance. This can be done both before and during playback. The gain can be set to a value between MIN_VOLUME_GAIN (1) and MAX_VOLUME_GAIN (8). The default value is MIN_VOLUME_GAIN, which will not increase the audio volume.

Example code

Setting the volume gain and checking its value.

JAVA
// Logging the default value, which will be 1
OTVLog.i(TAG, "Default gain value: " + videoView.getVolumeGain());

// Set the volume gain to the maximum permitted by the API
videoView.setVolumeGain(OTVVideoView.MAX_VOLUME_GAIN);

// Confirming the new value, which is 8
OTVLog.i(TAG, "New gain value: " + videoView.getVolumeGain());

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.