YouTube Data API ActionScript 3

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

13 thoughts on “YouTube Data API ActionScript 3

  1. Hey Guys,
    I tried downloading the file but the link to the SVN is broken – any idea on when it will be fixed?

    Cheers!

  2. 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

  3. 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.

    :)

  4. 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?

  5. Hi Martin,

    Something changed between yesterday and today, because now something in the API breaks.

  6. 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()

  7. 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.

  8. 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.

  9. 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

Leave a Reply

Your email address will not be published. Required fields are marked *

*

* Copy this password:

* Type or paste password here:

6,954 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">