CodeIgniter Forums
GData and Codeignitor problem with class/methods for YouTube - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: GData and Codeignitor problem with class/methods for YouTube (/thread-19018.html)



GData and Codeignitor problem with class/methods for YouTube - El Forum - 05-25-2009

[eluser]beinn[/eluser]
Hi folks, brain is fried and I don't seem to be able to figure this out. Any help welcome.

I am trying to get a list of youtube playlists for a username and their associated videos, from which users can select the playlist and then play the videos.

I have seen http://www.ibm.com/developerworks/xml/library/x-youtubeapi/ which uses simpleXML but it did not work for me.

So I decide to look a merging gData with CI. (http://www.beyondcoding.com/2008/02/21/using-zend-framework-with-codeigniter/). The additional advantage is that I have Zend library available.

This listing was a great help http://ellislab.com/forums/viewthread/90362/

I am now at the stage of trying to mix the google api documentation examples with my work but it keeps failing because it thinks one of the Zend/YouTube methods is not a method.

I have moved this function into a model.

Code:
function getAndPrintPlaylistListFeed($userName, $showPlaylistContents){
    
        $this->load->library('zend');
        $this->zend->load('Zend/Gdata/YouTube');
        
        $yt = new Zend_Gdata_YouTube();  
        // optionally set version to 2 to retrieve a version 2 feed  
        $yt->setMajorProtocolVersion(2);  
        $playlistListFeed = $yt->getPlaylistListFeed($userName);  
        printPlaylistListFeed($playlistListFeed, $showPlaylistContents);
    }
When it is called it fails because printPlaylistListFeed() is not recognised as a method of the GData/YouTube class.http://www.beyondcoding.com/2008/02/21/using-zend-framework-with-codeigniter/

e.g.Fatal error: Call to undefined function printplaylistlistfeed()

It has been a long day and if it is really simeple then DOH, but any help appreciated