flash视频全屏的困难。。
不同的电脑全屏的效果不一样,被截断了,附图,,谁能写个完整的视频全屏代码
stage.scaleMode=StageScaleMode.NO_BORDER ;
stage.align=StageAlign.TOP_LEFT;
function divfull(e:MouseEvent):void
{
stage.displayState="fullScreen";
flv.x=0;
flv.y=0;
flv.width = 视频层.width;
flv.height = 视频层.height;
全屏.visible=false;
}
这么写会导致视频裁剪,不过StageScaleMode设置了其他三种也一样达不到效果
[解决办法]
stage.displayState=StageDisplayState.FULL_SCREEN;
stage.displayState= StageDisplayState.NORMAL;
[解决办法]
全屏的话,会受所处容器限制的,我找找看啊,有再说!
[解决办法]
scaleMode设置为noScale,按等比例对视频进行缩放。
[解决办法]
参考一下吧:
import flash.display.Sprite;import flash.geom.Rectangle;import flash.events.MouseEvent;var videoHolder:Sprite = new Sprite();this.addChild(videoHolder);var video:Sprite = new Sprite();video.graphics.beginFill(0x999999);video.graphics.drawRoundRect(0,0,120,80,10,10);video.graphics.endFill();this.addChild(video);var rectVideoHolder:Rectangle = new Rectangle();changeRectVideoHolder();function changeRectVideoHolder(e:MouseEvent = null):void{ //随机生成视频窗口的大小,最小宽度200,最大宽度400,最小高度100,最大高度300 rectVideoHolder.width = 200 + int(Math.random() * 200); rectVideoHolder.height = 100 + int(Math.random() * 200); //为看效果,画个背景 videoHolder.graphics.clear(); videoHolder.graphics.beginFill(0); videoHolder.graphics.drawRect(0,0,rectVideoHolder.width,rectVideoHolder.height); videoHolder.graphics.endFill(); //视频窗口舞台居中 videoHolder.x = ((this.stage.stageWidth - videoHolder.width) >> 1); videoHolder.y = ((this.stage.stageHeight - videoHolder.height) >> 1); //等比例缩放视频 var zoom1:Number = videoHolder.width / videoHolder.height; var zoom2:Number = video.width / video.height; if(zoom1 > zoom2){ video.height = videoHolder.height; video.width = video.height * zoom2; }else{ video.width = videoHolder.width; video.height = video.width / zoom2; } //视频居中 video.x = ((this.stage.stageWidth - video.width) >> 1); video.y = ((this.stage.stageHeight - video.height) >> 1);}this.stage.addEventListener(MouseEvent.CLICK,changeRectVideoHolder);
[解决办法]
sorry,我多此一举了。