Hi Everyone,
so after a little research I found mostly outdated YouTube API’s out there. Even the ones on Adobe Labs refers to the pre-Google version of the YouTube API, which required a Key which you can’t get anymore.
So I set on a journey, a journey to build the AS3 Client Library for the YouTube Data API. 13 hours and 37 classes later, I’m about 90% done. I hardtyped everthing to make it completely auto-complete friendly. You have data-specific Iterators which spit out specific data objects, you have feeds, events, everything is a bit overkill but it makes it so you can explore everything from the auto-complete.
One thing I might need help with tho is documentation, if you’re interested in doing the Javadoc type work on it please leave a comment with some way I can contact you. If you don’t want to leave your email, feel free to leave your phone number!! haha.
I will go on and test things more in-depth tomorrow, or the next day. Then I will send it off to Adobe et YouTube/Google so they can make it official.
UPDATE
so I tested most things last night, they are working great!!!
I will post samples in the next few days. Thanks to Jeff for posting a crossdomain.xml file on the gdata.youtube.com host.
UPDATE
The project is now here: http://code.google.com/p/as3-youtube-data-api/ There are numerous posts on this website, check out the youtube category on the left!
Cheers!
Martin Legris
Hey Guys,
I tried downloading the file but the link to the SVN is broken – any idea on when it will be fixed?
Cheers!
I’ve posted the project on google code, here you go:
http://code.google.com/p/as3-youtube-data-api/
Plus click on the youtube category up left, you’ll get all the others posts on the subject..
Hi!
i would like to know if there are any way to get the totalResults info feed (openSearch) using your API.
thank you in advance!
Alessandro
Kefio: yes it is. I use the JSON output on the API, it simplifies my life. At first I had managed to access all the XML elements (event the ones on namespaces openSearch and others), but it’s much easier with JSON.
When you received results with the API I wrote, you get a (for example) VideoFeedEvent. Now from the event, letsay var evt:VideoFeedEvent, you can do evt.feed.totalResults to get what you want.
The “feeds” are custom iterators that are hardtyped to everything the youtube API spits out, there are feeds for everything, it makes it real easy to manipulate the data.
hi martin,
thanks for your quick reply, i will try and let you know.
another question:
is it possible to get the geographical origin information about a youtube video?
Hi Martin,
Something changed between yesterday and today, because now something in the API breaks.
Here is the error I get:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at ca.newcommerce.youtube.iterators::MediaContentIterator/get count()
at ca.newcommerce.youtube.iterators::MediaContentIterator/getAt()
at ca.newcommerce.youtube.iterators::MediaContentIterator/next()
at ca.newcommerce.youtube.data::VideoData/get swfUrl()
at topRated/doVideos()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at ca.newcommerce.youtube.webservice::YouTubeClient/doStdFeedLoaded()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
I get the same error..
((
Richeffect says:
Here is the error I get:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
Thank you for such a great topic. I have learned a lot by reading on this website and great information.
This is great, but where can I find the documentation for this so I can so much as know what parameters I need to use for functions like “getUserPlaylist” (I’m sure a string for the user is needed, but I can’t be sure that’s all you need.
Hoi
I have a question for {Martin} the Fx video player you make can i use it in my application and why it don’t play the video from the list?
Thnx for so far
Chuchu
Thanks for this.
Great article. Thanks for the great resource.