Accessibility

Table of Contents

Using the FLVPlayback component with Flash Player 9 Update 3

Taking advantage of H.264 support

With Flash Player 9 Update 3, the FLVPlayback component is updated to add support for the high-definition MPEG-4 video formats that utilize industry standard H.264 encoding. These formats include MP4, M4A, MOV, MP4V, 3GP, and 3G2. They do not include protected MP4 files, though, such as those downloaded from iTunes or digitally encrypted by FairPlay. Consequently, the FLVPlayback component is no longer restricted to playing FLV files.

Note: The ActionScript 2.0 FLVPlayback component also supports MPEG-4 video formats that utilize H.264 encoding, beginning with Flash Player 9 Update 3. For both ActionScript 3.0 and ActionScript 2.0, you need to ensure that you are working with an updated FLVPlayback component in order to use H.264 video files in your project.

Table 1 lists the formats specifically supported by Flash Player 9 Update 3 and the corresponding version of the FLVPlayback component.

Table 1. File formats supported by Flash Player 9 Update 3 and the FLVPlayback component

Format File type

Video codec

H.264

Audio codec

AAC or MP3

AVC profile

66, 77, 100, or 110 (Flash Player 9 Update 3 does not support 88, 122, 144, or None)

4CC

MP3, MP4A, AVC1, TXG3, GIF, PNG, JPEG, VP60, VP6A

Note: Even if a file has the supported codec and AVC (Advanced Video Coding) profile, Flash Player may still not support it if it has the wrong 4CC (four-character code that identifies the compression standard, or codec, that was used to store the video file). MultimediaWiki lists all 4CCs on their QuickTime container page.

You could also have playback problems if the video stream's data rate is set too high.

Adobe Flash Media Server 3 includes a tool, called FLVCheck, that determines if FMS, and by extension Flash Player 9 Update 3, can properly play an H.264 video file. You can download Flash Media Development Server 3 for free. For more information on using the FLVCheck tool, see the Flash Media Server Configuration and Administration Guide.

You can specify the video file for the FLVPlayback component to play in the following ways:

  • Set the source parameter in the Property inspector or the Component inspector
  • Specify a local file or a URL in the Video Import Wizard
  • Specify the video using ActionScript

Because a video file can originate from a variety of locations and because a URL can specify an XML or SMIL file in addition to a video file, the FLVPlayback component analyzes the URL that you supply. After installing Flash Player 9 Update 3, the FLVPlayback component performs the following checks on the URL in this order:

  • If you specify the RTMP, RTMPT, RTMPS, RTMPE, or RTMPTE protocol for streaming from Flash Media Server (FMS), the source URL is assumed to be streaming video from Flash Media Server
  • If the URL does not include a query string, for example:
    http://www.foo.com/app?param1=value&param2=value
    and the URL does not end in .txt, .xml or .smil, the source is assumed to be a video file
  • If the URL cotains the string "/fms/fpad" then the source is assumed to be a FPAD XML file from Flash Media Server
  • If none of the above is true, the FLVPlayback component assumes the source URL is a SMIL file

Setting the source parameter

To specify a video file that is not an FLV file or an XML (SMIL) file, you must either type the URL in the Content Path dialog box or use ActionScript to set the source property or the source parameter of the load() or play() methods.

To specify a video file other than an FLV file in the Content Path dialog box, you must type the URL. You cannot browse to a URL that is not an FLV file or an XML (SMIL) file. Also, if you are specifying a video file that is not an FLV file, do not check the Download FLV for Cue Points and Dimensions check box. If you do, the dialog box assumes that any file that does not end in .flv is an XML (SMIL) file and it attempts to parse it as such, which could result in a long delay. While the FLVPlayback component is selected on the Stage, click the parameter tab of the Property inspector. Click the source field to display the Content Path dialog box and enter the video's URL. Alternately, you can select Window > Component inspector and click the source field to access the Content Path dialog box and enter the URL to the video (see Figure 3).

Entering the URL to your video file in the Content Path dialog box

Figure 3. Entering the URL to your video file in the Content Path dialog box

The following code examples show how you can use ActionScript to set the source property and the source parameter for the load() and play() methods:

// loads source property
myFLVPlybk.source = "http://www.helpexamples.com/flash/video/water.flv";
// loads source parameter of load() method
myFLVPlybk.load("http://www.helpexamples.com/flash/video/water.flv");
// loads source parameter of play() method
myFLVPlybk.play("http://www.helpexamples.com/flash/video/water.flv");