YouTube Video API totalResults giriş almak için nasıl

1 Cevap php

Benim web uygulaması beslemek için YouTube videoları almak için PHP ve YouTube API kullanarak yapıyorum ama totalResults giriş almak için nasıl bilmiyorum

İşte benim kod:

$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

1 Cevap

Elemanının kendisi korunur; Eğer getTotalResults erişimciyi kullanmanız gerekir:

echo $feed->getTotalResults();