playback > togglePlayPause

Introduced in Control API version 1.6.0.

Use the togglePlayPause command in the playback namespace to toggle the playback state on the given group, if possible. Upon completion of the command, the player sends playbackStatus events to all subscribers. When toggling from pause to play, this functions similar to the play command. When transitioning from play to pause, it functions like the pause command. See those commands for more details about the functionality of those states.


Endpoint

POST


Request Parameters

There are no request parameters in the body, all of the request parameters are in the header.

This command requires a groupId to determine the target of the command. See the Control documentation for details.


Response

Returns an empty body with a success value of true if the player successfully changes the playback state.

Triggers a playbackStatus event if the playback state was changed.

In the event of a failure, returns a playbackError or a globalError

For example, if there’s no audio source loaded on the group, your app will receive an ERROR_PLAYBACK_FAILED.