Progressive Download Video


Now that you know something about how to create videos in FLV format, and balance video quality versus file size, you can move into a more sophisticated way of working with video in Flash. Projects with progressive video download enable users to download the video only when they want to and to watch the movie almost instantly. Users don't have to wait for the entire video to download before they can start watching it. Although this may sound like streaming video, it's not. Streaming video is covered in a later section of this chapter.

The progressive download process buffers a little bit of video into the end user's computer and then starts to play the video while the rest continues to download. One big advantage of progressive video downloading is that you can keep your video assets external to the Flash file. This is much more convenient for the end user because it greatly reduces the wait, while the SWF file is downloading.

The progressive video process is also convenient for you as you develop your project. Imagine that you're almost finished integrating video into a mid-size to large project. Suddenly, the client (or project manager) drops a bomb and says that all the video has to be replaced with new versions, and more clips need to be added. If you've built the project with embedded video, this could be a problem. But because progressively downloaded video files are external, the changes are as simple as swapping the existing video files with newly edited video that has the same filenames and then adding the extra files into your directory and project architecture. This is all possible because the video file isn't modified by Flash. Instead, you're using Flash to store information on which frames of the video you want to play for the end user. The other frames are there; you're just not playing them.

Video Import Wizard

To create a Flash document that progressively downloads a single FLV movie in a special video display component, open the Import Video Wizard by selecting File, Import, Import Video, as shown in Figure 15.3. Yes, you read correctly, you need to go to go to the Import Video screen even though the video will ultimately be an external file. This import process is more of a preparation for the display of the video than it is about actually importing the video itself. When you have the wizard open, you can set the path to the video you are going to import just as you would for importing video to embed.

Figure 15.3. Selecting the Progressive Download deployment method.


You are next asked how you would like to deploy the video. Select the Progressive Download from a Web Server option.

In the next step, you can select the video encoding profile and preview the quality your setting will produce. As you did earlier in the chapter, choose the On2 VP6 codec for Flash Player 8 or the Sorensen Spark codec for Flash Player 7.

In the Skinning step, you select how the user interface for the Flash Video Playback component will appear and function. Many skins are provided with Flash. These skins provide the look of the video player, but also include interactive elements that enable the end user to control the playback of the video. If you want to use a custom skin, select Custom Skin URL from the Skin drop-down menu and enter the relative directory path of the skin's .swf file that you want to use into the URL field. This path is relative to the directory of the .swf into which the video will be loaded. If you want to just play the video without giving the end user control over the player (such as stop, start, rewind, and the loading indicator), select None from the skin menu. Figure 15.4 shows some of the different skins that come with Flash.

Figure 15.4. Several skins for the Video Playback Component are available in Flash.


The last screen of the wizard displays some useful information including the current location of the video you selected for encoding and the relative path where your Flash file will find the encoded video file (.flv). To complete the process, click on the Finish button.

After the video file is encoded, notice that a new file has been created in the directory where the original video file resides. This is the newly encoded .flv version of the video. In addition, you can see that the FLVPlayback component is now on the stage of your Flash file, all set to load the .flv movie file at run-time.

Now all you need to do to play the file on your web server is publish an HTML display document that includes the SWF and upload the FLV, SWF, and HTML documents to your server.

Tip

When you are ready to publish your project on a web server, you need to upload the external video files, the SWFs that play the video, and all the HTML files that display the SWFs to the server to see your video display in the HTML document. Be aware that you cannot see the video display when you test your HTML documents locally in a browser. You can see them only after you have uploaded them to your web server. However, you can view the video by playing the SWF locally.


FLVPlayback Component

In addition to automatically creating an FLVPlayback component as a part of the Video Import Wizard as described in the previous section, you can also manually insert it into your projects and set it up to play any external FLV files that you want to include. This manual method is helpful when you create your FLV content in Sorensen Squeeze or with the Flash 8 Video Encoder, which is covered later in this chapter. Figure 15.5 shows the Playback component in the Components panel.

Figure 15.5. FLVPlayback component in the Components panel.


In the Components panel, (Window, Components), open the FLV Playback Player 8 menu item. Drag the FLVPlayback component from the menu to the stage. When you place it on the stage, it automatically adds the component to your document's library, so from now on you can go to your library to pull out a new instance of the component. Figure 15.6 shows an instance of the FLVPlayback component on the stage.

Figure 15.6. The FLVPlayback component on the stage, with component and library panels open.


After you have an instance on the stage, you're ready to set the parameters for the component, including the video source file and skin. Select the component instance on the stage and open the Component Inspector panel (see Figure 15.7).

Figure 15.7. The Component Inspector panel.


Setting the parameters for the FLVPlayback component is easy. Double-click on one of the parameters and either a drop-down menu or a dialog box opens to set that parameter. For instance, to tell the component what FLV to play, set the content path. Double-click the Content Path item in the Component Inspector and a dialog box opens that you can use to browse your system and select the FLV file to load into the component (see Figure 15.8).

Figure 15.8. The Content Path dialog box for the FLVPlayback component.


As with the Video Import Wizard, the FLVPlayback component enables you to choose from a selection of skins with different styles and functions. Double-click the Skin parameter to bring up the Select Skin interface, which has a drop-down menu of skins to choose from and a preview window so that you can see what you've selected before clicking on the OK button.

If you give the component an instance name, you can access it with ActionScript. You can use ActionScript to set the value for the contentPath parameter dynamically, rather than with the Component Inspector. You can use the following code, placed on a keyframe of the main timeline, to load an .flv into an instance of the FLVPlayback component.

family_vid1.contentPath = "family_vid1.flv";


The FLVPlayback component combines flexibility with ease of use. The capability to use ActionScript to dynamically set parameter values is a powerful feature. In my own work, I don't use components, but this one is working its way into my projects. Although you can use the Import Video Wizard to prepare a single .flv and the component that plays it, you can also use the standalone Flash 8 Video Encoder to batch process many video files at once.



Special Edition Using Macromedia Studio 8
Special Edition Using Macromedia Studio 8
ISBN: 0789733854
EAN: 2147483647
Year: 2003
Pages: 337

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net