0

当 Spotify JavaScript API 中的曲目被加星标或未加星标时,是否会触发任何事件?如果是,我该如何为此定义回调?

4

1 回答 1

2

您需要查看已加星标的播放列表以了解项目更改:

var sp = getSpotifyApi();
var models = sp.require('$api/models');

var playlist = models.library.starredPlaylist;
playlist.observe(models.EVENT.ITEMS_ADDED, function() {
  console.log('New starred tracks!');
  console.log(playlist.tracks);
});
于 2012-10-17T08:40:40.380 回答