spotify_ex v2.2.1 Spotify.Player View Source
Provides functions for retrieving and manipulating user's current playback.
https://developer.spotify.com/documentation/web-api/reference/player/
Link to this section Summary
Functions
iex> Spotify.Player.currently_playing_url(market: "US")
"https://api.spotify.com/v1/me/player/currently-playing?market=US"
iex> Spotify.Player.devices_url
"https://api.spotify.com/v1/me/player/devices"
Add an item to the user's playback queue. Spotify Documentation
iex> Spotify.Player.enqueue_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/queue?device_id=abc"
Get information about the user's playback currently playing context. Spotify Documentation
Get the user's currently playing tracks. Spotify Documentation
Get the user's available devices. Spotify Documentation
Get the user's recently played tracks. Spotify Documentation
iex> Spotify.Player.next_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/next?device_id=abc"
Pause the user's playback. Spotify Documentation
iex> Spotify.Player.pause_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/pause?device_id=abc"
Start/resume the user's playback. Spotify Documentation
iex> Spotify.Player.play_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/play?device_id=abc"
iex> Spotify.Player.player_url(market: "US")
"https://api.spotify.com/v1/me/player?market=US"
iex> Spotify.Player.previous_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/previous?device_id=abc"
iex> Spotify.Player.recently_played_url(limit: 50)
"https://api.spotify.com/v1/me/player/recently-played?limit=50"
iex> Spotify.Player.repeat_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/repeat?device_id=abc"
Seek to position in currently playing track. Spotify Documentation
iex> Spotify.Player.seek_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/seek?device_id=abc"
Set repeat mode for the user's playback. Spotify Documentation
Toggle shuffle for the user's playback. Spotify Documentation
Set volume for the user's playback. Spotify Documentation
iex> Spotify.Player.shuffle_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/shuffle?device_id=abc"
Skip the user's playback to next track. Spotify Documentation
Skip the user's playback to previous track. Spotify Documentation
Transfer the user's playback. Spotify Documentation
iex> Spotify.Player.volume_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/volume?device_id=abc"
Link to this section Functions
build_response(body) View Source
currently_playing_url(params \\ []) View Source
iex> Spotify.Player.currently_playing_url(market: "US")
"https://api.spotify.com/v1/me/player/currently-playing?market=US"
devices_url() View Source
iex> Spotify.Player.devices_url
"https://api.spotify.com/v1/me/player/devices"
enqueue(conn, uri, params \\ []) View Source
Add an item to the user's playback queue. Spotify Documentation
Method: POST
Optional Params: device_id
enqueue_url(params \\ []) View Source
iex> Spotify.Player.enqueue_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/queue?device_id=abc"
get_current_playback(conn, params \\ []) View Source
Get information about the user's playback currently playing context. Spotify Documentation
Method: GET
Optional Params: market
, additional_types
get_currently_playing(conn, params \\ []) View Source
Get the user's currently playing tracks. Spotify Documentation
Method: GET
Optional Params: market
, additional_types
get_devices(conn) View Source
Get the user's available devices. Spotify Documentation
Method: GET
get_recently_played(conn, params \\ []) View Source
Get the user's recently played tracks. Spotify Documentation
Method: GET
Optional Params: limit
, after
, before
handle_response(arg) View Source
next_url(params \\ []) View Source
iex> Spotify.Player.next_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/next?device_id=abc"
pause(conn, params \\ []) View Source
Pause the user's playback. Spotify Documentation
Method: PUT
Optional Params: device_id
pause_url(params \\ []) View Source
iex> Spotify.Player.pause_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/pause?device_id=abc"
play(conn, params \\ []) View Source
Start/resume the user's playback. Spotify Documentation
Method: PUT
Optional Params: device_id
, context_uri
, uris
, offset
, position_ms
play_url(params \\ []) View Source
iex> Spotify.Player.play_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/play?device_id=abc"
player_url(params \\ []) View Source
iex> Spotify.Player.player_url(market: "US")
"https://api.spotify.com/v1/me/player?market=US"
previous_url(params \\ []) View Source
iex> Spotify.Player.previous_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/previous?device_id=abc"
recently_played_url(params \\ []) View Source
iex> Spotify.Player.recently_played_url(limit: 50)
"https://api.spotify.com/v1/me/player/recently-played?limit=50"
repeat_url(params \\ []) View Source
iex> Spotify.Player.repeat_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/repeat?device_id=abc"
seek(conn, position_ms, params \\ []) View Source
Seek to position in currently playing track. Spotify Documentation
Method: PUT
Optional Params: device_id
seek_url(params \\ []) View Source
iex> Spotify.Player.seek_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/seek?device_id=abc"
set_repeat(conn, state, params \\ []) View Source
Set repeat mode for the user's playback. Spotify Documentation
Method: PUT
Optional Params: device_id
set_shuffle(conn, state, params \\ []) View Source
Toggle shuffle for the user's playback. Spotify Documentation
Method: PUT
Optional Params: device_id
set_volume(conn, volume_percent, params \\ []) View Source
Set volume for the user's playback. Spotify Documentation
Method: PUT
Optional Params: device_id
shuffle_url(params \\ []) View Source
iex> Spotify.Player.shuffle_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/shuffle?device_id=abc"
skip_to_next(conn, params \\ []) View Source
Skip the user's playback to next track. Spotify Documentation
Method: POST
Optional Params: device_id
skip_to_previous(conn, params \\ []) View Source
Skip the user's playback to previous track. Spotify Documentation
Method: POST
Optional Params: device_id
transfer_playback(conn, device_ids, params \\ []) View Source
Transfer the user's playback. Spotify Documentation
Method: PUT
Optional Params: play
volume_url(params \\ []) View Source
iex> Spotify.Player.volume_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/volume?device_id=abc"