I am working on a project that is going to have an API that allows the user to insert video. The API is basically an ActionScript class that attaches a property when the user publishes their SWF. When the SWF is loaded into the main SWF program, it has access to the special functions in the SWF file. First, I just used the FLVPlayback and a registry function so the app would have access to it’s functions. That’s fine, but the user has to host an FLV for this to be effective. Not everyone has a server at their disposal, so this is the reason to build on existing video sites. Also, your not shit as a dev guy unless your mashable Web 2.0 savvy.
Fortunately, the popular sites have APIs out there ready and available to get content and media. A developer is expected to know what they have available to them and what will make the job easier for them. Being in the know about Facebook shit is actually a job requirement.
So, first one I thought of was the giant, YouTube. YouTube’s player is AS2 and to use it in an AS3 project you need to wrap it in an AS3 SWF and use LocalConnection to interface with it. There are a few solutions out there but in the end it is a band aid, until YouTube puts together an alternative player API. After fumbling with this, and saving the failing code to my repository for later, I went to Vimeo.
Vimeo has a pretty cool player and the thing that puts it over the top for my app is that it is written in ActionScript 3. But, as with everything, it isn’t perfect. YouTube has a good API page, and some decent forums, and support of the widespread dev community. Vimeo does not. Their API page is nothing short of pathetic, to say the least. They have one example and it doesn’t work. I found a working example on their fourm. At the top of the API page (as of this posting) they have a blurb that says this: You may have noticed that there are some inaccuracies in this documentation. We working on improving it. How about now? In the time it took to put up that asinine message you could of updated the code. That is annoying. Also, there is no public functions to be seen what so ever. Searching on the forums, someone found play, load and unload, which kind of works like stop. I also needed an event at the end of the video. Pretty standard stuff as far as a video API goes. Looks like I am going to have to Sherlock Holmes this shit. Read more …