Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8267221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:26:22+00:00 2026-06-08T05:26:22+00:00

i need to convert a little flash site which does fullscreen video to a

  • 0

i need to convert a little flash site which does fullscreen video to a standalone-projector
the projector will run in windows 7 or xp and has to playback videos at 1080p

does anyone here have experiences how to get the best performance out of this?
hardware acceleration seems to be possible now ?

best regards and thanks for all input.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T05:26:25+00:00Added an answer on June 8, 2026 at 5:26 am

    flash.media.StageVideo is hardware accelerated playback reducing load on cpu:

    http://www.adobe.com/devnet/flashplayer/articles/stage_video.html

    The H.264 codec is stage video’s best friend; using this will ensure
    you get full GPU acceleration from video decoding to rendering. With
    this approach, no read-back (sending the data from the GPU to the CPU)
    is required to composite the video frames in the display list anymore.
    The YUV 4:2:0 formatted video frames are converted to RGB through a
    GPU shader (DirectX9 or OpenGL) and blitted onscreen. As a result, you
    will see higher pixel fidelity and some reduction in CPU and memory
    usage.

    From that link above, Thibault Imbert has an example implementation of stage video:

    package
    {
        import flash.display.Bitmap;
        import flash.display.BitmapData;
        import flash.display.DisplayObject;
        import flash.display.Loader;
        import flash.display.Shape;
        import flash.display.Sprite;
        import flash.display.StageAlign;
        import flash.display.StageDisplayState;
        import flash.display.StageScaleMode;
        import flash.events.Event;
        import flash.events.FullScreenEvent;
        import flash.events.KeyboardEvent;
        import flash.events.MouseEvent;
        import flash.events.NetStatusEvent;
        import flash.events.StageVideoAvailabilityEvent;
        import flash.events.StageVideoEvent;
        import flash.events.TimerEvent;
        import flash.events.VideoEvent;
        import flash.geom.Rectangle;
        import flash.media.SoundTransform;
        import flash.media.StageVideo;
        import flash.media.StageVideoAvailability;
        import flash.media.Video;
        import flash.net.NetConnection;
        import flash.net.NetStream;
        import flash.system.LoaderContext;
        import flash.text.TextField;
        import flash.text.TextFieldAutoSize;
        import flash.text.TextFormat;
        import flash.ui.Keyboard;
    
        /**
         * 
         * @author Thibault Imbert
         * 
         */ 
        [SWF(frameRate="1", backgroundColor="#000000")]
        public class SimpleStageVideo extends Sprite
        {
            private static const FILE_NAME:String = "video-file.mov";
            private static const INTERVAL:Number = 500;
            private static const BORDER:Number = 20;
    
            private var legend:TextField = new TextField();
            private var sv:StageVideo;
            private var nc:NetConnection;
            private var ns:NetStream;
            private var rc:Rectangle;
            private var video:Video;
            private var thumb:Shape;
            private var interactiveThumb:Sprite;
            private var totalTime:Number;
    
            private var videoWidth:int;
            private var videoHeight:int;
            private var outputBuffer:String = new String();
            private var rect:Rectangle = new Rectangle(0, 0, 0, BORDER);
            private var videoRect:Rectangle = new Rectangle(0, 0, 0, 0);
            private var gotStage:Boolean;
            private var stageVideoInUse:Boolean;
            private var classicVideoInUse:Boolean;
            private var accelerationType:String;
            private var infos:String = new String();
            private var available:Boolean;
            private var inited:Boolean;
            private var played:Boolean;
            private var container:Sprite;
    
            /**
             * 
             * 
             */     
            public function SimpleStageVideo()
            {
                // Make sure the app is visible and stage available
                addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
            }
    
            /**
             * 
             * @param event
             * 
             */     
            private function onAddedToStage(event:Event):void
            {
                // Scaling
                stage.scaleMode = StageScaleMode.NO_SCALE;
                stage.align = StageAlign.TOP_LEFT;
                legend.autoSize = TextFieldAutoSize.LEFT;
    
                // Debug infos
                legend.multiline = true;
                legend.background = true;
                legend.backgroundColor = 0xFFFFFFFF;
                addChild(legend);
    
                // Thumb seek Bar
                thumb = new Shape();
    
                interactiveThumb = new Sprite();
                interactiveThumb.addChild(thumb);
                addChild(interactiveThumb);
    
                // Connections
                nc = new NetConnection();
                nc.connect(null);
                ns = new NetStream(nc);
                ns.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
                ns.client = this;
    
                // Screen
                video = new Video();
                video.smoothing = true;
    
                // Video Events
                // the StageVideoEvent.STAGE_VIDEO_STATE informs you if StageVideo is available or not
                stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoState);
                // in case of fallback to Video, we listen to the VideoEvent.RENDER_STATE event to handle resize properly and know about the acceleration mode running
                video.addEventListener(VideoEvent.RENDER_STATE, videoStateChange);
    
                // Input Events
                stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
                stage.addEventListener(Event.RESIZE,  onResize);
                stage.addEventListener(MouseEvent.CLICK, onClick);
            }
    
            /**
             * 
             * @param event
             * 
             */     
            private function onNetStatus(event:NetStatusEvent):void
            {
                if ( event.info == "NetStream.Play.StreamNotFound" )
                    legend.text = "Video file passed, not available!";
            }
    
            /**
             * 
             * @param event
             * 
             */     
            private function onFrame(event:Event):void 
            {
                var ratio:Number = (ns.time / totalTime) * (stage.stageWidth - (BORDER << 1));
                rect.width = ratio;
                thumb.graphics.clear();
                thumb.graphics.beginFill(0xFFFFFF);
                thumb.graphics.drawRect(rect.x, rect.y, rect.width, rect.height);   
            }
    
            /**
             * 
             * @param event
             * 
             */     
            private function onClick(event:MouseEvent):void
            {
                if ( event.stageY >= interactiveThumb.y - BORDER && event.stageX <= stage.stageWidth - BORDER )
                {
                    var seekTime:Number = (stage.mouseX - BORDER) * ( totalTime / (stage.stageWidth - (BORDER << 1) ) );
                    ns.seek( seekTime );    
                }
            }
    
            /**
             * 
             * @param event
             * 
             */     
            private function onKeyDown(event:KeyboardEvent):void
            {   
                if ( event.keyCode == Keyboard.O )
                {
                    if ( available )
                        // We toggle the StageVideo on and off (fallback to Video and back to StageVideo)
                        toggleStageVideo(inited=!inited);
    
                } else if ( event.keyCode == Keyboard.F )
                {
                    stage.displayState = StageDisplayState.FULL_SCREEN;
                } else if ( event.keyCode == Keyboard.SPACE )
                {
                    ns.togglePause();
                }
            }
    
            /**
             * 
             * @param width
             * @param height
             * @return 
             * 
             */     
            private function getVideoRect(width:uint, height:uint):Rectangle
            {   
                var videoWidth:uint = width;
                var videoHeight:uint = height;
                var scaling:Number = Math.min ( stage.stageWidth / videoWidth, stage.stageHeight / videoHeight );
    
                videoWidth *= scaling, videoHeight *= scaling;
    
                var posX:uint = stage.stageWidth - videoWidth >> 1;
                var posY:uint = stage.stageHeight - videoHeight >> 1;
    
                videoRect.x = posX;
                videoRect.y = posY;
                videoRect.width = videoWidth;
                videoRect.height = videoHeight;
    
                return videoRect;
            }
    
            /**
             * 
             * 
             */     
            private function resize ():void
            {   
                if ( stageVideoInUse )
                {
                    // Get the Viewport viewable rectangle
                    rc = getVideoRect(sv.videoWidth, sv.videoHeight);
                    // set the StageVideo size using the viewPort property
                    sv.viewPort = rc;
                } else 
                {
                    // Get the Viewport viewable rectangle
                    rc = getVideoRect(video.videoWidth, video.videoHeight);
                    // Set the Video object size
                    video.width = rc.width;
                    video.height = rc.height;
                    video.x = rc.x, video.y = rc.y;
                }
    
                interactiveThumb.x = BORDER, interactiveThumb.y = stage.stageHeight - (BORDER << 1);
                legend.text = infos;
            }
    
            /**
             * 
             * @param evt
             * 
             */     
            public function onMetaData ( evt:Object ):void
            {
                totalTime = evt.duration;
                stage.addEventListener(Event.ENTER_FRAME, onFrame);
            }
    
            /**
             * 
             * @param event
             * 
             */     
            private function onStageVideoState(event:StageVideoAvailabilityEvent):void
            {   
                // Detect if StageVideo is available and decide what to do in toggleStageVideo
                toggleStageVideo(available = inited = (event.availability == StageVideoAvailability.AVAILABLE));
            }
    
            /**
             * 
             * @param on
             * 
             */     
            private function toggleStageVideo(on:Boolean):void
            {   
                infos = "StageVideo Running (Direct path) : " + on + "\n";
    
                // If we choose StageVideo we attach the NetStream to StageVideo
                if (on) 
                {
                    stageVideoInUse = true;
                    if ( sv == null )
                    {
                        sv = stage.stageVideos[0];
                        sv.addEventListener(StageVideoEvent.RENDER_STATE, stageVideoStateChange);
                    }
                    sv.attachNetStream(ns);
                    if (classicVideoInUse)
                    {
                        // If we use StageVideo, we just remove from the display list the Video object to avoid covering the StageVideo object (always in the background)
                        stage.removeChild ( video );
                        classicVideoInUse = false;
                    }
                } else 
                {
                    // Otherwise we attach it to a Video object
                    if (stageVideoInUse)
                        stageVideoInUse = false;
                    classicVideoInUse = true;
                    video.attachNetStream(ns);
                    stage.addChildAt(video, 0);
                }
    
                if ( !played ) 
                {
                    played = true;
                    ns.play(FILE_NAME);
                }
            } 
    
            /**
             * 
             * @param event
             * 
             */     
            private function onResize(event:Event):void
            {
                resize();       
            }
    
            /**
             * 
             * @param event
             * 
             */     
            private function stageVideoStateChange(event:StageVideoEvent):void
            {   
                infos += "StageVideoEvent received\n";
                infos += "Render State : " + event.status + "\n";
                resize();
            }
    
            /**
             * 
             * @param event
             * 
             */     
            private function videoStateChange(event:VideoEvent):void
            {   
                infos += "VideoEvent received\n";
                infos += "Render State : " + event.status + "\n";
                resize();
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to convert hierarchical data (AVRO data, which boils down to JSON) into
I am a little new to this, but I need to convert the below
I purchased a contact form. Great little thing but I need to convert the
I need to convert a Silverlight App to WPF (to finally run it on
I need to convert a bit-field structure from little-endian to big-endia architecture. What is
I need a simple regex that will work in preg_replace that will convert any
I need to convert an array of integers to a little endian bitmask using
I need to convert a String to enum. I followed the idea in String
I need to convert a string vector in a simple string. I do not
I need to convert full state name to its official state address code. For

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.