spotify-web-api-node
spotify-web-api-node copied to clipboard
Is it possible to make spotify player play some track by track uri/url ?
Yeah, This is what I did to get this to work. spotifyAPI is the auth'd client.
spotifyApi.addToQueue('spotify:track:4cOdK2wGLETKBW3PvgPWqT') //track URI = spotify:track: ID .then(function(data) { spotifyApi.skipToNext() .then(data => { console.log(data);}) .catch(err => {console.log(err);}); })
I tried this, and was not disappointed. Well done @Noelg14 🤣
Formatted a bit more cleanly:
spotifyApi
.addToQueue('spotify:track:4cOdK2wGLETKBW3PvgPWqT')
.then(function () {
spotifyApi
.skipToNext()
.then((data) => {
console.log(data);
})
.catch((err) => {
console.log(err);
});
});