Stage Video
From osmf.adobe
OSMF 1.6 and Flash Player 10.2 together provide automatic support for playback with the Stage Video pipeline. Flash Player 10.1 introduced support for hardware-accelerated decoding for some types of video content. Now, Flash Player 10.2 uses Stage Video to accelerate the presentation of content, as well.
The traditional method for rendering video in Flash Player uses the Video API pipeline. The Video object is treated as is any other display object on the stage. This allows the developer a great deal of creative control to blend or reshape videos, for example, but it comes at the cost of increased CPU usage.
The flash.media.StageVideo object, however, is not a display object. Instead, it sits behind the stage, behind all display objects. This allows Flash Player to take advantage of the device’s graphics processing unit (GPU) when rendering the video. This, in turn, greatly decreases the work of the CPU and allows higher frame rates and greater pixel fidelity and quality.
OSMF uses the Stage Video pipeline by default, whenever it is available on a given device or system. Whenever Stage Video becomes unavailable, OSMF falls back to the normal Video pipeline for displaying streams. During the playback of a video stream, OSMF can switch between Stage Video and Video mode multiple times, as the availability of Stage Video changes. If Stage Video becomes available in the middle of playback, the switch still happens. The Video object is only used if a version of Flash Player prior to 10.2 is installed on the client device, or if Flash Player 10.2 or newer is available, but the device itself is not capable of using Stage Video.
Because the device’s hardware displays the video, using a StageVideo object has the following constraints compared to a Video object:
- The number of StageVideo objects that can concurrently present videos is limited by the hardware.
- The video timing is not synchronized with the timing of any Flash content that the runtime presents.
- The video display area can only be a rectangle. You cannot use more advanced display areas, such as elliptical or irregular shapes. This supports the most common case for presenting video: a rectangular display area overlaid with video controls.
- You cannot rotate, apply filters, color transformations, or an alpha value to the video. Blend modes that you apply to display objects that are in front of the video do not apply to the video.
- You cannot bitmap cache the video.
- OSMF does not currently provide support for StageVideo API properties such as zoom or pan.
For more information on Stage Video, see:
- http://blogs.adobe.com/osmf/2011/02/getting-started-with-stage-video-support-in-osmf-and-strobe-media-playback.html
- http://www.adobe.com/devnet/flashplayer/stagevideo.html
Enabling and Disabling Stage Video in OSMF
Existing OSMF-based media players are given Stage Video capability simply by compiling against the OSMF 1.6 release using the -swf-version=11 compilation argument, with a few caveats:
- If the movie is not being displayed in full-screen mode, Stage Video must be activated by setting your HTML page’s wmode parameter to direct (wmode: “direct”). In full-screen mode, Stage Video is available with any wmode value.
- Because Stage Video renders under the display list, using opaque backgrounds under video assets can obscure the StageVideo object. If the video is not visible, check to see if you have an opaque object in your display list that could cover the Stage Video. To address this issue, you can make the display object transparent, for example. Similarly, in Flex applications, the video is not displayed unless you add backgroundAlpha=”0” to the Application container and to any other containers that could obscure the video.
- If Stage Video is enabled and a video resource is associated with a container that is smaller than the video’s native size, the scale mode must not be set to 'none'. Setting the scale mode to 'none' causes the video to not be clipped according to the container’s dimensions (this is the expected behavior).
The availability of the StageVideo objects is checked when a LightweightVideoElement or VideoElement object is added to the Stage.
Note: While you must use the new compilation target (-swf-version=11) to build a Stage Video-ready OSMF 1.6 player, your users are not forced to upgrade to Flash Player 10.2 when viewing media on the player.
If you have a player that uses features which are currently unsupported by Stage Video, you can still use OSMF 1.6 and exercise the option to disable Stage Video support. To turn off Stage Video support in an OSMF player, simply add the following snippet to your player’s code, before creating any media element:
OSMFSettings.enableStageVideo = false;
Changing the value of this property does not affect current media elements. It affects only the creation of future media elements.
Engineering Specification
You can view a PDF of the OSMF Stage Video Support Engineering Specification here.
Please note that an engineering design specification is a snapshot in time and is not guaranteed to contain the most current information.
