support playlist changing, shuffle, and repeat mode control
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user