If you want to be able to deliver non-FLV video in Flash (how cool is that?!), head over to the Adobe Flash Support Center and download the Adobe Flash Player Update for Flash CS3 Professional (9.0.2). The result? At runtime, you’ll be able to load MOV and MP4 files encoded in the H.264 hi-def codec. This is in addition to the usual FLV, and we’re talking Flash Player 9 only (specifically, version 126.96.36.199 or higher). You’ll also be able to load M4A audio instead of only MP3. The upgrade to the IDE allows you to view such content as you test and debug SWFs right in the authoring environment. I’ve already installed and tested, and the update works … but I have seen one stumbling block. You can work around it — in fact, you can work right through it — but it isn’t especially obvious.
Using the FLVPlayback component
If you’re coding up your video content with a Video object and
NetStream, you won’t see any issues, but if you’re a fan of FLVPlayback, you’ll have to fly blind during a few steps that are normally straightforward. Here’s what happens for me in Windows XP (and perhaps your mileage may vary):
I drag an instance of FLVPlayback from the Components panel to the Stage. I select the Parameters tab of the Property inspector and double-click source so I can browse to one of the new video file types. This opens a Content Path dialog with a button that browses for files. I click that button to locate an MP4 file, which opens a Browse for FLV file dialog, but nothing shows — even though I’m in the folder that has such files. The reason nothing shows is because the Files of type list box in this dialog only has an entry for *.flv files. To get around that, I type *.* into the File name field and hit Enter. Now I can see my MP4s (and every other file type in that folder). I double click my MP4.
Flash chews on that for a while. Honestly … maybe a minute and a half. Finally, Flash tells me “Failed to load FLV: [name of file].” This surprises me, because, well, I didn’t browse for an FLV. But I forged ahead anyway and clicked OK. I selected Control > Test Movie to see if the association succeeded anyway. It did.
So it does work. But Flash plays a bit of hide-and-seek with you while it gets you there. My take on it is, roll with the flow. It’s too bad that the manual association doesn’t seem to realize the new possibilities, but if it really gets on your nerves, you can always just set that source parameter via ActionScript 3.0: just give your FLVPlayback component an instance name in the Property inspector, such as
videoPlayer, and set its FLVPlayback.source property:
videoPlayer.source = "coolNewFormat.mp4";