//**************************************************// //*********** MEETING FUNCTIONS ********************// //**************************************************// var URLCreateFrameset = "/webconference/URLCreateFrameset.aspx", presentationSessionFormatID, returnToAccountManagerWait = 1000, isInMeeting = true, isJavaScreenSharingAppletOnThePage = false, isWindowsScreenSharingPluginOnThePage = false, currentWindowsScreenSharingPluginVersion = "2.0.4", currentJavaScreenSharingPluginVersion = "2.0.0", currentSharedWindow = "", isSwitchingApps = false; //URLCreateFrameset is what people get redirected to with a query string attached //returnToAccountManagerWait determines how long to wait before redirecting or closing window in milliseconds //-----------------------------------------------------------------------// // Tells whether the user browser is Internet Explorer //-----------------------------------------------------------------------// function isIE() { return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent); }; //-----------------------------------------------------------------------// // Tells whether the user browser is Firefox //-----------------------------------------------------------------------// function meetingJsIsFirefox() { var isFF = /Firefox/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent); return isFF; }; //-----------------------------------------------------------------------// // Tells whether the user browser is Google Chrome //-----------------------------------------------------------------------// function isGoogleChrome() { return navigator.userAgent.toLowerCase().indexOf('chrome') > -1; }; //-----------------------------------------------------------------------// // Tells whether the user browser is Safari //-----------------------------------------------------------------------// function meetingJsIsSafari() { //the userAgent of Google Chrome contains the text safari return ((navigator.userAgent.toLowerCase().indexOf('safari') > -1) && (navigator.userAgent.toLowerCase().indexOf('chrome') === -1)); }; //-----------------------------------------------------------------------// // Tells whether the user computer is Windows //-----------------------------------------------------------------------// function isWindows() { return (navigator.appVersion.toLowerCase().indexOf("win") != -1); // && !meetingJsIsFirefox(); //&& !isIE() }; //-----------------------------------------------------------------------// // Open our High Quality Video Plug-in install window //-----------------------------------------------------------------------// function OpenVideoPluginWindow() { MM_openBrWindow("http://" + serverWeb + "/AccountManager/Other/VideoComponentDownload.aspx?start=true", "_install", "width=760,height=450,status=1"); }; function setMinWidthHeight(myArgs) { var ary = myArgs.split("|||"), width = ary[0], height = ary[1], CosNetControl = document.getElementById("ip_control"), flashcontent = document.getElementById("flashcontent"); appMinWidth = width; appMinHeight = height; setSize(); }; function setSize() { var rightPanelWidth = 0; if ((isFb == 1 || isFb == "True" || isFb == "true" || isFb == true) && p == "0") { if (DisplayAds != 'False') rightPanelWidth = 180; else rightPanelWidth = 0; } var remainingWidth = $(window).width() - rightPanelWidth; var remainingHeight = $(window).height(); var controlName = "#flashcontent"; if ($(window).width() - rightPanelWidth < appMinWidth) { $(controlName).width(appMinWidth); } else $(controlName).css("width", "100%"); if ($(window).height() < appMinHeight) { $(controlName).height(appMinHeight); } else { $(controlName).css("height", "100%"); } var appContainerControl = "#appScroller"; $(appContainerControl).width(remainingWidth); $(appContainerControl).height(remainingHeight); }; //********************************************************************************* //This the start of a group of functions dealing with the launching of a URL window //-----------------------------------------------------------------------// // Provided an appropriate web URL, open a new window with our custom // header frame up top. //-----------------------------------------------------------------------// function URLLaunch(theURL) { var myWindow, myScreen = getScreenSize(), rExp = /,_self/gi, newString = new String(theURL); sentURL = newString.replace(rExp, ''); newString = null; launchURL = 'http://' + serverWeb + URLCreateFrameset + '?url=' + sentURL; if (isGoogleChrome()) { showBlockedURLMessage(); } else { urlWindow = window.open(launchURL, 'urlWindow', 'width=780,height=500,screenX=120,screenY=120,top=120,left=120,toolbar=0,location=0,status=1,menubar=0,resizable=1,scrollbars=1'); setTimeout(checkURLLaunch, 2000); } }; //-----------------------------------------------------------------------// // Allows user to hide the popup blocked message from view //-----------------------------------------------------------------------// function hideBlockedURLMessage() { $.unblockUI("#popupBlocked"); }; //-----------------------------------------------------------------------// // Let the user know that a pop up blocker grabbed our window //-----------------------------------------------------------------------// function showBlockedURLMessage() { $("#popupBlockedLink").attr("href", launchURL); $.blockUI({ message: $('#popupBlocked'), css: { cursor: 'default', width: '500px', top: '100px', left: (($(window).width() - 500) / 2) + 'px', textAlign: 'left'} }); }; //-----------------------------------------------------------------------// // Detect if the popup blocker grabbed our window and call the function // to show the user an alert. //-----------------------------------------------------------------------// function checkURLLaunch() { var IE = isIE(); alertText = "WARNING: Your browser has a pop-up blocker installed. The presenter has tried to send you this link below.\n\nCopy and paste this link into a new browser window."; if (urlWindow == null || typeof (urlWindow) == "undefined" || isGoogleChrome()) { //has pop-up blocker showBlockedURLMessage(); } else { try { urlWindow.focus(); } catch (e) { //has pop-up blocker showBlockedURLMessage(); } } }; //-----------------------------------------------------------------------// // Redirect to a Web URL, places our own custom header above in a // separate frame //-----------------------------------------------------------------------// function urlRedirect(theURL) { if (presentationSessionFormatID == 15) { //video only API window.location = theURL; } else { if (theURL.indexOf("SYID=") > 0) { window.location = "http://" + serverWeb + URLCreateFrameset + "?url=" + theURL + '%26rslt=' + resultUnique; } else { window.location = "http://" + serverWeb + URLCreateFrameset + "?url=" + theURL; } } }; //-----------------------------------------------------------------------// // Redirects to breakout room //-----------------------------------------------------------------------// function doBreakout(theURL) { var url = theURL; canClose = true; window.location = url; }; //This the end of a group of functions dealing with the launching of a URL window //********************************************************************************* function getFocus() { //we may do something with this in the future }; //-----------------------------------------------------------------------// // Maximize the page window //-----------------------------------------------------------------------// function Maximize() { window.moveTo(0, 0); window.resizeTo(screen.width - 11, screen.height - 79); window.screenX = 0; window.screenY = 0; alwaysLowered = false; isMinimized = false; }; //-----------------------------------------------------------------------// // Minimize the page window //-----------------------------------------------------------------------// function Minimize() { window.resizeTo(10, 10); window.moveTo(screen.width, screen.height); alwaysLowered = true; isMinimized = true; }; //-----------------------------------------------------------------------// // Called by the Presentation Active Upload file after it has successfully // uploaded a file. This will let the Flash Meeting App know of the new // file. //-----------------------------------------------------------------------// function fileUploaded(filename) { doCall("ip_control", "_level0.swfProxy_mc.presentation_mc.loadUploadedContent," + sp + filename); }; //**** SCREEN SHARING FUNCTIONS ************************************ //-----------------------------------------------------------------------// // Global Variables //-----------------------------------------------------------------------// var protocol = "rtmp", port = "1935", curTries = 0, maxTries = 2, gsID, gR, connecting = false, SSControl, isMinimized = false, isScreenSharing = false, canClose = true, hasPlugin = true, screenShareVersion = 2, screenShareFileType = "", appMinWidth = 910, appMinHeight = 610; //-----------------------------------------------------------------------// // CosNetControl (Screen Sharing component) Main Event Handler // This handles status changes for the Screen Sharing Component //-----------------------------------------------------------------------// function onStatus(pCode) { if (pCode != "NetStream.Record.Start") { if (pCode == "NetStream.Unpublish.Success" && isScreenSharing == false) { pCode = "NetConnection.Connect.Failed"; } if (pCode == "NetStream.Publish.Start" || pCode == "NetStream.Unpublish.Success" || pCode == "NetConnection.Connect.Closed") { switch (pCode) { case "NetStream.Publish.Start": isScreenSharing = true; if (isSwitchingApps == true) { $.unblockUI(); isSwitchingApps = false; } break; case "NetStream.Unpublish.Success": case "NetConnection.Connect.Closed": stopScreenShare(); break; } } if (pCode == "NetConnection.Connect.Success") { curTries = 0; connecting = false; isScreenSharing = true; successStart = true; } if (pCode == "NetStream.Publish.BadName") { //msgbox "BadName"; } if (pCode == "NetConnection.Connect.Failed") { //protocol = "rtmpt"; //port = "80"; if (curTries < maxTries && connecting == true) { curTries++; setTimeout("retryStartScreenShare()", 500); } else { stopScreenShare(); if (!isWindows()) { alert("We could not start screen sharing. This is probably because you didn't allow our Screen Sharing plugin to run. Please close your browser completely, log in to this meeting again, and be sure to click 'Allow' when prompted.\n\nIf you did click 'Allow', then you may be behind a firewall. Please check your connection settings."); pCode = "NetConnection.Connect.Failed.NoAlert"; } } } if (pCode == "Plugin.RequiresRestart") { //startScreenShareAfterSelectedOptions(gsID, gR); //if (isScreenSharing == true && currentSharedWindow != "") //{ // if (currentSharedWindow != oCosNetControl.TargetWindowName) // { //$.blockUI({ message: "Switching applications, please wait...", css: { cursor: 'default', height: '300px', fontWeight: 'bold'}}); var oCosNetControl = document.getElementById("CosNetControl"); $.blockUI(); isSwitchingApps = true; doCall("ip_control", "_level0.swfProxy_mc.IPScreenShare_mc.Plugin_SetCaptureOptions,2|d|" + oCosNetControl.TargetWindowName); // } //} } //Screen shares before 2010-08-16 have no screenShareVersion and no screenShareFileType //screenShareVersion is 2 and marks the addition of h.264 plugin var funcDoCall = "_level0.swfProxy_mc.IPScreenShare_mc.Plugin_onStatus," + pCode + ";;" + screenShareVersion + ";" + screenShareFileType; //alert(new Date() + " - doCall funcDoCall: " + funcDoCall); doCall("ip_control", funcDoCall); } }; function Destroy() { document.getElementById("CosNetControl") = null; }; //-----------------------------------------------------------------------// // This attempts to start screen sharing again. // This is typically used with a schedule command for when there is // problems connecting. //-----------------------------------------------------------------------// function retryStartScreenShare() { startScreenShareAfterSelectedOptions(gsID, gR); }; function saveScreenSharePrefs() { var oCosNetControl = document.getElementById("CosNetControl"), mode, captureWindow = ""; if (document.getElementById("radioMonitor1").checked) { mode = 0; } if (document.getElementById("radioMonitor2").checked) { mode = 1; } if (document.getElementById("radioWindowSelect").checked) { mode = 2; } if (mode == 2) { captureWindow = document.getElementById("captureWindowList").value; } $.unblockUI("#preferencesDialog"); doCall("ip_control", "_level0.swfProxy_mc.IPScreenShare_mc.Plugin_SetCaptureOptions," + mode + "|d|" + captureWindow); oCosNetControl.SetCaptureOptions(mode, captureWindow); startScreenShareAfterSelectedOptions(gsID, gR); } function populateScreenShareWindowList() { variantResult = cosNetControl.GetAvailableCaptureWindows(); var resultArray = variantResult.split("|d|"); resultArray.sort(); var windowList = document.getElementById("captureWindowList"); var selectedApp = cosNetControl.TargetWindowName; for (i = windowList.length - 1; i >= 0; i--) { windowList.remove(i); } for (i = 0; i < resultArray.length; i++) { var lvalue = resultArray[i]; var ltext = ""; if (lvalue.length > 73) { ltext = lvalue.substring(0, 70) + "..."; } else { ltext = lvalue; } var elOptNew = document.createElement('option'); elOptNew.text = ltext; elOptNew.value = lvalue; try { windowList.add(elOptNew, null); // standards compliant; doesn't work in IE } catch(ex) { windowList.add(elOptNew); // IE only } if (lvalue == selectedApp) { windowList.selectedIndex = i; document.getElementById("radioWindowSelect").checked = true; } var newItem = windowList[i]; if (i % 2 == 0) { newItem.style.backgroundColor = "#eeeeee"; } } if (selectedApp == "Full Screen") { document.getElementById("radioMonitor1").checked = true; } else if (selectedApp == "Full Screen Monitor 2") { document.getElementById("radioMonitor2").checked = true; } } function displayScreenSharePrefs() { cosNetControl = document.getElementById("CosNetControl"); var isSecondMonitorPresent = cosNetControl.IsSecondMonitorPresent(); if (isSecondMonitorPresent) { $("#tdSecondMonitor").show(); $("#spanMonitorOne").show(); } else { $("#tdSecondMonitor").hide(); $("#spanMonitorOne").hide(); } populateScreenShareWindowList(); $.blockUI({ message: $('#preferencesDialog'), css: { cursor: 'default', width: '500px', top: '100px', left: (($(window).width() - 500) / 2) + 'px', textAlign: 'left'} }); }; function CosNetControl_OnOptionsChanged() { var oCosNetControl = document.getElementById("CosNetControl"); doCall("ip_control", "_level0.swfProxy_mc.IPScreenShare_mc.Plugin_SetCaptureOptions,2|d|" + oCosNetControl.TargetWindowName); //alert("CosNetControl_OnOptionsChanged" + ", " + oCosNetControl.TargetWindowName); }; //-----------------------------------------------------------------------// // Start Screen Sharing //-----------------------------------------------------------------------// function startScreenShare(sID, r) { gsID = sID; gR = r; if (isWindowsScreenSharingPluginOnThePage) { displayScreenSharePrefs(); } else if (isJavaScreenSharingAppletOnThePage) { startScreenShareAfterSelectedOptions(sID, r); } }; var successStart = false; function startScreenShareAfterSelectedOptions(sID, r) { var oCosNetControl = document.getElementById("CosNetControl"); if ((oCosNetControl !== undefined) && (oCosNetControl !== null) && (oCosNetControl !== "")) { gsID = sID; gR = r; var strStreamPublishName, ary = r.split("|||"), publishType = ary[0], IPScreenShare_SessionsConducted = Number(ary[1]), rr = publishType.toUpperCase(), eventKey = ek, // exposed in default.aspx strStreamPublishPath = protocol + "://" + serverScreenSharing + ":" + port + "/screenshare/" + eventKey + "/" + sID, bitrate = document.getElementById("bandwidthList").options[document.getElementById("bandwidthList").selectedIndex].value, quality = document.getElementById("qualityList").options[document.getElementById("qualityList").selectedIndex].value; IPScreenShare_SessionsConducted++; if (isWindowsScreenSharingPluginOnThePage) { strStreamPublishName = "mp4:Sharing" + sID + "_" + IPScreenShare_SessionsConducted + ".mp4"; oCosNetControl.ColorQuality = 16; // default is 24, possible values 4,8,24 oCosNetControl.FPS = 15; // default is 2, possible values 1-5 oCosNetControl.Quality = quality; // default is 2, possible values 1-5 oCosNetControl.ForceMode = 'WINDOWS_GDI'; //default is DIRECTX_9, possible values: WINDOWS_GDI, DIRECTX_9 oCosNetControl.CompressionMode = 4; oCosNetControl.BitrateLimit = bitrate; oCosNetControl.KeyframeInterval = 450;//every 30 seconds SSControl = oCosNetControl; doCall("ip_control", "_level0.swfProxy_mc.IPScreenShare_mc.Plugin_resultScreenSize," + oCosNetControl.ScreenXWidth + ";" + oCosNetControl.ScreenYHeight); var strStart = "SSControl.StartShareDesktop('" + strStreamPublishName + "'," + strStreamPublishName.length + ",'" + strStreamPublishPath + "', " + strStreamPublishPath.length + ",'" + rr + "', 1)"; setTimeout(strStart, 500); } else if (isJavaScreenSharingAppletOnThePage) { strStreamPublishName = "Sharing" + sID + "_" + IPScreenShare_SessionsConducted; try { oCosNetControl.setColorQuality(16); // default is 24, possible values 4,8,24 oCosNetControl.setFPS(4); // default is 2, possible values 1-5 oCosNetControl.startShareDesktop(strStreamPublishName, strStreamPublishPath, rr, false); successStart = false; } catch (e) { stopScreenShare(); hasPlugin = false; sendFlashPluginDetails(); MM_openBrWindow("http://" + serverWeb + "/webconference/ScreenSharingInstall.aspx", "_install", "width=760,height=450,status=1,scrollbars=1,resizable=1"); return false; } } else { alert("The Screen Sharing Plugin did not load correctly. Try reloading the page."); return false; } //alert("strStreamPublishName: " + strStreamPublishName); sendStartingScreenSharing(); connecting = true; } }; //-----------------------------------------------------------------------// // Stop Screen Sharing //-----------------------------------------------------------------------// function stopScreenShare() { if (isScreenSharing == true) { var oCosNetControl = document.getElementById("CosNetControl"); if ((oCosNetControl !== undefined) && (oCosNetControl !== null) && (oCosNetControl !== "")) { if (isWindowsScreenSharingPluginOnThePage) { if (oCosNetControl.StopShareDesktop != undefined) { oCosNetControl.StopShareDesktop(); } } else if (isJavaScreenSharingAppletOnThePage) { oCosNetControl.stopShareDesktop(); } } } stoppedScreenShare(); }; //-----------------------------------------------------------------------// // Called by stopScreenShare() // Sets variables and window settings to END the screen sharing process. //-----------------------------------------------------------------------// function stoppedScreenShare() { connecting = false; curTries = 0; isScreenSharing = false; }; //-----------------------------------------------------------------------// // This is called by The Screen Sharing Component Download/Install pages. // This lets the install page know if the user already has the // screen sharing plug-in installed. //-----------------------------------------------------------------------// function detectPlugin() { return checkHasScreenShare(); }; //-----------------------------------------------------------------------// // Open our screen sharing plug-in install window // called in function ip_control_DoFSCommand(command, args) // where command from swf equals "installPlugin" //-----------------------------------------------------------------------// function InstallPlugin_new(isCalledFromMeeting) { if (isCalledFromMeeting === true) { isInMeeting = true; //loadScreenSharePlugin(); } MM_openBrWindow("http://" + serverWeb + "/webconference/ScreenSharingInstall.aspx", "_install", "width=760,height=450,status=1,scrollbars=1,resizable=1"); }; //-----------------------------------------------------------------------// // Check to see if the Screen Sharing Element is present on the page //-----------------------------------------------------------------------// function isUserUpgradingWindowsScreenSharingPlugin() { var oCosNetControl = document.getElementById("CosNetControl"), returnValue = false, cosNetControlVersion; try { if ((oCosNetControl !== undefined) && (oCosNetControl !== null) && (oCosNetControl !== "")) { if (isWindowsScreenSharingPluginOnThePage) { try { cosNetControlVersion = oCosNetControl.Version(); if (cosNetControlVersion !== currentWindowsScreenSharingPluginVersion && cosNetControlVersion !== undefined && cosNetControlVersion !== null) { returnValue = true; } } catch (e) { } } } } catch (e) { } return returnValue; }; //-----------------------------------------------------------------------// // Helper funtion for checkHasScreenShare // returns true if the CosNetControl object reference returns the // current Windows Screen Sharing Plugin version. else false. //-----------------------------------------------------------------------// function checkHasWindowsScreenSharingPlugin(oCosNetControlRef) { var returnValue = false; try { //alert(oCosNetControlRef.version); if (oCosNetControlRef.Version() === currentWindowsScreenSharingPluginVersion) { screenShareFileType = "mp4"; returnValue = true; } else { returnValue = false; } } catch (e) { //alert(e); returnValue = false; } return returnValue; }; //-----------------------------------------------------------------------// // Helper funtion for checkHasScreenShare // returns true if the CosNetControl object reference returns the // current Java Screen Sharing Plugin version. else false. //-----------------------------------------------------------------------// function checkHasJavaScreenSharingPlugin(oCosNetControlRef) { var returnValue = false; if (!isWindows() && (meetingJsIsSafari() || meetingJsIsFirefox())) { if (navigator.javaEnabled()) { returnValue = true; } else { returnValue = false; } } else { try { if (oCosNetControlRef.getVersion() === currentJavaScreenSharingPluginVersion) { screenShareFileType = "flv"; returnValue = true; } else { returnValue = false; } } catch (e) { returnValue = false; } } return returnValue; }; //-----------------------------------------------------------------------// // returns true if a Screen Sharing Plugin is working. else false. //-----------------------------------------------------------------------// function checkHasScreenShare() { var oCosNetControl = document.getElementById("CosNetControl"), returnValue = false; try { if ((oCosNetControl !== undefined) && (oCosNetControl !== null) && (oCosNetControl !== "")) { if (isWindows() == true) { if (meetingJsIsSafari()) { returnValue = checkHasJavaScreenSharingPlugin(oCosNetControl); } else { returnValue = checkHasWindowsScreenSharingPlugin(oCosNetControl); if (!returnValue && isInMeeting === true) { returnValue = checkHasJavaScreenSharingPlugin(oCosNetControl); } } } else { returnValue = checkHasJavaScreenSharingPlugin(oCosNetControl); } } else { returnValue = false; } } catch (e) { returnValue = false; } return returnValue; }; //-----------------------------------------------------------------------// // This is called to initialize the screen sharing plug-ins and set // member variables indicating that the page has finished loading. // This is called by the default.aspx body tag when the page has // finished loading. //-----------------------------------------------------------------------// function doOnLoad() { canClose = false; //load screen sharing plug-in if we have a presenter if (p == 1) { loadScreenSharePlugin(); } hasPlugin = checkLoaded(); isLoaded = true; }; //-----------------------------------------------------------------------// // Called by the HQ Video Download & Screen Sharing Video Download pages // after the plug-in has successfully installed. This refreshes the page // so that it recognizes that the plug-in has been installed and allows // for immediate usage of the plug-in //-----------------------------------------------------------------------// function refreshAfterPluginInstall(loadedWin) { if (loadedWin != null) { loadedWin.close(); } loadScreenSharePlugin(); }; function sendFlashPluginDetails() { try { var resultString = "_level0.swfProxy_mc.IPScreenShare_mc.Plugin_resultHasPlugin," + hasPlugin.toString() + "|||" + screenShareFileType; var doCallResult = doCall("ip_control", resultString); } catch (e) { } }; function sendStartingScreenSharing() { try { var resultString = "_level0.swfProxy_mc.IPScreenShare_mc.Plugin_onStarting,"; var doCallResult = doCall("ip_control", resultString); } catch (e) { } }; //-----------------------------------------------------------------------// // Check to make sure the Screen Sharing Plug-in is loaded, // responds with a DO CALL to the flash meeting app //-----------------------------------------------------------------------// function checkLoaded() { if (checkHasScreenShare() === true) { hasPlugin = true; } else { hasPlugin = false; } sendFlashPluginDetails(); return hasPlugin; }; //-----------------------------------------------------------------------// // Load ScreenSharing plug-in //-----------------------------------------------------------------------// function loadScreenSharePluginForInstallPage() { if (isJavaScreenSharingAppletOnThePage === false && isWindowsScreenSharingPluginOnThePage === false) { if (isWindows()) { if (meetingJsIsSafari() == true) { loadJavaApplet(); } else { loadWindowsPlugin(); //if (!checkHasWindowsScreenSharingPlugin(document.getElementById("CosNetControl")) && isInMeeting === true) { // loadJavaApplet(); //} } } else { loadJavaApplet(); } } else { } }; function loadScreenSharePlugin() { if(isJavaScreenSharingAppletOnThePage === false && isWindowsScreenSharingPluginOnThePage === false) { if (isWindows()) { if (meetingJsIsSafari() == true) { loadJavaApplet(); } else { loadWindowsPlugin(); if (!checkHasWindowsScreenSharingPlugin(document.getElementById("CosNetControl")) && isInMeeting === true) { loadJavaApplet(); } } } else { loadJavaApplet(); } } else { //either the windows screen sharing plugin has already been put on the page } }; //-----------------------------------------------------------------------// // Load our Windows screen sharing plug-in //-----------------------------------------------------------------------// function loadWindowsPlugin() { unloadWindowsPlugin(); var oPlugin = document.getElementById("plugin"); if ((oPlugin !== undefined) && (oPlugin !== null) && (oPlugin !== "")) { if (isIE()) { //Internet Explorer oPlugin.innerHTML = ""; var oCosNetControl = document.getElementById("CosNetControl"); oCosNetControl.attachEvent("OnStatus", onStatus); oCosNetControl.attachEvent("OnOptionsChanged", CosNetControl_OnOptionsChanged); } else { //Mozilla oPlugin.innerHTML = ""; } isWindowsScreenSharingPluginOnThePage = true; isJavaScreenSharingAppletOnThePage = false; //return checkLoaded(); return true; } else { return false; } }; //-----------------------------------------------------------------------// // Unload our Windows screen sharing plug-in //-----------------------------------------------------------------------// function unloadWindowsPlugin() { var oCosNetControl = document.getElementById("CosNetControl"); if ((oCosNetControl !== undefined) && (oCosNetControl !== null) && (oCosNetControl !== "")) { try { if (isIE()) { oCosNetControl.removeNode(true); } else { oCosNetControl.parentNode.removeChild(oCosNetControl); } isWindowsScreenSharingPluginOnThePage = false; } catch (e) { } } }; //-----------------------------------------------------------------------// // Load our (Non-Windows) Java applet screen sharing plug-in //-----------------------------------------------------------------------// var archiveString = "/webconference/components/applet/ScreenSharing2.0.0.jar,/webconference/components/applet/commons-codec-1.3.jar,/webconference/components/applet/commons-httpclient-3.1.jar, /webconference/components/applet/commons-logging-1.1.1.jar,/webconference/components/applet/plugin.jar"; var appletString = ""; function loadJavaApplet() { if (isWindows() || (!isWindows() && (meetingJsIsSafari() || meetingJsIsFirefox()) && navigator.javaEnabled())) { unloadJavaApplet(); var oPlugin = document.getElementById("plugin"); if ((oPlugin !== undefined) && (oPlugin !== null) && (oPlugin !== "")) { oPlugin.innerHTML = appletString; isJavaScreenSharingAppletOnThePage = true; isWindowsScreenSharingPluginOnThePage = false; return true; //return = checkLoaded(); } else { return false; } } }; //-----------------------------------------------------------------------// // Unload our Java applet screen sharing plug-in //-----------------------------------------------------------------------// function unloadJavaApplet() { var oCosNetControl = document.getElementById("CosNetControl"); if ((oCosNetControl !== undefined) && (oCosNetControl !== null) && (oCosNetControl !== "")) { try { oCosNetControl.removeChild(true); isJavaScreenSharingAppletOnThePage = false; //alert("You removed the applet from " + window.location); } catch (e) { } } }; //-----------------------------------------------------------------------// // Tell the Browser that there is no screen sharing installed //-----------------------------------------------------------------------// function noScreenSharePluginInstalled() { hasPlugin = false; }; //-----------------------------------------------------------------------// // Make someone a Presenter and load screen sharing also //-----------------------------------------------------------------------// function makePresenter() { isInMeeting = true; //true will force java applet to be loaded if windows plugin is not installed loadScreenSharePlugin(); }; //-----------------------------------------------------------------------// // Set the Presentation Session Format ( 10 = High Quality Video ) // If High Quality Video Format is selected, then Bandwidth is also set //-----------------------------------------------------------------------// function setFormatID(strFormat) { presentationSessionFormatID = Number(strFormat); if (typeof (setBandwidthProfile) != "undefined") { switch (presentationSessionFormatID) { case 10: setBandwidthProfile("small"); break; case 15: canClose = true; break; default: setBandwidthProfile("small"); break; } } }; //-----------------------------------------------------------------------// // This redirects Attendees to the proper exit page // * InstantPresenter Users get signup form // * My VSL users get signup form // * All other users get a blank page. //-----------------------------------------------------------------------// function goToExitPage() { //anyone who is not a reseller customer gets taken to a signup page if (isReseller == "False") { window.location = "/adw/WebConferencingSignUp.aspx"; } //all vsl customers get taken to a vsl signup page if (serverWeb.toLowerCase().indexOf("myvsl.com") > 0) { window.location = "http://www.videoseminarlive.com"; } else if (serverWeb.toLowerCase().indexOf("anymeeting") > 0) { window.location = "/EndMeeting.aspx"; } }; //-----------------------------------------------------------------------// // This is how commands get passed to the Flash Meeting App. This is the // main integration point from User Browser -----> Flash Meeting App //-----------------------------------------------------------------------// function doCall(swfId, what) { var swf = document.getElementById(swfId); if (swf) { try { swf.SetVariable('_root.externalFunction', what); } catch (e) {} } }; //-----------------------------------------------------------------------// // All Commands are passed through here via the Flash Meeting App // to talk to the browser. This is the main integration point from // Flash Meeting App -----> User Browser //-----------------------------------------------------------------------// function ip_control_DoFSCommand(command, args) { //alert("command: " + command + ", args: " + args); switch (command) { case "returnToAccountManager": //Presenter ended session without putting in a redirect URL if (p == 1) { //PluginStopBroadcast(); if (typeof (videohide) != 'undefined') { videohide(); } //send presenter to account manager after short delay, this gives our plugins TIME to UNLOAD setTimeout("returnToAccountManager()", returnToAccountManagerWait); } else { canClose = true; goToExitPage(); } break; case "startScreenShare": startScreenShare(sid, args); break; case "stopScreenShare": stopScreenShare(); break; case "startScreenShareAfterSelectedOptions": startScreenShareAfterSelectedOptions(sid, args); break; case "openURL": URLLaunch(args); break; case "redirectURL": //Presenter ended Session and put in a REDIRECT URL canClose = true; //send presenters back to the account manager if (p == 1 && serverWeb.indexOf("icohere") == -1) { //call delayed return to account manager so our plugins have time to UNLOAD setTimeout("returnToAccountManager()", returnToAccountManagerWait); } else { urlRedirect(args); } break; case "doBreakout": doBreakout(args); break; case "openContentUpload": openContentUploader(enceid); break; case "getHasPlugin": checkLoaded(); break; case "getHasVideoPlugin": if (typeof (PluginVideoCheckLoaded) != 'undefined') { PluginVideoCheckLoaded(); } break; case "PluginEnable": if (typeof (pluginEnable) != 'undefined') { pluginEnable(args); } break; case "installPlugin": InstallPlugin_new(true); break; case "getScreenSize": var CosNetControl = document.getElementById("CosNetControl"); if(meetingJsIsSafari()) { //prevent safari from hanging by using js screen width and height instead of the java applet doCall("ip_control", "_level0.swfProxy_mc.IPScreenShare_mc.Plugin_resultScreenSize," + screen.width + ";" + screen.height); } else if (!isJavaScreenSharingAppletOnThePage) { doCall("ip_control", "_level0.swfProxy_mc.IPScreenShare_mc.Plugin_resultScreenSize," + CosNetControl.ScreenXWidth + ";" + CosNetControl.ScreenYHeight); } else { doCall("ip_control", "_level0.swfProxy_mc.IPScreenShare_mc.Plugin_resultScreenSize," + CosNetControl.getScreenXWidth() + ";" + CosNetControl.getScreenYHeight()); } break; case "setQuality": break; case "setFrameRate": break; case "getFocus": getFocus(); break; case "makePresenter": makePresenter(); break; case "FormatID": setFormatID(args); break; case "onVideoSize": if (typeof (videoresize) != 'undefined') { videoresize(args); } break; case "menuShow": if (typeof (videohide) != 'undefined') { videohide(); } break; case "menuHide": if (typeof (videoshow) != 'undefined') { videoshow(); } break; case "videoHide": if (typeof (videohide) != 'undefined') { videohide(); } break; case "videoShow": if (typeof (videoshow) != 'undefined') { videoshow(); } break; case "PluginStartBroadcast": if (typeof (PluginStartBroadcast) != 'undefined') { PluginStartBroadcast(args); } break; case "PluginStopBroadcast": if (typeof (PluginStopBroadcast) != 'undefined') { PluginStopBroadcast(); } break; case "PluginSetMic": if (typeof (PluginSetMic) != 'undefined') { PluginSetMic(args); } break; case "PluginSettings": if (typeof (PluginSettings) != 'undefined') { PluginSettings(args); } break; case "PluginSetCamera": if (typeof (PluginSetCamera) != 'undefined') { PluginSetCamera(args); } break; case "PluginVideoPauseBroadcast": if (typeof (PluginVideoPauseBroadcast) != 'undefined') { PluginVideoPauseBroadcast(args); } break; case "PluginAudioPauseBroadcast": if (typeof (PluginAudioPauseBroadcast) != 'undefined') { PluginAudioPauseBroadcast(args); } break; case "PluginSetVolume": if (typeof (PluginSetVolume) != 'undefined') { PluginSetVolume(args); } break; case "PluginSetBandwidth": if (typeof (setBandwidthProfile) != 'undefined') { setBandwidthProfile(args); } break; case "PluginSetBroadcastBuffer": if (typeof (setBroadcastBuffer) != 'undefined') { setBroadcastBuffer(args); } break; case "ToasterMessage": ToasterMessage(args); break; case "PluginBroadcastStarted": PluginBroadcastStarted(); break; case "setMinWidthHeight": setMinWidthHeight(args); break; case "showScreenSharingMessage": showScreenSharingMessage(args); break; case "showDiv": showDiv(args); break; case "hideDiv": hideDiv(args); break; case "showJSIFrameDialog": showJSIFrameDialog(args); break; case "hideJSIFrameDialog": hideJSIFrameDialog(args); break; default: break; } }; //-----------------------------------------------------------------------// // Brings the Presenter back to the My Account page //-----------------------------------------------------------------------// function returnToAccountManager() { canClose = true; var destLocation = "http://" + serverWeb + "/AccountManager/Default.aspx?from=EndMeeting"; if (window.opener == "undefined" || !window.opener) { //The parent window has been closed already, send the only window that's open back to the account manager window.location = destLocation; } else { try { //send parent window to account manager window.parent.opener.location = destLocation; } catch (err) { //do nothing //alert(err.message); } //close the presentation window window.close(); } }; //-----------------------------------------------------------------------// // Determines whether passed file name is an allowed upload file type //-----------------------------------------------------------------------// function isValidUploadType(filename) { var dot = filename.lastIndexOf("."); var extention = filename.substr(dot + 1); var validTypes = validUploadFileTypes; if (validTypes.search(extention) != "-1") { return true; } else { return false; } }; //-----------------------------------------------------------------------// // Opens the Presentation Upload on the Fly window //-----------------------------------------------------------------------// function openContentUploader(encEventID) { var contentURL = "http://" + serverWeb + "/AccountManager/Presentation/PresentationActiveUpload.aspx?ip_e=" + encEventID; MM_openBrWindow(contentURL, "_upload", "modal,width=540,height=360,status=0"); }; //-----------------------------------------------------------------------// // Displays a little message in the lower right corner of the screen. //-----------------------------------------------------------------------// function ToasterMessage(msg) { jQuery.showMessage({ 'thisMessage': [msg], 'className': 'notification', 'opacity': 90, 'displayNavigation': false, 'autoClose': true, 'delayTime': 5000, 'position': 'bottom' }); }; function showScreenSharingMessage(msg) { var title, msg; //title = args.split("|")[0]; //msg = args.split("|")[1]; var lCosNetControl = document.getElementById("CosNetControl"); //ToasterMessage("msg: " + msg + ", isScreenSharing: " + isScreenSharing + ", window_focus: " + window_focus + ", lCosNetControl: " + lCosNetControl); //console.log("msg: " + msg + ", isScreenSharing: " + isScreenSharing + ", window_focus: " + window_focus + ", lCosNetControl: " + lCosNetControl); if (isScreenSharing == true && window_focus == false) { if (msg.length < 40) msg += "\n "; lCosNetControl.ShowNotification("You received a Chat Message...", msg); } }; function showDiv(divName) { $(divName).dialog("open"); } function hideDiv(divName) { $(divName).dialog("destroy"); } function showJSIFrameDialog(dialogName) { //$(divName).dialog("open"); if ($.cookie("dontShowAgain_" + dialogName) != "true") { var fullPath = "/WebConference/dialogs/" + dialogName + ".aspx"; var frameName = "ifrm" + dialogName; $('#appContainer').append(''); $("#" + frameName).attr("src", fullPath); } $("#" + frameName).load(function () { var pageTitle = $("#" + frameName).contents().find("title").html(); var _width = Number($("#" + frameName).contents().find("#dialogWidth").attr("content")); var _height = Number($("#" + frameName).contents().find("#dialogHeight").attr("content")); //alert("pageTitle: " + pageTitle + ", Width: " + _width + ", height: " + _height); //$("#" + frameName).dialog("option", "title", pageTitle); //$("#" + frameName).dialog("option", "width", _width); //$("#" + frameName).dialog("option", "height", _height); //console.log("Width: " + _width + ", height: " + _height); $("#" + frameName).dialog({ width: _width, height: _height, title: pageTitle, modal: true, buttons: [ { text: "Close", click: function () { hideJSIFrameDialog(dialogName); } }, { text: "Close and Don't Show Again", click: function () { closeAndDontShowAgain(dialogName); hideJSIFrameDialog(dialogName); } } ] }); $("#" + frameName).width(_width); $("#" + frameName).height(_height); }); } function hideJSIFrameDialog(dialogName) { var frameName = "ifrm" + dialogName; $("#" + frameName).dialog("destroy"); $("#" + frameName).remove(); } function closeAndDontShowAgain(dialogName) { $.cookie("dontShowAgain_" + dialogName, "true", { expires: 999 }); } function CheckUpdate() { var oCosNetControl = document.getElementById("CosNetControl"); return oCosNetControl.HasLatestVersion("2.0.4", "/WebConference/components/screen_share_2_0_4.exe", true); } // track window focus var window_focus = true; if (isIE()) { document.onfocusout = function() { window_focus = false; } document.onfocusin = function() { window_focus = true; } } else { window.onblur = function () { window_focus = false; } window.onfocus = function () { window_focus = true; } }