Monday, 1 November 2010

Flex Spark VideoPlayer FullScreen bug workaround

VideoPlayer has a native bug which causes it, to loose its width and height attributes when the user cancels FullScreen mode.

A workaround is to capture the event and re-enter the player attributes as follows:

Listening to the FULL_SCREEN event at the systemManager

systemManager.stage.addEventListener(FullScreenEvent.FULL_SCREEN,funct ion(e)
{
var event = e.fullScreen;
if(event==false)
{
player.percentHeight=100;
player.percentWidth=100;
player.invalidateDisplayList();
}trace(e);
});

and if it is about to close I re-enter the percentages for the player height and width, and it again works as expected.

I hope this helps someone....

3 comments:

Johannes said...

helped :) thx

JTtheGeek said...

Thanks very much, fixed it perfect!

Anonymous said...

Thanks alot, this fixed my problem