Flash Lite 2.x and 3 Help

Video class

Flash Lite 2.x lets you work with device-specific video formats, and supports the following types of video playback:

  • Video embedded in a SWF file
  • Video available as a separate file on the device
  • Video streamed over the network (in real time)

Flash Lite 2.x supports device video. Device video is stored in the published SWF file in the device's native video format. To play the device video, Flash Lite passes the video data to the device, which then decodes and plays the video.

NOTE

 

Flash Lite 2.x ActionScript does not support the NetConnection or NetStream classes.

Flash Lite 3.0 adds support for Flash Video (FLV) using versions of the On2 and Sorenson codecs optimized for mobile devices. FLV video is rendered directly in the Flash Lite player rather than by the device, so you no longer need to be concerned about whether your target devices support a particular video format. The ActionScript NetConnection and NetStream classes, which were not previously available in Flash Lite, let you control the playback of FLV video from a local drive or HTTP address. These classes are described in Chapter 2, "ActionScript Classes," in Flash Lite 2.x and 3.0 ActionScript Language Reference. Streaming video data over an RTMP connection to a Flash Media Server is also supported in Flash Lite 3.0 (but RTMPT and RTMPS connections are not). The Camera class and recording video are not supported for Flash Video.

Flash Lite 3.0 also includes a new property in the Video class, attachVideo, that specifies a video stream to be displayed within the boundaries of the Video object on the Stage. You use the methods of the NetStream class rather than those of the Video class to control playback of FLV (non-device) video. For example, to pause device video, you use the Video.pause method, but to pause FLV video, you use NetStream.pause.

For more information about the Video class, see the following references:

  • Developing Flash Lite 2.x and 3.0 Applications
  • Chapter 15, "Working with images, Sound, and Video," in Learning ActionScript 2.0 in Flash
  • Chapter 2, "ActionScript Classes," in Flash Lite 2.x and 3.0 ActionScript Language Reference

Method summary

The following table lists the methods that are not supported by the Video class when using ActionScript for Flash Lite 2.x and later.

Method

Description

Support

clear

Clears the image currently displayed in the Video object. This is useful when, for example, you want to display standby information without having to hide the Video object.

Not supported

Property summary

The following table lists the properties of the Video class that are not supported when using ActionScript for Flash Lite 2.x.

Property

Description

deblocking

Indicates the type of deblocking filter applied to decoded video as part of postprocessing. Two deblocking filters are available: one in the Sorenson codec and one in the On2 VP6 codec.

height

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

smoothing

Specifies whether the video should be smoothed (interpolated) when it is scaled. For smoothing to work, the player must be in high-quality mode.

width

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

Flash Lite method extensions

The Video class for Flash Lite 2.x adds the following new methods.

Method

Description

play()

Opens a video source and begins playing the video.

close()

Stops playing the video, frees the memory associated with this Video object, and clears the Video area onscreen.

stop()

Stops playing the video and continues to render the current frame onscreen. A subsequent call to Video.resume() resumes playing from the first frame of the video.

pause()

Stops playing the video and continues to render the current frame onscreen. A subsequent call to Video.resume() resumes playing from the current position.

resume()

Resumes playing the video.

The Video class for Flash Lite 3.0 adds the following new method.

Method

Description

attachVideo()

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

 

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