Question

I'm trying to make an instance of FLVPlayBack run in fullscreen, without affecting the rest of the application.

According to stuff I've read, I have set the players scale mode so it will fit the window when its scaled up.

flvPlayer.scaleMode = "exactFit";

And in order to stop the stage from scaling up I've also set the stage's scale mode too.

stage.scaleMode = "noScale";

Then in order to try and control what the video player does when I click the fullscreen button, I also use the fullScreenTakeOver setting on the player.

If I set the code like to 'false'

flvPlayer.fullScreenTakeOver = false;

Then the whole interface becomes fullscreen, with the stage positioned in the centre of the window, I guess this is because I set the stage not to scale. The video stays its normal size and carries on doing what it was doing. Exiting fullscreen shrinks the stage back to normal.

If, on the other hand I set it to 'true'

flvPlayer.fullScreenTakeOver = true;

Then the video takes over the screen, but it doesn't scale up, instead it positions the video in the middle of the page, and the clickable areas of the controls move to where they would be if the video was full size, leaving my guessing where the buttons should be.

In both cases the video carries on running fine.

Can anyone help me with the right combination of settings? I want the application to stay its windowed size and the fly player to scale to fit fullscreen by itself.

Thanks.

Was it helpful?

Solution

You'll want to set a few settings which some you've already done

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align     = StageAlign.TOP_LEFT;
flvPlayer.fullScreenTakeOver = false;

Now when you enter full screen your application stuff will positioned top left. You will want to make an event listener for full screen mode.

stage.addEventListener(FullScreenEvent.FULL_SCREEN, fullScreenHandler);

In that event is where you will handle resizing and moving the video (Also hiding other objects on the stage if need be)

function fullScreenHandler(e:FullScreenEvent):void
{
    if (stage.displayState == StageDisplayState.NORMAL)
    {
        // Setup NORMAL Layout
        // resize and reposition the flvPlayer
    }
    else
    {
        // Setup FULL_SCREEN Layout
        // move the flvPlayer to x:0 and y:0
        // set the flvPlayer width and height to stage.stageWidth and stage.stageHeight
    }
}

OTHER TIPS

There is a property in flvplayback named fullScreenTakeOver which is set by true by default. this will interfere with fullscreen really bad. if you want to apply fullscreen without changing logic of your stage you better set this as false after instantiation. this will decrease your troubles a lot

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