Skip to content

Commit 7bd4385

Browse files
committed
Merge branch 'patch-1' of https://github.com/jdnvn/spotify-web-api-js into jdnvn-patch-1
2 parents 9a54421 + 52d349f commit 7bd4385

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/spotify-web-api.js

+22
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ var SpotifyWebApi = (function () {
481481
return _checkParamsAndPerformRequest(requestData, callback);
482482
};
483483

484+
484485
/**
485486
* Add the current user as a follower of one playlist.
486487
* See [Follow a Playlist](https://developer.spotify.com/web-api/follow-playlist/) on
@@ -1649,6 +1650,27 @@ var SpotifyWebApi = (function () {
16491650
return _checkParamsAndPerformRequest(requestData, newOptions, callback);
16501651
};
16511652

1653+
1654+
/**
1655+
* adds a song to the queue
1656+
* See [Add an Item to the User's Playback Queue](https://developer.spotify.com/documentation/web-api/reference/player/add-to-queue/) on
1657+
* the Spotify Developer site for more information about the endpoint.
1658+
*/
1659+
1660+
Constr.prototype.queue = function (uri, options, callback) {
1661+
options = options || {};
1662+
var params =
1663+
'device_id' in options ? { uri: uri, device_id: options.device_id } : {uri: uri};
1664+
var requestData = {
1665+
type: 'PUT',
1666+
url: _baseUri + '/me/player/queue',
1667+
params: params
1668+
};
1669+
return _checkParamsAndPerformRequest(requestData, options, callback);
1670+
};
1671+
1672+
1673+
16521674
/**
16531675
* Pause playback on the user’s account.
16541676
* See [Pause a User’s Playback](https://developer.spotify.com/web-api/pause-a-users-playback/) on

0 commit comments

Comments
 (0)