Can I get the old full-screen zoom with FLVPlayback and flash 9.0.115+?

In previous versions of the flash, entering full-screen mode increased the height and width of the scene to fit the screen. Now that hardware scaling has appeared, the height and width are set by the size of the video (plus borders if the aspect ratio is different).

This is great if you do not have controls over the video. Previously, you could control their size; but now they are blown up on the same scale as the video, and pixelated horribly. The controls are ugly and the subtitles unreadable.

The user can turn off hardware scaling, but all that is achieved is to turn off anti-aliasing. The controls are still blown up to ugliness.

Is there a way to revert the old zoom behavior?

+4
source share
3 answers

In the end, I found the answer to this question. The problem is that the FLVPlayback component now uses the stage.fullScreenSourceRect property to enter full-screen mode with hardware scaling. When he does this, he stretches the display area set by stage.fullScreenSourceRect to fill the screen, rather than increasing the size of the scene or any components.

To stop it, you need to create a subclass of FLVPlayback that uses the UIManager subclass and override the function that defines stage.fullScreenSourceRect. From the bottom, you lose hardware scaling; but on the other hand, your player does not look as if he was drawn by three-year-old pencils.

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 are adding FLVPlayback to our movie using ActionScript, so we just need to replace

 var myFLVPLayback:FLVPlayback = new FLVPlayback(); 

with

 var myFLVPLayback:CustomFLVPlayback = new CustomFLVPlayback(); 

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

+1
source

Here is another way to solve it, which is simpler, and it seems to me that this works for me.

 myFLVPlayback. fullScreenTakeOver = false; 

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

Using the FLVPlayback Component with Flash Player 9 Update 3

+2
source
 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 an example myFLVPlayback.width = stage.stageWidth; myFLVPlayback.height = stage.stageHeight - controls.height; controls.y = stage.stageHeight - controls.height; } 

Or, and I'm not quite sure about this, you can try to do 9 slice scaling on FLVPlayback, but I don't know if this will work.

9-slice study guide: http://www.sephiroth.it/tutorials/flashPHP/scale9/

-1
source

Source: https://habr.com/ru/post/1276927/


All Articles