support playlist changing, shuffle, and repeat mode control

This commit is contained in:
Chris Ham
2018-12-11 11:25:15 -08:00
parent 11655fac86
commit 4b6bb38192
3 changed files with 93 additions and 7 deletions

View File

@@ -99,6 +99,10 @@ function Spotify(config) {
});
};
this.playContext = (uri) => {
return spotifyApi.play({"context_uri": uri});
};
this.skip = () => {
return spotifyApi.skipToNext();
};
@@ -117,6 +121,14 @@ function Spotify(config) {
if (volume > 100) volume = 100;
return spotifyApi.setVolume(volume);
};
this.shuffle = (state) => {
return spotifyApi.setShuffle({"state": state});
};
this.repeat = (state) => {
return spotifyApi.setRepeat({"state": state});
};
}
module.exports = Spotify;