The Spotify.Player static class

Does not wrap around any specific API object/endpoint.

Instead, the Spotify.Player class provides methods that accept raw Spotify IDs and call their web API versions, alongside functions that wrap around Spotify Player API endpoints.

Note

This class is 100% static, and new Spotify.Player() will never be valid, and is very likely to break things.

Methods

Method Name Parameters Return value Description
SaveCurrentlyPlaying None None Gets the currently playing track, and saves it to your Liked Songs
UnSaveCurrentlyPlaying None None Gets the currenty playing track, and removes it from your Liked Songs
SetVolume Volume (0-100) None Sets the playback volume on the current device to the number passed, clamped to 0-100
GetCurrentPlaybackInfo None A Currently Playing Object Returns info about what's currently playing (This DOES NOT include the device playback is happening on)
GetFullPlaybackInfo None A Currently Playing Context Object Returns even more info about current playback, including the device that playback is happening on
GetCurrentTrack None A track object Returns just the currently playing track, with no extra info.
GetDeviceList None An array of device objects Returns a list of all devices available for playback.
GetRecentlyPlayed None An array of play history objects Returns a list of tracks, and context that have been recently played
SeekTime TimeInMS None Seeks playback on the active device to the given time in MS
SetRepeatMode NewMode None Takes either Track, Context or Off, and sets the currently active player's repeat mode to that value (Context = on, but without the little 1 on the repeat button)
SetShuffle NewMode None Takes a true or false value, and sets shuffle on for true, and off for false.
NextTrack None None Skips to the next track.
PrevTrack None None Skips back a track.
PausePlayback None None Pauses playback on the active device.
ResumePlayback None None Resumes playback on the active device.
PlayPause None None Toggles playback being from being paused to resumed, and from resumed to paused
SwitchToDevice DeviceID None Takes the ID of a device, and switches playback to the device with the given ID.
SwitchToContext ContextType, ContextID None Takes the type, and ID of a context (a playlist/album/artist), and plays that context on the active device.
PlayTrack TrackID None Takes a track ID, and plays the track with that ID on the active device.
PlayPlaylist PlaylistID None Takes a playlist ID, and plays the playlist with that ID on the active device.
PlayAlbum AlbumID None Takes a album ID, and plays the album with that ID on the active device.