YouTube ActionScript 2.0 API

I had small requirement of YouTube API in one of my personal ActionScript 2.0 project, I couldn’t find any ActionScript 2.0 version of YouTube API. I wrote it couple of hours.

You can look at source code and example (app I made to test it, quick and dirty) and you can download it with example files.

You would notice, to construct FLV URL, I am doing client side parsing of YouTube html page to find out “t” param. This doesn’t work in Internet Explorer 6.0 (IE 6) because of a bug where IE 6.0 doesn’t uncompress gzipped page if requested through LoadVars?
In production mode, I would prefer server-side proxy to find out “t” param because it’s optimized:

  1. Would work in IE 6.0 and other browsers.
  2. Doesn’t require loading YouTube html page ( > 20 KB) and parsing.

Update: I am using following PHP code to get FLV from YouTube asset servers.

Technorati tags: youtube, flv, fetcher, download, php, curlscript