@@ -1076,7 +1076,7 @@ SpotifyWebApi.prototype = {
1076
1076
1077
1077
/**
1078
1078
* Starts o Resumes the Current User's Playback
1079
- * @param {Object } [options] Options, being context_uri, offset, uris.
1079
+ * @param {Object } [options] Options, being device_id, context_uri, offset, uris.
1080
1080
* @param {requestCallback } [callback] Optional callback method to be called instead of the promise.
1081
1081
* @example playbackResume({context_uri: 'spotify:album:5ht7ItJgpBH7W6vJ5BqpPr'}).then(...)
1082
1082
* @returns {Promise|undefined } A promise that if successful, resolves into a paging object of tracks,
@@ -1103,14 +1103,17 @@ SpotifyWebApi.prototype = {
1103
1103
1104
1104
/**
1105
1105
* Pauses the Current User's Playback
1106
+ * @param {Object } [options] Options, for now device_id,
1106
1107
* @param {requestCallback } [callback] Optional callback method to be called instead of the promise.
1107
1108
* @example playbackPause().then(...)
1108
1109
* @returns {Promise|undefined } A promise that if successful, resolves into a paging object of tracks,
1109
1110
* otherwise an error. Not returned if a callback is given.
1110
1111
*/
1111
- pause : function ( callback ) {
1112
+ pause : function ( options , callback ) {
1112
1113
return WebApiRequest . builder ( this . getAccessToken ( ) )
1113
1114
. withPath ( '/v1/me/player/pause' )
1115
+ /*jshint camelcase: false */
1116
+ . withQueryParameters ( options && options . device_id ? { device_id : options . device_id } : null )
1114
1117
. withHeaders ( { 'Content-Type' : 'application/json' } )
1115
1118
. build ( )
1116
1119
. execute ( HttpManager . put , callback ) ;
0 commit comments