php-soundcloud icon indicating copy to clipboard operation
php-soundcloud copied to clipboard

load player server side

Open drstreet opened this issue 10 years ago • 0 comments

hi everyone,

i want use Embedding a SoundCloud Widget from this url https://developers.soundcloud.com/docs/api/guide#playing

require_once 'Services/Soundcloud.php';

// create a client object with your app credentials $client = new Services_Soundcloud('YOUR_CLIENT_ID', 'YOUR_CLIENT_SECRET'); $client->setCurlOptions(array(CURLOPT_FOLLOWLOCATION => 1));

// get a tracks oembed data $track_url = 'http://soundcloud.com/forss/flickermood'; $embed_info = json_decode($client->get('oembed', array('url' => $track_url)));

// render the html for the player widget print $embed_info->html;

i have bellow errors : Fatal error: Uncaught exception 'Services_Soundcloud_Invalid_Http_Response_Code_Exception' with message 'The requested URL responded with HTTP code 302.' in /home/XXXX/domains/xc.com/public_html/system/Soundcloud.php:941 Stack trace: #0 /home/XXXXX/domains/xc.com/public_html/system/Soundcloud.php(600): Services_Soundcloud->_request('https://api.sou...', Array) #1 /home/XXXXX/domains/xc.com/public_html/themes/default/html/single_post.php(235): Services_Soundcloud->get('oembed', Array) #2 /home/XXXXXX/domains/xc.com/public_html/system/classes/class_page.php(271): require('/home/XXXXX/d...') #3

drstreet avatar Feb 18 '15 19:02 drstreet