loadByUUID($object_uuid)) { print "Scoreboard no longer available."; exit; } $configs = $ao->config_name_value_hash(); if ( !isset($configs['sloodleustreamchannel']) || $configs['sloodleustreamchannel'] == '') { print "Error: ustream channel not set"; exit; } $channel = $configs['sloodleustreamchannel']; if ( !defined('SLOODLE_USTREAM_API_KEY') || (SLOODLE_USTREAM_API_KEY == '') ) { print "Error: No API key, could not get channel."; exit; } $url = 'http://api.ustream.tv/json/channel/'.urlencode($channel).'/getCustomEmbedTag?key='.SLOODLE_USTREAM_API_KEY.'¶ms=autoplay:true;mute:false;height:980;width:980'; $ch = curl_init(); // initialize curl handle curl_setopt($ch, CURLOPT_URL, $url); // set url to post to curl_setopt($ch, CURLOPT_FAILONERROR,0); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable curl_setopt($ch, CURLOPT_TIMEOUT, 30); $result = curl_exec($ch); // run the whole process $info = curl_getinfo($ch); curl_close($ch); $json = json_decode($result); if (!isset($json->results)) { print "Error: No stream available right now"; exit; } $embed = $json->results; if ($embed == '') { print "Error: No stream available right now"; exit; } print ''; print '
'; print '