开发者

Checking if a SoundCloud song is embeddable

开发者 https://www.devze.com 2023-04-09 17:45 出处:网络
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:

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 pl开发者_运维知识库ayed outside of SoundCloud." I want to make sure this doesn't happen and unallow a song if it's one of those songs.


Referring to the documentation the streamable proprety exists. And yes it's the right one.

0

精彩评论

暂无评论...
验证码 换一张
取 消