
168
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
When you record a stream, the server creates a file with the name you passed to the Stream.get() method. The server
automatically creates a “streams” directory and subdirectories for each application instance name. If a stream isn’t
associated with an application instance, it is stored in a subdirectory called “_definst_” (default instance). For example,
a stream from the default lecture application instance would be stored here: applications\lectures\streams\_definst_.
A stream from the monday lectures application instance would be stored here: applications\lectures\streams\monday.
To append a live stream to a file, the stream name passed to the Stream.get() method must be different from the live
stream name in the client
NetStream.publish() method. In other cases, the client-side and server-side Stream
names can be the same.
Availability
Flash Communication Server 1
Parameters
flag One of these values: "record", "append", "appendWithGap", or false. If the value is "record", the data file is
overwritten if it exists. If the value is "
append" or "appendWithGap", the incoming data is appended to the end of the
existing file. If the value is
false, any previous recording stops. The default value is "record". For more information
about using "
appendWithGap", see Using DVR with dynamic streaming.
maxDuration An optional parameter specifying the maximum duration (in seconds) for a recording. The default
value, -1, uses the value of
<MaxDurationCap> in the Application.xml configuration file. The default value of
<MaxDurationCap> is -1, which means that there is no maximum duration; the recording length is unlimited.
Set this parameter to -2 or 0 to use the value of <MaxDuration> in the Application.xml configuration file as the limit.
maxSize An optional parameter specifying the maximum size (in kilobytes) for a recording. The default value, -1, uses
the value of
<MaxSizeCap> in the Application.xml configuration file. The default value of <MaxSizeCap> is -1, which
means that there is no maximum size; the recording file size is unlimited.
Set this parameter to -2 or 0 to use the value of <MaxSize> in the Application.xml configuration file as the limit. The
default value is -1.
When a recorded file exceeds the duration or size, the recording stops and when recording stops the
"NetStream.Record.DiskQuotaExceeded" message and then a "NetSteam.Record.Stop" message are sent to the
stream's
onStatus handler.
Returns
A boolean value of true if the recording succeeds; otherwise, false.
Example
The following example shows a client publishing a live stream, a server recording the stream, and a client subscribing
to the recorded stream.
First, the client publishes a live stream:
myNetStream.publish("clientStream", "live");
Next, the server opens a stream named serverStream and stores it in the Stream object s. The server-side code plays
and records the stream published by the client in F4V format. The name of the recorded file is “serverStream.f4v”,
which is the name passed to the
Stream.get() method.
Comentarios a estos manuales