NetStream class
99
len
An optional numeric parameter that specifies the duration of the playback, in seconds.
■
The default value for
len
is -1, which means that Flash plays a live stream until it is no
longer available or plays a recorded stream until it ends.
■
If you pass 0 for
len
, Flash plays the single frame that is
start
seconds from the
beginning of a recorded stream (assuming
start
is equal to or greater than 0).
■
If you pass a positive number for
len
, Flash plays a live stream for
len
seconds after it
becomes available, or plays a recorded stream for
len
seconds. (If a stream ends before
len
seconds, playback ends when the stream ends.)
■
If you pass a negative number other than -1 for
len
, Flash interprets the value as
if it were -1.
reset
An optional Boolean value or number that specifies whether to flush any
previous playlist. If
reset
is
false
(0),
name
is added (queued) in the current playlist; that is,
name
plays only after previous streams finish playing. You can use this technique to create a
dynamic playlist. If
reset
is
true
(1), any previous
play
calls are cleared and
name
is played
immediately. By default, the value is
true
.
You can also specify a 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 passing
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 2 or 3 for
reset
causes Flash Media Server
to return all messages in the recorded stream file at once, rather than at the intervals at which
the messages were originally recorded (the default behavior).
This is especially useful for accessing log files recorded by Flash Media Server. For more
information on Flash Media Server logging, see
TechNote 16464
.
Description
Method; feeds streaming audio, video, and text messages being published on the Flash Media
Server, or a recorded file stored on the server, to the client. This method is available only to
clients subscribed to the specified stream, not to the stream’s publisher.
To view video data, you must call
Video.attachVideo()
; audio being streamed with the
video will be played automatically. If audio-only data is being streamed, you can use
MovieClip.attachAudio()
to route streaming audio to a movie clip, and then create a
Sound object to control some aspects of the audio.