Flash Media Server Developer Documentation

Camera.quality

public quality : Number [read-only]

The level of picture quality, as determined by the amount of compression being applied to each video frame. Acceptable quality values range from 1 (lowest quality, maximum compression) to 100 (highest quality, no compression). The default value is 0, which means that picture quality can vary to avoid exceeding available bandwidth.

Availability

Flash Media Server (not required); Flash Player 6.

Example

The following example uses a NumericStepper instance to specify the amount of compression applied to the camera feed. Create a new video instance by selecting New Video from the Library panel menu. Add an instance to the Stage and give it the instance name my_video. Add a NumericStepper with the instance name quality_nstep. Then add the following code to Frame 1 of the Timeline:

var quality_nstep:mx.controls.NumericStepper;

var my_cam:Camera = Camera.get();
var my_video:Video;
my_video.attachVideo(my_cam);

quality_nstep.minimum = 0;
quality_nstep.maximum = 100;
quality_nstep.stepSize = 5;
quality_nstep.value = my_cam.quality;

function changeQuality() {
    my_cam.setQuality(my_cam.bandwidth, quality_nstep.value);
}
quality_nstep.addEventListener("change", changeQuality);

See also

Camera.setQuality()