访问 Spotify Api 中的当前位置 [英] Access current position in Spotify Api

查看:36
本文介绍了访问 Spotify Api 中的当前位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于 Spotify 最近改变了他们的 API,他们的文档并不是最好的.他们的文档说要访问歌曲中的当前位置,访问记录为未定义的models.player.position".

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.

有没有人使用新的 Spotify API 获得歌曲位置的运气更​​好?

Has anyone had better luck getting the song position with the new Spotify API?

推荐答案

position是一个需要通过load函数获取的属性:

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 */
    });

这篇关于访问 Spotify Api 中的当前位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆