PDA

View Full Version : fullscreen flv problems



spastic
April 13th, 2009, 03:40 PM
I’d like to make a fullscreen desktop application, with an FLV, using the FLV Playback component. However, I’d like there to be a Fullscreen button on the playback component, which will allow the user to toggle the video fullscreen.

I can’t, for the life of me, figure out how to do this with various settings—it should be easy! This is what I have--is there a better way to do things (without a custom movie player)?


My inital settings are as follows:

stage.displayState = StageDisplayState.FULL_SCREEN;
theMovie.fullScreenTakeOver = false;

Then I have a function which should work--but my button won't appear in fullscreen--Can I apply this function to the built-in fullscreen button?:


function handleClick(event:MouseEvent):void
{
if ( !theMovie.fullScreenTakeOver )
{
stage.displayState = StageDisplayState.NORMAL;
theMovie.fullScreenTakeOver = true;
stage.displayState=StageDisplayState.FULL_SCREEN;
} else {

theMovie.fullScreenTakeOver = false;
stage.displayState = StageDisplayState.FULL_SCREEN;

}

}

Daganev
April 13th, 2009, 04:47 PM
fullscreen only works if "allowFullscreen" is set to True in the embed code for the swf.

spastic
April 13th, 2009, 04:48 PM
It's a desktop app, so that shouldn't matter.

My issue is that I want the app to be fullscreen, but I also want the flv to be able to "take over" the screen when the fullscreen button is pressed in the player.

Daganev
April 13th, 2009, 05:13 PM
I'm not quite sure what your code is supposed to be doing, but in general you want to do something like this:

if(fullscreen)
{
stage.scaleMode = ScaleMode.NO_SCALE
stage.aling = StageAlign.TOP_LEFT;
stage.addChild(flvPlayer)
flvPlayer.setsize(stage.width, stage.height);
} else
{
stage.scaleMode = ScaleMode.SHOW_ALL
stage.aling = StageAlign.TOP_LEFT;
flvPlayerHolder.addChild(flvPlayer)
flvPlayer.setsize(vid_W, vid_H);
}

Daganev
April 13th, 2009, 05:15 PM
also, you can't make it fullScreen without the user initating it. So you have to make the initial fullscreen done by a user click.

spastic
April 13th, 2009, 05:20 PM
Thanks... my real problem is that I would like to implement this with the flvplayback component controls..is there any way to do this?

Daganev
April 13th, 2009, 05:23 PM
yes. I don't have the syntax infront of me, but basically, you want to move the flvPlayback component from where you have it, to be ontop of everything else when you go full screen. Then just set the height and width of the component to the size of the stage.

Be sure to keep a reference of the orig size so that you can set the height and width back to what it was. when you leave fullscreen. Also, make sure you use the "Over" controls, not the "under" controls.

unhitched
April 14th, 2009, 07:26 AM
If you're using an FLVPlayback component that you've brought over from Flash, then it has a function called enterFullScreenDisplayState()

So you can say, myCustomComponent.myFLVPlaybackComponentInstanceNa me.enterFullScreenDisplayState()

spastic
April 14th, 2009, 10:15 AM
Thanks, but when your application is already running fullscreen, this doesn't do anything.

spastic
April 14th, 2009, 10:36 AM
I'm going to make a button, as Daganev suggested earlier, that will resize my flv player as I need it I think.
Thanks!