Configuring Default Volume Parameters
There are lots of different volume parameters that can be set by default in AmplitudeJS. You can initialize the volume to be
Setting the Starting Volume
You can define the starting volume for when the user initially presses play.
To do this, you need to add a "volume" key to your initialization JSON. This
value is any number between 0 and 100. Think of this as a percentage.
If you want the volume percentage at 35%, set this value equal to 35.
Amplitude.init({
"songs": [...],
"volume": 35
});
Setting the Volume Increment and Decrement Values
AmplitudeJS allows you to have volume increment and decrement buttons. Each time one of the buttons is pressed, the volume increments or decrements a certain amount. You can configure AmplitudeJS to have values set for how much the volume should increment or decrement when you initialize.
Amplitude.init({
"songs": [...],
"volume_increment": 10,
"volume_decrement": 10
});
Think of these values as a percentage of the volume that AmplitudeJS adjusts. So every time we increment AmplitudeJS the volume now goes up by 10% or down by 10%. The default for this is 5%.