Stream class
155
The following example creates a playlist of three MP3 files (
beethoven.mp3
,
mozart.mp3
,
and
chopin.mp3
) and plays each file in turn over the live stream
foo
:
application.myStream = Stream.get("foo");
if(application.myStream) {
application.myStream.play("mp3:beethoven", 0);
application.myStream.play("mp3:mozart", 0, false);
application.myStream.play("mp3:chopin.mp3", 0, false);
}
In the following example, data messages in the recorded stream file
log.flv
are returned at
the intervals which they were originally recorded.
application.myStream = Stream.get("data");
if (application.myStream) {
application.myStream.play("log", 0, -1);
}
In the following example, data messages in the recorded stream file
log.flv
are returned all at
once, rather than at the intervals which they were originally recorded.
application.myStream = Stream.get("data");
if (application.myStream) {
application.myStream.play("log", 0, -1, 2);
}
Stream.record()
Availability
Flash Communication Server MX 1.0.
Usage
myStream
.record(
flag
)
Parameters
flag
This parameter can have the value
record
,
append
, or
false
. If the value is
record
,
the data file is overwritten if it exists. If the value is
append
, the incoming data is appended to
the end of the existing file. If the value is
false
, any previous recording stops. By default, the
value is
record
.
Returns
A Boolean value of
true
if the recording succeeds;
false
otherwise.
Description
Method; records all the data going through a Stream object.