Method: RSpotify::Player#queue

Defined in:
lib/rspotify/player.rb

#queue(device_id = nil, uri) ⇒ Object

Add an item to the end of the user’s current playback queue If device_id is not passed, the currently active spotify app will be triggered

Examples:

player = user.player
player.queue("spotify:track:4iV5W9uYEdYUVa79Axb7Rh")

Parameters:

  • device_id (String) (defaults to: nil)

    the ID of the device to set the repeat state on.

  • uri (String)

    the spotify uri of the track to be queued



101
102
103
104
105
# File 'lib/rspotify/player.rb', line 101

def queue(device_id = nil, uri)
  url = "me/player/queue?uri=#{uri}"
  url = device_id.nil? ? url : "#{url}&device_id=#{device_id}"
  User.oauth_post(@user.id, url, {})
end