【问题标题】:how to get a stream from a simple soundcloud URL? [closed]如何从简单的 soundcloud URL 获取流? [关闭]
【发布时间】:2012-04-19 15:20:26
【问题描述】:

我正在使用 Javascript 为 SoundCloud 和 SoundManager2 创建另一个自定义播放器。

我可以从 api.soundcloud.com/tracks/1928712958 等 URI 播放流,但我想使用 Soundcloud url(如 http://soundcloud.com/damianmarley/skrillex-damian-marley-make-it)作为输入。

我该怎么做?

【问题讨论】:

标签: javascript soundcloud soundmanager2


【解决方案1】:

首先你需要在声音云上创建你自己的应用

创建应用后你 git

现在您可以调用 soundcloud API,但您需要知道 userId 或 PlaylistId 或 TrackId

要知道用户的ID,我们可以使用/resolve函数

假设用户链接是

https://soundcloud.com/a-salem-2

要知道用户 ID,我们使用如下解析函数

http://api.soundcloud.com/resolve.json?url=https://soundcloud.com/a-salem-2&client_id=YOUR_CLIENT_ID

这会给你 userId,在我的例子中是 [75258312]

获取用户轨迹

https://api.soundcloud.com/users/75258312/tracks.json?client_id=YOUR_CLIENT_ID

希望有所帮助:)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-08
    • 2021-03-29
    • 2017-10-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-21
    相关资源
    最近更新 更多