在Spotify JavaScript API中,当曲目获得加星标或取消星标时,是否有任何事件被触发?如果是,我该如何为此定义回调?
答案 0 :(得分: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);
});