13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Working with video<br />

The StageVideo class imposes certain restrictions on video usage. Before implem<strong>en</strong>ting StageVideo, review the<br />

guidelines and make sure your application can accept them. If you accept the restrictions, use the StageVideo class<br />

wh<strong>en</strong>ever Flash Player detects that hardware accelerated pres<strong>en</strong>tation is available. See “<strong>Guide</strong>lines and limitations” on<br />

page 513.<br />

Parallel planes: Stage video and the Flash display list<br />

With the stage video model, Flash Player can separate video from the display list. Flash Player divides the composite<br />

display betwe<strong>en</strong> two Z-ordered planes:<br />

Stage video plane The stage video plane sits in the background. It displays only hardware accelerated video. Because<br />

of this design, this plane is not available if hardware acceleration is not supported or not available on the device. In<br />

ActionScript, StageVideo objects handle videos played on the stage video plane.<br />

Flash display list plane Flash display list <strong>en</strong>tities are composited on a plane in front of the stage video plane. Display<br />

list <strong>en</strong>tities include anything that the runtime r<strong>en</strong>ders, including playback controls. Wh<strong>en</strong> hardware acceleration is not<br />

available, videos can be played only on this plane, using the Video class object. Stage video always displays behind Flash<br />

display list graphics.<br />

Stage Video Plane (GPU accelerated)<br />

Video 1<br />

Video 2<br />

Video display planes<br />

Controls 1<br />

Controls 2<br />

The StageVideo object appears in a non-rotated, window-aligned rectangular region of the scre<strong>en</strong>. You cannot layer<br />

objects behind the stage video plane. However, you can use the Flash display list plane to layer other graphics on top<br />

of the stage video plane. Stage video runs concurr<strong>en</strong>tly with the display list. Thus, you can use the two mechanisms<br />

together to create a unified visual effect that uses two discreet planes. For example, you can use the front plane for<br />

playback controls that operate on the stage video running in the background.<br />

Stage video and H.264 codec<br />

In Flash Player applications, implem<strong>en</strong>ting video hardware acceleration involves two steps:<br />

1 Encoding the video as H.264<br />

Flash Display List (CPU only)<br />

Other<br />

Flash<br />

graphics<br />

Last updated 6/6/2012<br />

512

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!