Access current position in Spotify Api

有些话、适合烂在心里 提交于 2019-12-11 19:19:16

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!