检查 SoundCloud 歌曲是否可嵌入
我正在尝试使用 SoundCloud API 来检查歌曲是否可嵌入,这与可流式传输相同吗?我的代码如下所示:
$trackid = $track['id'];
$username = mysql_real_escape_string($track['user']['username']);
$title = mysql_real_escape_string($track['title']);
$downloadable = $track['downloadable'];
$streamable = $track['streamable'];
// Check if streamable
if(!$streamable) {
header( 'Location: error.php' );
} else { ...
我可以获得 trackid、用户名、标题和名称。可以轻松下载,但是可流式传输是要寻找的正确属性吗?我说的是当你去嵌入一首歌曲时,它会显示“哎呀,这首歌无法在 SoundCloud 之外播放”。我想确保这种情况不会发生,并且如果某首歌是其中一首,则不允许播放该歌曲。
I'm trying to use the SoundCloud API to check if a song is embeddable, is this the same as streamable? My code looks like this:
$trackid = $track['id'];
$username = mysql_real_escape_string($track['user']['username']);
$title = mysql_real_escape_string($track['title']);
$downloadable = $track['downloadable'];
$streamable = $track['streamable'];
// Check if streamable
if(!$streamable) {
header( 'Location: error.php' );
} else { ...
I can get the trackid, username, title & downloadable easily, but is streamable the correct property to look for? I'm talking about when you go to embed a song and it says "Oops this track can't be played outside of SoundCloud." I want to make sure this doesn't happen and unallow a song if it's one of those songs.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
参考文档,存在
streamable
属性。是的,这是正确的。Referring to the documentation the
streamable
proprety exists. And yes it's the right one.