
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
105
// Set up the server stream.
application.myStream = Stream.get("foo");
if (application.myStream){
// This server stream plays "Live1",
// "Record1", and "Live2" for 5 seconds each.
application.myStream.play("Live1", -1, 5);
application.myStream.play("Record1", 0, 5, false);
application.myStream.play("Live2", -1, 5, false);
}
The following example combines different streams into a recorded stream:
// Set up the server stream.
application.myStream = Stream.get("foo");
if (application.myStream){
// Like the previous example, this server stream
// plays "Live1", "Record1", and "Live2"
// for 5 seconds each. But this time,
// all the data will be recorded to a recorded stream "foo".
application.myStream.record();
application.myStream.play("Live1", -1, 5);
application.myStream.play("Record1", 0, 5, false);
application.myStream.play("Live2", -1, 5, false);
}
The following example calls Stream.play() to stop playing the stream foo:
application.myStream.play(false);
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);
application.myStream.play("mp4:file1.mp4", -1, 5, false);
}
The following example plays an MP4 file:
application.myStream = Stream.get("foo");
if(application.myStream) {
application.myStream.play("mp4:beethoven", 0);
application.myStream.play("mp4:mozart", 0, false);
}
In the following example, data messages in the recorded stream file log.flv are returned at the intervals at 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 at which they were originally recorded:
application.myStream = Stream.get("data");
if (application.myStream) {
application.myStream.play("log", 0, -1, 2);
}
Commenti su questo manuale