playerVolume > setRelativeVolume

Use the setRelativeVolume command in the playerVolume namespace to increase or decrease volume for a player and unmute the player if muted.


Endpoint

POST


Request Parameters

This command requires a playerId 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 (Optional) Between -100 and 100 to indicate the amount to increase or decrease the volume for the player. If your app submits a number outside of this range, you will receive an ERROR_INVALID_PARAMETER error. The player adds this value to the current volume and keeps the result in the range of 0 to 100.
muted boolean (Optional) true to mute the player or false to unmute the player.

Note that while both parameters are optional, your app must send at least one parameter or the player will send an ERROR_MISSING_PARAMETERS error. See globalError for details.


Response

Returns an empty body with a success value of true if successful. The player generates a playerVolume event if the volume was changed.

In the event of a failure, returns a globalError.


Example

Request

If volume was changed, the player will also send a playerVolume event.