Merge branch '090-java-detection' into HEAD

Conflicts:
	bigbluebutton-client/locale/pt_BR/bbbResources.properties
	bigbluebutton-client/resources/prod/BigBlueButton.html
	bigbluebutton-client/resources/prod/lib/bbb_deskshare.js
	bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components/DesktopPublishWindow.mxml
This commit is contained in:
Felipe Cecagno 2015-01-25 18:19:13 -02:00
commit b7130a379f
7 changed files with 1385 additions and 44 deletions

View File

@ -265,8 +265,9 @@ bbb.desktopPublish.chromeOnMacUnsupportedHint = Desktop sharing is not currently
bbb.desktopPublish.minimizeBtn.toolTip = Minimize bbb.desktopPublish.minimizeBtn.toolTip = Minimize
bbb.desktopPublish.minimizeBtn.accessibilityName = Minimize the Desktop Sharing Publish Window bbb.desktopPublish.minimizeBtn.accessibilityName = Minimize the Desktop Sharing Publish Window
bbb.desktopPublish.maximizeRestoreBtn.accessibilityName = Maximize the Desktop Sharing Publish Window bbb.desktopPublish.maximizeRestoreBtn.accessibilityName = Maximize the Desktop Sharing Publish Window
bbb.desktopPublish.javaRequiredLabel = Requires Java 7u51 (or later) to run. bbb.desktopPublish.javaRequiredLabel.verified = Compatible Java version detected. In case of any problem, make sure Java 7u51 (or later) is installed by clicking on the link below.
bbb.desktopPublish.javaTestLinkLabel = Test Java bbb.desktopPublish.javaRequiredLabel.unknown = Java version couldn't be verified. Make sure Java 7u51 (or later) is installed by clicking on the link below.
bbb.desktopPublish.javaTestLinkLabel = Test Java
bbb.desktopPublish.javaTestLinkLabel.tooltip = Test Your Java Version bbb.desktopPublish.javaTestLinkLabel.tooltip = Test Your Java Version
bbb.desktopPublish.javaTestLinkLabel.tooltip.accessibility = Test Your Java Version bbb.desktopPublish.javaTestLinkLabel.tooltip.accessibility = Test Your Java Version
bbb.desktopView.title = Desktop Sharing bbb.desktopView.title = Desktop Sharing

View File

@ -265,7 +265,8 @@ bbb.desktopPublish.chromeOnMacUnsupportedHint = Compartilhamento de tela não su
bbb.desktopPublish.minimizeBtn.toolTip = Minimizar bbb.desktopPublish.minimizeBtn.toolTip = Minimizar
bbb.desktopPublish.minimizeBtn.accessibilityName = Minimizar janela do compartilhamento de tela bbb.desktopPublish.minimizeBtn.accessibilityName = Minimizar janela do compartilhamento de tela
bbb.desktopPublish.maximizeRestoreBtn.accessibilityName = Maximizar janela do compartilhamento de tela bbb.desktopPublish.maximizeRestoreBtn.accessibilityName = Maximizar janela do compartilhamento de tela
bbb.desktopPublish.javaRequiredLabel = Requer Java 7u51 (ou posterior). bbb.desktopPublish.javaRequiredLabel.verified = Versão compatível do Java detectada. Em caso de problemas, certifique-se que o Java 7u51 (ou posterior) está instalado clicando no link abaixo.
bbb.desktopPublish.javaRequiredLabel.unknown = Versão do Java não verificada. Certifique-se que o Java 7u51 (ou posterior) está instalado clicando no link abaixo.
bbb.desktopPublish.javaTestLinkLabel = Testar Java bbb.desktopPublish.javaTestLinkLabel = Testar Java
bbb.desktopPublish.javaTestLinkLabel.tooltip = Testar sua versão do Java bbb.desktopPublish.javaTestLinkLabel.tooltip = Testar sua versão do Java
bbb.desktopPublish.javaTestLinkLabel.tooltip.accessibility = Testar sua versão do Java bbb.desktopPublish.javaTestLinkLabel.tooltip.accessibility = Testar sua versão do Java

View File

@ -17,9 +17,14 @@
width: 1px !important; width: 1px !important;
overflow: hidden; overflow: hidden;
} }
#deployJavaPlugin {
display : none;
}
</style> </style>
<script type="text/javascript" src="swfobject/swfobject.js"></script> <script type="text/javascript" src="swfobject/swfobject.js"></script>
<script src="lib/deployJava.js?v=VERSION" language="javascript"></script>
<script type="text/javascript"> <script type="text/javascript">
//swfobject.registerObject("BigBlueButton", "11", "expressInstall.swf"); //swfobject.registerObject("BigBlueButton", "11", "expressInstall.swf");
var flashvars = {}; var flashvars = {};

View File

@ -4,6 +4,8 @@ if (!window.console.log) window.console.log = function () { };
function startApplet(IP, roomNumber, fullScreen, useSVC2) function startApplet(IP, roomNumber, fullScreen, useSVC2)
{ {
console.log("Starting deskshare applet."); console.log("Starting deskshare applet.");
console.log("Is Java enabled? " + isJavaEnabled());
console.log("Is Java version appropriate for desktop sharing? " + isJavaVersionAppropriateForDeskshare());
var div = document.createElement("div"); var div = document.createElement("div");
div.id = "deskshare"; div.id = "deskshare";
@ -41,6 +43,16 @@ function stopApplet(){
removeFrame(); removeFrame();
} }
var isJavaEnabled = function() {
return typeof(navigator.javaEnabled) !== 'undefined' && navigator.javaEnabled();
}
var isJavaVersionAppropriateForDeskshare = function() {
var required = '1.7.0_51+';
deployJava.init();
return deployJava.versionCheck(required);
}
function checkForJava(){ function checkForJava(){
// if (navigator.javaEnabled() || window.navigator.javaEnabled()) // if (navigator.javaEnabled() || window.navigator.javaEnabled())
return 1; return 1;

File diff suppressed because it is too large Load Diff

View File

@ -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="320" width="365"
title="{ResourceUtil.getInstance().getString('bbb.desktopPublish.title')}" title="{ResourceUtil.getInstance().getString('bbb.desktopPublish.title')}"
resizable="false"> resizable="false">
@ -68,9 +68,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.modules.deskshare.model.DeskshareOptions; import org.bigbluebutton.modules.deskshare.model.DeskshareOptions;
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;
@ -84,7 +83,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private var video:Video; private var video:Video;
private var ns:NetStream; private var ns:NetStream;
[Bindable] private var videoHolder:UIComponent;
private var stream:String; private var stream:String;
private var videoHeight:Number; private var videoHeight:Number;
private var videoWidth:Number; private var videoWidth:Number;
@ -96,6 +94,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
[Bindable] private var cursor:Sprite; [Bindable] private var cursor:Sprite;
[Bindable] private var baseIndex:int; [Bindable] private var baseIndex:int;
[Bindable] private var dsOptions:DeskshareOptions; [Bindable] private var dsOptions:DeskshareOptions;
[Bindable] private var javaRequiredString:String;
private function init():void { private function init():void {
dsOptions = new DeskshareOptions(); dsOptions = new DeskshareOptions();
@ -103,12 +102,19 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
} }
private function onCreationComplete():void { private function onCreationComplete():void {
windowControls.maximizeRestoreBtn.enabled = false; windowControls.maximizeRestoreBtn.visible = false;
cursor = new Sprite(); cursor = new Sprite();
cursor.graphics.lineStyle(6, 0xFF0000, 0.6); cursor.graphics.lineStyle(6, 0xFF0000, 0.6);
cursor.graphics.drawCircle(0,0,3); cursor.graphics.drawCircle(0,0,3);
if (ExternalInterface.available
&& ExternalInterface.call("isJavaEnabled")
&& ExternalInterface.call("isJavaVersionAppropriateForDeskshare")) {
javaRequiredString = "bbb.desktopPublish.javaRequiredLabel.verified";
} else {
javaRequiredString = "bbb.desktopPublish.javaRequiredLabel.unknown";
}
if (isUsingLessThanChrome38OnMac()) { if (isUsingLessThanChrome38OnMac()) {
setCurrentState("chromeOnMacWarningState"); setCurrentState("chromeOnMacWarningState");
} }
@ -116,7 +122,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
setCurrentState("dispFullRegionControlBar"); setCurrentState("dispFullRegionControlBar");
} }
resourcesChanged(); resourcesChanged();
validateNow();
titleBarOverlay.tabIndex = baseIndex; titleBarOverlay.tabIndex = baseIndex;
titleBarOverlay.focusEnabled = true; titleBarOverlay.focusEnabled = true;
@ -208,15 +215,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
// 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{
@ -234,42 +240,31 @@ 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(); var vidW:Number;
var vidH:Number;
var vidW:Number = captureWidth; if (captureAspectRatio > videoHolderAspectRatio) {
var vidH:Number = captureHeight; vidW = DEFAULT_PREVIEW_WIDTH;
vidH = Math.floor(DEFAULT_PREVIEW_WIDTH / captureAspectRatio);
// Don't scale if capture dimension is smaller than window. } else {
if((captureWidth > this.width - VID_WIDTH_PAD) && (captureHeight < this.height - VID_HEIGHT_PAD)){ vidH = DEFAULT_PREVIEW_HEIGHT;
vidW = this.width - VID_WIDTH_PAD; vidW = Math.floor(DEFAULT_PREVIEW_HEIGHT * captureAspectRatio);
vidH = (captureHeight / captureWidth) * vidW;
}
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; video.x = Math.floor((DEFAULT_PREVIEW_WIDTH - video.width) / 2);
videoHolder.height = vidH; video.y = Math.floor((DEFAULT_PREVIEW_HEIGHT - video.height) / 2);
video.x = videoHolder.x = (this.width - VID_WIDTH_PAD - vidW) / 2;
video.y = videoHolder.y = (this.height - VID_HEIGHT_PAD - vidH) / 2;
videoHolder.addChild(video); videoHolder.addChild(video);
videoHolder.addChild(cursor); videoHolder.addChild(cursor);
videoHolder.addChild(cursorImg); videoHolder.addChild(cursorImg);
cursor.visible = false; cursor.visible = false;
this.addChild(videoHolder);
ns = new NetStream(nc); ns = new NetStream(nc);
ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onAsyncError); ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onAsyncError);
@ -359,6 +354,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
stopStream(); stopStream();
closeWindow(); closeWindow();
} }
private function adjustWindowSize():void {
this.height = container.measuredHeight + this.borderMetrics.top + this.borderMetrics.bottom + checkJavaBtn.height;
}
private function onCheckYourJavaClicked():void { private function onCheckYourJavaClicked():void {
var CHECK_JAVA_URL:String = BBB.initConfigManager().config.javaTest.url; var CHECK_JAVA_URL:String = BBB.initConfigManager().config.javaTest.url;
@ -378,6 +377,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<dspub:states> <dspub:states>
<mx:State name="dispFullRegionControlBar"> <mx:State name="dispFullRegionControlBar">
<mx:AddChild> <mx:AddChild>
<mx:VBox id="container" width="100%" horizontalAlign="center">
<mx:UIComponent id="videoHolder" width="{DEFAULT_PREVIEW_WIDTH}" height="{DEFAULT_PREVIEW_HEIGHT}" />
<mx:ControlBar id="fullRegionBottomBar"> <mx:ControlBar id="fullRegionBottomBar">
<mx:VBox width="100%" height="100%" horizontalAlign="center"> <mx:VBox width="100%" height="100%" horizontalAlign="center">
@ -409,13 +410,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
</mx:HBox> </mx:HBox>
<mx:Label id="javaVersionLabel" styleName="javaVersionRequiredLabelStyle" text="{ResourceUtil.getInstance().getString('bbb.desktopPublish.javaRequiredLabel')}"/> <mx:Text id="javaVersionLabel" styleName="javaVersionRequiredLabelStyle" width="100%" text="{ResourceUtil.getInstance().getString(javaRequiredString)}" resize="adjustWindowSize()" />
<mx:LinkButton id="checkJavaBtn" label="{ResourceUtil.getInstance().getString('bbb.desktopPublish.javaTestLinkLabel')}" click="onCheckYourJavaClicked()" height="22" <mx:LinkButton id="checkJavaBtn" label="{ResourceUtil.getInstance().getString('bbb.desktopPublish.javaTestLinkLabel')}" click="onCheckYourJavaClicked()" height="22"
styleName="testJavaLinkButtonStyle" textDecoration="underline" styleName="testJavaLinkButtonStyle" textDecoration="underline"
toolTip="{ResourceUtil.getInstance().getString('bbb.desktopPublish.javaTestLinkLabel.tooltip')}" toolTip="{ResourceUtil.getInstance().getString('bbb.desktopPublish.javaTestLinkLabel.tooltip')}"
accessibilityDescription="{ResourceUtil.getInstance().getString('bbb.desktopPublish.javaTestLinkLabel.tooltip.accessibility')}"/> accessibilityDescription="{ResourceUtil.getInstance().getString('bbb.desktopPublish.javaTestLinkLabel.tooltip.accessibility')}"/>
</mx:VBox> </mx:VBox>
</mx:ControlBar> </mx:ControlBar>
</mx:VBox>
</mx:AddChild> </mx:AddChild>
</mx:State> </mx:State>
<mx:State name="chromeOnMacWarningState"> <mx:State name="chromeOnMacWarningState">

View File

@ -53,7 +53,8 @@ public class DeskShareApplet extends JApplet implements ClientListener {
public boolean isSharing = false; public boolean isSharing = false;
private volatile boolean clientStarted = false; private volatile boolean clientStarted = false;
private final static String VERSION_ERROR_MSG = "You have an unsupported Java version."; private final static String MIN_JRE_VERSION = "1.7.0_51";
private final static String VERSION_ERROR_MSG = "Desktop sharing requires Java 7 update 51 (or later) to run.";
private class DestroyJob implements PrivilegedExceptionAction { private class DestroyJob implements PrivilegedExceptionAction {
public Object run() throws Exception { public Object run() throws Exception {
@ -127,13 +128,14 @@ public class DeskShareApplet extends JApplet implements ClientListener {
public void start() { public void start() {
System.out.println("Desktop Sharing Applet Starting"); System.out.println("Desktop Sharing Applet Starting");
super.start(); super.start();
String javaRuntimeVersion = getJavaVersionRuntime(); String javaRuntimeVersion = getJavaVersionRuntime();
System.out.println("**** JAVA VERSION = [" + javaRuntimeVersion + "]"); System.out.println("**** JAVA VERSION = [" + javaRuntimeVersion + "]");
if (VersionCheckUtil.validateMinJREVersion(javaRuntimeVersion, minJreVersion)) if (VersionCheckUtil.validateMinJREVersion(javaRuntimeVersion, minJreVersion))
allowDesktopSharing(); allowDesktopSharing();
else else
displayJavaWarning("Unsupported Java version [" + javaRuntimeVersion + "]. Minimum version required [" + minJreVersion + "]"); displayJavaWarning(VERSION_ERROR_MSG);
} }