开发者

How to get the totalResults entry from the YouTube video API

I'm using PHP and the YouTube API to get videos from YouTube to feed to my web app, but I don't know how to get the totalResults entry

Here is my code:

$yt = new Zend_Gdata_YouTube();
$query = $yt->newVideoQuery();
$query->setQuery($searchTerm);
$query->setStartIndex($startIndex);
$query->setMaxResults($maxResults);
开发者_开发百科$feed = $yt->getVideoFeed($query);

echo $feed->totalResults; // this desn't work


The element itself is protected; you need to use the getTotalResults accessor:

echo $feed->getTotalResults();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜