Best Practices: Video in Acrobat 9

| 3 Comments

So here’s the thing… video files are big. Period. Even a minute of decent quality video encoded with H.264 is just too big to email.

Acrobat 9 Pro and Pro Extended will let you either embed or provide a URL to video files when you create a Rich Media Video Annotation. Neither of these options provides an ideal scenario. You either end up with a file that’s just too big to move around through email but works well while off-line or a file that is small but only works correctly when you are connected to the web.

When you create a PDF Portfolio and add a video file, you only have the option of storing the video in the Portfolio; no URL option. Additionally, you don’t see a thumbnail of the video in the Portfolio view. Again, not the best experience for displaying video in PDF.

ActionScript to the Rescue:
With very little effort, I was able to create this sample PDF that works well off-line and online, is small enough to email, yet provides full HD streaming video when you’re online. If you’re not online, an embedded low resolution version plays instead. The secret is in building your own video player in Flex or adding a little ActionScript around the FLVPlayback component in Flash. Then, rather than adding the video directly, you add your customized SWF player as a Rich Media Flash Annotation. The player that I created using Flex Builder 3 for the sample above will detect the network and, if present, stream a high resolution version of the FLV into the player. If the network, or more specifically, the URL, is unavailable, an embedded low resolution version of the same FLV will play. The low resolution version is stored as a resource in the Rich Media Flash Annotation. One side benefit is that, if you add a poster to the Rich Media Flash Annotation, you’ll see that poster when the PDF is added to a PDF Portfolio.

The example is a very basic player and is just a proof of concept so I won’t be providing the source code. Besides, it won’t take long for even a novice ActionScripter to come up with a better player than what I’m showing here.

Update!
I’ve created another custom player using Flash CS3. This time, I’ve added a full controler and leveraged FlashVars so that I can aim the player at any online/embedded video pair. Open this sample PDF and use the "Select Object" tool in the "Advanced Editing" toolbar to examine the "Flash" and "Resources" panel of the Rich Media Flash Annotation to see how I used these Acrobat features to load the video and the controler. You can get the Flash CS3 project here.