
60
Usage
myStream.onStatus = function([infoObject]) {
// Insert code here
};
Parameters
infoObject An optional parameter defined according to the status message. For details about
this parameter, see the Appendix, “Server-Side Information Objects,” on page 67.
Returns
Nothing.
Description
Event handler; invoked every time the status of a Stream object changes. For example, if you play
a file in a stream,
Stream.onStatus is invoked. Use Stream.onStatus to check when play starts
and ends, when recording starts, and so on.
Example
This example defines a function that executes whenever the Stream.onStatus event is invoked:
s = Stream.get("foo");
s.onStatus = function(info){
// insert code here
};
Stream.play
Availability
Flash Communication Server MX.
Usage
Stream.play(streamName, [startTime, length, reset, remoteConnection])
Parameters
streamName The name of any published live stream or recorded stream.
startTime The start time of the stream playback, in seconds. If no value is specified, it is set to
-2. If
startTime is -2, the server tries to play a live stream with the name specified in
streamName. If no live stream is available, the server tries to play a recorded stream with the name
specified in streamName. If no recorded stream is 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 is an optional parameter.
length 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 is an optional parameter.
Kommentare zu diesen Handbüchern