Client-Side Communication ActionScript > NetStream.receiveVideo

 

NetStream.receiveVideo

Availability

Flash Player 6.

Flash Communication Server MX.

Usage

myStream.receiveVideo(receive | FPS)

Parameters

receive A Boolean value that specifies whether incoming video plays on the specified stream (true) or not (false). The default value is true.

FPS A number that specifies the frame rate per second of the incoming video. The default value is the frame rate of the movie.

Returns

Nothing.

Description

Method; specifies whether incoming video will play on the specified stream, or specifies the frame rate of the video. This method is available only to clients subscribed to the specified stream, not to the stream's publisher.

You can call this method before or after you call the NetStream.play method and actually begin receiving the stream. For example, you can attach these methods to a button the user presses to show or hide the incoming video stream.

To stop receiving video, pass 0 for FPS. (This has the same effect as passing false.) To determine the current frame rate, use NetStream.currentFps.

If you call NetStream.receiveVideo with a frame rate after calling NetStream.receiveVideo(false), an implicit call to NetStream.receiveVideo(true) is issued.

If the specified stream contains only video data, then passing a value of false to this method stops NetStream.time from further incrementing.

Example

The following example opens a stream and specifies that the video play at a specified rate.

myStream = new NetStream(myConnection);
myStream.receiveVideo(false);   // don't display video being published
// Later....
myStream.receiveVideo(12);      // display video at 12 FPS

See also

NetStream.currentFps, NetStream.receiveAudio, NetStream.time