Video class
141
Video.attachVideo()
Availability
■
Flash Player 6.
■
Flash Media Server (not required).
Usage
public attachVideo(
source
:Object) : Void
Parameters
source
A NetStream or Camera object that is playing video or MP3 audio data or
capturing video data, respectively. To drop the connection to the Video object, pass
null
for
source
.
Returns
Nothing.
Description
Method; specifies a video stream (
source
) to be displayed within the boundaries of the Video
object on the Stage. The video stream is either a NetStream object being displayed by means
of the
NetStream.play()
command (requires Flash Media Server), a Camera object, or
null
. If
source
is
null
, video is no longer played within the Video object.
You don't have to use this method if the FLV file contains only audio. The audio portion of
an FLV fils is played automatically when the
NetStream.play()
command is issued.
If you want to control the audio, you can use
MovieClip.attachAudio()
to route the audio
to a movie clip; you can then create a Sound object to control some aspects of the audio. For
more information, see
MovieClip.attachAudio()
.
Example
The following example plays live video locally, without the need for Flash Media Server:
var active_cam:Camera = Camera.get();
my_video.attachVideo(active_cam); // my_video is a Video object on the
Stage.