ActionScript 2.0 Components Language Reference |
|
|
|
| FLVPlayback Component > FLVPlayback class > FLVPlayback.idleTimeout | |||
Flash Player 8.
Flash Professional 8.
my_FLVPlybk.idleTimeout
Property; the amount of time, in milliseconds, before Flash terminates an idle connection to a FMS because playing paused or stopped. This property has no effect on an FLV file downloading over HTTP.
If this property is set when a video stream is already idle, it restarts the timeout period with the new value.
The default value is 300,000, or 5 minutes.
The following example assumes playing a streaming FLV file from a FMS or FVSS. The example sets the idleTimeout property to a low value of 10 milliseconds, which triggers a timeout and, consequently, a close event on the RTMP connection. The listener for the close event shows the index number of the video player for which the event occurred.
Drag an FLVPlayback component to the Stage, and give it an instance name of my_FLVPlybk. In the Component inspector, assign the contentPath parameter a value that specifies the location of a streaming FLV file from a FMS or FVSS. 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.idleTimeout = 10;
var listenerObject:Object = new Object();
//listen for close event on RTMP connection; display index of video player
listenerObject.close = function(eventObject:Object) {
trace("Closed connection for video player: " + eventObject.vp);
};
my_FLVPlybk.addEventListener("close", listenerObject);
|
|
|
|