how to get contentDetails part from youtube video list -


i working on youtube api v3 , want show each video duration in list. here code when run code gives me error

"fatal error: uncaught exception 'exception' message 'error 400 contentdetails : unknownpart' in /home/whatcove/public_html/youtube/youtube_v3/yt/vendor/madcoda/php-youtube-api/lib/madcoda/youtube.php:364 stack trace: #0 /home/whatcove/public_html/youtube/youtube_v3/yt/vendor/madcoda/php-youtube-api/lib/madcoda/youtube.php(145): madcoda\youtube->decodelist('{\n "error": {\n ...') #1 /home/whatcove/public_html/youtube/youtube_v3/yt/vendor/madcoda/php-youtube-api/lib/madcoda/youtube.php(77): madcoda\youtube->searchadvanced(array) #2 /home/whatcove/public_html/youtube/youtube_v3/yt/index.php(12): madcoda\youtube->search('leela movie') #3 {main} thrown in /home/whatcove/public_html/youtube/youtube_v3/yt/vendor/madcoda/php-youtube-api/lib/madcoda/youtube.php on line 364"

    public function search($q, $maxresults = 10) {     $params = array(         'q' => $q,         'part' => 'id, snippet, contentdetails',         'maxresults' => $maxresults     );     return $this->searchadvanced($params); } 

the 'search' endpoint not have contentdetails part; nor can retrieve video durations 'search' endpoint. rather, it's used minimal information (think of metaphor of search results) , offer possible filters, , when video selected, can use videoid hit 'videos' endpoint (where have more info returned less possible filters, can't used searching).


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -