User Guide
Stream class 151
Example
The following 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 1.0.
Usage
myStream.play(streamName, [startTime, length, reset, remoteConnection,
virtualKey])
Parameters
streamName The name of any published live stream, recorded stream (FLV file), or
MP3 file.
To play FLV files, the default Flash file format for recorded streams, specify the name of the
stream (for example,
"myVideo"). To play 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 Media 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.