Skip to content

Instantly share code, notes, and snippets.

@thiagopnts
Last active August 29, 2015 13:58
Show Gist options
  • Save thiagopnts/10388462 to your computer and use it in GitHub Desktop.
Save thiagopnts/10388462 to your computer and use it in GitHub Desktop.
private function _onStageResize(event:Event):void {
_hls.width = stage.stageWidth;
stage.fullScreenSourceRect = new Rectangle(0,0,stage.stageWidth,stage.stageHeight);
_resize();
};
private function _resize():void {
var rect:Rectangle;
rect = ScaleVideo.resizeRectangle(_videoWidth, _videoHeight, stage.stageWidth, stage.stageHeight);
// resize video
if (_video) {
_video.width = rect.width;
_video.height = rect.height;
_video.x = rect.x;
_video.y = rect.y;
} else if (_stageVideo) {
_stageVideo.viewPort = rect;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment