84
Client-Side ActionScript Language Reference
Example
The following function publishes a stream on a NetConnection named
my_nc
containing the
camera output from
active_cam
.
function pubLive() {
// Create a new source stream.
var source_ns:NetStream = new NetStream(my_nc);
/* Attach the camera activity to the source stream. This call causes a
warning message to show which service is requesting access. It also gives
the user the option of not sending the camera activity to the server. */
source_ns.attachVideo(active_cam);
// Get the stream name from the user input.
var mySubj:String = subject;
/* Assuming the user named the stream 'webCamStream',
publish the live camera activity as 'webCamStream'. */
source_ns.publish(mySubj, "live");
}
See also the example for
MovieClip.attachAudio()
.
See also
Camera class
,
Camera.setMode()
,
NetStream.publish()
,
NetStream.receiveVideo()
,
Video.attachVideo()
NetStream.bufferLength
Availability
■
Flash Player 6.
■
Flash Communication Server MX 1.0.
Usage
public bufferLength : Number [read-only]
Description
Property (read-only); the number of seconds of data currently in the buffer. You can use this
property in conjunction with
NetStream.bufferTime
to estimate how close the buffer is to
being full—for example, to display feedback to a user who is waiting for data to be loaded
into the buffer.