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, and others. In this chapter, you'll learn the differences between distribution file formats and protocols for Flash Video, along with their advantages and disadvantages.
File Formats: SWF, FLV, and HTML
In order for Flash 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 Flash Video playback in a SWF file: embedded or external video.
Embedded video (SWF)
The Flash Video content (FLV file) is imported into a Flash document (FLA file) and published as a Flash movie (SWF file). Some Flash Video encoder tools automatically embed Flash Video content in a SWF file. This option is backward-compatible with Flash Player 6 or higher, and you need to keep track of only one media file. However, your Flash Video content significantly increases the file size of the SWF file, and you can't replace the Flash Video content without republishing the Flash movie.
For most Flash Video projects produced by interactive agencies, embedded video isn't the preferred approach for deployment. Most Flash Video content used by Web sites such as Google or YouTube is distributed as FLV files.
External video (FLV)
The Flash Video content (FLV file) is loaded as a separate asset into the SWF file at runtime when the Web page loads. The FLV file can be loaded with your own custom programming in ActionScript, the scripting language for the Flash platform, or with a prebuilt Flash component. I explore both techniques in later chapters.
There are advantages to using an external video file. For example, the FLV file can be preloaded into the Flash movie shell. You can also more easily swap out the video content with a new FLV file if necessary. In addition, you have much more control over your Flash Video when you load and control the video with ActionScript. Publishing times are drastically reduced when the Flash Video isn't embedded in the Flash document.
The disadvantage of using an external video file in the FLV format is that you must use Flash Media Server to stream playback if you need Flash Player 6 compatibility with your Flash Video content. (I talk more about Flash Media Server later in this chapter and throughout the book.) FLV files can be uploaded to a Web server, a Flash Media Server, or a Flash Video Streaming Service provider.
Video playback (SWF)
Regardless of which file format you use for your Flash Video content—SWF or FLV—you can control the playback and display of Flash Video with another Flash movie (SWF). Usually, this shell Flash movie is the SWF file you specify in your HTML document to initiate the Flash Player.
Web page (HTML)