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?
有没有办法让旧的缩放行为恢复?
3 个解决方案
#1
2
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:
fullScreenTakeOver属性是在Flash Player 9 update 3中引入的。文档有点模糊,但这里有更多信息:
Using the FLVPlayback
component with Flash Player 9 Update 3
将FLVPlayback组件与Flash Player 9 Update 3一起使用
#2
1
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.
我终于找到了答案。问题是FLVPlayback组件现在使用stage.fullScreenSourceRect属性进入硬件扩展的全屏模式。当它这样做时,它会拉伸stage.fullScreenSourceRect给出的渲染区域来填充屏幕,而不是增加舞台或任何组件的大小。
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.
要停止它,你必须创建一个FLVPlayback的子类,它使用UIManager的子类,并覆盖设置stage.fullScreenSourceRect的函数。在不利方面,您将失去硬件扩展;但从好的方面来说,你的玩家看起来并不像是一个三岁的蜡笔画的。
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
我们使用actionscript将FLVPlayback添加到我们的电影中,所以我们只需要替换
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.
我不知道是否有办法在组件库中提供自定义类。
#3
-1
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.
或者,我并不完全确定这一点,你可能会尝试在FLVPlayback上做一些9切片缩放,但我不知道这是否有效。
9-slice scaling tutorial: http://www.sephiroth.it/tutorials/flashPHP/scale9/
9切片缩放教程:http://www.sephiroth.it/tutorials/flashPHP/scale9/
#1
2
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:
fullScreenTakeOver属性是在Flash Player 9 update 3中引入的。文档有点模糊,但这里有更多信息:
Using the FLVPlayback
component with Flash Player 9 Update 3
将FLVPlayback组件与Flash Player 9 Update 3一起使用
#2
1
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.
我终于找到了答案。问题是FLVPlayback组件现在使用stage.fullScreenSourceRect属性进入硬件扩展的全屏模式。当它这样做时,它会拉伸stage.fullScreenSourceRect给出的渲染区域来填充屏幕,而不是增加舞台或任何组件的大小。
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.
要停止它,你必须创建一个FLVPlayback的子类,它使用UIManager的子类,并覆盖设置stage.fullScreenSourceRect的函数。在不利方面,您将失去硬件扩展;但从好的方面来说,你的玩家看起来并不像是一个三岁的蜡笔画的。
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
我们使用actionscript将FLVPlayback添加到我们的电影中,所以我们只需要替换
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.
我不知道是否有办法在组件库中提供自定义类。
#3
-1
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.
或者,我并不完全确定这一点,你可能会尝试在FLVPlayback上做一些9切片缩放,但我不知道这是否有效。
9-slice scaling tutorial: http://www.sephiroth.it/tutorials/flashPHP/scale9/
9切片缩放教程:http://www.sephiroth.it/tutorials/flashPHP/scale9/