FLVPlayback.play()

Availability

Flash Player 8.

Edition

Flash Professional 8.

Usage

my_FLVplybk.play ([contentPath:String, totalTime:Number, isLive:Boolean]) 

Parameters

contentPath A string that specifies the URL of the FLV file to stream and how to stream it. The URL can be a local path, an HTTP URL to an FLV file, an RTMP URL to an FLV file stream, or an HTTP URL to an XML file. It is optional, but the contentPath property must be set either through the Component inspector or through ActionScript, or this method has no effect.

totalTime A number that is the total playing time for the video. Optional.

isLive A Boolean value that is true if the video stream is live. This value is effective only when streaming from a FMS or FVSS. The value of this property is ignored for an HTTP download. Optional.

Returns

Nothing.

Description

Method; plays the video stream. With no parameters, the method simply takes the FLV file from a paused or stopped state to the playing state.

If parameters are used, the method acts as a shortcut for setting the autoPlay property to true and setting the isLive, totalTime and, contentPath properties. If the totalTime and isLive properties are undefined, they are not set.

Example

The following example disables the FLV file from playing automatically, calls the seekSeconds() method to set the playhead 20 seconds into the video, and calls the play() method to begin playing the FLV file at that point.

Drag an FLVPlayback component to the Stage, and give it an instance name of my_FLVPlybk. Then add the following code to the Actions panel on Frame 1 of the Timeline:

/**
 Requires:
  - FLVPlayback component on the Stage with an instance name of my_FLVPlybk
*/
import mx.video.*;
my_FLVPlybk.autoPlay = false;
var listenerObject:Object = new Object();
listenerObject.ready = function(eventObject:Object):Void {
    my_FLVPlybk.seekSeconds(4);
    my_FLVPlybk.play();
};
my_FLVPlybk.addEventListener("ready", listenerObject);
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/water.flv";

See also

FLVPlayback.autoPlay, FLVPlayback.contentPath, FLVPlayback.load(), FLVPlayback.pause(), FLVPlayback.stop()