Use the setRelativeVolume
command in the groupVolume
namespace to increase or decrease group volume, and unmute the group if muted.
Your app can use setRelativeVolume
instead of setVolume
when the user intent is to increase or decrease the group volume, but not to set the final volume to a particular value. For example, your app should use setRelativeVolume
when the user presses hard volume plus/minus buttons on a mobile device.
The group will automatically limit the final volume set within the valid range, so your app does not need to worry about that.
See setVolume
for more details on how group volume works.
Endpoint
POST
1 |
/groups/{groupId}/groupVolume/relative |
Request Parameters
This command requires a groupId
to determine the target of the command. See the Control documentation for details.
See the table below for a description of the parameter in the body.
Parameter | Type | Value |
---|---|---|
volumeDelta |
number | An integer between -100 and 100 (including those values) indicating the amount to increase or decrease the current group volume. The group coordinator adds this value to the current group volume and then keeps the result in the range of 0 to 100. |
Response
Returns an empty body with a success
value of true if successful. The player generates a groupVolume
event if the volume was changed. In the event of a failure, returns a globalError
.
Example
Request
1 2 3 |
{ "volumeDelta": -10 } |