Zend Framework and Youtube API
Posted In: PHP, Zend Framework
Commentary
Robert,
Thanks for the blog post. I work on the PHP Client Library components at Google and am responsible for some of the code that you mention. I agree that the class structure is quite verbose.
We also need to update our own documentation on the Zend site. In the meantime you may want to check out the PHP Developer Guide on code.google.com which details the helper methods that we have for accessing video meta-data:
http://code.google.com/apis/youtube/developers_guide_php.html#RetrievingVideoInfo
So you can do for example:
print $entry->getVideoDescription();
print $entry->getFlashPlayerUrl();
The thumbnail array contains a value for each XML element:
The attributes correspond to the XML attributes. Three thumbnails are automatically generated for each video during the trans-coding process.
I hope this helps. For information about how to use the PHP Client Library to perform video uploads you can also check out our video:
http://www.youtube.com/watch?v=iIp7OnHXBlo
Please note that the helper methods such as ->SetVideoTitle() discussed in the video are in Zend /trunk
We are planning to write a more high-level class that sits on top of the Zend_Gdata classes to abstract 90% of the YouTube API functionality to help developers that just want to get up and running with the YouTube API without having to dig too deeply into the class hierarchy.
If you are interested please feel free to contribute some ideas or code for the issue linked here:
http://framework.zend.com/issues/browse/ZF-3467
Whew. That was long. We appreciate your feedback ! Please ping me if you have any other questions!
Thanks
- Jochen
Looks like the XML got cut off by Word Press's input filter. The XML that I was referring to with regards to thumbnails can be found at the link below: http://code.google.com/apis/youtube/developers_guide_protocol.html#Understanding_Video_Entries
Jochen - thanks for the response. I am glad to hear of the plans to write a higher level class and I also appreciate the links to more documentation. Its great you are contributing to the Zend Framework and also listening to the community. Hopefully I can get some time to contribute, because as I mentioned in my post, it is easy to sit on the sidelines and complain than to help out! Again, glad you are actively working on things and I look forward to seeing what's in the pipeline. I think an easier abstraction that provides 80% of the functionality will be appreciated by people!
Well, almost easy for me to implement....just have a question.... at line= $query->videoQuery = ‘cat’; What other options can i use? the worst developer guide i've read, its zend_framework you know...they doesnt explain parameters at all.... i understand...cat, so, can I use dog? pork? duck? or what does CAT means?? hope u know the answer...
its me again, hehehe just to apologize about my previous comment....just had to drink water and read again.... sorry for that