Sample Code – Using the YouTube AS3 API with the YouTube Player API

2 actionscript,as3,flash,webservices,youtube  |   May 28, 2010  |     2054

Hi Everyone,

I have been absent for a while.. taking advantage of life. I also have switched to Android lately, doing some prototyping work with 80/20 Studio in NYC.

Someone from Belgium contacted me today about the YouTube AS3 API, so I decided to look into it once again. While browsing the Youtube API site I found that they have finally published a AS3 Player that can be used!! So here is some sample code on how to do it.

Warning, in the onPlayerError be sure to read what is coming out. Some videos (the first result from this sample search) are not allowed to be played on foreign sites (copyright content mostly).


  • November 19, 2010 at 11:34 am

    Andrew Clark

    I do not want these restricted videos to be made available. How would I
    a) exclude them from the getVideos request
    and/or b) find the yt:state tag in the feed returned


  • June 29, 2011 at 12:29 am


    Why don’t you implement to get a single video’s data, such as title, description etc.? I think it would be used often.

    Looking forward to the Flex version.


Leave a Reply