User Guide

160 Server-Side ActionScript Language Reference
Example
The following code sets the virtual key to B, the virtual path to /foo, and the physical
directory to c:\streams\on2:
myStream.setVirtualPath("B", "/foo", "c:\streams\on2");
Stream.size()
Availability
Flash Media Server 2.
Usage
Stream.size(name[, virtualKey])
Parameters
name A string indicating the name of a stream. You can use the format tag in the name
parameter to specify the type.
virtualKey A string indicating a key value. Starting with Flash Media Server 2, stream
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
Stream.size()
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. This parameter is optional.
Returns
A number indicating the size of the stream; if the requested stream is not found, returns 0.
Description
Method (static); returns the size of a recorded stream in bytes.
Example
The following examples return the size of a stream and an MP3 stream, respectively:
function onProcessCmd(cmd){
// Insert code here...
var streamSize = Stream.size("foo");
trace("Size: " + streamSize + "\n");
}
//For mp3