Using Communication Components > VideoRecord component > Using the VideoRecord component

 

Using the VideoRecord component

You can use this component as a video recorder, saving streams to the server. The following list describes two ways to use this component:

Movie recorder: Use this component to capture video to the server for later playback.

Video notes: Record messages for another user to view later.

 
To use the component in your application:

1

Make sure Flash Communication Server is running.

2

Create a directory in the Flash Communication Server MX applications directory, and name it recplay_test.

3

Drag the VideoRecord component onto the Stage and give it an instance name, such as record_mc. To set additional parameters, see VideoRecord component Property inspector.

4

Drag the VideoPlayback component onto the Stage and give it an instance name, such as playback_mc. To set additional parameters, see the VideoPlayback component Property inspector.

5

Drag the SimpleConnect component onto the Stage.

6

In the Property inspector for the SimpleConnect component, provide the following two parameters:

In the Application Directory text box, type the URI of the application you created in Step 2: rtmp:/recplay_test.

Double-click the Communication Components text box. In the Values dialog box that appears, click the plus sign (+) and type the instance name of the playback and record components: playback_mc and record_mc. Click OK.

By providing these values, you are using the SimpleConnect component to handle the connection for the VideoPlayback and VideoRecord components. When the SimpleConnect component successfully connects to the server, the other components automatically connect to the server.

7

Save and publish this file as recplay_test.swf.

8

In the application's directory, create a file named main.asc with the following code:

load("components.asc");

Note: You can also copy the main.asc file from another application directory to this application's directory.

9

Open the SWF file or, in the Flash MX authoring environment, choose Control > Test Movie, and log in.

Click the Record button of the VideoRecord component to record the default stream video as defined in the component's Default Stream Name property. The camera and microphone output is recorded when the right-arrow Record button is clicked on the VideoRecord component, as shown here.

The stream to play back, video, is defined in the first property of the playback component. After you have stopped recording, click the right-arrow Playback button on the playback component to see the recorded video stream play back, as shown here.

 
VideoRecord component Property inspector

Name

Variable

Description

Default Stream Name

streamName

String; the default value is video. Specifies the name of the stream to initially load and play back.

Default Settings

[setLowsetMedsetHigh]

String; the default value is setHigh. Indicates the camera settings to use when the component is initialized. The three possible settings are setLow, setMed, and setHigh.

Buffer Time

bufferTime

Number; the default value is 10. Indicates the length, in seconds, of the video data to buffer for recording.

Low Quality Setting

setLow

Object; contains the following values to use for the camera settings.

 

width, 160 horizontal pixels

height, 120 vertical pixels

fps, 10 video frames per second

bandwidth, maximum bandwidth to use, 0 (0 indicates unlimited)

quality, video compression quality, 50 (0 indicates unlimited)

key, keyframe interval, 10 keyframes

rate, audio quality in Khz, 11 Khz

Medium Quality Setting

setMed

Object; contains the following values to use for the camera settings.

 

width, 240 horizontal pixels

height, 180 vertical pixels

fps, 12 video frames per second

bandwidth, maximum bandwidth to use, 0 (0 indicates unlimited)

quality, video compression quality, 80 (0 indicates unlimited)

key, keyframe interval, 12 keyframes

rate, audio quality in Khz, 22 Khz

High Quality Setting

setHigh

Object; contains the following values to use for the camera settings.

 

width, 320 horizontal pixels

height, 240 vertical pixels

fps, 15 video frames per second

bandwidth, maximum bandwidth to use, 0 (0 indicates unlimited)

quality, video compression quality, 90 (0 indicates unlimited)

key, keyframe interval, 5 keyframes

rate, audio quality in Khz, 44 Khz