Use the seek
command in the playback
namespace to go to a specific position in the current track. Optionally add the cloud queue itemId
to target a specific track.
Use itemId
to ensure the group seeks on the current item. If the current item’s itemId
does not match the one provided, the player returns an ERROR_INVALID_OBJECT_ID
error.
Endpoint
POST
1 |
/groups/{groupId}/playback/seek |
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 descriptions of parameters in the body.
Parameter | Type | Value |
---|---|---|
itemId |
string | (Optional) The identifier for the item. If included and it does not match the currently playing item, the command fails. This ensures that playback does not jump back to a track if a user starts to scrub just as the player begins to play the next item or due to latency. |
positionMillis |
unsigned int | Position within track in milliseconds. If this value exceeds the current track duration time, Sonos moves to the end of the current track, which results in a skip to the next track. |
Response
Returns an empty body with a success
value of true if successful.
In the event of a failure, returns playbackError
when the scrub operation fails. Returns globalError
for all other errors. For example, the player may return ERROR_DISALLOWED_BY_POLICY
when scrubbing is not allowed or ERROR_INVALID_OBJECT_ID
when the heard track does not match the given itemId
.
Example
Request
1 2 3 4 |
{ "itemId": "abc", "positionMillis": 30000 } |