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"

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

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

iex> Spotify.Player.volume_url(device_id: "abc")

"https://api.spotify.com/v1/me/player/volume?device_id=abc"

Link to this section Functions

Link to this function

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"
iex> Spotify.Player.devices_url
"https://api.spotify.com/v1/me/player/devices"
Link to this function

enqueue(conn, uri, params \\ []) View Source

Add an item to the user's playback queue. Spotify Documentation

Method: POST

Optional Params: device_id

Link to this function

enqueue_url(params \\ []) View Source

iex> Spotify.Player.enqueue_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/queue?device_id=abc"
Link to this function

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

Link to this function

get_currently_playing(conn, params \\ []) View Source

Get the user's currently playing tracks. Spotify Documentation

Method: GET

Optional Params: market, additional_types

Get the user's available devices. Spotify Documentation

Method: GET

Link to this function

get_recently_played(conn, params \\ []) View Source

Get the user's recently played tracks. Spotify Documentation

Method: GET

Optional Params: limit, after, before

iex> Spotify.Player.next_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/next?device_id=abc"
Link to this function

pause(conn, params \\ []) View Source

Pause the user's playback. Spotify Documentation

Method: PUT

Optional Params: device_id

iex> Spotify.Player.pause_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/pause?device_id=abc"
Link to this function

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

iex> Spotify.Player.play_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/play?device_id=abc"
Link to this function

player_url(params \\ []) View Source

iex> Spotify.Player.player_url(market: "US")
"https://api.spotify.com/v1/me/player?market=US"
Link to this function

previous_url(params \\ []) View Source

iex> Spotify.Player.previous_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/previous?device_id=abc"
Link to this function

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"
Link to this function

repeat_url(params \\ []) View Source

iex> Spotify.Player.repeat_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/repeat?device_id=abc"
Link to this function

seek(conn, position_ms, params \\ []) View Source

Seek to position in currently playing track. Spotify Documentation

Method: PUT

Optional Params: device_id

iex> Spotify.Player.seek_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/seek?device_id=abc"
Link to this function

set_repeat(conn, state, params \\ []) View Source

Set repeat mode for the user's playback. Spotify Documentation

Method: PUT

Optional Params: device_id

Link to this function

set_shuffle(conn, state, params \\ []) View Source

Toggle shuffle for the user's playback. Spotify Documentation

Method: PUT

Optional Params: device_id

Link to this function

set_volume(conn, volume_percent, params \\ []) View Source

Set volume for the user's playback. Spotify Documentation

Method: PUT

Optional Params: device_id

Link to this function

shuffle_url(params \\ []) View Source

iex> Spotify.Player.shuffle_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/shuffle?device_id=abc"
Link to this function

skip_to_next(conn, params \\ []) View Source

Skip the user's playback to next track. Spotify Documentation

Method: POST

Optional Params: device_id

Link to this function

skip_to_previous(conn, params \\ []) View Source

Skip the user's playback to previous track. Spotify Documentation

Method: POST

Optional Params: device_id

Link to this function

transfer_playback(conn, device_ids, params \\ []) View Source

Transfer the user's playback. Spotify Documentation

Method: PUT

Optional Params: play

Link to this function

volume_url(params \\ []) View Source

iex> Spotify.Player.volume_url(device_id: "abc")
"https://api.spotify.com/v1/me/player/volume?device_id=abc"