This command is a new API to support suspending and resuming playback. We’ll provide more details about how to implement this feature in the coming months. Watch the blog for details.
Use the suspend command in the
playbackSession namespace to suspend a specified session. The player will clear the stored item window of tracks and send a
playbackStatus event to tell clients that the current item is null.
As described in a cloud queue use case in Play audio, if your app sends a play command when the cloud queue is empty, the player will attempt to resume playback of content that was playing prior to this command. For example, if the user was previously listening to a radio station or had a playlist queued, it will attempt to resume playback of that content.
When a session is suspended, the player won’t revert to the previous music source in this case. Instead, the player delivers a
sessionInfo event with a
suspended value of true for the suspended session. The session stays suspended until one of the following occurs:
- The player receives a play command. If the player receives a play command, it sends a
sessionInfoevent with a
suspendedvalue of false.
- The player receives either a
skipToItemcommand for the suspended session. The player follows these commands as specified.
- The player receives a
createSessioncommand. The suspended session receives an
- The user or an action picks a new music source. This can either be from the Sonos app or through the
loadFavoritecommand. The suspended session receives an
This command requires a
sessionId to determine the target of the command. See the Control documentation for details.
See the table below for descriptions of parameters in the body.
||string||(Optional) The player will store this value locally. The cloud queue server should return this queue version in all
Returns an empty body with a
success value of true if successful.
For example. if the
sessionId is not valid or has terminated, the player returns an