2012-08-10 35 views
0

我希望我的查詢結果只在視頻中比例如7分鐘短。那可能嗎?youtube zend api:結果短於n分鐘

目前我使用這個:

$yt = new Zend_Gdata_YouTube(); 
$yt->setMajorProtocolVersion(2); 
$query = $yt->newVideoQuery(); 
$query->setOrderBy('relevance'); 
$query->setSafeSearch('none'); 
$query->setVideoQuery($searchTerms); 

// Note that we need to pass the version number to the query URL function 
// to ensure backward compatibility with version 1 of the API. 
$videoFeed = $yt->getVideoFeed($query->getQueryUrl(2)); 

文檔說,有一個 「時間」 參數:https://developers.google.com/youtube/2.0/reference?hl=de#durationsp

但不幸的是我沒有運氣

$query->setDuration('short'); 

但是,這是無論如何,它不會做它,而它會尋找短於四分鐘的視頻。

任何想法?

克里斯

回答

0

我認爲你可能會想嘗試$query->setSeconds(240);

我發現了信息:Zend_Gdata_YouTube_Extension_DurationInteracting with Gdata

好運。

+0

對不起。不起作用。我幫助自己使用javascript api,並且如果持續時間超過x秒,就簡單地跳過視頻。 – 2012-08-19 20:23:04