src/spotify-web-api.js
function(options, callback) {
    /*jshint camelcase: false */
    var _options = options || {};
    var queryParams = _options.device_id
      ? { device_id: _options.device_id }
      : null;
    var postData = {};
    ['context_uri', 'uris', 'offset'].forEach(function(field) {
      if (field in _options) {
        postData[field] = _options[field];
      }
    });
    return WebApiRequest.builder(this.getAccessToken())
      .withPath('/v1/me/player/play')
      .withQueryParameters(queryParams)
      .withHeaders({ 'Content-Type': 'application/json' })
      .withBodyParameters(postData)
      .build()
      .execute(HttpManager.put, callback);
  }
function(options, callback) {
    /*jshint camelcase: false */
    var _options = options || {};
    var queryParams = _options.device_id
      ? { device_id: _options.device_id }
      : null;
    var postData = {};
    ['context_uri', 'uris', 'offset'].forEach(function(field) {
      if (field in _options) {
        postData[field] = _options[field];
      }
    });
    return WebApiRequest.builder(this.getAccessToken())
      .withPath('/v1/me/player/play')
      .withQueryParameters(queryParams)
      .withHeaders({ 'Content-Type': 'application/json' })
      .withBodyParameters(postData)
      .build()
      .execute(HttpManager.put, callback);
  }
function ( options , callback ) { /*jshint camelcase: false */ var _options = options || { } ; var queryParams = _options . device_id ? { device_id : _options . device_id } : null ; var postData = { } ; [ 'context_uri' , 'uris' , 'offset' ] . forEach ( function ( field ) { if ( field in _options ) { postData [ field ] = _options [ field ] ; } } ) ; return WebApiRequest . builder ( this . getAccessToken ( ) ) . withPath ( '/v1/me/player/play' ) . withQueryParameters ( queryParams ) . withHeaders ( { 'Content-Type' : 'application/json' } ) . withBodyParameters ( postData ) . build ( ) . execute ( HttpManager . put , callback ) ; }
Starts o Resumes the Current User's Playback
@param {Object} [options] Options, being device_id, context_uri, offset, uris.
@param {requestCallback} [callback] Optional callback method to be called instead of the promise.
@example playbackResume({context_uri: 'spotify:album:5ht7ItJgpBH7W6vJ5BqpPr'}).then(...)
@returns {Promise|undefined} A promise that if successful, resolves into a paging object of tracks,
otherwise an error. Not returned if a callback is given.
Starts o Resumes the Current User s Playback