Deezer API-获取用户当前正在播放的曲目 [英] Deezer API - Get user's currently playing track

查看:93
本文介绍了Deezer API-获取用户当前正在播放的曲目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以使用Deezer API来了解音轨的状态.正在播放"还是不播放"?

Is there any way to know the state of a track using the deezer api. "playing" or "not playing" ?

我在文档中找不到任何内容...我想知道应用程序的每个用户当前正在播放的曲目...或者至少是最近播放的曲目.

I can't find anything in the docs... I'd like to know the currently playing track for each user of my app... Or at least the last played track.

我认为可能存在一些隐私问题...有什么想法吗?

I assume there might be some privacy issues... any thought?

推荐答案

我们没有正在播放"状态,但是您可以使用用户/历史记录"字段:GET https://api.deezer.com/user/1494543/history

We don't have a 'now playing' status but you can use the User/History fields: GET https://api.deezer.com/user/1494543/history

这将为您提供给定用户的完整分页收听历史记录,几乎实时更新(有时允许1或2分钟).第一个结果是最后听过的歌曲.

That will give you the full paginated listening history of a given user, updated almost realtime (allow 1 or 2 minutes sometimes). The first result is the last song listened.

关于隐私,您需要在登录时询问"listening_history"权限.

Regarding privacy, you'll need to ask the 'listening_history' permission at login.

这篇关于Deezer API-获取用户当前正在播放的曲目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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