Overview of Flash Media Server



Client-server architecture

Flash Media Server is a hub. Applications connect to the hub using Real-Time Messaging Protocol. The server can send data to and receive data from many connected users. A user can capture live video or audio using a camera and microphone attached to a computer running Adobe® Flash® Player or Adobe® AIR™ and publish it to a server that streams it to thousands of users worldwide. Users worldwide can participate in an online game, with all moves synchronized for all users.

Users connect to the server through a network connection. A connection is similar to a large pipe and can carry many streams of data. Each stream travels in one direction and transports content between one client and the server. Each server can handle many connections concurrently, with the number determined by your server capacity.

An application that runs on Flash Media Server has a client-server architecture. The client application is developed in Adobe Flash or Adobe Flex™ and runs in Flash Player, Adobe AIR, or Flash® Lite™ 3. It can capture and display audio and video and handle user interaction. The server application runs on the server. It manages client connections and permissions, writes to the server’s file system, and performs other tasks.

The client must initiate the connection to the server. Once connected, the client can communicate with the server and with other clients. More specifically, the client connects to an instance of the application running on the server. An example of an application instance is an online game with different rooms for various groups of users. In that case, each room is an instance.

Many instances of an application can run at the same time. Each application instance has its own unique name and provides unique resources to clients. Multiple clients can connect to the same application instance or to different instances.

View full size graphic
Several clients connecting to multiple applications (sudoku and scrabble) and application instances (room 2, room 1, and room 2) running on Flash Media Server

Parts of a media application

The client application is written in ActionScript™ and compiles to a SWF file. The server application is written in Server-Side ActionScript (which is like ActionScript 1.0, but runs on the server, rather than on the client). A media application usually has recorded or live audio and video that it streams from server to client, client to server, or server to server.

A typical Flash Media Server application has these parts:

Client user interface
The client displays a user interface, such as controls to start, stop, or pause a video. The user interface can run in Flash Player, Adobe AIR, or Flash Lite 3 and can be developed with Adobe Flash or Adobe Flex.

Client-side ActionScript
The client contains ActionScript code that handles user interaction and connects to the server. Flash Media Server 3 and later support ActionScript 3.0, ActionScript 2.0, and ActionScript 1.0.

Video or audio files
Many media applications stream recorded audio or video from the server to clients. Flash Media Server supports playback of a variety of stream formats, including Flash Video (FLV), MPEG-3 (MP3), and MPEG-4 (MP4 and F4V).

Camera or microphone
You can use Adobe Flash Media Live Encoder to stream live video or audio to the server. You can also create your own client that captures live audio and video. In both cases, you need a camera and a microphone to capture the video and audio.

Server-Side ActionScript
Most applications use Server-Side ActionScript code written in a file with the suffix .asc, called an ActionScript Communication File. The file is named either main.asc, or myApplication.asc. The server-side code handles the work the server does, such as streaming audio and video and defining what happens when users connect and disconnect.