public class PlaybackSessionResource extends Object implements Subscribable
PlaybackSessionResource class.
| Constructor and Description |
|---|
PlaybackSessionResource(SonosApiClient apiClient)
Constructor for PlaybackSessionResource.
|
| Modifier and Type | Method and Description |
|---|---|
SonosPlaybackSessionStatus |
createSession(String clientToken,
String groupId,
SonosSessionRequest request)
Create a new playback session (removing any existing playback session)
|
SonosPlaybackSessionStatus |
joinOrCreateSession(String clientToken,
String groupId,
SonosSessionRequest request)
Join an existing session, or create a new one if there is no existing session
|
SonosPlaybackSessionStatus |
joinSession(String clientToken,
String groupId,
SonosSessionRequest request)
Join an existing playback session
|
SonosSuccess |
loadCloudQueue(String clientToken,
String sessionId,
SonosCloudQueueRequest request)
Load a cloud queue into a playback session (see docs)
|
SonosSuccess |
loadStreamUrl(String clientToken,
String sessionId,
SonosStreamUrlRequest request)
Load a URL as a playback session (see docs)
|
SonosSuccess |
refreshCloudQueue(String clientToken,
String sessionId)
Trigger a re-fetch of items from the cloud queue server
|
SonosSuccess |
seek(String clientToken,
String sessionId,
String itemId,
String positionMillis)
Seek within a track
|
SonosSuccess |
seekRelative(String clientToken,
String sessionId,
String itemId,
String deltaMillis)
Seek by a relative amount (optionally target a specific track)
|
SonosSuccess |
skipToItem(String clientToken,
String sessionId,
SonosSessionRequest request)
Skip to a specific item
|
SonosSuccess |
subscribe(String clientToken,
String sessionId)
Subscribe to events for this resource.
|
SonosSuccess |
suspend(String clientToken,
String sessionId,
String queueVersion)
Suspend a named session (feature appears to still be in development)
|
SonosSuccess |
unsubscribe(String clientToken,
String sessionId)
Unsubscribe from events related to this resource.
|
public PlaybackSessionResource(SonosApiClient apiClient)
Constructor for PlaybackSessionResource.
apiClient - a SonosApiClient object.public SonosPlaybackSessionStatus createSession(String clientToken, String groupId, SonosSessionRequest request) throws SonosApiClientException, SonosApiError
clientToken - for the usergroupId - to create the session inrequest - a SonosSessionRequest object.SonosPlaybackSessionStatus object.SonosApiClientException - if an error occurs during the call.SonosApiError - if there is an error from the API.SonosSessionRequest,
joinOrCreateSession(String, String, SonosSessionRequest)public SonosPlaybackSessionStatus joinSession(String clientToken, String groupId, SonosSessionRequest request) throws SonosApiClientException, SonosApiError
clientToken - for the usergroupId - to join the session inrequest - of the session you're joining - appId and appContextSonosPlaybackSessionStatus object.SonosApiClientException - if an error occurs during the call.SonosApiError - if there is an error from the API.createSession(String, String, SonosSessionRequest),
joinOrCreateSession(String, String, SonosSessionRequest)public SonosPlaybackSessionStatus joinOrCreateSession(String clientToken, String groupId, SonosSessionRequest request) throws SonosApiClientException, SonosApiError
clientToken - for the usergroupId - a String object.request - a SonosSessionRequest object.SonosPlaybackSessionStatus object.SonosApiClientException - if an error occurs during the call.SonosApiError - if there is an error from the API.createSession(String, String, SonosSessionRequest),
joinSession(String, String, SonosSessionRequest)public SonosSuccess loadCloudQueue(String clientToken, String sessionId, SonosCloudQueueRequest request) throws SonosApiClientException, SonosApiError
clientToken - for the usersessionId - a String object.request - a SonosCloudQueueRequest object.SonosApiClientException - if an error occurs during the call.SonosApiError - if there is an error from the API.public SonosSuccess loadStreamUrl(String clientToken, String sessionId, SonosStreamUrlRequest request) throws SonosApiClientException, SonosApiError
clientToken - for the usersessionId - a String object.request - a SonosStreamUrlRequest object.SonosApiClientException - if an error occurs during the call.SonosApiError - if there is an error from the API.public SonosSuccess refreshCloudQueue(String clientToken, String sessionId) throws SonosApiClientException, SonosApiError
clientToken - for the usersessionId - a String object.SonosApiClientException - if an error occurs during the call.SonosApiError - if there is an error from the API.public SonosSuccess skipToItem(String clientToken, String sessionId, SonosSessionRequest request) throws SonosApiClientException, SonosApiError
clientToken - for the usersessionId - a String object.request - a SonosSessionRequest object.SonosApiClientException - if an error occurs during the call.SonosApiError - if there is an error from the API.public SonosSuccess seek(String clientToken, String sessionId, String itemId, String positionMillis) throws SonosApiClientException, SonosApiError
clientToken - for the usersessionId - a String object.itemId - a String object.positionMillis - a String object.SonosApiClientException - if an error occurs during the call.SonosApiError - if there is an error from the API.public SonosSuccess seekRelative(String clientToken, String sessionId, String itemId, String deltaMillis) throws SonosApiClientException, SonosApiError
clientToken - for the usersessionId - a String object.itemId - a String object.deltaMillis - a String object.SonosApiClientException - if an error occurs during the call.SonosApiError - if there is an error from the API.public SonosSuccess subscribe(String clientToken, String sessionId) throws SonosApiClientException, SonosApiError
Subscribe to events for this resource.
subscribe in interface SubscribableclientToken - for the usersessionId - of the resource to subscribe toSonosApiClientException - if an error occurs during the callSonosApiError - if there is an error from the APIpublic SonosSuccess suspend(String clientToken, String sessionId, String queueVersion) throws SonosApiClientException, SonosApiError
clientToken - for the usersessionId - a String object.queueVersion - a String object.SonosApiClientException - if an error occurs during the call.SonosApiError - if there is an error from the API.public SonosSuccess unsubscribe(String clientToken, String sessionId) throws SonosApiClientException, SonosApiError
Unsubscribe from events related to this resource.
unsubscribe in interface SubscribableclientToken - for the usersessionId - of the resource to unsubscribe fromSonosApiClientException - if an error occurs during the callSonosApiError - if there is an error from the APICopyright © 2018. All rights reserved.