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:
commit
b7130a379f
@ -265,8 +265,9 @@ bbb.desktopPublish.chromeOnMacUnsupportedHint = Desktop sharing is not currently
|
||||
bbb.desktopPublish.minimizeBtn.toolTip = Minimize
|
||||
bbb.desktopPublish.minimizeBtn.accessibilityName = Minimize 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.javaTestLinkLabel = Test Java
|
||||
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.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.accessibility = Test Your Java Version
|
||||
bbb.desktopView.title = Desktop Sharing
|
||||
|
@ -265,7 +265,8 @@ bbb.desktopPublish.chromeOnMacUnsupportedHint = Compartilhamento de tela não su
|
||||
bbb.desktopPublish.minimizeBtn.toolTip = Minimizar
|
||||
bbb.desktopPublish.minimizeBtn.accessibilityName = Minimizar 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.tooltip = Testar sua versão do Java
|
||||
bbb.desktopPublish.javaTestLinkLabel.tooltip.accessibility = Testar sua versão do Java
|
||||
|
@ -17,9 +17,14 @@
|
||||
width: 1px !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#deployJavaPlugin {
|
||||
display : none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript" src="swfobject/swfobject.js"></script>
|
||||
<script src="lib/deployJava.js?v=VERSION" language="javascript"></script>
|
||||
<script type="text/javascript">
|
||||
//swfobject.registerObject("BigBlueButton", "11", "expressInstall.swf");
|
||||
var flashvars = {};
|
||||
|
@ -4,6 +4,8 @@ if (!window.console.log) window.console.log = function () { };
|
||||
function startApplet(IP, roomNumber, fullScreen, useSVC2)
|
||||
{
|
||||
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");
|
||||
div.id = "deskshare";
|
||||
|
||||
@ -41,6 +43,16 @@ function stopApplet(){
|
||||
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(){
|
||||
// if (navigator.javaEnabled() || window.navigator.javaEnabled())
|
||||
return 1;
|
||||
|
1318
bigbluebutton-client/resources/prod/lib/deployJava.js
Normal file
1318
bigbluebutton-client/resources/prod/lib/deployJava.js
Normal file
File diff suppressed because it is too large
Load Diff
@ -29,7 +29,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
initialize="init()"
|
||||
creationComplete="onCreationComplete()"
|
||||
verticalScrollPolicy="off" horizontalScrollPolicy="off"
|
||||
width="365" height="320"
|
||||
width="365"
|
||||
title="{ResourceUtil.getInstance().getString('bbb.desktopPublish.title')}"
|
||||
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.util.i18n.ResourceUtil;
|
||||
|
||||
public static const SCALE:Number = 5;
|
||||
private static const VID_HEIGHT_PAD:Number = 73;
|
||||
private static const VID_WIDTH_PAD:Number = 6;
|
||||
private const DEFAULT_PREVIEW_WIDTH:int = 320;
|
||||
private const DEFAULT_PREVIEW_HEIGHT:int = 180; // 16x9 aspect ratio
|
||||
|
||||
private var images:Images = new Images();
|
||||
[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 ns:NetStream;
|
||||
[Bindable] private var videoHolder:UIComponent;
|
||||
private var stream:String;
|
||||
private var videoHeight: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 baseIndex:int;
|
||||
[Bindable] private var dsOptions:DeskshareOptions;
|
||||
[Bindable] private var javaRequiredString:String;
|
||||
|
||||
private function init():void {
|
||||
dsOptions = new DeskshareOptions();
|
||||
@ -103,12 +102,19 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
}
|
||||
|
||||
private function onCreationComplete():void {
|
||||
windowControls.maximizeRestoreBtn.enabled = false;
|
||||
windowControls.maximizeRestoreBtn.visible = false;
|
||||
|
||||
cursor = new Sprite();
|
||||
cursor.graphics.lineStyle(6, 0xFF0000, 0.6);
|
||||
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()) {
|
||||
setCurrentState("chromeOnMacWarningState");
|
||||
}
|
||||
@ -116,7 +122,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
setCurrentState("dispFullRegionControlBar");
|
||||
}
|
||||
resourcesChanged();
|
||||
|
||||
validateNow();
|
||||
|
||||
titleBarOverlay.tabIndex = baseIndex;
|
||||
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).
|
||||
cursor.x = video.x + ((event.x/captureWidth)) * video.width;
|
||||
cursor.y = video.y + ((event.y/captureHeight)) * video.height;
|
||||
cursorImg.visible = true;
|
||||
|
||||
// Do not display cursor if they are outside the capture area.
|
||||
if (cursor.x < video.x) cursor.x = video.x;
|
||||
if (cursor.y < video.y) cursor.y = video.y;
|
||||
if (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;
|
||||
cursorImg.x = cursor.x;
|
||||
cursorImg.y = cursor.y;
|
||||
cursorImg.visible = !(cursor.x < video.x
|
||||
|| cursor.y < video.y
|
||||
|| cursor.x > video.x + video.width
|
||||
|| cursor.y > video.y + video.height);
|
||||
cursorImg.x = cursor.x;
|
||||
cursorImg.y = cursor.y;
|
||||
}
|
||||
|
||||
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.
|
||||
captureWidth = capWidth;
|
||||
captureHeight = capHeight;
|
||||
var captureAspectRatio:Number = captureWidth / captureHeight;
|
||||
var videoHolderAspectRatio:Number = DEFAULT_PREVIEW_WIDTH / DEFAULT_PREVIEW_HEIGHT;
|
||||
|
||||
videoHolder = new UIComponent();
|
||||
|
||||
var vidW:Number = captureWidth;
|
||||
var vidH:Number = captureHeight;
|
||||
|
||||
// Don't scale if capture dimension is smaller than window.
|
||||
if((captureWidth > this.width - VID_WIDTH_PAD) && (captureHeight < this.height - VID_HEIGHT_PAD)){
|
||||
vidW = this.width - VID_WIDTH_PAD;
|
||||
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;
|
||||
var vidW:Number;
|
||||
var vidH:Number;
|
||||
if (captureAspectRatio > videoHolderAspectRatio) {
|
||||
vidW = DEFAULT_PREVIEW_WIDTH;
|
||||
vidH = Math.floor(DEFAULT_PREVIEW_WIDTH / captureAspectRatio);
|
||||
} else {
|
||||
vidH = DEFAULT_PREVIEW_HEIGHT;
|
||||
vidW = Math.floor(DEFAULT_PREVIEW_HEIGHT * captureAspectRatio);
|
||||
}
|
||||
|
||||
LogUtil.debug("deskshare preview[" + captureWidth + "," + captureHeight + "][" + vidW + "," + vidH + "]");
|
||||
trace("deskshare preview[" + captureWidth + "," + captureHeight + "][" + vidW + "," + vidH + "]");
|
||||
video = new Video(vidW, vidH);
|
||||
video.width = vidW;
|
||||
video.height = vidH;
|
||||
videoHolder.width = vidW;
|
||||
videoHolder.height = vidH;
|
||||
video.x = videoHolder.x = (this.width - VID_WIDTH_PAD - vidW) / 2;
|
||||
video.y = videoHolder.y = (this.height - VID_HEIGHT_PAD - vidH) / 2;
|
||||
video.x = Math.floor((DEFAULT_PREVIEW_WIDTH - video.width) / 2);
|
||||
video.y = Math.floor((DEFAULT_PREVIEW_HEIGHT - video.height) / 2);
|
||||
|
||||
|
||||
videoHolder.addChild(video);
|
||||
videoHolder.addChild(cursor);
|
||||
videoHolder.addChild(cursorImg);
|
||||
cursor.visible = false;
|
||||
this.addChild(videoHolder);
|
||||
|
||||
ns = new NetStream(nc);
|
||||
ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onAsyncError);
|
||||
@ -359,6 +354,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
stopStream();
|
||||
closeWindow();
|
||||
}
|
||||
|
||||
private function adjustWindowSize():void {
|
||||
this.height = container.measuredHeight + this.borderMetrics.top + this.borderMetrics.bottom + checkJavaBtn.height;
|
||||
}
|
||||
|
||||
private function onCheckYourJavaClicked():void {
|
||||
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>
|
||||
<mx:State name="dispFullRegionControlBar">
|
||||
<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:VBox width="100%" height="100%" horizontalAlign="center">
|
||||
@ -409,13 +410,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
</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"
|
||||
styleName="testJavaLinkButtonStyle" textDecoration="underline"
|
||||
toolTip="{ResourceUtil.getInstance().getString('bbb.desktopPublish.javaTestLinkLabel.tooltip')}"
|
||||
accessibilityDescription="{ResourceUtil.getInstance().getString('bbb.desktopPublish.javaTestLinkLabel.tooltip.accessibility')}"/>
|
||||
</mx:VBox>
|
||||
</mx:ControlBar>
|
||||
</mx:VBox>
|
||||
</mx:AddChild>
|
||||
</mx:State>
|
||||
<mx:State name="chromeOnMacWarningState">
|
||||
|
@ -53,7 +53,8 @@ public class DeskShareApplet extends JApplet implements ClientListener {
|
||||
|
||||
public boolean isSharing = 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 {
|
||||
public Object run() throws Exception {
|
||||
@ -127,13 +128,14 @@ public class DeskShareApplet extends JApplet implements ClientListener {
|
||||
public void start() {
|
||||
System.out.println("Desktop Sharing Applet Starting");
|
||||
super.start();
|
||||
|
||||
String javaRuntimeVersion = getJavaVersionRuntime();
|
||||
System.out.println("**** JAVA VERSION = [" + javaRuntimeVersion + "]");
|
||||
|
||||
if (VersionCheckUtil.validateMinJREVersion(javaRuntimeVersion, minJreVersion))
|
||||
allowDesktopSharing();
|
||||
else
|
||||
displayJavaWarning("Unsupported Java version [" + javaRuntimeVersion + "]. Minimum version required [" + minJreVersion + "]");
|
||||
displayJavaWarning(VERSION_ERROR_MSG);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user