Exspotify.Player (Exspotify v0.1.0)
View SourceProvides functions for interacting with the Player endpoints of the Spotify Web API. Most endpoints require a user access token with appropriate scopes and an active device. See: https://developer.spotify.com/documentation/web-api/reference/player
Summary
Functions
Add an item to the end of the user's playback queue. Warning: This will change playback for the user. Requires: user-modify-playback-state scope.
Get a list of the user's available devices. Requires: user-read-playback-state scope.
Get information about the user's currently playing track. Requires: user-read-currently-playing scope.
Get information about the user's current playback state. Requires: user-read-playback-state scope.
Get the user's current playback queue. Requires: user-read-playback-state scope.
Get the user's recently played tracks (paginated). Requires: user-read-recently-played scope.
Pause playback on the user's active device. Warning: This will pause playback for the user. Requires: user-modify-playback-state scope.
Seek to a position in the currently playing track. Warning: This will change playback for the user. Requires: user-modify-playback-state scope.
Set playback volume. Warning: This will change playback for the user. Requires: user-modify-playback-state scope.
Set repeat mode for playback. Warning: This will change playback for the user. Requires: user-modify-playback-state scope.
Skip to the next track in the user's queue. Warning: This will change playback for the user. Requires: user-modify-playback-state scope.
Skip to the previous track in the user's queue. Warning: This will change playback for the user. Requires: user-modify-playback-state scope.
Start or resume playback on the user's active device. Warning: This will start or change playback for the user. Requires: user-modify-playback-state scope.
Toggle shuffle playback. Warning: This will change playback for the user. Requires: user-modify-playback-state scope.
Transfer playback to a new device. Warning: This will change the user's active playback device. Requires: user-modify-playback-state scope.
Functions
@spec add_to_queue(String.t(), String.t()) :: {:ok, any()} | {:error, Exspotify.Error.t()}
Add an item to the end of the user's playback queue. Warning: This will change playback for the user. Requires: user-modify-playback-state scope.
@spec get_available_devices(String.t()) :: {:ok, Exspotify.Structs.Devices.t()} | {:error, Exspotify.Error.t()}
Get a list of the user's available devices. Requires: user-read-playback-state scope.
@spec get_currently_playing(String.t()) :: {:ok, Exspotify.Structs.PlaybackState.t() | nil} | {:error, Exspotify.Error.t()}
Get information about the user's currently playing track. Requires: user-read-currently-playing scope.
@spec get_playback_state(String.t()) :: {:ok, Exspotify.Structs.PlaybackState.t() | nil} | {:error, Exspotify.Error.t()}
Get information about the user's current playback state. Requires: user-read-playback-state scope.
@spec get_queue(String.t()) :: {:ok, Exspotify.Structs.Queue.t()} | {:error, Exspotify.Error.t()}
Get the user's current playback queue. Requires: user-read-playback-state scope.
@spec get_recently_played( String.t(), keyword() ) :: {:ok, Exspotify.Structs.RecentlyPlayed.t()} | {:error, Exspotify.Error.t()}
Get the user's recently played tracks (paginated). Requires: user-read-recently-played scope.
@spec pause_playback(String.t()) :: {:ok, any()} | {:error, Exspotify.Error.t()}
Pause playback on the user's active device. Warning: This will pause playback for the user. Requires: user-modify-playback-state scope.
@spec seek_to_position(String.t(), integer()) :: {:ok, any()} | {:error, Exspotify.Error.t()}
Seek to a position in the currently playing track. Warning: This will change playback for the user. Requires: user-modify-playback-state scope.
@spec set_playback_volume(String.t(), integer()) :: {:ok, any()} | {:error, Exspotify.Error.t()}
Set playback volume. Warning: This will change playback for the user. Requires: user-modify-playback-state scope.
@spec set_repeat_mode(String.t(), String.t()) :: {:ok, any()} | {:error, Exspotify.Error.t()}
Set repeat mode for playback. Warning: This will change playback for the user. Requires: user-modify-playback-state scope.
@spec skip_to_next(String.t()) :: {:ok, any()} | {:error, Exspotify.Error.t()}
Skip to the next track in the user's queue. Warning: This will change playback for the user. Requires: user-modify-playback-state scope.
@spec skip_to_previous(String.t()) :: {:ok, any()} | {:error, Exspotify.Error.t()}
Skip to the previous track in the user's queue. Warning: This will change playback for the user. Requires: user-modify-playback-state scope.
@spec start_playback(String.t(), map()) :: {:ok, any()} | {:error, Exspotify.Error.t()}
Start or resume playback on the user's active device. Warning: This will start or change playback for the user. Requires: user-modify-playback-state scope.
@spec toggle_shuffle(String.t(), boolean()) :: {:ok, any()} | {:error, Exspotify.Error.t()}
Toggle shuffle playback. Warning: This will change playback for the user. Requires: user-modify-playback-state scope.
@spec transfer_playback(String.t(), [String.t()]) :: {:ok, any()} | {:error, Exspotify.Error.t()}
Transfer playback to a new device. Warning: This will change the user's active playback device. Requires: user-modify-playback-state scope.