View comments | RSS feed

Video


Object
    |
    +-Video

public class Video
extends Object

The Video class enables you to display live streaming video on the Stage without embedding it in your SWF file. You capture the video by using Camera.get(). In files published for Flash Player 7 and later, you can also use the Video class to play back Flash Video (FLV) files over HTTP or from the local file system. For more information, see the NetConnection class and NetStream class entries.

Flash Player 7 supports Flash video (FLV) encoded with the Sorenson Spark video codec. Flash Player 8 supports Flash video (FLV) encoded with either the Sorenson or the On2 VP6 codec and also supports an alpha channel. The On2 VP6 video codec uses less bandwidth than older technologies, and offers additional deblocking and deringing filters.

If your Flash content dynamically loads Flash video (using either progressive download or Flash Communication Server), you can use On2 VP6 video without having to republish your SWF for Flash Player 8, as long as users view your content through Flash Player 8. By streaming or downloading On2 VP6 video into Flash SWF version 6 or 7, and playing the content using Flash Player 8, you avoid having to recreate your SWF files for use with Flash Player 8.

Codec

Content (SWF)Version(publish version)

Flash PlayerVersion(version required for playback)

Sorenson Spark

6

6, 7, 8

7

7, 8

On2 VP6

6

8*

7

8

8

8

* If your Flash content dynamically loads Flash video (FLV), you can use On2 VP6 video without having to republish your SWF for Flash Player 8, as long as users use Flash Player 8 to view your content. Only Flash Player 8 supports both publish and playback of On2 VP6 video.

A Video object can be used like a movie clip. As with other objects you place on the Stage, you can control various properties of Video objects. For example, you can move the Video object around on the Stage by using its _x and _y properties, you can change its size using its _height and _width properties, and so on.

To display the video stream, first place a Video object on the Stage. Then use Video.attachVideo() to attach the video stream to the Video object.

Availability: ActionScript 1.0; Flash Player 6 - The ability to play Flash Video (FLV) files was added in Flash Player 7. The ability to use the On2 VP6 codec and to use an alpha channel was added in Flash Player 8.

See also

NetConnection, NetStream

Property summary

Modifiers

Property

Description

 

_alpha:Number

Indicates the alpha transparency value of the Video object specified.

 

deblocking:Number

Indicates the type of deblocking filter applied to decoded video as part of postprocessing.

 

_height:Number

Indicates the height of the Video object, in pixels.

 

height:Number [read-only]

An integer specifying the height of the video stream, in pixels.

 

_name:String

Indicates the instance name of the Video object specified.

 

_parent:MovieClip

Indicates the movie clip or object that contains the current Video object.

 

_rotation:Number

Indicates the rotation of the Video object, in degrees, from its original orientation.

 

smoothing:Boolean

Specifies whether the video should be smoothed (interpolated) when it is scaled.

 

_visible:Boolean

Indicates whether the Video object specified by my_video is visible.

 

_width:Number

Indicates the width of the Video object, in pixels.

 

width:Number [read-only]

An integer specifying the width of the video stream, in pixels.

 

_x:Number

Indicates the x coordinate of a Video object relative to the local coordinates of the parent movie clip.

 

_xmouse:Number [read-only]

Indicates the x coordinate of the mouse position.

 

_xscale:Number

Indicates the horizontal scale (percentage) of the Video object as applied from the registration point of the Video object.

 

_y:Number

Indicates the y coordinate of a Video object relative to the local coordinates of the parent movie clip.

 

_ymouse:Number [read-only]

Indicates the y coordinate of the mouse position.

 

_yscale:Number

Indicates the vertical scale (percentage) of the Video object as applied from the registration point of the Video object.

Properties inherited from class Object

constructor, __proto__, prototype, __resolve


Method summary

Modifiers

Signature

Description

 

attachVideo(source:Object) : Void

Specifies a video stream (source) to be displayed within the boundaries of the Video object on the Stage.

 

clear() : Void

Clears the image currently displayed in the Video object.

Methods inherited from class Object

addProperty, hasOwnProperty, isPropertyEnumerable, isPrototypeOf, registerClass, toString, unwatch, valueOf, watch



Version 8

Comments


snah said on Sep 15, 2005 at 6:12 AM :
How to add video with alpha.
Can I use for it flv player component, which is built in Flash 8?
Thanks
Jay4 said on Sep 15, 2005 at 3:55 PM :
Hello snah, there is an example of alpha video used with the FLV Playback component at http://www.macromedia.com/support/documentation/en/flash/fl8/samples.html.
Drakkon said on Feb 17, 2006 at 2:54 PM :
Is there any way top adjust volume on a Video embedded object?
I imported and embedded a video on my stage and would really like to be able to mute/adjust the volume.
No screen name said on Mar 16, 2006 at 12:03 PM :
How can I grab one frame from camera and use it as picture? I t will better if I can work with this image with FileReference. :)
metaltoadmedia said on May 10, 2006 at 1:48 PM :
it seems that it is not possible to dynamically create a Video object for playing back video using this object. The Video object must be dragged to the stage and then referenced via ActionScript. I've tried it and wasn't able to get it to work and found this reference confirming my suspicions:

http://chattyfig.figleaf.com/pipermail/flashcoders/2005-September/150202.html
asinomasimple said on Sep 11, 2006 at 12:40 AM :
I want my video._width and video._height to adjust to any loaded video. To do this I retrieve the video.width and video.height.
The problem is that when I load a different video it maintains the previous video's width and height (stream not object).
Is there a way of reseting the stream's width and height or a onLoadStart method?

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/8/main/00002842.html