【发布时间】:2012-08-10 20:52:34
【问题描述】:
我希望我的查询只生成短于例如 7 分钟的视频。这可能吗?
目前我用这个:
$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');
但这无论如何都不会这样做,因为它会寻找短于四分钟的视频。
有什么想法吗?
克里斯
【问题讨论】:
标签: php zend-framework search youtube-api