public interface PlayerApi
SpotifyAppRemote.getPlayerApi()
.SpotifyAppRemote
Modifier and Type | Interface and Description |
---|---|
static class |
PlayerApi.StreamType
Available Streamtypes
|
Modifier and Type | Method and Description |
---|---|
CallResult<CrossfadeState> |
getCrossfadeState()
Returns the state of the audio crossfade setting.
|
CallResult<PlayerState> |
getPlayerState()
Get the player state of the Spotify app Introduced in
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1 |
CallResult<Empty> |
pause()
Pause playback if it's currently playing Introduced in
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1 |
CallResult<Empty> |
play(java.lang.String uri)
Play the given Spotify uri.
|
CallResult<Empty> |
play(java.lang.String uri,
PlayerApi.StreamType streamType)
Play the given Spotify uri with specific behaviour for that streamtype - such as initiating
playback of an URI on the audio stream for alarms.
|
CallResult<Empty> |
queue(java.lang.String uri)
Queue the given Spotify uri.
|
CallResult<Empty> |
resume()
Resume playback if it's currently paused Introduced in
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1 |
CallResult<Empty> |
seekTo(long positionMs)
Seek to specified position in the song.
|
CallResult<Empty> |
seekToRelativePosition(long milliseconds)
Seek to relative position in a track.
|
CallResult<Empty> |
setPodcastPlaybackSpeed(PlaybackSpeed.PodcastPlaybackSpeed podcastPlaybackSpeed)
Set playback speed for Podcast.
|
CallResult<Empty> |
setRepeat(int repeatMode)
Set repeat mode to repeatMode Introduced in
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1 |
CallResult<Empty> |
setShuffle(boolean enabled)
Set the shuffle state Introduced in
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1 |
CallResult<Empty> |
skipNext()
Skip to the next track in the currently playing context if there is one.
|
CallResult<Empty> |
skipPrevious()
Restart the current track or, if current track has played for less than 3 seconds, skip to
the previous track in the currently playing context Introduced in
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1 |
CallResult<Empty> |
skipToIndex(java.lang.String uri,
int index)
Skip to track at specified index in album or playlist.
|
Subscription<PlayerContext> |
subscribeToPlayerContext()
Create a subscription for player context changes
|
Subscription<PlayerState> |
subscribeToPlayerState()
Create a subscription for player state changes Introduced in
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1 |
CallResult<Empty> |
toggleRepeat()
Toggle repeat mode Introduced in
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1 |
CallResult<Empty> |
toggleShuffle()
Toggle the shuffle state Introduced in
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1 |
CallResult<Empty> play(java.lang.String uri)
NOTE Capabilities.canPlayOnDemand
must be true to play a Track.
Introduced in com.spotify.protocol.client.RequiredFeatures#FEATURES_V1
uri
- to playCallResult<Empty> play(java.lang.String uri, PlayerApi.StreamType streamType)
Introduced in com.spotify.protocol.client.RequiredFeatures#FEATURES_V3
uri
- to playstreamType
- Must be one of defined PlayerApi.StreamType
CallResult<Empty> queue(java.lang.String uri)
uri
- to queueCallResult<Empty> resume()
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1
CallResult<Empty> pause()
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1
CallResult<Empty> setPodcastPlaybackSpeed(PlaybackSpeed.PodcastPlaybackSpeed podcastPlaybackSpeed)
PlaybackSpeed
Introduced in com.spotify.protocol.client.RequiredFeatures#FEATURES_V3
podcastPlaybackSpeed
- predefined PlaybackSpeed.PodcastPlaybackSpeed
valuesCallResult<Empty> skipNext()
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1
CallResult<Empty> skipPrevious()
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1
CallResult<Empty> skipToIndex(java.lang.String uri, int index)
Introduced in com.spotify.protocol.client.RequiredFeatures#FEATURES_V3
uri
- of album or playlist to play the track from.index
- of track to be played. Index can have value 0 or higher. Negative values will be
ignored.CallResult<Empty> setShuffle(boolean enabled)
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1
enabled
- true enables shuffling, false turns it offCallResult<Empty> toggleShuffle()
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1
CallResult<Empty> setRepeat(int repeatMode)
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1
CallResult<Empty> toggleRepeat()
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1
CallResult<Empty> seekTo(long positionMs)
com.spotify.protocol.client.RequiredFeatures#FEATURES_V2
positionMs
- position to seek toCallResult<Empty> seekToRelativePosition(long milliseconds)
com.spotify.protocol.client.RequiredFeatures#FEATURES_V2
milliseconds
- relative position to seek toCallResult<PlayerState> getPlayerState()
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1
Subscription<PlayerState> subscribeToPlayerState()
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1
Subscription<PlayerContext> subscribeToPlayerContext()
CallResult<CrossfadeState> getCrossfadeState()
Introduced in com.spotify.protocol.client.RequiredFeatures#FEATURES_V3