MACROMEDIA FLASH MEDIA SERVER 2-SERVER-SIDE ACTIONSCRIPT LANGUAGE Reference page 149

Server-side actionscript language reference
Table of Contents

Advertisement

Stream.length()
Availability
Flash Communication Server MX 1.0.
Usage
myStream.length(name[, virtualKey])
Parameters
Name of a recorded stream (FLV) file or MP3 file. To get the length of an MP3 file,
name
precede the name of the file with
A string indicating a key value. Starting with Flash Media Server 2, stream
virtualKey
names are not always unique; you can create multiple streams with the same name, place them
in different physical directories, and use the VirtualDirectory section and VirtualKeys section
of the vhost.xml file to direct clients to the appropriate stream. Because the
method is not associated with a client, but connects to a stream on the server, you may need to
specify a virtual key to identify the correct stream. For more information about keys, see
Client.virtualKey
Returns
The length of a recorded stream file or MP3 file in seconds.
Description
Method (static); returns the length of a recorded stream file or MP3 file in seconds. If the
requested file is not found, the return value is 0.
Example
The following example gets the length of the recorded stream file
the variable
streamLen
function onProcessCmd(cmd){
var streamLen = Stream.length("myVideo");
trace("Length: " + streamLen + "\n");
}
The following example gets the length of the MP3 file
variable
:
streamLen
function onProcessCmd(cmd){
var streamLen = Stream.length("mp3:beethoven");
trace("Length: " + streamLen + "\n");
}
(for example,
mp3:
. This parameter is optional.
:
).
"mp3:beethoven"
myVideo
and assigns it to the
beethoven.mp3
Stream.length()
and assigns it to
Stream class
149

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MEDIA SERVER 2-SERVER-SIDE ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash media server 2

Table of Contents