A software package a day. Day 3: Adobe Flash CS4 as Movie Player

Yesterday I mentioned that we needed to put videos online for an indeterminate sized audience. These videos were in AVI Format, which is a pretty typical format to receive video in. Putting videos on the web can be done numerous ways, including using various hosting services. However, we needed the quality to remain high (higher than most hosting services permit) and we wanted good tracking of the distribution (to determine if the project was successful). In the end it was decided that we wound transcode the video to a format of our choosing (and thus a resolution and compression rate of our choosing) and use our own player. For this purpose we used Adobe Flash CS4 Professional.

Barring sites that allow uploading of a raw format and then do the encoding and player construction, it really couldn’t have been much easier to do. The first step was to use the Adobe Media Encoder to create a F4V format file, a very simple and quick step which gave us the control we needed over the resolution and compression. Next we opened Flash itself and resized the stage to the size of the video. Finally, we did a drag and drop of the F4V file onto the stage: Flash detects the file and prompts on how it should be presented.

We opted to link to the external F4V file rather than embedding it directly, and we used a fairly basic set of video player options. That was it for the formalities: a quick test showed our video exactly as we expected.

Getting the video hosted in the Amazon S3 service was frankly the tricky part… and even that was really not difficult. The key to success was to edit the Flash video player component and manually set the S3 bucket URLs for both the F4V file and the “skin” file. Then the main flash file was uploaded with those components into a bucket and the files set to readable by the public.

With this done there remains the issue that Flash does not allow “cross domain” scripting: a sensible security choice. To allow the flash to be executed across domains the following “crossdomain.xml” file was created and uploaded to the same S3 bucket (see the full article on this topic):

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE cross-domain-policy SYSTEM
  "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
  <site-control permitted-cross-domain-policies="master-only" />
  <allow-access-from domain="*.mydomain.org" />
  <allow-http-request-headers-from domain="*.mydomain.org"
    headers="SOAPAction" />
</cross-domain-policy>

With this file in place the video downloaded and played perfectly.

Of course, Adobe Flash CS4 is capable of much more than making video players, so I will surely return to this topic in the future. Personally I believe that Flash is often abused in banner advertisements and other contexts, but there are times (such as video distribution or games) where the ubiquitous nature of the software makes it an unbeatable choice.