improved the desktop sharing publish window preview
This commit is contained in:
parent
815be28d0b
commit
7fee4ac0d0
@ -29,7 +29,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
|||||||
initialize="init()"
|
initialize="init()"
|
||||||
creationComplete="onCreationComplete()"
|
creationComplete="onCreationComplete()"
|
||||||
verticalScrollPolicy="off" horizontalScrollPolicy="off"
|
verticalScrollPolicy="off" horizontalScrollPolicy="off"
|
||||||
width="365" height="350"
|
width="320" height="258"
|
||||||
title="{ResourceUtil.getInstance().getString('bbb.desktopPublish.title')}"
|
title="{ResourceUtil.getInstance().getString('bbb.desktopPublish.title')}"
|
||||||
resizable="false">
|
resizable="false">
|
||||||
|
|
||||||
@ -72,9 +72,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
|||||||
import org.bigbluebutton.modules.deskshare.utils.JavaCheck;
|
import org.bigbluebutton.modules.deskshare.utils.JavaCheck;
|
||||||
import org.bigbluebutton.util.i18n.ResourceUtil;
|
import org.bigbluebutton.util.i18n.ResourceUtil;
|
||||||
|
|
||||||
public static const SCALE:Number = 5;
|
private const DEFAULT_PREVIEW_WIDTH:int = 320;
|
||||||
private static const VID_HEIGHT_PAD:Number = 73;
|
private const DEFAULT_PREVIEW_HEIGHT:int = 180; // 16x9 aspect ratio
|
||||||
private static const VID_WIDTH_PAD:Number = 6;
|
|
||||||
|
|
||||||
private var images:Images = new Images();
|
private var images:Images = new Images();
|
||||||
[Bindable] public var bbbLogo:Class = images.bbb_logo;
|
[Bindable] public var bbbLogo:Class = images.bbb_logo;
|
||||||
@ -224,19 +223,22 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function onUpdateCursorEvent(event:CursorEvent):void {
|
private function onUpdateCursorEvent(event:CursorEvent):void {
|
||||||
|
if (cursor == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// DO NOT compute the x and y coordinate and assign directly to the cursorImg
|
// DO NOT compute the x and y coordinate and assign directly to the cursorImg
|
||||||
// as it results in a flickering and jerky mouse pointer (ralam jun 10, 2010).
|
// as it results in a flickering and jerky mouse pointer (ralam jun 10, 2010).
|
||||||
cursor.x = video.x + ((event.x/captureWidth)) * video.width;
|
cursor.x = video.x + ((event.x/captureWidth)) * video.width;
|
||||||
cursor.y = video.y + ((event.y/captureHeight)) * video.height;
|
cursor.y = video.y + ((event.y/captureHeight)) * video.height;
|
||||||
cursorImg.visible = true;
|
|
||||||
|
|
||||||
// Do not display cursor if they are outside the capture area.
|
// Do not display cursor if they are outside the capture area.
|
||||||
if (cursor.x < video.x) cursor.x = video.x;
|
cursorImg.visible = !(cursor.x < video.x
|
||||||
if (cursor.y < video.y) cursor.y = video.y;
|
|| cursor.y < video.y
|
||||||
if (cursor.x > video.x + video.width) cursor.x = video.x + video.width;
|
|| cursor.x > video.x + video.width
|
||||||
if (cursor.y > video.y + video.height) cursor.y = video.y + video.height;
|
|| cursor.y > video.y + video.height);
|
||||||
cursorImg.x = cursor.x;
|
cursorImg.x = cursor.x;
|
||||||
cursorImg.y = cursor.y;
|
cursorImg.y = cursor.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function onAppletStart(event:AppletStartedEvent):void{
|
private function onAppletStart(event:AppletStartedEvent):void{
|
||||||
@ -254,35 +256,29 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
|||||||
// Store capture dimensions so we can position cursor properly.
|
// Store capture dimensions so we can position cursor properly.
|
||||||
captureWidth = capWidth;
|
captureWidth = capWidth;
|
||||||
captureHeight = capHeight;
|
captureHeight = capHeight;
|
||||||
|
var captureAspectRatio:Number = captureWidth / captureHeight;
|
||||||
|
var videoHolderAspectRatio:Number = DEFAULT_PREVIEW_WIDTH / DEFAULT_PREVIEW_HEIGHT;
|
||||||
|
|
||||||
videoHolder = new UIComponent();
|
videoHolder = new UIComponent();
|
||||||
|
|
||||||
var vidW:Number = captureWidth;
|
var vidW:Number;
|
||||||
var vidH:Number = captureHeight;
|
var vidH:Number;
|
||||||
|
if (captureAspectRatio > videoHolderAspectRatio) {
|
||||||
// Don't scale if capture dimension is smaller than window.
|
vidW = DEFAULT_PREVIEW_WIDTH;
|
||||||
if((captureWidth > this.width - VID_WIDTH_PAD) && (captureHeight < this.height - VID_HEIGHT_PAD)){
|
vidH = Math.floor(DEFAULT_PREVIEW_WIDTH / captureAspectRatio);
|
||||||
vidW = this.width - VID_WIDTH_PAD;
|
} else {
|
||||||
vidH = (captureHeight / captureWidth) * vidW;
|
vidH = DEFAULT_PREVIEW_HEIGHT;
|
||||||
}
|
vidW = Math.floor(DEFAULT_PREVIEW_HEIGHT * captureAspectRatio);
|
||||||
else if( ((captureWidth < this.width - VID_WIDTH_PAD) && (captureHeight > this.height - VID_HEIGHT_PAD))
|
|
||||||
|| ((captureWidth > this.width - VID_WIDTH_PAD) && (captureHeight > this.height - VID_HEIGHT_PAD)) ){
|
|
||||||
vidH = this.height - VID_HEIGHT_PAD;
|
|
||||||
vidW = (captureWidth / captureHeight) * vidH;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
vidW = captureWidth;
|
|
||||||
vidH = captureHeight;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LogUtil.debug("deskshare preview[" + captureWidth + "," + captureHeight + "][" + vidW + "," + vidH + "]");
|
trace("deskshare preview[" + captureWidth + "," + captureHeight + "][" + vidW + "," + vidH + "]");
|
||||||
video = new Video(vidW, vidH);
|
video = new Video(vidW, vidH);
|
||||||
video.width = vidW;
|
video.width = vidW;
|
||||||
video.height = vidH;
|
video.height = vidH;
|
||||||
videoHolder.width = vidW;
|
videoHolder.width = DEFAULT_PREVIEW_WIDTH;
|
||||||
videoHolder.height = vidH;
|
videoHolder.height = DEFAULT_PREVIEW_HEIGHT;
|
||||||
video.x = videoHolder.x = (this.width - VID_WIDTH_PAD - vidW) / 2;
|
video.x = Math.floor((DEFAULT_PREVIEW_WIDTH - video.width) / 2);
|
||||||
video.y = videoHolder.y = (this.height - VID_HEIGHT_PAD - vidH) / 2;
|
video.y = Math.floor((DEFAULT_PREVIEW_HEIGHT - video.height) / 2);
|
||||||
|
|
||||||
|
|
||||||
videoHolder.addChild(video);
|
videoHolder.addChild(video);
|
||||||
|
Loading…
Reference in New Issue
Block a user