问题
Since Spotify changed around their API recently, their documentation isn't the greatest. Their docs say to access the current position in a song, access `models.player.position' which logs as being undefined.
Has anyone had better luck getting the song position with the new Spotify API?
回答1:
position
is an attribute that needs to be fetched through the load
function:
models.player.load('position')
.done(
function(p){
/* p.position stores the current position */
});
来源:https://stackoverflow.com/questions/18168334/access-current-position-in-spotify-api