
161
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
found, the server creates a live stream with the name specified in streamName and waits for someone to publish to that
stream. If
startTime is -1, the server attempts to play a live stream with the name specified in streamName and waits
for a publisher if no specified live stream is available. If
startTime is greater than or equal to 0, the server plays the
recorded stream with the name specified in
streamName, starting from the time given. If no recorded stream is found,
the
play() method is ignored. If a negative value other than -1 is specified, the server interprets it as -2. This parameter
is optional.
length A number indicating the length of play, in seconds. For a live stream, a value of -1 plays the stream as long as
the stream exists. Any positive value plays the stream for the corresponding number of seconds. For a recorded stream,
a value of
-1 plays the entire file, and a value of 0 returns the first video frame. Any positive number plays the stream
for the corresponding number of seconds. By default, the value is -1. This parameter is optional.
reset A boolean value, or number, that flushes the playing stream. If reset is false (0), the server maintains a
playlist, and each call to
Stream.play() is appended to the end of the playlist so that the next play does not start until
the previous play finishes. You can use this technique to create a dynamic playlist. If
reset is true (1), any playing
stream stops, and the playlist is reset. By default, the value is
true.
You can also specify a number value of 2 or 3 for the reset parameter, which is useful when playing recorded stream
files that contain message data. These values are analogous to
false (0) and true (1), respectively: a value of 2
maintains a playlist, and a value of 3 resets the playlist. However, the difference is that specifying either 2 or 3 for
reset
returns all messages in the specified recorded stream at once, rather than at the intervals at which the messages were
originally recorded (the default behavior).
remoteConnection A NetConnection object that is used to connect to a remote server. If this parameter is provided,
the requested stream plays from the remote server. This is an optional parameter.
virtualKey A string indicating a key value. Starting with Adobe 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.length() 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 is an optional parameter.
Returns
A boolean value: true if the call is accepted by the server; otherwise, false. If the server fails to find the stream, or if
an error occurs, the
Stream.play() method can fail. To get information about the Stream.play() method, define a
Stream.onStatus() handler.
If the streamName parameter is false, the stream stops playing. A boolean value of true is returned if the stop
succeeds; otherwise,
false.
Example
The following example shows how streams can be chained between servers:
Comentários a estes Manuais