1
我正在嘗試創建一個簡單的視頻庫,以便從特定Ustream用戶的錄製視頻中提取視頻。我一直在做一些研究,看着API Documentation,但似乎無法弄清楚。使用UStream API創建視頻庫
這是我到目前爲止。
$request = 'http://api.ustream.tv';
$format = 'php'; // this can be xml, json, html, or php
$args .= 'subject=[channel]';
$args .= '&uid= [the-crossfader-show]';
$args .= '&command=[getCusomEmbedTag]';
$args .= '¶ms=[autoplay:false; mute:false; height:100; width:100;]';
$args .= '&page=[1]';
$args .= '&limit=[20]';
$args .= '&key=[4872929558631FEB4E9AEE8DDF080F28]';
// Get and config the curl session object
$session = curl_init($request.'/'.$format.'?'.$args);
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
//execute the request and close
$response = curl_exec($session);
curl_close($session);
// this line works because we requested $format='php' and not some other output format
$resultsArray = unserialize($response);
// this is your data returned; you could do something more useful here than just echo it
print_r $resultsArray['result'];
我不知道該做些什麼之後才能把它變成一個簡單的畫廊。任何人都有使用UStream API的經驗,或者對接下來要做什麼有所建議?
繼續爲其他人查看。使用命令'listAllVideos'或'listAllChannels'將返回一組結果,您可以從中建立視頻列表。 – 2013-05-30 15:38:00