Chapter 9. Server-Side Streams

Stream Management

The heart and soul of audio/video in Flash Media Server 3 is the Stream object. You can think of the Stream object as a manager for existing NetStream objects giving you far more options than with NetStream alone. For example, in a broadcast, you can switch the stream from one broadcast source to another and have both publish live and record simultaneously. Imagine an “anchor” with several “reporters” and recorded video. The anchor would be able to switch from the camera on him or her to the camera on a reporter in the field to recorded FLV files.

As a manager, the Stream object can play or record existing streams, such as live NetStream objects created on the client. It can order the playback of recorded MP3 and FLV files. Basically, you can control streams in ways not possible using the client side objects and methods alone.

Anatomy of Stream.play( )

Server-side Communication ActionScript lets you control streams in ways not easily done with client-side scripts. At the heart of the methods is Stream.play. In breaking down the parameters, you can find several different options. By beginning with the full list of options, you can examine the different ways you can use the parameters.

myStream.play("name",start,length,reset,remoteConnection, virtualKey)

The name you play and the name you get are generally different. For example:

application.myStream.get("serSideStreamName")
application.myStream.play("newProduct")

means that you have created ...

Get Learning Flash Media Server 3 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.