
Server-Side Communication ActionScript 69
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, recorded stream (FLV file), or MP3 file.
To play back FLV files, the default Flash file format for recorded streams, specify the name of the
stream (for example,
"myVideo"). To play back MP3 files that you’ve stored on the server, or the
ID3 tags of MP3 files, you must precede the stream name with
mp3: or id3: (for example,
"mp3:bolero" or "id3:bolero"). For more information on playing MP3 files, see Developing
Communication Applications.
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.
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.
Komentarze do niniejszej Instrukcji