Question

With previous versions of flash, entering the full screen mode increased the height and width of the stage to the dimensions of the screen. Now that hardware scaling has arrived, the height and width are set to the dimensions of the video (plus borders if the aspect ratio is different).

That's fine, unless you have controls placed over the video. Before, you could control their size; but now they're blown up by the same scale as the video, and pixellated horribly. Controls are ugly and subtitles are unreadable.

It's possible for the user to turn off hardware scaling, but all that achieves is to turn off anti-aliasing. The controls are still blown up to ugliness.

Is there a way to get the old scaling behaviour back?

Was it helpful?

Solution 2

I've eventually found the answer to this. The problem is that the FLVPlayback component is now using the stage.fullScreenSourceRect property to enter a hardware-scaled full screen mode. When it does that, it stretches the rendered area given by stage.fullScreenSourceRect to fill the screen, rather than increasing the size of the stage or any components.

To stop it, you have to create a subclass of FLVPlayback that uses a subclass of UIManager, and override the function that's setting stage.fullScreenSourceRect. On the down side, you lose hardware scaling; but on the up side, your player doesn't look like it's been drawn by a three-year-old in crayons.

CustomFLVPlayback.as:

import fl.video.*;
use namespace flvplayback_internal;

public class CustomFLVPlayback
{
    public function CustomFLVPlayback()
    {
        super();
        uiMgr = new CustomUIManager(this);
    }
}

CustomUIManager.as:

import fl.video.*;
import flash.display.StageDisplayState;

public class CustomUIManager
{
    public function CustomUIManager(vc:FLVPlayback)
    {
        super(vc);
    }

    public override function enterFullScreenDisplayState():void
    {
        if (!_fullScreen && _vc.stage != null)
        {
            try
            {
                 _vc.stage.displayState = StageDisplayState.FULL_SCREEN;
            } catch (se:SecurityError) {
            }
        }
    }
}

We add the FLVPlayback to our movie using actionscript, so we just have to replace

var myFLVPLayback:FLVPlayback = new FLVPlayback();

with

var myFLVPLayback:CustomFLVPlayback = new CustomFLVPlayback();

I don't know whether there's a way to make the custom class available in the component library.

OTHER TIPS

Here's another way to solve it, which is simpler and it seems to work quite well for me.

myFLVPlayback.fullScreenTakeOver = false;

The fullScreenTakeOver property was introduced in Flash Player 9 update 3. The docs are all a bit vague, but there's a bit more info here:

Using the FLVPlayback component with Flash Player 9 Update 3

stage.align     = StageAlign.TOP_LEFT; 
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.addEventListener(Event.RESIZE, onStageResize);

function onStageResize(event:Event):void {
    //do whatever you want to re-position your controls and scale the video
    // here's an example
    myFLVPlayback.width = stage.stageWidth;
    myFLVPlayback.height = stage.stageHeight - controls.height;
    controls.y = stage.stageHeight - controls.height;
}

Or, and I'm not entirely sure about this, you might try to do some 9 slice scaling on the FLVPlayback, but I don't know if that'll work.

9-slice scaling tutorial: http://www.sephiroth.it/tutorials/flashPHP/scale9/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top