Video with Adobe Flash CS4 Professional: Delivery and Deployment Primer
- Sep 9, 2009
Creating video files with a video-compression tool is only one step in the process of taking your video content to the Web. To enable the best user experience for visitors watching your videos, you need to know how to distribute your video files on Web servers, streaming servers, or possibly even a content distribution network (CDN) such as Akamai, Limelight Networks, and others. In this chapter, you’ll learn the differences between distribution file formats and protocols for Flash-based video, along with their advantages and disadvantages.
File Formats: SWF, FLV, H.264, and HTML
For video to play properly on a Web site, you need at least one Flash movie, or SWF file, that contains the scripting code to initiate loading and playback. You have two options with video playback in a SWF file: embedded and external video.
Embedded video (SWF)
An FLV file is imported into a Flash document (FLA file) and published as a Flash movie (SWF file). Some video encoder tools automatically embed video content in a SWF file. This option is backward-compatible with Flash Player 6 or newer, and you need to keep track of only one media file. However, your video content significantly increases the file size of the SWF file, and you can’t replace the video content without republishing the Flash movie.
For most Flash-based video projects produced by interactive agencies, embedded video isn’t the preferred approach for deployment. Most Flash-based video content used by Web sites such as Google or YouTube is distributed as FLV files.
External video (FLV or H.264)
The video content (as an FLV or H.264 container file) is loaded as a separate asset into the SWF file at runtime when the Web page loads. The video file can be loaded with your own custom programming in ActionScript, the scripting language for the Flash platform, or with a prebuilt Flash component. You’ll explore both techniques in later chapters.
Using an external video file has its advantages. For example, you can preload the video file into the Flash movie shell. You can also more easily swap out the video content with a new video file if necessary. In addition, you have much more control over your video when you load and control the video with ActionScript. Publishing times are drastically reduced when the video isn’t embedded in the Flash document.
You can upload video files to a Web server, a streaming server such as Adobe Flash Media Server, or a streaming video service provider.
Video playback (SWF or AIR)
Regardless of which file format you use for your video content—SWF, FLV, or H.264—you can control the playback and display of video with another Flash movie (SWF). Usually, this shell Flash movie is the SWF file you specify in your HTML document to initiate Flash Player. You can also create and distribute a playback mechanism within an Adobe Integrated Runtime (AIR) application. AIR enables you to create desktop applications on Windows, Mac, and Linux.
Web page (HTML)