A few months ago, I needed a quick way to include YouTube video content into an AIR application I was making.  Initially, I looked into creating my own video player and trying to use the as3youtubelib, however I ran into people who had many issues with YouTube changing their API which lead to broken videos.  I decided to avoid the hassles and time constraints of this approach and instead opted for another one.

YouTubeHTML Component

YouTubeHTML Component

I discovered YouTube’s Embedded Player URL Parameters API and decided to investigate the possibility of using an HTML component to point to a video on YouTube and change several optional parameters until the video player met my needs.  Turns out that this approach was extremely simple and worked beautifully.  To ease the transition of other developers learning the YouTube’s API, I decided to extend AIR’s HTML component and open up properties which could set the parameters automatically.  Note that because this component is based on the HTML component, it only works in AIR.

Download the code here.