YouTube AS3 Wrapper for the ChromeLess Player

3 actionscript,as3,flash,work,youtube  |   June 1, 2009  |     1080

Hi Everyone,

I was toying around today to get a youtube video to play the “legal” way. Quite honestly using the little KeepVid client I made and FLVPlayer, it works fantastic.. but yeah, it isn’t legal.

So after a few hours, I found a wrapper that works.. You can see it in action here.


The big problem with the chromeless player, and indeed the Player API from youtube is that it is made in AS2, so you need some kind of bridge to communicate between it and AS3; using a LocalConnection. This is far from ideal, I wish they would hire somebody and make a version of their chromeless player with a proper crossdomain.xml file that would work for everybody without all this fuss.

The source code is here. Remember to upload these two files along with your SWF on your server in order to get things to work, and they DO have to be in the same path as your HTML / SWF..

  • ytPlayer.swf
  • ytODLCWrapper.swf

The project’s home and info is here.

Did I mention this was a pain in the arse? I mean, you can’t even test it inside of the Flash IDE, it will not work. You cannot test it as a standalone SWF file cause the URL changes all the time, it is a load of pain….

Until YouTube decides to do this properly, I suggest using this approach as a form of silent protest. Of course, that would be illegal, hence I can’t use this approach for my clients… but it will work fine for personal project and prototypes.

Take care peeps

Martin

Comments

Leave a Reply