使用自定义播放器从 Soundcloud 的 API 流式传输私人曲目 [英] Streaming private tracks from Soundcloud's API using a Custom Player

查看:51
本文介绍了使用自定义播放器从 Soundcloud 的 API 流式传输私人曲目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我知道有很多关于创建自定义播放器的 SoundCloud 文档 - 以及使用他们自己的播放器流式传输私人声音.

So I know there's plenty of SoundCloud documentation on creating custom players -- as well as streaming private sounds with their own player.

但我找不到明确的答案:

But I can't find a definitive answer to:

我可以使用 API 通过我自己的自定义播放器流式传输私人曲目吗——但不需要任何 SoundCloud 登录身份验证?

--

或者以项目符号的形式,我想知道我是否可以:

Or in bullet form, I want to know if i can:

  • 流式传输 Soundcloud 托管的曲目
  • 这些曲目必须是私有的,不能在 SoundCloud 上公开提供
  • 播放器必须完全由我们自己设计
  • 任何人都无需登录 SoundCloud 即可收听这些曲目

--

我意识到这只会让 SoundCloud 成为音乐托管服务,所以想知道是否有人这样做过.

I realize this would just make SoundCloud into a music hosting service, so just wondering if anyone has done this.

推荐答案

理论上,是的,你可以这样做.

in theory, yes, you can do that.

首先,您需要为上传这些私人曲目的用户获取访问令牌.(这应该发生在服务器端)

first you'll need to gain access token for the users who has uploaded these private tracks. (this should happen on server side)

之后,您将把网站上的每个访问者伪装成这个默认用户,他就可以访问这些曲目了.

after that, you will impersonate every visitor on the site as this default user, and he will have access to the tracks.

但是,这不是一个好习惯.你需要担心的是你需要很好地隐藏这个令牌,这样访问者就不能滥用它.

but, this is not a good practice. you need to be worried about is that you need to hide this token pretty good, so the visitors can't abuse it.

我的建议是创建一个服务器代码,它将完成与访问令牌相关的所有工作(获取曲目、获取曲目流等),并在客户端只显示最终结果.这样,您就可以确保您的访问令牌安全.

my suggestion is to create a server code that will do all the job related to access token (getting tracks, getting tracks streams etc), and in client side just show the final results. this way, you'll keep your access token safe.

这篇关于使用自定义播放器从 Soundcloud 的 API 流式传输私人曲目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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