Sptfy.Player (Sptfy v0.1.3) View Source

https://developer.spotify.com/documentation/web-api/reference-beta/#category-player

Link to this section Summary

Functions

POST /v1/me/player/queue

GET /v1/me/player/currently-playing

GET /v1/me/player/devices

GET /v1/me/player/recently-played

PUT /v1/me/player/pause

PUT /v1/me/player/play

PUT /v1/me/player/seek

PUT /v1/me/player/repeat

PUT /v1/me/player/shuffle

PUT /v1/me/player/volume

POST /v1/me/player/next

POST /v1/me/player/previous

Link to this section Functions

Link to this function

enqueue(token, params \\ %{})

View Source

Specs

enqueue(token :: String.t(), params :: map() | Keyword.t()) ::
  :ok | {:error, Sptfy.Object.Error.t()} | {:error, Mint.Types.error()}

POST /v1/me/player/queue

Parameters

  • uri: required
  • device_id
Link to this function

get_currently_playing(token, params \\ %{})

View Source

Specs

get_currently_playing(token :: String.t(), params :: map() | Keyword.t()) ::
  {:ok, Sptfy.Object.CurrentlyPlaying.t()}
  | {:error, Sptfy.Object.Error.t()}
  | {:error, Mint.Types.error()}

GET /v1/me/player/currently-playing

Parameters

  • market
  • additional_types
Link to this function

get_devices(token, params \\ %{})

View Source

Specs

get_devices(token :: String.t(), params :: map() | Keyword.t()) ::
  {:ok, [Sptfy.Object.Device.t()]}
  | {:error, Sptfy.Object.Error.t()}
  | {:error, Mint.Types.error()}

GET /v1/me/player/devices

Link to this function

get_playback(token, params \\ %{})

View Source

Specs

get_playback(token :: String.t(), params :: map() | Keyword.t()) ::
  {:ok, Sptfy.Object.Playback.t()}
  | {:error, Sptfy.Object.Error.t()}
  | {:error, Mint.Types.error()}

GET /v1/me/player

Parameters

  • market
  • additional_types
Link to this function

get_recently_played(token, params \\ %{})

View Source

Specs

get_recently_played(token :: String.t(), params :: map() | Keyword.t()) ::
  {:ok, Sptfy.Object.CursorPaging.t()}
  | {:error, Sptfy.Object.Error.t()}
  | {:error, Mint.Types.error()}

GET /v1/me/player/recently-played

Parameters

  • limit
  • before
  • after
Link to this function

pause(token, params \\ %{})

View Source

Specs

pause(token :: String.t(), params :: map() | Keyword.t()) ::
  :ok | {:error, Sptfy.Object.Error.t()} | {:error, Mint.Types.error()}

PUT /v1/me/player/pause

Parameters

  • device_id
Link to this function

play(token, params \\ %{})

View Source

Specs

play(token :: String.t(), params :: map() | Keyword.t()) ::
  :ok | {:error, Sptfy.Object.Error.t()} | {:error, Mint.Types.error()}

PUT /v1/me/player/play

Parameters

  • device_id
  • context_uri
  • uris
  • offset
  • position_ms
Link to this function

seek(token, params \\ %{})

View Source

Specs

seek(token :: String.t(), params :: map() | Keyword.t()) ::
  :ok | {:error, Sptfy.Object.Error.t()} | {:error, Mint.Types.error()}

PUT /v1/me/player/seek

Parameters

  • position_ms: required
  • device_id
Link to this function

set_repeat(token, params \\ %{})

View Source

Specs

set_repeat(token :: String.t(), params :: map() | Keyword.t()) ::
  :ok | {:error, Sptfy.Object.Error.t()} | {:error, Mint.Types.error()}

PUT /v1/me/player/repeat

Parameters

  • state: required
  • device_id
Link to this function

set_shuffle(token, params \\ %{})

View Source

Specs

set_shuffle(token :: String.t(), params :: map() | Keyword.t()) ::
  :ok | {:error, Sptfy.Object.Error.t()} | {:error, Mint.Types.error()}

PUT /v1/me/player/shuffle

Parameters

  • state: required
  • device_id
Link to this function

set_volume(token, params \\ %{})

View Source

Specs

set_volume(token :: String.t(), params :: map() | Keyword.t()) ::
  :ok | {:error, Sptfy.Object.Error.t()} | {:error, Mint.Types.error()}

PUT /v1/me/player/volume

Parameters

  • volume_percent: required
  • device_id
Link to this function

skip_to_next(token, params \\ %{})

View Source

Specs

skip_to_next(token :: String.t(), params :: map() | Keyword.t()) ::
  :ok | {:error, Sptfy.Object.Error.t()} | {:error, Mint.Types.error()}

POST /v1/me/player/next

Parameters

  • device_id
Link to this function

skip_to_prev(token, params \\ %{})

View Source

Specs

skip_to_prev(token :: String.t(), params :: map() | Keyword.t()) ::
  :ok | {:error, Sptfy.Object.Error.t()} | {:error, Mint.Types.error()}

POST /v1/me/player/previous

Parameters

  • device_id
Link to this function

transfer_playback(token, params \\ %{})

View Source

Specs

transfer_playback(token :: String.t(), params :: map() | Keyword.t()) ::
  :ok | {:error, Sptfy.Object.Error.t()} | {:error, Mint.Types.error()}

PUT /v1/me/player

Parameters

  • device_ids: required
  • play