Merge branch 'master' of https://github.com/antobinary/bigbluebutton into meteor-client-viewer

Conflicts:
	labs/meteor-client/app/.meteor/packages
	labs/meteor-client/app/.meteor/versions
	labs/meteor-client/app/client/main.coffee
	labs/meteor-client/app/client/stylesheets/style.css
This commit is contained in:
Maxim Khlobystov 2014-11-24 13:08:44 -08:00
commit 8256f78db1
432 changed files with 19149 additions and 24616 deletions

View File

@ -47,6 +47,8 @@
<script src="lib/bbb_blinker.js" language="javascript"></script>
<script src="lib/bbb_deskshare.js" language="javascript"></script>
<script type="text/javascript" src="lib/bbb_api_bridge.js"></script>
<script src="lib/sip.js?v=VERSION" language="javascript"></script>
<script src="lib/bbb_webrtc_bridge_sip.js" language="javascript"></script>
<script>
$(document).ready();

View File

@ -20,4 +20,6 @@
<a href="demo_openid.jsp">Login with Openid</a> &nbsp;&nbsp;
<a href="demo11.jsp">Javascript API</a> &nbsp;&nbsp;
<a href="mobile.jsp">Mobile Demo</a> &nbsp;&nbsp

150
bbb-api-demo/src/main/webapp/mobile.jsp Normal file → Executable file
View File

@ -1,51 +1,119 @@
<%
/*
BigBlueButton - http://www.bigbluebutton.org
Copyright (c) 2011 by respective authors (see below). All rights reserved.
BigBlueButton is free software; you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
Author: Felipe Cecagno <fcecagno@gmail.com>
*/
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!--
BigBlueButton - http://www.bigbluebutton.org
Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
BigBlueButton is free software; you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
Author: Chad Pilkey <capilkey@gmail.org>
-->
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Join Demo Meeting From Mobile</title>
</head>
<%@page import="org.apache.commons.httpclient.HttpClient"%>
<%@page import="org.apache.commons.httpclient.HttpMethod"%>
<%@page import="org.apache.commons.httpclient.methods.GetMethod"%>
<body>
<%@ include file="bbb_api.jsp"%>
<%
if (request.getParameterMap().isEmpty()) {
//
// Assume we want to create a meeting
//
%>
<%@ include file="demo_header.jsp"%>
<h2>Join Demo Meeting From Mobile</h2>
You must have the BigBlueButton mobile client installed on your device for this demo to work.
<br /><br />
<FORM NAME="form1" METHOD="GET">
<table cellpadding="5" cellspacing="5" style="width: 400px; ">
<tbody>
<tr>
<td>
&nbsp;</td>
<td style="text-align: right; ">
Full Name:</td>
<td style="width: 5px; ">
&nbsp;</td>
<td style="text-align: left ">
<input type="text" autofocus required name="username" /></td>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
<input type="submit" value="Join" /></td>
</tr>
</tbody>
</table>
<INPUT TYPE=hidden NAME=action VALUE="create">
</FORM>
<%@ include file="mobile_api.jsp"%>
<%
String result = error(E_INVALID_URL);
if (request.getParameterMap().isEmpty()) {
result = success("mobileSupported", "This server supports mobile devices.");
} else if (request.getParameter("action") == null) {
// return the default result
} else if (request.getParameter("action").equals("getTimestamp")) {
result = getTimestamp(request);
} else if (request.getParameter("action").equals("getMeetings")) {
result = mobileGetMeetings(request);
} else if (request.getParameter("action").equals("join")) {
result = mobileJoinMeeting(request);
} else if (request.getParameter("action").equals("create")) {
result = mobileCreate(request);
}
} else if (request.getParameter("action").equals("create")) {
//
// Got an action=create
//
String username = request.getParameter("username");
String url = BigBlueButtonURL.replace("bigbluebutton/","demo/");
// String preUploadPDF = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='"+url+"pdfs/sample.pdf'/></module></modules>";
String joinURL = getJoinURL(request.getParameter("username"), "Demo Meeting", "false", null, null, null);
if (joinURL.startsWith("http://")) {
joinURL = joinURL.replace("http", "bigbluebutton");
%>
<%=result%>
<script language="javascript" type="text/javascript">
window.location.href="<%=joinURL%>";
</script>
<%
} else {
%>
Error: getJoinURL() failed
<p/>
<%=joinURL %>
<%
}
}
%>
<%@ include file="demo_footer.jsp"%>
</body>
</html>

View File

@ -1,182 +0,0 @@
<%
/*
BigBlueButton - http://www.bigbluebutton.org
Copyright (c) 2011 by respective authors (see below). All rights reserved.
BigBlueButton is free software; you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
Author: Felipe Cecagno <fcecagno@gmail.com>
*/
%>
<%@ include file="bbb_api.jsp"%>
<%@ include file="mobile_conf.jsp"%>
<%@page import="org.apache.commons.httpclient.HttpClient"%>
<%@page import="org.apache.commons.httpclient.HttpMethod"%>
<%@page import="org.apache.commons.httpclient.methods.GetMethod"%>
<%!
public final int E_OK = 0;
public final int E_CHECKSUM_NOT_INFORMED = 1;
public final int E_INVALID_CHECKSUM = 2;
public final int E_INVALID_TIMESTAMP = 3;
public final int E_EMPTY_SECURITY_KEY = 4;
public final int E_MISSING_PARAM_MEETINGID = 5;
public final int E_MISSING_PARAM_FULLNAME = 6;
public final int E_MISSING_PARAM_PASSWORD = 7;
public final int E_MISSING_PARAM_TIMESTAMP = 8;
public final int E_INVALID_URL = 9;
public String error(int code) {
switch(code) {
case E_CHECKSUM_NOT_INFORMED:
case E_INVALID_CHECKSUM:
return error("checksumError", "You did not pass the checksum security check.");
case E_INVALID_TIMESTAMP:
return error("invalidTimestamp", "You did not pass the timestamp check.");
case E_EMPTY_SECURITY_KEY:
return error("emptySecurityKey", "The mobile security key is empty. Please contact the administrator.");
case E_MISSING_PARAM_MEETINGID:
return error("missingParamMeetingID", "You must specify a meeting ID for the meeting.");
case E_MISSING_PARAM_FULLNAME:
return error("missingParamFullName", "You must specify a name for the attendee who will be joining the meeting.");
case E_MISSING_PARAM_PASSWORD:
return error("invalidPassword", "You either did not supply a password or the password supplied is neither the attendee or moderator password for this conference.");
case E_MISSING_PARAM_TIMESTAMP:
return error("missingParamTimestamp", "You must specify the timestamp provided by the server when you called the method getTimestamp.");
case E_INVALID_URL:
return error("invalidAction", "The requested URL is unavailable.");
default:
return error("unknownError", "An unexpected error occurred");
}
}
private String getRequestURL(HttpServletRequest request) {
return request.getQueryString();
}
private String removeChecksum(String requestURL) {
return requestURL.substring(0, requestURL.lastIndexOf("&checksum="));
}
private String addValidChecksum(String requestURL) {
return requestURL + "&checksum=" + checksum(requestURL + mobileSalt);
}
private int isRequestValid(HttpServletRequest request) {
// if there's no checksum parameter, the request isn't valid
if (request.getParameter("checksum") == null)
return E_CHECKSUM_NOT_INFORMED;
// check the timestamp for all the requests except getTimestamp
if (!request.getParameter("action").equals("getTimestamp")) {
String requestTimestamp = request.getParameter("timestamp");
if (requestTimestamp == null)
return E_MISSING_PARAM_TIMESTAMP;
Long requestTimestampL = Long.valueOf(requestTimestamp);
// the timestamp is valid for 60 seconds
if (Math.abs(getTimestamp() - requestTimestampL) > 60)
return E_INVALID_TIMESTAMP;
}
if (mobileSalt.isEmpty())
return E_EMPTY_SECURITY_KEY;
String requestURL = getRequestURL(request);
String urlWithoutChecksum = removeChecksum(requestURL);
String urlWithChecksum = addValidChecksum(urlWithoutChecksum);
return (requestURL.equals(urlWithChecksum)? E_OK: E_INVALID_CHECKSUM);
}
private String mountResponse(String returncode, String messageKey, String message) {
return "<response><returncode>" + returncode + "</returncode><messageKey>" + messageKey + "</messageKey><message>" + message + "</message></response>";
}
public String success(String messageKey, String message) {
return mountResponse("SUCCESS", messageKey, message);
}
public String error(String messageKey, String message) {
return mountResponse("FAILED", messageKey, message);
}
private long getTimestamp() {
return (System.currentTimeMillis() / 1000L);
}
public String getTimestamp(HttpServletRequest request) {
int code = isRequestValid(request);
if (code != E_OK)
return error(code);
return "<response><returncode>SUCCESS</returncode><timestamp>" + getTimestamp() + "</timestamp></response>";
}
public String mobileGetMeetings(HttpServletRequest request) {
int code = isRequestValid(request);
if (code != E_OK)
return error(code);
return getMeetings();
}
public String mobileJoinMeeting(HttpServletRequest request) {
int code = isRequestValid(request);
if (code != E_OK)
return error(code);
String meetingID = request.getParameter("meetingID");
if (meetingID == null) return error(E_MISSING_PARAM_MEETINGID);
String fullName = request.getParameter("fullName");
if (fullName == null) return error(E_MISSING_PARAM_FULLNAME);
String password = request.getParameter("password");
if (password == null) return error(E_MISSING_PARAM_PASSWORD);
String result = error("failedJoin", "Couldn't join the meeting.");
String joinUrl = getJoinMeetingURL(fullName, meetingID, password, null);
String enterUrl = BigBlueButtonURL + "api/enter";
try {
HttpClient client = new HttpClient();
HttpMethod method = new GetMethod(joinUrl);
client.executeMethod(method);
method.releaseConnection();
method = new GetMethod(enterUrl);
client.executeMethod(method);
result = method.getResponseBodyAsString();
method.releaseConnection();
} catch (Exception e) {
}
return result;
}
public String mobileCreate(HttpServletRequest request) {
int code = isRequestValid(request);
if (code != E_OK)
return error(code);
String meetingID = request.getParameter("meetingID");
if (meetingID == null) return error(E_MISSING_PARAM_MEETINGID);
return createMeeting(meetingID, "", "", "", "", 0, BigBlueButtonURL);
}
// it's just for testing purposes
private String fixURL(HttpServletRequest request) {
return addValidChecksum(removeChecksum(getRequestURL(request)));
}
%>

View File

@ -1,6 +0,0 @@
<%!
// This is the mobile security salt that must be used to check the requests on mobile.jsp
String mobileSalt = "";
%>

11
bbb-client-check/.gitignore vendored Normal file
View File

@ -0,0 +1,11 @@
check/
.actionScriptProperties
.flexProperties
.project
org.eclipse.core.resources.prefs
org.eclipse.ltk.core.refactoring.prefs
FlexPrettyPrintCommand.prefs
index.template.html
conf/config.xml
resources/lib/bbb_webrtc_bridge_sip.js
resources/lib/sip.js

153
bbb-client-check/build.xml Executable file
View File

@ -0,0 +1,153 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="BigBlueButton Client Check"
basedir="."
default="build">
<property environment="env"/>
<property name="FLEX_HOME"
value="${env.FLEX_HOME}"/>
<property name="BASE_DIR"
value="${basedir}"/>
<property name="SRC_DIR"
value="${BASE_DIR}/src"/>
<property name="TEST_IMAGE_URL" value="http://upload.wikimedia.org/wikipedia/commons/0/0a/Keswick,_Cumbria_Panorama_1_-_June_2009.jpg" />
<property name="OUTPUT_DIR"
value="check"/>
<property name="TEST_IMAGE_PATH"
value="${OUTPUT_DIR}/test_image.jpg"/>
<taskdef resource="flexTasks.tasks"
classpath="${FLEX_HOME}/ant/lib/flexTasks.jar"/>
<macrodef name="create-rsl">
<attribute name="rsl-dir"/>
<attribute name="swc-dir"/>
<attribute name="swc-name"/>
<sequential>
<unzip src="@{swc-dir}/@{swc-name}.swc"
dest="@{rsl-dir}">
<patternset>
<include name="library.swf"/>
</patternset>
</unzip>
<move file="@{rsl-dir}/library.swf"
tofile="@{rsl-dir}/@{swc-name}.swf"/>
</sequential>
</macrodef>
<target name="Extract-rsls">
<!-- Third parties RSLs -->
<create-rsl rsl-dir="check/rsls/"
swc-dir="${BASE_DIR}/libs/"
swc-name="robotlegs-framework-v2.2.1"/>
<create-rsl rsl-dir="check/rsls/"
swc-dir="${BASE_DIR}/libs/"
swc-name="as3-signals-v0.9-BETA"/>
<create-rsl rsl-dir="check/rsls/"
swc-dir="${BASE_DIR}/libs/"
swc-name="as3-signals-utilities-async-v0.9-BETA"/>
<create-rsl rsl-dir="check/rsls/"
swc-dir="${BASE_DIR}/libs/"
swc-name="robotlegs-extensions-SignalCommandMap-v1.0.0b1"/>
<create-rsl rsl-dir="check/rsls/"
swc-dir="${BASE_DIR}/libs/"
swc-name="localelib"/>
</target>
<target name="Compile-Release"
description="Compile MXML file to release SWF application.">
<echo>Compiling source...</echo>
<mxmlc file="${SRC_DIR}/BBBClientCheck.mxml"
output="check/BBBClientCheck.swf"
debug="false"
locale="en_US"
actionscript-file-encoding="UTF-8"
incremental="false">
<static-link-runtime-shared-libraries>false</static-link-runtime-shared-libraries>
<source-path>locale/{locale}</source-path>
<source-path path-element="src"/>
<include-resource-bundles>resources</include-resource-bundles>
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
<keep-as3-metadata name="Inject"/>
<keep-as3-metadata name="PostConstruct"/>
<runtime-shared-library-path path-element="${BASE_DIR}/libs/robotlegs-framework-v2.2.1.swc">
<url rsl-url="rsls/robotlegs-framework-v2.2.1.swf"/>
</runtime-shared-library-path>
<runtime-shared-library-path path-element="${BASE_DIR}/libs/localelib.swc">
<url rsl-url="rsls/localelib.swf"/>
</runtime-shared-library-path>
<runtime-shared-library-path path-element="${BASE_DIR}/libs/as3-signals-v0.9-BETA.swc">
<url rsl-url="rsls/as3-signals-v0.9-BETA.swf"/>
</runtime-shared-library-path>
<runtime-shared-library-path path-element="${BASE_DIR}/libs/robotlegs-extensions-SignalCommandMap-v1.0.0b1.swc">
<url rsl-url="rsls/robotlegs-extensions-SignalCommandMap-v1.0.0b1.swf"/>
</runtime-shared-library-path>
<runtime-shared-library-path path-element="${BASE_DIR}/libs/as3-signals-utilities-async-v0.9-BETA.swc">
<url rsl-url="rsls/as3-signals-utilities-async-v0.9-BETA.swf"/>
</runtime-shared-library-path>
<compiler.library-path dir="${BASE_DIR}/libs"
append="true">
<include name=".swc"/>
</compiler.library-path>
<compiler.library-path dir="${FLEX_HOME}/frameworks/libs"
append="true">
<include name=".swc"/>
</compiler.library-path>
<compiler.library-path dir="${FLEX_HOME}/frameworks/libs/mx"
append="true">
<include name=".swc"/>
</compiler.library-path>
</mxmlc>
<antcall target="Resolve-Dependency">
<param name="html.output"
value="${OUTPUT_DIR}"/>
</antcall>
</target>
<target name="Build-Release">
<antcall target="Compile-Release"/>
</target>
<target name="Resolve-Dependency"
description="Generate HTML wrapper">
<copy todir="resources/lib/" >
<fileset file="../bigbluebutton-client/resources/prod/lib/bbb_webrtc_bridge_sip.js" />
<fileset file="../bigbluebutton-client/resources/prod/lib/sip.js" />
</copy>
<get src="${TEST_IMAGE_URL}" dest="${html.output}/test_image.jpg" skipexisting="true" />
<copy file="html-template/index.html"
tofile="${html.output}/index.html"/>
<copy file="html-template/swfobject.js"
tofile="${html.output}/swfobject.js"/>
<copy file="${SRC_DIR}/AppStyle.css"
tofile="${html.output}/AppStyle.css"/>
<copy todir="${html.output}/resources">
<fileset dir="resources"/>
</copy>
<copy todir="${html.output}/history">
<fileset dir="html-template/history"/>
</copy>
<copy todir="${html.output}/conf">
<fileset dir="conf"/>
</copy>
</target>
<target name="build"
depends="gen-config-xml, Extract-rsls, Build-Release"
description="Launcher for building whole release process"/>
<target name="get-local-ip">
<exec executable="bash" outputproperty="IP">
<arg value="-c"/>
<arg value="ifconfig | grep -v '127.0.0.1' | grep -E '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*' | tail -1 | cut -d: -f2 | awk '{ print $1}'"/>
</exec>
</target>
<target name="init">
<available file="conf/config.xml" property="config.xml.exists" />
<available file="${TEST_IMAGE_PATH}" property="test_image.exists" />
</target>
<target name="gen-config-xml" depends="init, get-local-ip" unless="${config.xml.exists}">
<copy file="resources/config.xml.template" tofile="conf/config.xml" />
<exec executable="sed">
<arg value="-i"/>
<arg value="s:HOST:${IP}:g"/>
<arg value="conf/config.xml"/>
</exec>
<echo message="config.xml generated" />
</target>
</project>

View File

@ -0,0 +1,4 @@
location /check {
root /var/www/bigbluebutton;
index index.html index.htm;
}

3
bbb-client-check/gen-file.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
head -c $1 < /dev/urandom

View File

@ -0,0 +1,6 @@
/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
#ie_historyFrame { width: 0px; height: 0px; display:none }
#firefox_anchorDiv { width: 0px; height: 0px; display:none }
#safari_formDiv { width: 0px; height: 0px; display:none }
#safari_rememberDiv { width: 0px; height: 0px; display:none }

View File

@ -0,0 +1,678 @@
BrowserHistoryUtils = {
addEvent: function(elm, evType, fn, useCapture) {
useCapture = useCapture || false;
if (elm.addEventListener) {
elm.addEventListener(evType, fn, useCapture);
return true;
}
else if (elm.attachEvent) {
var r = elm.attachEvent('on' + evType, fn);
return r;
}
else {
elm['on' + evType] = fn;
}
}
}
BrowserHistory = (function() {
// type of browser
var browser = {
ie: false,
ie8: false,
firefox: false,
safari: false,
opera: false,
version: -1
};
// Default app state URL to use when no fragment ID present
var defaultHash = '';
// Last-known app state URL
var currentHref = document.location.href;
// Initial URL (used only by IE)
var initialHref = document.location.href;
// Initial URL (used only by IE)
var initialHash = document.location.hash;
// History frame source URL prefix (used only by IE)
var historyFrameSourcePrefix = 'history/historyFrame.html?';
// History maintenance (used only by Safari)
var currentHistoryLength = -1;
// Flag to denote the existence of onhashchange
var browserHasHashChange = false;
var historyHash = [];
var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
var backStack = [];
var forwardStack = [];
var currentObjectId = null;
//UserAgent detection
var useragent = navigator.userAgent.toLowerCase();
if (useragent.indexOf("opera") != -1) {
browser.opera = true;
} else if (useragent.indexOf("msie") != -1) {
browser.ie = true;
browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
if (browser.version == 8)
{
browser.ie = false;
browser.ie8 = true;
}
} else if (useragent.indexOf("safari") != -1) {
browser.safari = true;
browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
} else if (useragent.indexOf("gecko") != -1) {
browser.firefox = true;
}
if (browser.ie == true && browser.version == 7) {
window["_ie_firstload"] = false;
}
function hashChangeHandler()
{
currentHref = document.location.href;
var flexAppUrl = getHash();
//ADR: to fix multiple
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
var pl = getPlayers();
for (var i = 0; i < pl.length; i++) {
pl[i].browserURLChange(flexAppUrl);
}
} else {
getPlayer().browserURLChange(flexAppUrl);
}
}
// Accessor functions for obtaining specific elements of the page.
function getHistoryFrame()
{
return document.getElementById('ie_historyFrame');
}
function getFormElement()
{
return document.getElementById('safari_formDiv');
}
function getRememberElement()
{
return document.getElementById("safari_remember_field");
}
// Get the Flash player object for performing ExternalInterface callbacks.
// Updated for changes to SWFObject2.
function getPlayer(id) {
var i;
if (id && document.getElementById(id)) {
var r = document.getElementById(id);
if (typeof r.SetVariable != "undefined") {
return r;
}
else {
var o = r.getElementsByTagName("object");
var e = r.getElementsByTagName("embed");
for (i = 0; i < o.length; i++) {
if (typeof o[i].browserURLChange != "undefined")
return o[i];
}
for (i = 0; i < e.length; i++) {
if (typeof e[i].browserURLChange != "undefined")
return e[i];
}
}
}
else {
var o = document.getElementsByTagName("object");
var e = document.getElementsByTagName("embed");
for (i = 0; i < e.length; i++) {
if (typeof e[i].browserURLChange != "undefined")
{
return e[i];
}
}
for (i = 0; i < o.length; i++) {
if (typeof o[i].browserURLChange != "undefined")
{
return o[i];
}
}
}
return undefined;
}
function getPlayers() {
var i;
var players = [];
if (players.length == 0) {
var tmp = document.getElementsByTagName('object');
for (i = 0; i < tmp.length; i++)
{
if (typeof tmp[i].browserURLChange != "undefined")
players.push(tmp[i]);
}
}
if (players.length == 0 || players[0].object == null) {
var tmp = document.getElementsByTagName('embed');
for (i = 0; i < tmp.length; i++)
{
if (typeof tmp[i].browserURLChange != "undefined")
players.push(tmp[i]);
}
}
return players;
}
function getIframeHash() {
var doc = getHistoryFrame().contentWindow.document;
var hash = String(doc.location.search);
if (hash.length == 1 && hash.charAt(0) == "?") {
hash = "";
}
else if (hash.length >= 2 && hash.charAt(0) == "?") {
hash = hash.substring(1);
}
return hash;
}
/* Get the current location hash excluding the '#' symbol. */
function getHash() {
// It would be nice if we could use document.location.hash here,
// but it's faulty sometimes.
var idx = document.location.href.indexOf('#');
return (idx >= 0) ? document.location.href.substr(idx+1) : '';
}
/* Get the current location hash excluding the '#' symbol. */
function setHash(hash) {
// It would be nice if we could use document.location.hash here,
// but it's faulty sometimes.
if (hash == '') hash = '#'
document.location.hash = hash;
}
function createState(baseUrl, newUrl, flexAppUrl) {
return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
}
/* Add a history entry to the browser.
* baseUrl: the portion of the location prior to the '#'
* newUrl: the entire new URL, including '#' and following fragment
* flexAppUrl: the portion of the location following the '#' only
*/
function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
//delete all the history entries
forwardStack = [];
if (browser.ie) {
//Check to see if we are being asked to do a navigate for the first
//history entry, and if so ignore, because it's coming from the creation
//of the history iframe
if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
currentHref = initialHref;
return;
}
if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
newUrl = baseUrl + '#' + defaultHash;
flexAppUrl = defaultHash;
} else {
// for IE, tell the history frame to go somewhere without a '#'
// in order to get this entry into the browser history.
getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
}
setHash(flexAppUrl);
} else {
//ADR
if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
initialState = createState(baseUrl, newUrl, flexAppUrl);
} else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
}
if (browser.safari && !browserHasHashChange) {
// for Safari, submit a form whose action points to the desired URL
if (browser.version <= 419.3) {
var file = window.location.pathname.toString();
file = file.substring(file.lastIndexOf("/")+1);
getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
//get the current elements and add them to the form
var qs = window.location.search.substring(1);
var qs_arr = qs.split("&");
for (var i = 0; i < qs_arr.length; i++) {
var tmp = qs_arr[i].split("=");
var elem = document.createElement("input");
elem.type = "hidden";
elem.name = tmp[0];
elem.value = tmp[1];
document.forms.historyForm.appendChild(elem);
}
document.forms.historyForm.submit();
} else {
top.location.hash = flexAppUrl;
}
// We also have to maintain the history by hand for Safari
historyHash[history.length] = flexAppUrl;
_storeStates();
} else {
// Otherwise, just tell the browser to go there
setHash(flexAppUrl);
}
}
backStack.push(createState(baseUrl, newUrl, flexAppUrl));
}
function _storeStates() {
if (browser.safari) {
getRememberElement().value = historyHash.join(",");
}
}
function handleBackButton() {
//The "current" page is always at the top of the history stack.
var current = backStack.pop();
if (!current) { return; }
var last = backStack[backStack.length - 1];
if (!last && backStack.length == 0){
last = initialState;
}
forwardStack.push(current);
}
function handleForwardButton() {
//summary: private method. Do not call this directly.
var last = forwardStack.pop();
if (!last) { return; }
backStack.push(last);
}
function handleArbitraryUrl() {
//delete all the history entries
forwardStack = [];
}
/* Called periodically to poll to see if we need to detect navigation that has occurred */
function checkForUrlChange() {
if (browser.ie) {
if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
//This occurs when the user has navigated to a specific URL
//within the app, and didn't use browser back/forward
//IE seems to have a bug where it stops updating the URL it
//shows the end-user at this point, but programatically it
//appears to be correct. Do a full app reload to get around
//this issue.
if (browser.version < 7) {
currentHref = document.location.href;
document.location.reload();
} else {
if (getHash() != getIframeHash()) {
// this.iframe.src = this.blankURL + hash;
var sourceToSet = historyFrameSourcePrefix + getHash();
getHistoryFrame().src = sourceToSet;
currentHref = document.location.href;
}
}
}
}
if (browser.safari && !browserHasHashChange) {
// For Safari, we have to check to see if history.length changed.
if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
//alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
var flexAppUrl = getHash();
if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
{
// If it did change and we're running Safari 3.x or earlier,
// then we have to look the old state up in our hand-maintained
// array since document.location.hash won't have changed,
// then call back into BrowserManager.
currentHistoryLength = history.length;
flexAppUrl = historyHash[currentHistoryLength];
}
//ADR: to fix multiple
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
var pl = getPlayers();
for (var i = 0; i < pl.length; i++) {
pl[i].browserURLChange(flexAppUrl);
}
} else {
getPlayer().browserURLChange(flexAppUrl);
}
_storeStates();
}
}
if (browser.firefox && !browserHasHashChange) {
if (currentHref != document.location.href) {
var bsl = backStack.length;
var urlActions = {
back: false,
forward: false,
set: false
}
if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
urlActions.back = true;
// FIXME: could this ever be a forward button?
// we can't clear it because we still need to check for forwards. Ugg.
// clearInterval(this.locationTimer);
handleBackButton();
}
// first check to see if we could have gone forward. We always halt on
// a no-hash item.
if (forwardStack.length > 0) {
if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
urlActions.forward = true;
handleForwardButton();
}
}
// ok, that didn't work, try someplace back in the history stack
if ((bsl >= 2) && (backStack[bsl - 2])) {
if (backStack[bsl - 2].flexAppUrl == getHash()) {
urlActions.back = true;
handleBackButton();
}
}
if (!urlActions.back && !urlActions.forward) {
var foundInStacks = {
back: -1,
forward: -1
}
for (var i = 0; i < backStack.length; i++) {
if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
arbitraryUrl = true;
foundInStacks.back = i;
}
}
for (var i = 0; i < forwardStack.length; i++) {
if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
arbitraryUrl = true;
foundInStacks.forward = i;
}
}
handleArbitraryUrl();
}
// Firefox changed; do a callback into BrowserManager to tell it.
currentHref = document.location.href;
var flexAppUrl = getHash();
//ADR: to fix multiple
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
var pl = getPlayers();
for (var i = 0; i < pl.length; i++) {
pl[i].browserURLChange(flexAppUrl);
}
} else {
getPlayer().browserURLChange(flexAppUrl);
}
}
}
}
var _initialize = function () {
browserHasHashChange = ("onhashchange" in document.body);
if (browser.ie)
{
var scripts = document.getElementsByTagName('script');
for (var i = 0, s; s = scripts[i]; i++) {
if (s.src.indexOf("history.js") > -1) {
var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
}
}
historyFrameSourcePrefix = iframe_location + "?";
var src = historyFrameSourcePrefix;
var iframe = document.createElement("iframe");
iframe.id = 'ie_historyFrame';
iframe.name = 'ie_historyFrame';
iframe.src = 'javascript:false;';
try {
document.body.appendChild(iframe);
} catch(e) {
setTimeout(function() {
document.body.appendChild(iframe);
}, 0);
}
}
if (browser.safari && !browserHasHashChange)
{
var rememberDiv = document.createElement("div");
rememberDiv.id = 'safari_rememberDiv';
document.body.appendChild(rememberDiv);
rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
var formDiv = document.createElement("div");
formDiv.id = 'safari_formDiv';
document.body.appendChild(formDiv);
var reloader_content = document.createElement('div');
reloader_content.id = 'safarireloader';
var scripts = document.getElementsByTagName('script');
for (var i = 0, s; s = scripts[i]; i++) {
if (s.src.indexOf("history.js") > -1) {
html = (new String(s.src)).replace(".js", ".html");
}
}
reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
document.body.appendChild(reloader_content);
reloader_content.style.position = 'absolute';
reloader_content.style.left = reloader_content.style.top = '-9999px';
iframe = reloader_content.getElementsByTagName('iframe')[0];
if (document.getElementById("safari_remember_field").value != "" ) {
historyHash = document.getElementById("safari_remember_field").value.split(",");
}
}
if (browserHasHashChange)
document.body.onhashchange = hashChangeHandler;
}
return {
historyHash: historyHash,
backStack: function() { return backStack; },
forwardStack: function() { return forwardStack },
getPlayer: getPlayer,
initialize: function(src) {
_initialize(src);
},
setURL: function(url) {
document.location.href = url;
},
getURL: function() {
return document.location.href;
},
getTitle: function() {
return document.title;
},
setTitle: function(title) {
try {
backStack[backStack.length - 1].title = title;
} catch(e) { }
//if on safari, set the title to be the empty string.
if (browser.safari) {
if (title == "") {
try {
var tmp = window.location.href.toString();
title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
} catch(e) {
title = "";
}
}
}
document.title = title;
},
setDefaultURL: function(def)
{
defaultHash = def;
def = getHash();
//trailing ? is important else an extra frame gets added to the history
//when navigating back to the first page. Alternatively could check
//in history frame navigation to compare # and ?.
if (browser.ie)
{
window['_ie_firstload'] = true;
var sourceToSet = historyFrameSourcePrefix + def;
var func = function() {
getHistoryFrame().src = sourceToSet;
window.location.replace("#" + def);
setInterval(checkForUrlChange, 50);
}
try {
func();
} catch(e) {
window.setTimeout(function() { func(); }, 0);
}
}
if (browser.safari)
{
currentHistoryLength = history.length;
if (historyHash.length == 0) {
historyHash[currentHistoryLength] = def;
var newloc = "#" + def;
window.location.replace(newloc);
} else {
//alert(historyHash[historyHash.length-1]);
}
setInterval(checkForUrlChange, 50);
}
if (browser.firefox || browser.opera)
{
var reg = new RegExp("#" + def + "$");
if (window.location.toString().match(reg)) {
} else {
var newloc ="#" + def;
window.location.replace(newloc);
}
setInterval(checkForUrlChange, 50);
}
},
/* Set the current browser URL; called from inside BrowserManager to propagate
* the application state out to the container.
*/
setBrowserURL: function(flexAppUrl, objectId) {
if (browser.ie && typeof objectId != "undefined") {
currentObjectId = objectId;
}
//fromIframe = fromIframe || false;
//fromFlex = fromFlex || false;
//alert("setBrowserURL: " + flexAppUrl);
//flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
var pos = document.location.href.indexOf('#');
var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
var newUrl = baseUrl + '#' + flexAppUrl;
if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
currentHref = newUrl;
addHistoryEntry(baseUrl, newUrl, flexAppUrl);
currentHistoryLength = history.length;
}
},
browserURLChange: function(flexAppUrl) {
var objectId = null;
if (browser.ie && currentObjectId != null) {
objectId = currentObjectId;
}
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
var pl = getPlayers();
for (var i = 0; i < pl.length; i++) {
try {
pl[i].browserURLChange(flexAppUrl);
} catch(e) { }
}
} else {
try {
getPlayer(objectId).browserURLChange(flexAppUrl);
} catch(e) { }
}
currentObjectId = null;
},
getUserAgent: function() {
return navigator.userAgent;
},
getPlatform: function() {
return navigator.platform;
}
}
})();
// Initialization
// Automated unit testing and other diagnostics
function setURL(url)
{
document.location.href = url;
}
function backButton()
{
history.back();
}
function forwardButton()
{
history.forward();
}
function goForwardOrBackInHistory(step)
{
history.go(step);
}
//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
(function(i) {
var u =navigator.userAgent;var e=/*@cc_on!@*/false;
var st = setTimeout;
if(/webkit/i.test(u)){
st(function(){
var dr=document.readyState;
if(dr=="loaded"||dr=="complete"){i()}
else{st(arguments.callee,10);}},10);
} else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
document.addEventListener("DOMContentLoaded",i,false);
} else if(e){
(function(){
var t=document.createElement('doc:rdy');
try{t.doScroll('left');
i();t=null;
}catch(e){st(arguments.callee,0);}})();
} else{
window.onload=i;
}
})( function() {BrowserHistory.initialize();} );

View File

@ -0,0 +1,29 @@
<html>
<head>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</head>
<body>
<script>
function processUrl()
{
var pos = url.indexOf("?");
url = pos != -1 ? url.substr(pos + 1) : "";
if (!parent._ie_firstload) {
parent.BrowserHistory.setBrowserURL(url);
try {
parent.BrowserHistory.browserURLChange(url);
} catch(e) { }
} else {
parent._ie_firstload = false;
}
}
var url = document.location.href;
processUrl();
document.write(encodeURIComponent(url));
</script>
Hidden frame for Browser History support.
</body>
</html>

View File

@ -0,0 +1,113 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<!--
Smart developers always View Source.
This application was built using Adobe Flex, an open source framework
for building rich Internet applications that get delivered via the
Flash Player or to desktops via Adobe AIR.
Learn more about Flex at http://flex.org
// -->
<head>
<title></title>
<meta name="google" value="notranslate" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and
the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as
the percentage of the height of its parent container, which has to be set explicitly. Fix for
Firefox 3.6 focus border issues. Initially, don't display flashContent div so it won't show
if JavaScript disabled.
-->
<style type="text/css" media="screen">
html, body { height:100%; }
body { margin:0; padding:0; overflow:auto; text-align:center;
background-color: #ffffff; }
object:focus { outline:none; }
#flashContent { display:none; }
</style>
<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
<!-- BEGIN Browser History required section -->
<link rel="stylesheet" type="text/css" href="history/history.css" />
<script type="text/javascript" src="history/history.js"></script>
<!-- END Browser History required section -->
<script type="text/javascript" src="resources/lib/api-bridge.js"></script>
<script type="text/javascript" src="resources/lib/sip.js"></script>
<script type="text/javascript" src="resources/lib/bbb_webrtc_bridge_sip.js"></script>
<script type="text/javascript" src="resources/lib/deployJava.js"></script>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
// For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection.
var swfVersionStr = "10.2.0";
// To use express install, set to playerProductInstall.swf, otherwise the empty string.
var xiSwfUrlStr = "playerProductInstall.swf";
var flashvars = {};
var params = {};
params.quality = "high";
params.bgcolor = "#ffffff";
params.allowscriptaccess = "sameDomain";
params.allowfullscreen = "true";
var attributes = {};
attributes.id = "BBBClientCheck";
attributes.name = "BBBClientCheck";
attributes.align = "middle";
swfobject.embedSWF(
"BBBClientCheck.swf", "flashContent",
"100%", "100%",
swfVersionStr, xiSwfUrlStr,
flashvars, params, attributes);
// JavaScript enabled so display the flashContent div in case it is not replaced with a swf object.
swfobject.createCSS("#flashContent", "display:block;text-align:left;");
</script>
</head>
<body>
<div id="deployJavaPluginContainer" style="visibility:hidden; height:0px; "></div>
<!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough
JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
when JavaScript is disabled.
-->
<div id="flashContent">
<p>
To view this page ensure that Adobe Flash Player version
10.2.0 or greater is installed.
</p>
<script type="text/javascript">
var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://");
document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='"
+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" );
</script>
</div>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%" id="BBBClientCheck">
<param name="movie" value="BBBClientCheck.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="BBBClientCheck.swf" width="100%" height="100%">
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<!--<![endif]-->
<!--[if gte IE 6]>-->
<p>
Either scripts and active content are not permitted to run or Adobe Flash Player version
10.2.0 or greater is not installed.
</p>
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</noscript>
</body>
</html>

View File

@ -0,0 +1,113 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<!--
Smart developers always View Source.
This application was built using Adobe Flex, an open source framework
for building rich Internet applications that get delivered via the
Flash Player or to desktops via Adobe AIR.
Learn more about Flex at http://flex.org
// -->
<head>
<title>BigBlueButton Client Check</title>
<meta name="google" value="notranslate" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and
the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as
the percentage of the height of its parent container, which has to be set explicitly. Fix for
Firefox 3.6 focus border issues. Initially, don't display flashContent div so it won't show
if JavaScript disabled.
-->
<style type="text/css" media="screen">
html, body { height:100%; }
body { margin:0; padding:0; overflow:auto; text-align:center;
background-color: #ffffff; }
object:focus { outline:none; }
#flashContent { display:none; }
</style>
<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
<!-- BEGIN Browser History required section -->
<link rel="stylesheet" type="text/css" href="history/history.css" />
<script type="text/javascript" src="history/history.js"></script>
<!-- END Browser History required section -->
<script type="text/javascript" src="resources/lib/api-bridge.js"></script>
<script type="text/javascript" src="resources/lib/sip.js"></script>
<script type="text/javascript" src="resources/lib/bbb_webrtc_bridge_sip.js"></script>
<script type="text/javascript" src="resources/lib/deployJava.js"></script>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
// For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection.
var swfVersionStr = "10.2.0";
// To use express install, set to playerProductInstall.swf, otherwise the empty string.
var xiSwfUrlStr = "playerProductInstall.swf";
var flashvars = {};
var params = {};
params.quality = "high";
params.bgcolor = "#ffffff";
params.allowscriptaccess = "sameDomain";
params.allowfullscreen = "true";
var attributes = {};
attributes.id = "BBBClientCheck";
attributes.name = "BBBClientCheck";
attributes.align = "middle";
swfobject.embedSWF(
"BBBClientCheck.swf", "flashContent",
"100%", "100%",
swfVersionStr, xiSwfUrlStr,
flashvars, params, attributes);
// JavaScript enabled so display the flashContent div in case it is not replaced with a swf object.
swfobject.createCSS("#flashContent", "display:block;text-align:left;");
</script>
</head>
<body>
<div id="deployJavaPluginContainer" style="visibility:hidden; height:0px; "></div>
<!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough
JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
when JavaScript is disabled.
-->
<div id="flashContent">
<p>
To view this page ensure that Adobe Flash Player version
10.2.0 or greater is installed.
</p>
<script type="text/javascript">
var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://");
document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='"
+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" );
</script>
</div>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%" id="BBBClientCheck">
<param name="movie" value="BBBClientCheck.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="BBBClientCheck.swf" width="100%" height="100%">
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<!--<![endif]-->
<!--[if gte IE 6]>-->
<p>
Either scripts and active content are not permitted to run or Adobe Flash Player version
10.2.0 or greater is not installed.
</p>
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</noscript>
</body>
</html>

Binary file not shown.

View File

@ -0,0 +1,777 @@
/*! SWFObject v2.2 <http://code.google.com/p/swfobject/>
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var swfobject = function() {
var UNDEF = "undefined",
OBJECT = "object",
SHOCKWAVE_FLASH = "Shockwave Flash",
SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
FLASH_MIME_TYPE = "application/x-shockwave-flash",
EXPRESS_INSTALL_ID = "SWFObjectExprInst",
ON_READY_STATE_CHANGE = "onreadystatechange",
win = window,
doc = document,
nav = navigator,
plugin = false,
domLoadFnArr = [main],
regObjArr = [],
objIdArr = [],
listenersArr = [],
storedAltContent,
storedAltContentId,
storedCallbackFn,
storedCallbackObj,
isDomLoaded = false,
isExpressInstallActive = false,
dynamicStylesheet,
dynamicStylesheetMedia,
autoHideShow = true,
/* Centralized function for browser feature detection
- User agent string detection is only used when no good alternative is possible
- Is executed directly for optimal performance
*/
ua = function() {
var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
u = nav.userAgent.toLowerCase(),
p = nav.platform.toLowerCase(),
windows = p ? /win/.test(p) : /win/.test(u),
mac = p ? /mac/.test(p) : /mac/.test(u),
webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
playerVersion = [0,0,0],
d = null;
if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
d = nav.plugins[SHOCKWAVE_FLASH].description;
if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
plugin = true;
ie = false; // cascaded feature detection for Internet Explorer
d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
}
}
else if (typeof win.ActiveXObject != UNDEF) {
try {
var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
if (a) { // a will return null when ActiveX is disabled
d = a.GetVariable("$version");
if (d) {
ie = true; // cascaded feature detection for Internet Explorer
d = d.split(" ")[1].split(",");
playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
}
}
}
catch(e) {}
}
return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
}(),
/* Cross-browser onDomLoad
- Will fire an event as soon as the DOM of a web page is loaded
- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
- Regular onload serves as fallback
*/
onDomLoad = function() {
if (!ua.w3) { return; }
if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically
callDomLoadFunctions();
}
if (!isDomLoaded) {
if (typeof doc.addEventListener != UNDEF) {
doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
}
if (ua.ie && ua.win) {
doc.attachEvent(ON_READY_STATE_CHANGE, function() {
if (doc.readyState == "complete") {
doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
callDomLoadFunctions();
}
});
if (win == top) { // if not inside an iframe
(function(){
if (isDomLoaded) { return; }
try {
doc.documentElement.doScroll("left");
}
catch(e) {
setTimeout(arguments.callee, 0);
return;
}
callDomLoadFunctions();
})();
}
}
if (ua.wk) {
(function(){
if (isDomLoaded) { return; }
if (!/loaded|complete/.test(doc.readyState)) {
setTimeout(arguments.callee, 0);
return;
}
callDomLoadFunctions();
})();
}
addLoadEvent(callDomLoadFunctions);
}
}();
function callDomLoadFunctions() {
if (isDomLoaded) { return; }
try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
t.parentNode.removeChild(t);
}
catch (e) { return; }
isDomLoaded = true;
var dl = domLoadFnArr.length;
for (var i = 0; i < dl; i++) {
domLoadFnArr[i]();
}
}
function addDomLoadEvent(fn) {
if (isDomLoaded) {
fn();
}
else {
domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
}
}
/* Cross-browser onload
- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
- Will fire an event as soon as a web page including all of its assets are loaded
*/
function addLoadEvent(fn) {
if (typeof win.addEventListener != UNDEF) {
win.addEventListener("load", fn, false);
}
else if (typeof doc.addEventListener != UNDEF) {
doc.addEventListener("load", fn, false);
}
else if (typeof win.attachEvent != UNDEF) {
addListener(win, "onload", fn);
}
else if (typeof win.onload == "function") {
var fnOld = win.onload;
win.onload = function() {
fnOld();
fn();
};
}
else {
win.onload = fn;
}
}
/* Main function
- Will preferably execute onDomLoad, otherwise onload (as a fallback)
*/
function main() {
if (plugin) {
testPlayerVersion();
}
else {
matchVersions();
}
}
/* Detect the Flash Player version for non-Internet Explorer browsers
- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
a. Both release and build numbers can be detected
b. Avoid wrong descriptions by corrupt installers provided by Adobe
c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
*/
function testPlayerVersion() {
var b = doc.getElementsByTagName("body")[0];
var o = createElement(OBJECT);
o.setAttribute("type", FLASH_MIME_TYPE);
var t = b.appendChild(o);
if (t) {
var counter = 0;
(function(){
if (typeof t.GetVariable != UNDEF) {
var d = t.GetVariable("$version");
if (d) {
d = d.split(" ")[1].split(",");
ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
}
}
else if (counter < 10) {
counter++;
setTimeout(arguments.callee, 10);
return;
}
b.removeChild(o);
t = null;
matchVersions();
})();
}
else {
matchVersions();
}
}
/* Perform Flash Player and SWF version matching; static publishing only
*/
function matchVersions() {
var rl = regObjArr.length;
if (rl > 0) {
for (var i = 0; i < rl; i++) { // for each registered object element
var id = regObjArr[i].id;
var cb = regObjArr[i].callbackFn;
var cbObj = {success:false, id:id};
if (ua.pv[0] > 0) {
var obj = getElementById(id);
if (obj) {
if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
setVisibility(id, true);
if (cb) {
cbObj.success = true;
cbObj.ref = getObjectById(id);
cb(cbObj);
}
}
else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
var att = {};
att.data = regObjArr[i].expressInstall;
att.width = obj.getAttribute("width") || "0";
att.height = obj.getAttribute("height") || "0";
if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
// parse HTML object param element's name-value pairs
var par = {};
var p = obj.getElementsByTagName("param");
var pl = p.length;
for (var j = 0; j < pl; j++) {
if (p[j].getAttribute("name").toLowerCase() != "movie") {
par[p[j].getAttribute("name")] = p[j].getAttribute("value");
}
}
showExpressInstall(att, par, id, cb);
}
else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
displayAltContent(obj);
if (cb) { cb(cbObj); }
}
}
}
else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
setVisibility(id, true);
if (cb) {
var o = getObjectById(id); // test whether there is an HTML object element or not
if (o && typeof o.SetVariable != UNDEF) {
cbObj.success = true;
cbObj.ref = o;
}
cb(cbObj);
}
}
}
}
}
function getObjectById(objectIdStr) {
var r = null;
var o = getElementById(objectIdStr);
if (o && o.nodeName == "OBJECT") {
if (typeof o.SetVariable != UNDEF) {
r = o;
}
else {
var n = o.getElementsByTagName(OBJECT)[0];
if (n) {
r = n;
}
}
}
return r;
}
/* Requirements for Adobe Express Install
- only one instance can be active at a time
- fp 6.0.65 or higher
- Win/Mac OS only
- no Webkit engines older than version 312
*/
function canExpressInstall() {
return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
}
/* Show the Adobe Express Install dialog
- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
*/
function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
isExpressInstallActive = true;
storedCallbackFn = callbackFn || null;
storedCallbackObj = {success:false, id:replaceElemIdStr};
var obj = getElementById(replaceElemIdStr);
if (obj) {
if (obj.nodeName == "OBJECT") { // static publishing
storedAltContent = abstractAltContent(obj);
storedAltContentId = null;
}
else { // dynamic publishing
storedAltContent = obj;
storedAltContentId = replaceElemIdStr;
}
att.id = EXPRESS_INSTALL_ID;
if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
if (typeof par.flashvars != UNDEF) {
par.flashvars += "&" + fv;
}
else {
par.flashvars = fv;
}
// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
if (ua.ie && ua.win && obj.readyState != 4) {
var newObj = createElement("div");
replaceElemIdStr += "SWFObjectNew";
newObj.setAttribute("id", replaceElemIdStr);
obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
obj.style.display = "none";
(function(){
if (obj.readyState == 4) {
obj.parentNode.removeChild(obj);
}
else {
setTimeout(arguments.callee, 10);
}
})();
}
createSWF(att, par, replaceElemIdStr);
}
}
/* Functions to abstract and display alternative content
*/
function displayAltContent(obj) {
if (ua.ie && ua.win && obj.readyState != 4) {
// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
var el = createElement("div");
obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
el.parentNode.replaceChild(abstractAltContent(obj), el);
obj.style.display = "none";
(function(){
if (obj.readyState == 4) {
obj.parentNode.removeChild(obj);
}
else {
setTimeout(arguments.callee, 10);
}
})();
}
else {
obj.parentNode.replaceChild(abstractAltContent(obj), obj);
}
}
function abstractAltContent(obj) {
var ac = createElement("div");
if (ua.win && ua.ie) {
ac.innerHTML = obj.innerHTML;
}
else {
var nestedObj = obj.getElementsByTagName(OBJECT)[0];
if (nestedObj) {
var c = nestedObj.childNodes;
if (c) {
var cl = c.length;
for (var i = 0; i < cl; i++) {
if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
ac.appendChild(c[i].cloneNode(true));
}
}
}
}
}
return ac;
}
/* Cross-browser dynamic SWF creation
*/
function createSWF(attObj, parObj, id) {
var r, el = getElementById(id);
if (ua.wk && ua.wk < 312) { return r; }
if (el) {
if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
attObj.id = id;
}
if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
var att = "";
for (var i in attObj) {
if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
if (i.toLowerCase() == "data") {
parObj.movie = attObj[i];
}
else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
att += ' class="' + attObj[i] + '"';
}
else if (i.toLowerCase() != "classid") {
att += ' ' + i + '="' + attObj[i] + '"';
}
}
}
var par = "";
for (var j in parObj) {
if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
par += '<param name="' + j + '" value="' + parObj[j] + '" />';
}
}
el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
r = getElementById(attObj.id);
}
else { // well-behaving browsers
var o = createElement(OBJECT);
o.setAttribute("type", FLASH_MIME_TYPE);
for (var m in attObj) {
if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
o.setAttribute("class", attObj[m]);
}
else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
o.setAttribute(m, attObj[m]);
}
}
}
for (var n in parObj) {
if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
createObjParam(o, n, parObj[n]);
}
}
el.parentNode.replaceChild(o, el);
r = o;
}
}
return r;
}
function createObjParam(el, pName, pValue) {
var p = createElement("param");
p.setAttribute("name", pName);
p.setAttribute("value", pValue);
el.appendChild(p);
}
/* Cross-browser SWF removal
- Especially needed to safely and completely remove a SWF in Internet Explorer
*/
function removeSWF(id) {
var obj = getElementById(id);
if (obj && obj.nodeName == "OBJECT") {
if (ua.ie && ua.win) {
obj.style.display = "none";
(function(){
if (obj.readyState == 4) {
removeObjectInIE(id);
}
else {
setTimeout(arguments.callee, 10);
}
})();
}
else {
obj.parentNode.removeChild(obj);
}
}
}
function removeObjectInIE(id) {
var obj = getElementById(id);
if (obj) {
for (var i in obj) {
if (typeof obj[i] == "function") {
obj[i] = null;
}
}
obj.parentNode.removeChild(obj);
}
}
/* Functions to optimize JavaScript compression
*/
function getElementById(id) {
var el = null;
try {
el = doc.getElementById(id);
}
catch (e) {}
return el;
}
function createElement(el) {
return doc.createElement(el);
}
/* Updated attachEvent function for Internet Explorer
- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
*/
function addListener(target, eventType, fn) {
target.attachEvent(eventType, fn);
listenersArr[listenersArr.length] = [target, eventType, fn];
}
/* Flash Player and SWF content version matching
*/
function hasPlayerVersion(rv) {
var pv = ua.pv, v = rv.split(".");
v[0] = parseInt(v[0], 10);
v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
v[2] = parseInt(v[2], 10) || 0;
return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
}
/* Cross-browser dynamic CSS creation
- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
*/
function createCSS(sel, decl, media, newStyle) {
if (ua.ie && ua.mac) { return; }
var h = doc.getElementsByTagName("head")[0];
if (!h) { return; } // to also support badly authored HTML pages that lack a head element
var m = (media && typeof media == "string") ? media : "screen";
if (newStyle) {
dynamicStylesheet = null;
dynamicStylesheetMedia = null;
}
if (!dynamicStylesheet || dynamicStylesheetMedia != m) {
// create dynamic stylesheet + get a global reference to it
var s = createElement("style");
s.setAttribute("type", "text/css");
s.setAttribute("media", m);
dynamicStylesheet = h.appendChild(s);
if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
}
dynamicStylesheetMedia = m;
}
// add style rule
if (ua.ie && ua.win) {
if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
dynamicStylesheet.addRule(sel, decl);
}
}
else {
if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
}
}
}
function setVisibility(id, isVisible) {
if (!autoHideShow) { return; }
var v = isVisible ? "visible" : "hidden";
if (isDomLoaded && getElementById(id)) {
getElementById(id).style.visibility = v;
}
else {
createCSS("#" + id, "visibility:" + v);
}
}
/* Filter to avoid XSS attacks
*/
function urlEncodeIfNecessary(s) {
var regex = /[\\\"<>\.;]/;
var hasBadChars = regex.exec(s) != null;
return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
}
/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
*/
var cleanup = function() {
if (ua.ie && ua.win) {
window.attachEvent("onunload", function() {
// remove listeners to avoid memory leaks
var ll = listenersArr.length;
for (var i = 0; i < ll; i++) {
listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
}
// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
var il = objIdArr.length;
for (var j = 0; j < il; j++) {
removeSWF(objIdArr[j]);
}
// cleanup library's main closures to avoid memory leaks
for (var k in ua) {
ua[k] = null;
}
ua = null;
for (var l in swfobject) {
swfobject[l] = null;
}
swfobject = null;
});
}
}();
return {
/* Public API
- Reference: http://code.google.com/p/swfobject/wiki/documentation
*/
registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
if (ua.w3 && objectIdStr && swfVersionStr) {
var regObj = {};
regObj.id = objectIdStr;
regObj.swfVersion = swfVersionStr;
regObj.expressInstall = xiSwfUrlStr;
regObj.callbackFn = callbackFn;
regObjArr[regObjArr.length] = regObj;
setVisibility(objectIdStr, false);
}
else if (callbackFn) {
callbackFn({success:false, id:objectIdStr});
}
},
getObjectById: function(objectIdStr) {
if (ua.w3) {
return getObjectById(objectIdStr);
}
},
embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
var callbackObj = {success:false, id:replaceElemIdStr};
if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
setVisibility(replaceElemIdStr, false);
addDomLoadEvent(function() {
widthStr += ""; // auto-convert to string
heightStr += "";
var att = {};
if (attObj && typeof attObj === OBJECT) {
for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
att[i] = attObj[i];
}
}
att.data = swfUrlStr;
att.width = widthStr;
att.height = heightStr;
var par = {};
if (parObj && typeof parObj === OBJECT) {
for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
par[j] = parObj[j];
}
}
if (flashvarsObj && typeof flashvarsObj === OBJECT) {
for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
if (typeof par.flashvars != UNDEF) {
par.flashvars += "&" + k + "=" + flashvarsObj[k];
}
else {
par.flashvars = k + "=" + flashvarsObj[k];
}
}
}
if (hasPlayerVersion(swfVersionStr)) { // create SWF
var obj = createSWF(att, par, replaceElemIdStr);
if (att.id == replaceElemIdStr) {
setVisibility(replaceElemIdStr, true);
}
callbackObj.success = true;
callbackObj.ref = obj;
}
else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
att.data = xiSwfUrlStr;
showExpressInstall(att, par, replaceElemIdStr, callbackFn);
return;
}
else { // show alternative content
setVisibility(replaceElemIdStr, true);
}
if (callbackFn) { callbackFn(callbackObj); }
});
}
else if (callbackFn) { callbackFn(callbackObj); }
},
switchOffAutoHideShow: function() {
autoHideShow = false;
},
ua: ua,
getFlashPlayerVersion: function() {
return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
},
hasFlashPlayerVersion: hasPlayerVersion,
createSWF: function(attObj, parObj, replaceElemIdStr) {
if (ua.w3) {
return createSWF(attObj, parObj, replaceElemIdStr);
}
else {
return undefined;
}
},
showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
if (ua.w3 && canExpressInstall()) {
showExpressInstall(att, par, replaceElemIdStr, callbackFn);
}
},
removeSWF: function(objElemIdStr) {
if (ua.w3) {
removeSWF(objElemIdStr);
}
},
createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
if (ua.w3) {
createCSS(selStr, declStr, mediaStr, newStyleBoolean);
}
},
addDomLoadEvent: addDomLoadEvent,
addLoadEvent: addLoadEvent,
getQueryParamValue: function(param) {
var q = doc.location.search || doc.location.hash;
if (q) {
if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
if (param == null) {
return urlEncodeIfNecessary(q);
}
var pairs = q.split("&");
for (var i = 0; i < pairs.length; i++) {
if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
}
}
}
return "";
},
// For internal usage only
expressInstallCallback: function() {
if (isExpressInstallActive) {
var obj = getElementById(EXPRESS_INSTALL_ID);
if (obj && storedAltContent) {
obj.parentNode.replaceChild(storedAltContent, obj);
if (storedAltContentId) {
setVisibility(storedAltContentId, true);
if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
}
if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
}
isExpressInstallActive = false;
}
}
};
}();

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,29 @@
bbbsystemcheck.title = BigBlueButton Client Check
bbbsystemcheck.refresh = Refresh
bbbsystemcheck.mail = Mail
bbbsystemcheck.version = Client Check Version
bbbsystemcheck.dataGridColumn.item = Item
bbbsystemcheck.dataGridColumn.status = Status
bbbsystemcheck.dataGridColumn.result = Result
bbbsystemcheck.copyAllText = Copy all text
bbbsystemcheck.result.undefined = Undefined
bbbsystemcheck.result.javaEnabled.disabled = Java is disabled in your browser
bbbsystemcheck.result.javaEnabled.notDetected = No Java detected
bbbsystemcheck.status.succeeded = Succeded
bbbsystemcheck.status.warning = Warning
bbbsystemcheck.status.failed = Failed
bbbsystemcheck.status.loading = Loading...
bbbsystemcheck.test.name.browser = Browser
bbbsystemcheck.test.name.cookieEnabled = Cookie Enabled
bbbsystemcheck.test.name.downloadSpeed = Download Speed
bbbsystemcheck.test.name.flashVersion = Flash Version
bbbsystemcheck.test.name.pepperFlash = Is Pepper Flash
bbbsystemcheck.test.name.javaEnabled = Java Enabled
bbbsystemcheck.test.name.language = Language
bbbsystemcheck.test.name.ping = Ping
bbbsystemcheck.test.name.screenSize = Screen Size
bbbsystemcheck.test.name.uploadSpeed = Upload Speed
bbbsystemcheck.test.name.userAgent = User Agent
bbbsystemcheck.test.name.webRTCEcho = WebRTC Echo Test
bbbsystemcheck.test.name.webRTCSocket = WebRTC Socket Test
bbbsystemcheck.test.name.webRTCSupported = WebRTC Supported

View File

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<config>
<version>VERSION</version>
<mail>MAIL</mail>
<downloadFilePath url="test_image.jpg"/>
<ports>
<port>
<name>Port 9123</name>
<number>9123</number>
</port>
</ports>
<rtmpapps>
<app>
<name>RTMP BigBlueButton app</name>
<uri>rtmp://HOST/bigbluebutton</uri>
</app>
<app>
<name>RTMP deskShare app</name>
<uri>rtmp://HOST/deskShare</uri>
</app>
<app>
<name>RTMP video app</name>
<uri>rtmp://HOST/video</uri>
</app>
<app>
<name>RTMP sip app</name>
<uri>rtmp://HOST/sip</uri>
</app>
<app>
<name>RTMPT BigBlueButton app</name>
<uri>rtmpt://HOST/bigbluebutton</uri>
</app>
<app>
<name>RTMPT deskShare app</name>
<uri>rtmpt://HOST/deskShare</uri>
</app>
<app>
<name>RTMPT video app</name>
<uri>rtmpt://HOST/video</uri>
</app>
<app>
<name>RTMPT sip app</name>
<uri>rtmpt://HOST/sip</uri>
</app>
</rtmpapps>
</config>

View File

@ -0,0 +1,305 @@
{
var BBBClientCheck = {};
var BBB = {};
var userAgent;
var userMicMedia;
var currentSession;
function getSwfObj() {
return swfobject.getObjectById('BBBClientCheck');
}
BBBClientCheck.userAgent = function(){
var userAgentInfo = '';
var swfObj = getSwfObj();
userAgentInfo = navigator.userAgent;
swfObj.userAgent(userAgentInfo);
}
BBBClientCheck.browser = function() {
var nVer = navigator.appVersion;
var nAgt = navigator.userAgent;
var browserInfo, nameOffset, verOffset, ix;
var browser = navigator.appName;
var version = '' + parseFloat(navigator.appVersion);
var swfObj = getSwfObj();
// taken from http://stackoverflow.com/a/18706818/1729349
// Opera
if ((verOffset = nAgt.indexOf('Opera')) != -1) {
browser = 'Opera';
version = nAgt.substring(verOffset + 6);
if ((verOffset = nAgt.indexOf('Version')) != -1) {
version = nAgt.substring(verOffset + 8);
}
}
// MSIE
else if ((verOffset = nAgt.indexOf('MSIE')) != -1) {
browser = 'Microsoft Internet Explorer';
version = nAgt.substring(verOffset + 5);
}
//IE 11 no longer identifies itself as MS IE, so trap it
//http://stackoverflow.com/questions/17907445/how-to-detect-ie11
else if ((browser == 'Netscape') && (nAgt.indexOf('Trident/') != -1)) {
browser = 'Microsoft Internet Explorer';
version = nAgt.substring(verOffset + 5);
if ((verOffset = nAgt.indexOf('rv:')) != -1) {
version = nAgt.substring(verOffset + 3);
}
}
// Chrome
else if ((verOffset = nAgt.indexOf('Chrome')) != -1) {
browser = 'Chrome';
version = nAgt.substring(verOffset + 7);
}
// Safari
else if ((verOffset = nAgt.indexOf('Safari')) != -1) {
browser = 'Safari';
version = nAgt.substring(verOffset + 7);
if ((verOffset = nAgt.indexOf('Version')) != -1) {
version = nAgt.substring(verOffset + 8);
}
// Chrome on iPad identifies itself as Safari. Actual results do not match what Google claims
// at: https://developers.google.com/chrome/mobile/docs/user-agent?hl=ja
// No mention of chrome in the user agent string. However it does mention CriOS, which presumably
// can be keyed on to detect it.
if (nAgt.indexOf('CriOS') != -1) {
//Chrome on iPad spoofing Safari...correct it.
browser = 'Chrome';
//Don't believe there is a way to grab the accurate version number, so leaving that for now.
}
}
// Firefox
else if ((verOffset = nAgt.indexOf('Firefox')) != -1) {
browser = 'Firefox';
version = nAgt.substring(verOffset + 8);
}
// Other browsers
else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) < (verOffset = nAgt.lastIndexOf('/'))) {
browser = nAgt.substring(nameOffset, verOffset);
version = nAgt.substring(verOffset + 1);
if (browser.toLowerCase() == browser.toUpperCase()) {
browser = navigator.appName;
}
}
// trim the version string
if ((ix = version.indexOf(';')) != -1) version = version.substring(0, ix);
if ((ix = version.indexOf(' ')) != -1) version = version.substring(0, ix);
if ((ix = version.indexOf(')')) != -1) version = version.substring(0, ix);
browserInfo = browser + " " + version;
swfObj.browser(browserInfo);
}
BBBClientCheck.screenSize = function(){
var screenSizeInfo = '';
var swfObj = getSwfObj();
if (screen.width !== undefined) {
width = (screen.width) ? screen.width : '';
height = (screen.height) ? screen.height : '';
screenSizeInfo += '' + width + " x " + height;
}
swfObj.screenSize(screenSizeInfo);
}
BBBClientCheck.flashVersion = function(){
var flashVersionInfo = '';
var swfObj = getSwfObj();
flashVersionInfo = swfobject.getFlashPlayerVersion();
if (flashVersionInfo.major > 0) {
flashVersionInfo = flashVersionInfo.major + '.' + flashVersionInfo.minor + ' r' + flashVersionInfo.release;
}
swfObj.flashVersion(flashVersionInfo);
}
BBBClientCheck.isPepperFlash = function(){
var isPepperFlashInfo = false;
var swfObj = getSwfObj();
var isPPAPI = false;
var type = 'application/x-shockwave-flash';
var mimeTypes = navigator.mimeTypes;
if (mimeTypes && mimeTypes[type] && mimeTypes[type].enabledPlugin && (mimeTypes[type].enabledPlugin.filename.match(/pepflashplayer|Pepper/gi))) {
isPepperFlashInfo = true;
}
swfObj.isPepperFlash(isPepperFlashInfo);
}
BBBClientCheck.cookieEnabled = function(){
var cookieEnabledInfo = '';
var swfObj = getSwfObj();
cookieEnabledInfo = navigator.cookieEnabled;
swfObj.cookieEnabled(cookieEnabledInfo);
}
BBBClientCheck.javaEnabled = function(){
var result = {
enabled: navigator.javaEnabled(),
version: [],
minimum: '1.7.0_51+',
appropriate: false
};
if (result.enabled) {
result.version = getJavaVersion();
result.appropriate = isJavaVersionAppropriateForDeskshare(result.minimum);
}
console.log(result);
var swfObj = getSwfObj();
swfObj.javaEnabled(result);
}
function getJavaVersion() {
return deployJava.getJREs();
}
function isJavaVersionAppropriateForDeskshare(required) {
return deployJava.versionCheck(required);
}
BBBClientCheck.language = function(){
var languageInfo = '';
var swfObj = getSwfObj();
languageInfo = navigator.language;
swfObj.language(languageInfo);
}
BBBClientCheck.isWebRTCSupported = function() {
var isWebRTCSupportedInfo = isWebRTCAvailable();
var swfObj = getSwfObj();
swfObj.isWebRTCSupported(isWebRTCSupportedInfo);
}
BBBClientCheck.webRTCEchoAndSocketTest = function() {
var audioContext = new (window.AudioContext || window.webkitAudioContext)();
var silentStream = audioContext.createMediaStreamDestination().stream;
userMicMedia = silentStream;
startWebRTCAudioTest();
}
function sendWebRTCEchoTestAnswer(success, errorcode) {
var swfObj = getSwfObj();
swfObj.webRTCEchoTest(success, errorcode);
webrtc_hangup(function() {
console.log("[BBBClientCheck] Handling webRTC hangup callback");
var userAgentTemp = userAgent;
userAgent = null;
userAgentTemp.stop();
});
}
BBB.getMyUserInfo = function(callback) {
var obj = {
myUserID: "12345",
myUsername: "bbbTestUser",
myAvatarURL: "undefined",
myRole: "undefined",
amIPresenter: "undefined",
dialNumber: "undefined",
voiceBridge: "undefined",
customdata: "undefined"
}
callback(obj);
}
// webrtc test callbacks
BBB.webRTCEchoTestFailed = function(errorcode) {
console.log("[BBBClientCheck] Handling webRTCEchoTestFailed");
sendWebRTCEchoTestAnswer(false, errorcode);
}
BBB.webRTCEchoTestEnded = function() {
console.log("[BBBClientCheck] Handling webRTCEchoTestEnded");
}
BBB.webRTCEchoTestStarted = function() {
console.log("[BBBClientCheck] Handling webRTCEchoTestStarted");
sendWebRTCEchoTestAnswer(true, 'Connected');
}
BBB.webRTCEchoTestConnecting = function() {
console.log("[BBBClientCheck] Handling webRTCEchoTestConnecting");
}
BBB.webRTCEchoTestWaitingForICE = function() {
console.log("[BBBClientCheck] Handling webRTCEchoTestWaitingForICE");
}
BBB.webRTCEchoTestWebsocketSucceeded = function() {
console.log("[BBBClientCheck] Handling webRTCEchoTestWebsocketSucceeded");
var swfObj = getSwfObj();
swfObj.webRTCSocketTest(true, 'Connected');
}
BBB.webRTCEchoTestWebsocketFailed = function(errorcode) {
console.log("[BBBClientCheck] Handling webRTCEchoTestWebsocketFailed");
var swfObj = getSwfObj();
swfObj.webRTCSocketTest(false, errorcode);
}
// webrtc callbacks
BBB.webRTCConferenceCallFailed = function(errorcode) {
console.log("[BBBClientCheck] Handling webRTCConferenceCallFailed");
}
BBB.webRTCConferenceCallEnded = function() {
console.log("[BBBClientCheck] Handling webRTCConferenceCallEnded");
}
BBB.webRTCConferenceCallStarted = function() {
console.log("[BBBClientCheck] Handling webRTCConferenceCallStarted");
}
BBB.webRTCConferenceCallConnecting = function() {
console.log("[BBBClientCheck] Handling webRTCConferenceCallConnecting");
}
BBB.webRTCConferenceCallWaitingForICE = function() {
console.log("[BBBClientCheck] Handling webRTCConferenceCallWaitingForICE");
}
BBB.webRTCConferenceCallWebsocketSucceeded = function() {
console.log("[BBBClientCheck] Handling webRTCConferenceCallWebsocketSucceeded");
}
BBB.webRTCConferenceCallWebsocketFailed = function(errorcode) {
console.log("[BBBClientCheck] Handling webRTCConferenceCallWebsocketFailed");
}
BBB.webRTCMediaRequest = function() {
console.log("[BBBClientCheck] Handling webRTCMediaRequest");
}
BBB.webRTCMediaSuccess = function() {
console.log("[BBBClientCheck] Handling webRTCMediaSuccess");
}
BBB.webRTCMediaFail = function() {
console.log("[BBBClientCheck] Handling webRTCMediaFail");
}
}

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,31 @@
/* CSS file */
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
s|Application {
skinClass: ClassReference("org.bigbluebutton.clientcheck.view.skins.CustomApplicationSkin");
}
.controlBarLabelStyle {
fontWeight: bold;
fontSize: 15;
fontFamily: Arial;
color: #e1e2e5;
textAlign: center;
}
.borderContainerStyle {
verticalCenter: 0;
horizontalCenter: 0;
}
.windowTitleStyle {
fontFamily: Arial;
fontSize: 20;
fontWeight: bold;
}
.errorLabelStyle {
fontFamily: Arial;
fontSize: 12;
}

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:view="org.bigbluebutton.clientcheck.view.mainview.*"
width="100%"
height="100%"
preinitialize="preinitializeHandler(event)"
xmlns:mainview="org.bigbluebutton.clientcheck.view.mainview.*">
<fx:Style source="AppStyle.css" />
<fx:Metadata>
[ResourceBundle("resources")]
</fx:Metadata>
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
import org.bigbluebutton.clientcheck.AppConfig;
import org.bigbluebutton.clientcheck.view.mainview.MainViewConfig;
import org.bigbluebutton.clientcheck.view.mainview.RefreshButtonConfig;
import org.bigbluebutton.clientcheck.view.mainview.MailButtonConfig;
import robotlegs.bender.bundles.mvcs.MVCSBundle;
import robotlegs.bender.extensions.contextView.ContextView;
import robotlegs.bender.extensions.signalCommandMap.SignalCommandMapExtension;
import robotlegs.bender.framework.api.IContext;
import robotlegs.bender.framework.impl.Context;
private static var robotlegsContext:IContext;
protected function preinitializeHandler(event:FlexEvent):void
{
setupRobotlegsContext();
Security.allowDomain("*");
}
/**
* Setup robotlegs initial configuration
*/
private function setupRobotlegsContext():void
{
robotlegsContext=new Context().install(MVCSBundle, SignalCommandMapExtension)
.configure(AppConfig)
.configure(MainViewConfig)
.configure(RefreshButtonConfig)
.configure(MailButtonConfig)
.configure(new ContextView(this));
}
]]>
</fx:Script>
<s:controlBarContent>
<mx:Label id="controlBarLabel"
width="100%"
text="{resourceManager.getString('resources', 'bbbsystemcheck.title')}"
styleName="controlBarLabelStyle"/>
<view:RefreshButton id="refreshBtn"
label="{resourceManager.getString('resources', 'bbbsystemcheck.refresh')}"/>
<view:MailButton id="mailBtn"
label="{resourceManager.getString('resources', 'bbbsystemcheck.mail')}"/>
</s:controlBarContent>
<mainview:MainView width="80%"
height="97%"
styleName="borderContainerStyle"/>
</s:Application>

View File

@ -0,0 +1,101 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck
{
import org.bigbluebutton.clientcheck.command.GetConfigXMLDataCommand;
import org.bigbluebutton.clientcheck.command.GetConfigXMLDataSignal;
import org.bigbluebutton.clientcheck.command.RequestBandwidthInfoCommand;
import org.bigbluebutton.clientcheck.command.RequestBandwidthInfoSignal;
import org.bigbluebutton.clientcheck.command.RequestBrowserInfoCommand;
import org.bigbluebutton.clientcheck.command.RequestBrowserInfoSignal;
import org.bigbluebutton.clientcheck.command.RequestPortsCommand;
import org.bigbluebutton.clientcheck.command.RequestPortsSignal;
import org.bigbluebutton.clientcheck.command.RequestRTMPAppsCommand;
import org.bigbluebutton.clientcheck.command.RequestRTMPAppsSignal;
import org.bigbluebutton.clientcheck.model.ISystemConfiguration;
import org.bigbluebutton.clientcheck.model.IXMLConfig;
import org.bigbluebutton.clientcheck.model.IDataProvider;
import org.bigbluebutton.clientcheck.model.SystemConfiguration;
import org.bigbluebutton.clientcheck.model.XMLConfig;
import org.bigbluebutton.clientcheck.model.DataProvider;
import org.bigbluebutton.clientcheck.service.DownloadBandwidthService;
import org.bigbluebutton.clientcheck.service.ExternalApiCallbacks;
import org.bigbluebutton.clientcheck.service.ExternalApiCalls;
import org.bigbluebutton.clientcheck.service.FlashService;
import org.bigbluebutton.clientcheck.service.IDownloadBandwidthService;
import org.bigbluebutton.clientcheck.service.IExternalApiCallbacks;
import org.bigbluebutton.clientcheck.service.IExternalApiCalls;
import org.bigbluebutton.clientcheck.service.IFlashService;
import org.bigbluebutton.clientcheck.service.IPingService;
import org.bigbluebutton.clientcheck.service.IPortTunnelingService;
import org.bigbluebutton.clientcheck.service.IRTMPTunnelingService;
import org.bigbluebutton.clientcheck.service.IUploadBandwidthService;
import org.bigbluebutton.clientcheck.service.PingService;
import org.bigbluebutton.clientcheck.service.PortTunnelingService;
import org.bigbluebutton.clientcheck.service.RTMPTunnelingService;
import org.bigbluebutton.clientcheck.service.UploadBandwidthService;
import robotlegs.bender.extensions.signalCommandMap.api.ISignalCommandMap;
import robotlegs.bender.framework.api.IConfig;
import robotlegs.bender.framework.api.IInjector;
public class AppConfig implements IConfig
{
[Inject]
public var injector:IInjector;
[Inject]
public var signalCommandMap:ISignalCommandMap;
public function configure():void
{
configureSignalsToCommands();
configureSingletons();
configureTypes();
}
private function configureTypes():void
{
injector.map(IExternalApiCalls).toType(ExternalApiCalls);
injector.map(IExternalApiCallbacks).toType(ExternalApiCallbacks);
injector.map(IRTMPTunnelingService).toType(RTMPTunnelingService);
injector.map(IPortTunnelingService).toType(PortTunnelingService);
injector.map(IDownloadBandwidthService).toType(DownloadBandwidthService);
injector.map(IUploadBandwidthService).toType(UploadBandwidthService);
injector.map(IPingService).toType(PingService);
injector.map(IFlashService).toType(FlashService);
}
private function configureSingletons():void
{
injector.map(ISystemConfiguration).toSingleton(SystemConfiguration);
injector.map(IXMLConfig).toSingleton(XMLConfig);
injector.map(IDataProvider).toSingleton(DataProvider);
}
private function configureSignalsToCommands():void
{
signalCommandMap.map(RequestPortsSignal).toCommand(RequestPortsCommand);
signalCommandMap.map(GetConfigXMLDataSignal).toCommand(GetConfigXMLDataCommand);
signalCommandMap.map(RequestBrowserInfoSignal).toCommand(RequestBrowserInfoCommand);
signalCommandMap.map(RequestRTMPAppsSignal).toCommand(RequestRTMPAppsCommand);
signalCommandMap.map(RequestBandwidthInfoSignal).toCommand(RequestBandwidthInfoCommand);
}
}
}

View File

@ -0,0 +1,97 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.command
{
import flash.net.URLRequest;
import flash.utils.getTimer;
import mx.core.FlexGlobals;
import mx.utils.URLUtil;
import org.bigbluebutton.clientcheck.model.ISystemConfiguration;
import org.bigbluebutton.clientcheck.model.IXMLConfig;
import org.bigbluebutton.clientcheck.model.test.IPortTest;
import org.bigbluebutton.clientcheck.model.test.IRTMPAppTest;
import org.bigbluebutton.clientcheck.model.test.PortTest;
import org.bigbluebutton.clientcheck.model.test.RTMPAppTest;
import org.bigbluebutton.clientcheck.service.ConfigService;
import robotlegs.bender.bundles.mvcs.Command;
public class GetConfigXMLDataCommand extends Command
{
[Inject]
public var systemConfiguration:ISystemConfiguration;
[Inject]
public var config:IXMLConfig;
private var CONFIG_XML:String="check/conf/config.xml";
private var _urlRequest:URLRequest;
public override function execute():void
{
var configSubservice:ConfigService=new ConfigService();
configSubservice.successSignal.add(afterConfig);
configSubservice.unsuccessSignal.add(fail);
configSubservice.getConfig(buildRequestURL(), _urlRequest);
}
private function buildRequestURL():String
{
var swfPath:String=FlexGlobals.topLevelApplication.url;
var protocol:String=URLUtil.getProtocol(swfPath);
systemConfiguration.serverName=URLUtil.getServerNameWithPort(swfPath);
return protocol + "://" + systemConfiguration.serverName + "/" + CONFIG_XML + "?t=" + getTimer().toString();
}
private function fail(reason:String):void
{
// TODO: create pop up to notify about failure
}
private function afterConfig(data:Object):void
{
config.init(new XML(data));
systemConfiguration.downloadFilePath=config.downloadFilePath.url;
systemConfiguration.applicationAddress=config.serverUrl.url;
for each (var _port:Object in config.getPorts())
{
var port:IPortTest=new PortTest();
port.portName=_port.name;
port.portNumber=_port.number;
systemConfiguration.ports.push(port);
}
for each (var _rtmpApp:Object in config.getRTMPApps())
{
var app:IRTMPAppTest=new RTMPAppTest();
app.applicationName=_rtmpApp.name;
app.applicationUri=_rtmpApp.uri;
systemConfiguration.rtmpApps.push(app);
}
config.configParsedSignal.dispatch();
}
}
}

View File

@ -0,0 +1,31 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.command
{
import org.osflash.signals.Signal;
public class GetConfigXMLDataSignal extends Signal
{
public function GetConfigXMLDataSignal()
{
super();
}
}
}

View File

@ -0,0 +1,52 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.command
{
import org.bigbluebutton.clientcheck.model.ISystemConfiguration;
import org.bigbluebutton.clientcheck.service.IDownloadBandwidthService;
import org.bigbluebutton.clientcheck.service.IPingService;
import org.bigbluebutton.clientcheck.service.IUploadBandwidthService;
import robotlegs.bender.bundles.mvcs.Command;
public class RequestBandwidthInfoCommand extends Command
{
[Inject]
public var downloadBandwithService:IDownloadBandwidthService;
[Inject]
public var uploadBandwidthService:IUploadBandwidthService;
[Inject]
public var pingService:IPingService;
[Inject]
public var systemConfiguration:ISystemConfiguration;
public override function execute():void
{
downloadBandwithService.init();
pingService.init();
// commenting out upload service for now as it needs to be properly implemented
// uploadBandwidthService.init();
}
}
}

View File

@ -0,0 +1,31 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.command
{
import org.osflash.signals.Signal;
public class RequestBandwidthInfoSignal extends Signal
{
public function RequestBandwidthInfoSignal()
{
super();
}
}
}

View File

@ -0,0 +1,53 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.command
{
import flash.external.ExternalInterface;
import org.bigbluebutton.clientcheck.model.ISystemConfiguration;
import org.bigbluebutton.clientcheck.service.IExternalApiCalls;
import org.bigbluebutton.clientcheck.service.IFlashService;
import robotlegs.bender.bundles.mvcs.Command;
public class RequestBrowserInfoCommand extends Command
{
[Inject]
public var externalApiCalls:IExternalApiCalls;
[Inject]
public var flashService:IFlashService;
public override function execute():void
{
externalApiCalls.requestUserAgent();
externalApiCalls.requestBrowser();
externalApiCalls.requestScreenSize();
externalApiCalls.requestIsPepperFlash();
externalApiCalls.requestLanguage();
externalApiCalls.requestCookiesEnabled();
externalApiCalls.requestJavaEnabled();
externalApiCalls.requestIsWebRTCSupported();
externalApiCalls.requestWebRTCEchoAndSocketTest();
flashService.requestFlashVersion();
}
}
}

View File

@ -0,0 +1,31 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.command
{
import org.osflash.signals.Signal;
public class RequestBrowserInfoSignal extends Signal
{
public function RequestBrowserInfoSignal()
{
super();
}
}
}

View File

@ -0,0 +1,36 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.command
{
import org.bigbluebutton.clientcheck.service.IPortTunnelingService;
import robotlegs.bender.bundles.mvcs.Command;
public class RequestPortsCommand extends Command
{
[Inject]
public var portTunnelingService:IPortTunnelingService;
public override function execute():void
{
portTunnelingService.init();
}
}
}

View File

@ -0,0 +1,31 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.command
{
import org.osflash.signals.Signal;
public class RequestPortsSignal extends Signal
{
public function RequestPortsSignal()
{
super();
}
}
}

View File

@ -0,0 +1,41 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.command
{
import org.bigbluebutton.clientcheck.model.test.IPortTest;
import org.bigbluebutton.clientcheck.model.test.IRTMPAppTest;
import org.bigbluebutton.clientcheck.model.ISystemConfiguration;
import org.bigbluebutton.clientcheck.model.test.PortTest;
import org.bigbluebutton.clientcheck.service.IRTMPTunnelingService;
import robotlegs.bender.bundles.mvcs.Command;
import org.bigbluebutton.clientcheck.model.test.RTMPAppTest;
public class RequestRTMPAppsCommand extends Command
{
[Inject]
public var rtmpTunnelingService:IRTMPTunnelingService;
public override function execute():void
{
rtmpTunnelingService.init();
}
}
}

View File

@ -0,0 +1,31 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.command
{
import org.osflash.signals.Signal;
public class RequestRTMPAppsSignal extends Signal
{
public function RequestRTMPAppsSignal()
{
super();
}
}
}

View File

@ -0,0 +1,81 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model
{
public class Bandwidth
{
private var _filePath:String;
private var _testResultArray:Array=new Array;
private var _testsCount:Number;
private var _startTime:uint;
private var _endTime:uint;
public function get filePath():String
{
return _filePath;
}
public function set filePath(value:String):void
{
_filePath=value;
}
public function get testsCount():Number
{
return _testsCount;
}
public function set testsCount(value:Number):void
{
_testsCount=value;
}
public function get startTime():uint
{
return _startTime;
}
public function set startTime(value:uint):void
{
_startTime=value;
}
public function get endTime():uint
{
return _endTime;
}
public function set endTime(value:uint):void
{
_endTime=value;
}
public function get testResultArray():Array
{
return _testResultArray;
}
public function set testResultArray(value:Array):void
{
_testResultArray=value;
}
}
}

View File

@ -0,0 +1,40 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model
{
import flash.net.Socket;
public class CustomSocket extends Socket
{
// need to add a port property in order to distinguish sockets when getting connection response
private var _port:int;
public override function connect(host:String, port:int):void
{
_port=port;
super.connect(host, port);
}
public function get port():int
{
return _port;
}
}
}

View File

@ -0,0 +1,86 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model
{
import mx.collections.ArrayCollection;
import spark.collections.Sort;
import spark.collections.SortField;
public class DataProvider implements IDataProvider
{
private var _dataProvider:ArrayCollection = new ArrayCollection;
public function addData(obj:Object, status:Object):void
{
_dataProvider.addItem(mergeWithStatusObject(obj, status));
}
public function getData():ArrayCollection
{
return _dataProvider;
}
private function sortData():void
{
var itemSortField:SortField = new SortField();
var statusSortField:SortField = new SortField();
itemSortField.name = "Item";
statusSortField.name = "StatusPriority";
statusSortField.numeric = true;
var dataSort:Sort = new Sort();
dataSort.fields = [statusSortField, itemSortField];
_dataProvider.sort = dataSort;
_dataProvider.refresh();
}
public function updateData(obj:Object, status:Object):void
{
var merged:Object = mergeWithStatusObject(obj, status);
var i:int = 0;
while (i < _dataProvider.length && _dataProvider.getItemAt(i).Item != merged.Item) i++;
if (_dataProvider.getItemAt(i).Item == merged.Item)
{
_dataProvider.removeItemAt(i);
_dataProvider.addItemAt(merged, i);
}
else trace("Something is missing at MainViewMediator's initDataProvider");
sortData();
}
public function mergeWithStatusObject(obj:Object, status:Object):Object
{
var merged:Object = new Object();
var p:String;
for (p in obj) {
merged[p] = obj[p];
}
for (p in status) {
merged[p] = status[p];
}
return merged;
}
}
}

View File

@ -0,0 +1,30 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model
{
import mx.collections.ArrayCollection;
public interface IDataProvider
{
function addData(obj:Object, status:Object):void;
function getData():ArrayCollection;
function updateData(obj:Object, status:Object):void;
}
}

View File

@ -0,0 +1,64 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model
{
import org.bigbluebutton.clientcheck.model.test.BrowserTest;
import org.bigbluebutton.clientcheck.model.test.CookieEnabledTest;
import org.bigbluebutton.clientcheck.model.test.DownloadBandwidthTest;
import org.bigbluebutton.clientcheck.model.test.FlashVersionTest;
import org.bigbluebutton.clientcheck.model.test.IsPepperFlashTest;
import org.bigbluebutton.clientcheck.model.test.JavaEnabledTest;
import org.bigbluebutton.clientcheck.model.test.LanguageTest;
import org.bigbluebutton.clientcheck.model.test.PingTest;
import org.bigbluebutton.clientcheck.model.test.ScreenSizeTest;
import org.bigbluebutton.clientcheck.model.test.UploadBandwidthTest;
import org.bigbluebutton.clientcheck.model.test.UserAgentTest;
import org.bigbluebutton.clientcheck.model.test.WebRTCEchoTest;
import org.bigbluebutton.clientcheck.model.test.WebRTCSocketTest;
import org.bigbluebutton.clientcheck.model.test.WebRTCSupportedTest;
public interface ISystemConfiguration
{
function get userAgent():UserAgentTest;
function get browser():BrowserTest;
function get screenSize():ScreenSizeTest;
function get flashVersion():FlashVersionTest;
function get isPepperFlash():IsPepperFlashTest;
function get cookieEnabled():CookieEnabledTest;
function get javaEnabled():JavaEnabledTest;
function get language():LanguageTest;
function get isWebRTCSupported():WebRTCSupportedTest;
function get webRTCEchoTest():WebRTCEchoTest;
function get webRTCSocketTest():WebRTCSocketTest;
function get downloadBandwidthTest():DownloadBandwidthTest;
function get uploadBandwidthTest():UploadBandwidthTest;
function get pingTest():PingTest;
function get ports():Array;
function get rtmpApps():Array;
function get applicationAddress():String;
function set applicationAddress(value:String):void;
function get serverName():String;
function set serverName(value:String):void;
function set downloadFilePath(value:String):void;
function get downloadFilePath():String;
function set uploadFilePath(value:String):void;
function get uploadFilePath():String;
}
}

View File

@ -0,0 +1,35 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model
{
import org.osflash.signals.ISignal;
public interface IXMLConfig
{
function init(config:XML):void;
function get configParsedSignal():ISignal;
function get downloadFilePath():Object;
function get serverUrl():Object;
function getPorts():XMLList;
function getRTMPApps():XMLList;
function getVersion():String;
function getMail():String;
}
}

View File

@ -0,0 +1,181 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model
{
import org.bigbluebutton.clientcheck.model.test.BrowserTest;
import org.bigbluebutton.clientcheck.model.test.CookieEnabledTest;
import org.bigbluebutton.clientcheck.model.test.DownloadBandwidthTest;
import org.bigbluebutton.clientcheck.model.test.FlashVersionTest;
import org.bigbluebutton.clientcheck.model.test.IsPepperFlashTest;
import org.bigbluebutton.clientcheck.model.test.JavaEnabledTest;
import org.bigbluebutton.clientcheck.model.test.LanguageTest;
import org.bigbluebutton.clientcheck.model.test.PingTest;
import org.bigbluebutton.clientcheck.model.test.ScreenSizeTest;
import org.bigbluebutton.clientcheck.model.test.UploadBandwidthTest;
import org.bigbluebutton.clientcheck.model.test.UserAgentTest;
import org.bigbluebutton.clientcheck.model.test.WebRTCEchoTest;
import org.bigbluebutton.clientcheck.model.test.WebRTCSocketTest;
import org.bigbluebutton.clientcheck.model.test.WebRTCSupportedTest;
public class SystemConfiguration implements ISystemConfiguration
{
private var _userAgent:UserAgentTest=new UserAgentTest;
private var _browser:BrowserTest=new BrowserTest;
private var _screenSize:ScreenSizeTest=new ScreenSizeTest;
private var _flashVersion:FlashVersionTest=new FlashVersionTest;
private var _isPepperFlash:IsPepperFlashTest=new IsPepperFlashTest;
private var _cookieEnabled:CookieEnabledTest=new CookieEnabledTest;
private var _javaEnabled:JavaEnabledTest=new JavaEnabledTest;
private var _language:LanguageTest=new LanguageTest;
private var _isWebRTCSupported:WebRTCSupportedTest=new WebRTCSupportedTest;
private var _webRTCEchoTest:WebRTCEchoTest=new WebRTCEchoTest;
private var _webRTCSocketTest:WebRTCSocketTest=new WebRTCSocketTest;
private var _downloadBandwidthTest:DownloadBandwidthTest=new DownloadBandwidthTest;
private var _uploadBandwidthTest:UploadBandwidthTest=new UploadBandwidthTest;
private var _pingTest:PingTest=new PingTest;
private var _downloadFilePath:String;
private var _applicationAddress:String;
private var _serverName:String;
private var _uploadFilePath:String;
private var _ports:Array=new Array;
private var _rtmpApps:Array=new Array;
public function get userAgent():UserAgentTest
{
return _userAgent;
}
public function get browser():BrowserTest
{
return _browser;
}
public function get screenSize():ScreenSizeTest
{
return _screenSize;
}
public function get flashVersion():FlashVersionTest
{
return _flashVersion;
}
public function get isPepperFlash():IsPepperFlashTest
{
return _isPepperFlash;
}
public function get cookieEnabled():CookieEnabledTest
{
return _cookieEnabled;
}
public function get javaEnabled():JavaEnabledTest
{
return _javaEnabled;
}
public function get language():LanguageTest
{
return _language
}
public function get isWebRTCSupported():WebRTCSupportedTest
{
return _isWebRTCSupported;
}
public function get webRTCEchoTest():WebRTCEchoTest
{
return _webRTCEchoTest;
}
public function get webRTCSocketTest():WebRTCSocketTest
{
return _webRTCSocketTest;
}
public function get downloadBandwidthTest():DownloadBandwidthTest
{
return _downloadBandwidthTest;
}
public function get uploadBandwidthTest():UploadBandwidthTest
{
return _uploadBandwidthTest;
}
public function get pingTest():PingTest
{
return _pingTest;
}
public function get ports():Array
{
return _ports;
}
public function get rtmpApps():Array
{
return _rtmpApps;
}
public function set applicationAddress(value:String):void
{
_applicationAddress=value;
}
public function get applicationAddress():String
{
return _applicationAddress;
}
public function set serverName(value:String):void
{
_serverName=value;
}
public function get serverName():String
{
return _serverName;
}
public function set downloadFilePath(value:String):void
{
_downloadFilePath=value;
}
public function get downloadFilePath():String
{
return _downloadFilePath;
}
public function set uploadFilePath(value:String):void
{
_uploadFilePath=value;
}
public function get uploadFilePath():String
{
return _uploadFilePath;
}
}
}

View File

@ -0,0 +1,76 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model
{
import org.osflash.signals.ISignal;
import org.osflash.signals.Signal;
public class XMLConfig implements IXMLConfig
{
private var _config:XML;
private var _configParsedSignal:ISignal=new Signal;
public function init(config:XML):void
{
_config=config;
}
public function get configParsedSignal():ISignal
{
return _configParsedSignal;
}
public function get downloadFilePath():Object
{
var downloadFilePath:Object=new Object();
downloadFilePath.url=_config.downloadFilePath.@url;
return downloadFilePath;
}
public function get serverUrl():Object
{
var serverUrl:Object=new Object();
serverUrl.url=_config.server.@url;
return serverUrl;
}
public function getPorts():XMLList
{
return new XMLList(_config.ports).children();
}
public function getRTMPApps():XMLList
{
return new XMLList(_config.rtmpapps).children();
}
public function getVersion():String
{
var version:String = _config.version;
return version;
}
public function getMail():String
{
var mail:String = _config.mail;
return mail;
}
}
}

View File

@ -0,0 +1,62 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model.test
{
import org.osflash.signals.ISignal;
import org.osflash.signals.Signal;
import mx.resources.ResourceManager;
public class BrowserTest implements ITestable
{
public static var BROWSER:String=ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.test.name.browser');
private var _testSuccessfull:Boolean;
private var _testResult:String;
private var _browserTestSuccessfullChangedSignal:ISignal=new Signal;
public function get testSuccessfull():Boolean
{
return _testSuccessfull;
}
public function set testSuccessfull(value:Boolean):void
{
_testSuccessfull=value;
_browserTestSuccessfullChangedSignal.dispatch();
}
public function get testResult():String
{
return _testResult;
}
public function set testResult(value:String):void
{
_testResult=value;
}
public function get browserTestSuccessfullChangedSignal():ISignal
{
return _browserTestSuccessfullChangedSignal;
}
}
}

View File

@ -0,0 +1,62 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model.test
{
import org.osflash.signals.ISignal;
import org.osflash.signals.Signal;
import mx.resources.ResourceManager;
public class CookieEnabledTest implements ITestable
{
public static var COOKIE_ENABLED:String=ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.test.name.cookieEnabled');
private var _testSuccessfull:Boolean;
private var _testResult:String;
private var _cookieEnabledTestSuccessfullChangedSignal:ISignal=new Signal;
public function get testSuccessfull():Boolean
{
return _testSuccessfull;
}
public function set testSuccessfull(value:Boolean):void
{
_testSuccessfull=value;
cookieEnabledTestSuccessfullChangedSignal.dispatch();
}
public function get testResult():String
{
return _testResult;
}
public function set testResult(value:String):void
{
_testResult=value;
}
public function get cookieEnabledTestSuccessfullChangedSignal():ISignal
{
return _cookieEnabledTestSuccessfullChangedSignal;
}
}
}

View File

@ -0,0 +1,62 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model.test
{
import org.bigbluebutton.clientcheck.model.Bandwidth;
import org.osflash.signals.ISignal;
import org.osflash.signals.Signal;
import mx.resources.ResourceManager;
public class DownloadBandwidthTest extends Bandwidth implements ITestable
{
public static var DOWNLOAD_SPEED:String=ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.test.name.downloadSpeed');
private var _testResult:String;
private var _testSuccessfull:Boolean;
private var _downloadSpeedTestSuccessfullChangedSignal:ISignal=new Signal;
public function get testResult():String
{
return _testResult;
}
public function set testResult(value:String):void
{
_testResult=value;
}
public function get testSuccessfull():Boolean
{
return _testSuccessfull;
}
public function set testSuccessfull(value:Boolean):void
{
_testSuccessfull=value;
_downloadSpeedTestSuccessfullChangedSignal.dispatch();
}
public function get downloadSpeedTestSuccessfullChangedSignal():ISignal
{
return _downloadSpeedTestSuccessfullChangedSignal;
}
}
}

View File

@ -0,0 +1,62 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model.test
{
import org.osflash.signals.ISignal;
import org.osflash.signals.Signal;
import mx.resources.ResourceManager;
public class FlashVersionTest implements ITestable
{
public static var FLASH_VERSION:String=ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.test.name.flashVersion');
private var _testSuccessfull:Boolean;
private var _testResult:String;
private var _flashVersionTestSuccessfullChangedSignal:ISignal=new Signal;
public function get testSuccessfull():Boolean
{
return _testSuccessfull;
}
public function set testSuccessfull(value:Boolean):void
{
_testSuccessfull=value;
flashVersionTestSuccessfullChangedSignal.dispatch();
}
public function get testResult():String
{
return _testResult;
}
public function set testResult(value:String):void
{
_testResult=value;
}
public function get flashVersionTestSuccessfullChangedSignal():ISignal
{
return _flashVersionTestSuccessfullChangedSignal;
}
}
}

View File

@ -0,0 +1,32 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model.test
{
import org.osflash.signals.ISignal;
public interface IPortTest extends ITestable
{
function get portNumber():int;
function set portNumber(value:int):void;
function get portName():String;
function set portName(value:String):void;
function get tunnelResultSuccessfullChangedSignal():ISignal;
}
}

View File

@ -0,0 +1,32 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model.test
{
import org.osflash.signals.ISignal;
public interface IRTMPAppTest extends ITestable
{
function get applicationUri():String;
function set applicationUri(value:String):void;
function get applicationName():String;
function set applicationName(value:String):void;
function get connectionResultSuccessfullChangedSignal():ISignal;
}
}

View File

@ -0,0 +1,30 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model.test
{
public interface ITestable
{
function get testSuccessfull():Boolean;
function set testSuccessfull(value:Boolean):void;
function get testResult():String;
function set testResult(value:String):void;
}
}

View File

@ -0,0 +1,62 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model.test
{
import org.osflash.signals.Signal;
import org.osflash.signals.ISignal;
import mx.resources.ResourceManager;
public class IsPepperFlashTest implements ITestable
{
public static var PEPPER_FLASH:String=ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.test.name.pepperFlash');
private var _testSuccessfull:Boolean;
private var _testResult:String;
private var _pepperFlashTestSuccessfullChangedSignal:ISignal=new Signal;
public function get testSuccessfull():Boolean
{
return _testSuccessfull;
}
public function set testSuccessfull(value:Boolean):void
{
_testSuccessfull=value;
pepperFlashTestSuccessfullChangedSignal.dispatch();
}
public function get testResult():String
{
return _testResult;
}
public function set testResult(value:String):void
{
_testResult=value;
}
public function get pepperFlashTestSuccessfullChangedSignal():ISignal
{
return _pepperFlashTestSuccessfullChangedSignal;
}
}
}

View File

@ -0,0 +1,62 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model.test
{
import org.osflash.signals.ISignal;
import org.osflash.signals.Signal;
import mx.resources.ResourceManager;
public class JavaEnabledTest implements ITestable
{
public static var JAVA_ENABLED:String=ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.test.name.javaEnabled');
private var _testSuccessfull:Boolean;
private var _testResult:String;
private var _javaEnabledTestSuccessfullChangedSignal:ISignal=new Signal;
public function get testSuccessfull():Boolean
{
return _testSuccessfull;
}
public function set testSuccessfull(value:Boolean):void
{
_testSuccessfull=value;
javaEnabledTestSuccessfullChangedSignal.dispatch();
}
public function get testResult():String
{
return _testResult;
}
public function set testResult(value:String):void
{
_testResult=value;
}
public function get javaEnabledTestSuccessfullChangedSignal():ISignal
{
return _javaEnabledTestSuccessfullChangedSignal;
}
}
}

View File

@ -0,0 +1,62 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model.test
{
import org.osflash.signals.ISignal;
import org.osflash.signals.Signal;
import mx.resources.ResourceManager;
public class LanguageTest implements ITestable
{
public static var LANGUAGE:String=ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.test.name.language');
private var _testSuccessfull:Boolean;
private var _testResult:String;
private var _languageTestSuccessfullChangedSignal:ISignal=new Signal;
public function get testSuccessfull():Boolean
{
return _testSuccessfull;
}
public function set testSuccessfull(value:Boolean):void
{
_testSuccessfull=value;
languageTestSuccessfullChangedSignal.dispatch();
}
public function get testResult():String
{
return _testResult;
}
public function set testResult(value:String):void
{
_testResult=value;
}
public function get languageTestSuccessfullChangedSignal():ISignal
{
return _languageTestSuccessfullChangedSignal;
}
}
}

View File

@ -0,0 +1,62 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model.test
{
import org.bigbluebutton.clientcheck.model.Bandwidth;
import org.osflash.signals.ISignal;
import org.osflash.signals.Signal;
import mx.resources.ResourceManager;
public class PingTest extends Bandwidth
{
public static var PING:String=ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.test.name.ping');
private var _testResult:String;
private var _testSuccessfull:Boolean;
private var _pingSpeedTestSuccessfullChangedSignal:ISignal=new Signal;
public function get testResult():String
{
return _testResult;
}
public function set testResult(value:String):void
{
_testResult=value;
}
public function get testSuccessfull():Boolean
{
return _testSuccessfull;
}
public function set testSuccessfull(value:Boolean):void
{
_testSuccessfull=value;
_pingSpeedTestSuccessfullChangedSignal.dispatch();
}
public function get pingSpeedTestSuccessfullChangedSignal():ISignal
{
return _pingSpeedTestSuccessfullChangedSignal;
}
}
}

View File

@ -0,0 +1,80 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model.test
{
import org.osflash.signals.ISignal;
import org.osflash.signals.Signal;
public class PortTest implements IPortTest
{
private var _testSuccessfull:Boolean;
private var _tunnelResultSuccessfullChangedSignal:ISignal=new Signal();
private var _portNumber:int;
private var _portName:String;
private var _testResult:String;
public function get portNumber():int
{
return _portNumber;
}
public function set portNumber(value:int):void
{
_portNumber=value;
}
public function get portName():String
{
return _portName;
}
public function set portName(value:String):void
{
_portName=value;
}
public function get testResult():String
{
return _testResult;
}
public function set testResult(value:String):void
{
_testResult=value;
}
public function set testSuccessfull(value:Boolean):void
{
_testSuccessfull=value;
_tunnelResultSuccessfullChangedSignal.dispatch(portNumber);
}
public function get testSuccessfull():Boolean
{
return _testSuccessfull;
}
public function get tunnelResultSuccessfullChangedSignal():ISignal
{
return _tunnelResultSuccessfullChangedSignal;
}
}
}

View File

@ -0,0 +1,80 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model.test
{
import org.osflash.signals.ISignal;
import org.osflash.signals.Signal;
public class RTMPAppTest implements IRTMPAppTest
{
private var _applicationUri:String;
private var _applicationName:String;
private var _testResult:String;
private var _testSuccessfull:Boolean;
private var _connectionResultSuccessfullChangedSignal:ISignal=new Signal();
public function get applicationUri():String
{
return _applicationUri;
}
public function set applicationUri(value:String):void
{
_applicationUri=value;
}
public function get applicationName():String
{
return _applicationName;
}
public function set applicationName(value:String):void
{
_applicationName=value;
}
public function get testResult():String
{
return _testResult;
}
public function set testResult(value:String):void
{
_testResult=value;
}
public function get connectionResultSuccessfullChangedSignal():ISignal
{
return _connectionResultSuccessfullChangedSignal;
}
public function set testSuccessfull(value:Boolean):void
{
_testSuccessfull=value;
_connectionResultSuccessfullChangedSignal.dispatch(applicationUri);
}
public function get testSuccessfull():Boolean
{
return _testSuccessfull;
}
}
}

View File

@ -0,0 +1,62 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model.test
{
import org.osflash.signals.ISignal;
import org.osflash.signals.Signal;
import mx.resources.ResourceManager;
public class ScreenSizeTest implements ITestable
{
public static var SCREEN_SIZE:String=ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.test.name.screenSize');
private var _testSuccessfull:Boolean;
private var _testResult:String;
private var _screenSizeTestSuccessfullChangedSignal:ISignal=new Signal;
public function get testSuccessfull():Boolean
{
return _testSuccessfull;
}
public function set testSuccessfull(value:Boolean):void
{
_testSuccessfull=value;
_screenSizeTestSuccessfullChangedSignal.dispatch();
}
public function get testResult():String
{
return _testResult;
}
public function set testResult(value:String):void
{
_testResult=value;
}
public function get screenSizeTestSuccessfullChangedSignal():ISignal
{
return _screenSizeTestSuccessfullChangedSignal;
}
}
}

View File

@ -0,0 +1,62 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model.test
{
import org.bigbluebutton.clientcheck.model.Bandwidth;
import org.osflash.signals.ISignal;
import org.osflash.signals.Signal;
import mx.resources.ResourceManager;
public class UploadBandwidthTest extends Bandwidth implements ITestable
{
public static var UPLOAD_SPEED:String=ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.test.name.uploadSpeed');
private var _testResult:String;
private var _testSuccessfull:Boolean;
private var _uploadSpeedTestSuccessfullChangedSignal:ISignal=new Signal;
public function get testResult():String
{
return _testResult;
}
public function set testResult(value:String):void
{
_testResult=value;
}
public function get testSuccessfull():Boolean
{
return _testSuccessfull;
}
public function set testSuccessfull(value:Boolean):void
{
_testSuccessfull=value;
_uploadSpeedTestSuccessfullChangedSignal.dispatch();
}
public function get uploadSpeedTestSuccessfullChangedSignal():ISignal
{
return _uploadSpeedTestSuccessfullChangedSignal;
}
}
}

View File

@ -0,0 +1,62 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model.test
{
import org.osflash.signals.ISignal;
import org.osflash.signals.Signal;
import mx.resources.ResourceManager;
public class UserAgentTest implements ITestable
{
public static var USER_AGENT:String=ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.test.name.userAgent');
private var _testSuccessfull:Boolean;
private var _testResult:String;
private var _userAgentTestSuccessfullChangedSignal:ISignal=new Signal;
public function get testSuccessfull():Boolean
{
return _testSuccessfull;
}
public function set testSuccessfull(value:Boolean):void
{
_testSuccessfull=value;
_userAgentTestSuccessfullChangedSignal.dispatch();
}
public function get testResult():String
{
return _testResult;
}
public function set testResult(value:String):void
{
_testResult=value;
}
public function get userAgentTestSuccessfullChangedSignal():ISignal
{
return _userAgentTestSuccessfullChangedSignal;
}
}
}

View File

@ -0,0 +1,62 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model.test
{
import org.osflash.signals.ISignal;
import org.osflash.signals.Signal;
import mx.resources.ResourceManager;
public class WebRTCEchoTest implements ITestable
{
public static var WEBRTC_ECHO_TEST:String=ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.test.name.webRTCEcho');
private var _testSuccessfull:Boolean;
private var _testResult:String;
private var _webRTCEchoTestSuccessfullChangedSignal:ISignal=new Signal;
public function get testSuccessfull():Boolean
{
return _testSuccessfull;
}
public function set testSuccessfull(value:Boolean):void
{
_testSuccessfull=value;
webRTCEchoTestSuccessfullChangedSignal.dispatch();
}
public function get testResult():String
{
return _testResult;
}
public function set testResult(value:String):void
{
_testResult=value;
}
public function get webRTCEchoTestSuccessfullChangedSignal():ISignal
{
return _webRTCEchoTestSuccessfullChangedSignal;
}
}
}

View File

@ -0,0 +1,62 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model.test
{
import org.osflash.signals.ISignal;
import org.osflash.signals.Signal;
import mx.resources.ResourceManager;
public class WebRTCSocketTest implements ITestable
{
public static var WEBRTC_SOCKET_TEST:String=ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.test.name.webRTCSocket');
private var _testSuccessfull:Boolean;
private var _testResult:String;
private var _webRTCSocketTestSuccessfullChangedSignal:ISignal=new Signal;
public function get testSuccessfull():Boolean
{
return _testSuccessfull;
}
public function set testSuccessfull(value:Boolean):void
{
_testSuccessfull=value;
webRTCSocketTestSuccessfullChangedSignal.dispatch();
}
public function get testResult():String
{
return _testResult;
}
public function set testResult(value:String):void
{
_testResult=value;
}
public function get webRTCSocketTestSuccessfullChangedSignal():ISignal
{
return _webRTCSocketTestSuccessfullChangedSignal;
}
}
}

View File

@ -0,0 +1,62 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.model.test
{
import org.osflash.signals.ISignal;
import org.osflash.signals.Signal;
import mx.resources.ResourceManager;
public class WebRTCSupportedTest implements ITestable
{
public static var WEBRTC_SUPPORTED:String=ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.test.name.webRTCSupported');
private var _testSuccessfull:Boolean;
private var _testResult:String;
private var _webRTCSupportedTestSuccessfullChangedSignal:ISignal=new Signal;
public function get testSuccessfull():Boolean
{
return _testSuccessfull;
}
public function set testSuccessfull(value:Boolean):void
{
_testSuccessfull=value;
webRTCSupportedTestSuccessfullChangedSignal.dispatch();
}
public function get testResult():String
{
return _testResult;
}
public function set testResult(value:String):void
{
_testResult=value;
}
public function get webRTCSupportedTestSuccessfullChangedSignal():ISignal
{
return _webRTCSupportedTestSuccessfullChangedSignal;
}
}
}

View File

@ -0,0 +1,71 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.service
{
import flash.events.Event;
import flash.events.HTTPStatusEvent;
import flash.events.IOErrorEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLRequestHeader;
import flash.net.URLRequestMethod;
import mx.utils.ObjectUtil;
import org.osflash.signals.ISignal;
import org.osflash.signals.Signal;
import org.bigbluebutton.clientcheck.service.util.URLFetcher;
public class ConfigService
{
protected var _successSignal:Signal=new Signal();
protected var _unsuccessSignal:Signal=new Signal();
public function get successSignal():ISignal
{
return _successSignal;
}
public function get unsuccessSignal():ISignal
{
return _unsuccessSignal;
}
public function getConfig(serverUrl:String, urlRequest:URLRequest):void
{
var configUrl:String=serverUrl;
var fetcher:URLFetcher=new URLFetcher;
fetcher.successSignal.add(onSuccess);
fetcher.unsuccessSignal.add(onUnsuccess);
fetcher.fetch(configUrl, urlRequest);
}
protected function onSuccess(data:Object, responseUrl:String, urlRequest:URLRequest):void
{
successSignal.dispatch(new XML(data));
}
protected function onUnsuccess(reason:String):void
{
unsuccessSignal.dispatch(reason);
}
}
}

View File

@ -0,0 +1,135 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.service
{
import flash.display.Loader;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.ProgressEvent;
import flash.events.TimerEvent;
import flash.net.URLRequest;
import flash.system.ApplicationDomain;
import flash.system.LoaderContext;
import flash.utils.getTimer;
import flash.utils.Timer;
import mx.formatters.NumberBaseRoundType;
import mx.formatters.NumberFormatter;
import org.bigbluebutton.clientcheck.model.ISystemConfiguration;
public class DownloadBandwidthService implements IDownloadBandwidthService
{
[Inject]
public var systemConfiguration:ISystemConfiguration;
private static const NUM_OF_SECONDS:Number = 10;
private static const BYTES_IN_MBIT:Number=Math.pow(2, 17);
private static const BYTES_IN_MBYTE:Number=Math.pow(2, 20);
private var _imageLoader:Loader;
private var _initiated:Boolean = false;
private var _loading:Boolean = false;
private var _ignoreBytes:int = 0;
private var _startTime:int;
private var _endTime:int;
private var _timer:Timer;
private var _secondsCounter:int = 0;
public function init():void
{
_initiated=false;
_timer = new Timer(1000, NUM_OF_SECONDS);
_timer.addEventListener(TimerEvent.TIMER, onTimerListener)
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerCompleted);
_timer.reset();
_timer.start();
_imageLoader=new Loader;
_imageLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, contentLoaderProgressHandler);
_imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, contentLoaderCompleteHandler, false, 0, true);
_imageLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, contentLoaderIoErrorHandler, false, 0, true);
_loading = true;
_imageLoader.load(new URLRequest(systemConfiguration.downloadFilePath + "?t=" + getTimer().toString()));
}
protected function onTimerListener(event:TimerEvent):void {
step();
}
protected function step():void {
if (_initiated) {
_secondsCounter = Math.min(_secondsCounter + 1, NUM_OF_SECONDS);
updateData(_secondsCounter == NUM_OF_SECONDS);
}
}
protected function updateData(lastUpdate:Boolean = false):void {
var now:int = getTimer();
var duration:Number = ((now - _startTime) / 1000)
var loadedSoFar:int = _imageLoader.contentLoaderInfo.bytesLoaded - _ignoreBytes;
var loadedInMB:Number = loadedSoFar / BYTES_IN_MBYTE;
var loadedInMb:Number = loadedSoFar / BYTES_IN_MBIT;
var speed:Number = loadedInMb / duration;
var dataFormatter:NumberFormatter=new NumberFormatter();
dataFormatter.precision=3;
dataFormatter.rounding=NumberBaseRoundType.NEAREST;
var msg:String;
if (lastUpdate) {
msg = dataFormatter.format(speed) + " Mbps (" + dataFormatter.format(loadedInMB) + " MB in " + _secondsCounter + " seconds)";
} else {
msg = dataFormatter.format(speed) + " Mbps (" + dataFormatter.format(loadedInMB) + " MB, " + (NUM_OF_SECONDS - _secondsCounter) + " seconds remaining)";
}
systemConfiguration.downloadBandwidthTest.testResult=msg;
systemConfiguration.downloadBandwidthTest.testSuccessfull=true;
}
protected function onTimerCompleted(event:TimerEvent):void {
_imageLoader.close();
step();
}
protected function contentLoaderProgressHandler(event:ProgressEvent):void
{
if (!_initiated)
{
_startTime = getTimer();
_ignoreBytes = event.bytesLoaded;
_initiated=true;
}
}
protected function contentLoaderIoErrorHandler(event:IOErrorEvent):void
{
systemConfiguration.downloadBandwidthTest.testResult=event.text;
systemConfiguration.downloadBandwidthTest.testSuccessfull=false;
}
protected function contentLoaderCompleteHandler(event:Event):void
{
_timer.stop();
updateData(true);
}
}
}

View File

@ -0,0 +1,127 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.service
{
import flash.external.ExternalInterface;
import org.bigbluebutton.clientcheck.model.ISystemConfiguration;
import org.bigbluebutton.clientcheck.model.test.ITestable;
import mx.resources.ResourceManager;
public class ExternalApiCallbacks implements IExternalApiCallbacks
{
[Inject]
public var systemConfiguration:ISystemConfiguration;
public function ExternalApiCallbacks()
{
if (ExternalInterface.available)
{
ExternalInterface.addCallback("userAgent", userAgentCallbackHandler);
ExternalInterface.addCallback("browser", browserCallbackHandler);
ExternalInterface.addCallback("screenSize", screenSizeCallbackHandler);
ExternalInterface.addCallback("isPepperFlash", isPepperFlashCallbackHandler);
ExternalInterface.addCallback("cookieEnabled", cookieEnabledCallbackHandler);
ExternalInterface.addCallback("javaEnabled", javaEnabledCallbackHandler);
ExternalInterface.addCallback("language", languageCallbackHandler);
ExternalInterface.addCallback("isWebRTCSupported", isWebRTCSupportedCallbackHandler);
ExternalInterface.addCallback("webRTCEchoTest", webRTCEchoTestCallbackHandler);
ExternalInterface.addCallback("webRTCSocketTest", webRTCSocketTestCallbackHandler);
}
}
private function checkResult(result:String, item:ITestable):void
{
if ((result == null) || (result == ""))
{
item.testResult = ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.result.undefined');
item.testSuccessfull=false;
}
else
{
item.testResult=result;
item.testSuccessfull=true;
}
}
public function webRTCSocketTestCallbackHandler(success:Boolean, result:String):void
{
systemConfiguration.webRTCSocketTest.testResult=result;
systemConfiguration.webRTCSocketTest.testSuccessfull=success;
}
public function webRTCEchoTestCallbackHandler(success:Boolean, result:String):void
{
systemConfiguration.webRTCEchoTest.testResult=result;
systemConfiguration.webRTCEchoTest.testSuccessfull=success;
}
public function isPepperFlashCallbackHandler(value:String):void
{
checkResult(value, systemConfiguration.isPepperFlash);
}
public function languageCallbackHandler(value:String):void
{
checkResult(value, systemConfiguration.language);
}
public function javaEnabledCallbackHandler(value:Object):void
{
var testResult:String;
if (!value.enabled) {
testResult = ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.result.javaEnabled.disabled');
} else if (value.version.length == 0) {
testResult = ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.result.javaEnabled.notDetected');
} else {
testResult = value.version.join(', ');
}
systemConfiguration.javaEnabled.testResult = testResult;
systemConfiguration.javaEnabled.testSuccessfull = value.appropriate;
}
public function isWebRTCSupportedCallbackHandler(value:String):void
{
checkResult(value, systemConfiguration.isWebRTCSupported);
}
public function cookieEnabledCallbackHandler(value:String):void
{
checkResult(value, systemConfiguration.cookieEnabled);
}
public function screenSizeCallbackHandler(value:String):void
{
checkResult(value, systemConfiguration.screenSize);
}
private function browserCallbackHandler(value:String):void
{
checkResult(value, systemConfiguration.browser);
}
public function userAgentCallbackHandler(value:String):void
{
checkResult(value, systemConfiguration.userAgent);
}
}
}

View File

@ -0,0 +1,71 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.service
{
import flash.external.ExternalInterface;
public class ExternalApiCalls implements IExternalApiCalls
{
public function requestUserAgent():void
{
ExternalInterface.call("BBBClientCheck.userAgent");
}
public function requestBrowser():void
{
ExternalInterface.call("BBBClientCheck.browser");
}
public function requestScreenSize():void
{
ExternalInterface.call("BBBClientCheck.screenSize");
}
public function requestIsPepperFlash():void
{
ExternalInterface.call('BBBClientCheck.isPepperFlash');
}
public function requestCookiesEnabled():void
{
ExternalInterface.call('BBBClientCheck.cookieEnabled');
}
public function requestJavaEnabled():void
{
ExternalInterface.call('BBBClientCheck.javaEnabled');
}
public function requestLanguage():void
{
ExternalInterface.call('BBBClientCheck.language');
}
public function requestIsWebRTCSupported():void
{
ExternalInterface.call('BBBClientCheck.isWebRTCSupported');
}
public function requestWebRTCEchoAndSocketTest():void
{
ExternalInterface.call('BBBClientCheck.webRTCEchoAndSocketTest');
}
}
}

View File

@ -0,0 +1,54 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.service
{
import flash.system.Capabilities;
import org.bigbluebutton.clientcheck.model.ISystemConfiguration;
public class FlashService implements IFlashService
{
[Inject]
public var systemConfiguration:ISystemConfiguration;
public function requestFlashVersion():void
{
var versionNumber:String=Capabilities.version;
var versionArray:Array=versionNumber.split(",");
var platformAndVersion:Array=versionArray[0].split(" ");
var majorVersion:String=platformAndVersion[1];
var minorVersion:String=versionArray[1];
var buildNumber:String=versionArray[2] + "." + versionArray[3];
var parsedResult:String=majorVersion + "." + minorVersion + "." + buildNumber;
if (parsedResult != "")
{
systemConfiguration.flashVersion.testResult=parsedResult;
systemConfiguration.flashVersion.testSuccessfull=true;
}
else
{
systemConfiguration.flashVersion.testResult=null;
systemConfiguration.flashVersion.testSuccessfull=false;
}
}
}
}

View File

@ -0,0 +1,27 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.service
{
public interface IDownloadBandwidthService
{
function init():void;
}
}

View File

@ -0,0 +1,35 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.service
{
public interface IExternalApiCallbacks
{
function userAgentCallbackHandler(value:String):void;
function cookieEnabledCallbackHandler(value:String):void;
function isPepperFlashCallbackHandler(value:String):void;
function languageCallbackHandler(value:String):void;
function javaEnabledCallbackHandler(value:Object):void;
function screenSizeCallbackHandler(value:String):void;
function isWebRTCSupportedCallbackHandler(value:String):void;
function webRTCEchoTestCallbackHandler(success:Boolean, result:String):void;
function webRTCSocketTestCallbackHandler(success:Boolean, result:String):void;
}
}

View File

@ -0,0 +1,35 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.service
{
public interface IExternalApiCalls
{
function requestUserAgent():void;
function requestBrowser():void;
function requestScreenSize():void;
function requestIsPepperFlash():void;
function requestCookiesEnabled():void;
function requestJavaEnabled():void;
function requestLanguage():void;
function requestIsWebRTCSupported():void;
function requestWebRTCEchoAndSocketTest():void;
}
}

View File

@ -0,0 +1,27 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.service
{
public interface IFlashService
{
function requestFlashVersion():void;
}
}

View File

@ -0,0 +1,27 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.service
{
public interface IPingService
{
function init():void;
}
}

View File

@ -0,0 +1,27 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.service
{
public interface IPortTunnelingService
{
function init():void;
}
}

View File

@ -0,0 +1,27 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.service
{
public interface IRTMPTunnelingService
{
function init():void;
}
}

View File

@ -0,0 +1,27 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.service
{
public interface IUploadBandwidthService
{
function init():void;
}
}

View File

@ -0,0 +1,107 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.service
{
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.SecurityErrorEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.utils.getTimer;
import mx.formatters.NumberBaseRoundType;
import mx.formatters.NumberFormatter;
import org.bigbluebutton.clientcheck.model.ISystemConfiguration;
public class PingService implements IPingService
{
private var _urlLoader:URLLoader;
private var _urlRequest:URLRequest;
private static var NUM_OF_TESTS:Number=5;
private static var UNDEFINED:String="Undefined";
private static var HTTP:String="http://";
[Inject]
public var systemConfiguration:ISystemConfiguration;
public function init():void
{
_urlRequest=new URLRequest(HTTP + systemConfiguration.serverName);
_urlLoader=new URLLoader();
_urlLoader.addEventListener(Event.COMPLETE, urlLoaderLoadCompleteHandler);
_urlLoader.addEventListener(IOErrorEvent.IO_ERROR, urlLoaderIoErrorHandler);
_urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, urlLoaderSecurityErrorHandler);
_urlLoader.load(_urlRequest);
systemConfiguration.pingTest.startTime=getTimer();
}
protected function urlLoaderSecurityErrorHandler(event:SecurityErrorEvent):void
{
systemConfiguration.pingTest.testResult=UNDEFINED;
systemConfiguration.pingTest.testSuccessfull=false;
}
protected function urlLoaderIoErrorHandler(event:IOErrorEvent):void
{
systemConfiguration.pingTest.testResult=UNDEFINED;
systemConfiguration.pingTest.testSuccessfull=false;
}
protected function urlLoaderLoadCompleteHandler(event:Event):void
{
systemConfiguration.pingTest.endTime=getTimer();
var totalTime:Number=(systemConfiguration.pingTest.endTime - systemConfiguration.pingTest.startTime);
systemConfiguration.pingTest.testResultArray.push(totalTime);
if (systemConfiguration.pingTest.testResultArray.length >= NUM_OF_TESTS)
{
calculateResults();
}
else
{
init();
}
}
private function calculateResults():void
{
var totalResult:Number=0;
for (var i:int=0; i < systemConfiguration.pingTest.testResultArray.length; i++)
{
totalResult+=systemConfiguration.pingTest.testResultArray[i];
}
var formatter:NumberFormatter=new NumberFormatter();
formatter.precision=1;
formatter.rounding=NumberBaseRoundType.NEAREST;
var result:String=formatter.format(totalResult / systemConfiguration.pingTest.testResultArray.length);
systemConfiguration.pingTest.testResult=result + " ms";
systemConfiguration.pingTest.testSuccessfull=true;
}
}
}

View File

@ -0,0 +1,106 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.service
{
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.SecurityErrorEvent;
import flash.net.Socket;
import org.bigbluebutton.clientcheck.model.CustomSocket;
import org.bigbluebutton.clientcheck.model.ISystemConfiguration;
import org.bigbluebutton.clientcheck.model.test.PortTest;
public class PortTunnelingService implements IPortTunnelingService
{
[Inject]
public var systemConfiguration:ISystemConfiguration;
private var _socket:CustomSocket;
private var _sockets:Array=new Array;
public function init():void
{
for (var i:int=0; i < systemConfiguration.ports.length; i++)
{
try
{
_socket=new CustomSocket();
_sockets.push(_socket);
_socket.addEventListener(Event.CONNECT, socketConnectHandler);
_socket.addEventListener(IOErrorEvent.IO_ERROR, socketIoErrorHandler);
_socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, socketSecurityErrorHandler);
_socket.connect(systemConfiguration.serverName, systemConfiguration.ports[i].portNumber);
}
catch (error:Error)
{
// TODO: create a popup window here to notify user that error occured
}
}
}
private function getPortItemByPortName(port:String):PortTest
{
for (var i:int=0; i < systemConfiguration.ports.length; i++)
{
if (systemConfiguration.ports[i].portNumber == port)
return systemConfiguration.ports[i];
}
return null;
}
private function getSocketItemByPortName(port:int):CustomSocket
{
for (var i:int=0; i < _sockets.length; i++)
{
if (_sockets[i].port == port)
return _sockets[i];
}
return null;
}
protected function socketIoErrorHandler(event:IOErrorEvent):void
{
genericErrorHandler(event);
}
protected function socketConnectHandler(event:Event):void
{
var port:PortTest=getPortItemByPortName(event.currentTarget.port);
port.testResult=event.type;
port.testSuccessfull=true;
getSocketItemByPortName(event.currentTarget.port).close();
}
protected function socketSecurityErrorHandler(event:SecurityErrorEvent):void {
genericErrorHandler(event);
}
protected function genericErrorHandler(event:Event):void {
var port:PortTest=getPortItemByPortName(event.currentTarget.port);
port.testResult=event.type;
port.testSuccessfull=false;
getSocketItemByPortName(event.currentTarget.port).close();
}
}
}

View File

@ -0,0 +1,176 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.service
{
import flash.events.AsyncErrorEvent;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.NetStatusEvent;
import flash.events.SecurityErrorEvent;
import flash.net.NetConnection;
import org.bigbluebutton.clientcheck.model.ISystemConfiguration;
import org.bigbluebutton.clientcheck.model.test.RTMPAppTest;
public class RTMPTunnelingService implements IRTMPTunnelingService
{
[Inject]
public var systemConfiguration:ISystemConfiguration;
private var _netConnection:NetConnection;
private static var USER_NAME_MOCK:String="Test User";
private static var ROLE_MOCK:String="MODERATOR";
private static var ROOM_MOCK:String="room-mock-default";
private static var VOICE_BRIDGE_MOCK:String="85115";
private static var RECORD_MOCK:Boolean=false;
private static var EXTERNAL_USER_ID_MOCK:String="123456";
private static var INTERNAL_USER_ID_MOCK:String="654321";
private static var LOCK_ON_MOCK:Boolean=true;
public function init():void
{
for (var i:int=0; i < systemConfiguration.rtmpApps.length; i++)
{
_netConnection=new NetConnection();
_netConnection.client={};
registerListeners(_netConnection);
if (systemConfiguration.rtmpApps[i].applicationUri)
{
try
{
// sip has a different way of connecting to the red5 server, need to fake connection data.
if (systemConfiguration.rtmpApps[i].applicationUri.indexOf("sip") > 0)
{
_netConnection.connect(systemConfiguration.rtmpApps[i].applicationUri, ROOM_MOCK, EXTERNAL_USER_ID_MOCK, USER_NAME_MOCK);
continue;
}
else
{
// need to fake connection data
_netConnection.connect(systemConfiguration.rtmpApps[i].applicationUri, USER_NAME_MOCK, ROLE_MOCK, ROOM_MOCK, VOICE_BRIDGE_MOCK, RECORD_MOCK, EXTERNAL_USER_ID_MOCK, INTERNAL_USER_ID_MOCK, LOCK_ON_MOCK);
}
}
catch (error:Error)
{
// TODO: create a popup window here to notify user that error occured
}
}
}
}
private function registerListeners(nc:NetConnection):void
{
nc.addEventListener(NetStatusEvent.NET_STATUS, netStatus);
nc.addEventListener(AsyncErrorEvent.ASYNC_ERROR, netASyncError);
nc.addEventListener(SecurityErrorEvent.SECURITY_ERROR, netSecurityError);
nc.addEventListener(IOErrorEvent.IO_ERROR, netIOError);
}
private function unregisterListeners(nc:NetConnection):void
{
nc.removeEventListener(NetStatusEvent.NET_STATUS, netStatus);
nc.removeEventListener(AsyncErrorEvent.ASYNC_ERROR, netASyncError);
nc.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, netSecurityError);
nc.removeEventListener(IOErrorEvent.IO_ERROR, netIOError);
nc.close();
}
private function notifyErrorOccured(event:Event):void
{
var rtmpAppItem:RTMPAppTest=getRTMPAppItemByURI(event.currentTarget.uri);
if (rtmpAppItem)
{
if (event is IOErrorEvent)
{
rtmpAppItem.testResult="IOError";
}
else if (event is SecurityErrorEvent)
{
rtmpAppItem.testResult="SecurityError";
}
else if (event is AsyncErrorEvent)
{
rtmpAppItem.testResult="AsyncError";
}
rtmpAppItem.testSuccessfull=false;
unregisterListeners(event.target as NetConnection);
}
}
private function getRTMPAppItemByURI(applicationURI:String):RTMPAppTest
{
for (var i:int=0; i < systemConfiguration.rtmpApps.length; i++)
{
if (systemConfiguration.rtmpApps[i].applicationUri == applicationURI)
return systemConfiguration.rtmpApps[i];
}
return null;
}
protected function netStatus(event:NetStatusEvent):void
{
var info:Object=event.info;
var statusCode:String=info.code;
var rtmpAppItem:RTMPAppTest=getRTMPAppItemByURI(event.currentTarget.uri);
if (rtmpAppItem)
{
rtmpAppItem.testResult=statusCode;
switch (statusCode)
{
case "NetConnection.Connect.Success":
rtmpAppItem.testSuccessfull=true;
break;
default:
rtmpAppItem.testResult += ": " + info.description;
rtmpAppItem.testSuccessfull=false;
break;
}
unregisterListeners(event.target as NetConnection);
}
else
{
trace("Coudn't find rtmp app by applicationUri, skipping item: " + event.currentTarget.uri);
}
}
protected function netIOError(event:IOErrorEvent):void
{
notifyErrorOccured(event);
}
protected function netSecurityError(event:SecurityErrorEvent):void
{
notifyErrorOccured(event);
}
protected function netASyncError(event:AsyncErrorEvent):void
{
notifyErrorOccured(event);
}
}
}

View File

@ -0,0 +1,166 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.service
{
import flash.events.DataEvent;
import flash.events.Event;
import flash.events.HTTPStatusEvent;
import flash.events.IOErrorEvent;
import flash.events.ProgressEvent;
import flash.events.SecurityErrorEvent;
import flash.net.FileFilter;
import flash.net.FileReference;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
import flash.net.URLVariables;
import flash.utils.getTimer;
import mx.formatters.NumberBaseRoundType;
import mx.formatters.NumberFormatter;
import org.bigbluebutton.clientcheck.model.ISystemConfiguration;
public class UploadBandwidthService implements IUploadBandwidthService
{
private var _urlLoader:URLLoader;
private var _urlRequest:URLRequest;
private var fileToUpload:FileReference=new FileReference();
private var request:URLRequest=new URLRequest();
private var sendVars:URLVariables=new URLVariables();
private static var NUM_OF_TESTS:Number=1;
private static var UNDEFINED:String="Undefined";
private static var FAKE_DATA_NUM:Number=655360;
private static var TOTAL_BITS:Number=41943040;
private static var BYTES_IN_MBIT:Number=125000;
[Inject]
public var systemConfiguration:ISystemConfiguration;
private var obj:Object;
public function init():void
{
obj=create5MbObject();
_urlRequest=new URLRequest(systemConfiguration.applicationAddress + "test/clientTest.php");
_urlRequest.method=URLRequestMethod.POST;
_urlRequest.data=obj;
_urlLoader=new URLLoader();
_urlLoader.addEventListener(Event.COMPLETE, urlLoaderLoadCompleteHandler);
_urlLoader.addEventListener(IOErrorEvent.IO_ERROR, urlLoaderIoErrorHandler);
_urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, urlLoaderSecurityErrorHandler);
_urlLoader.load(_urlRequest);
}
protected function progressHandler(event:ProgressEvent):void
{
if (event.bytesLoaded == event.bytesTotal)
{
systemConfiguration.uploadBandwidthTest.endTime=getTimer();
var totalTime:Number=((systemConfiguration.uploadBandwidthTest.endTime - systemConfiguration.uploadBandwidthTest.startTime));
// convert bits to megabits
var totalMB:Number=(event.bytesTotal / BYTES_IN_MBIT);
// calculate download speed
var uploadSpeedTime:Number=totalMB / totalTime;
systemConfiguration.uploadBandwidthTest.testResultArray.push(uploadSpeedTime);
calculateResults();
}
}
protected function uploadCompleteHandler(event:DataEvent):void
{
}
protected function onSelectFile(event:Event):void
{
systemConfiguration.uploadBandwidthTest.startTime=getTimer();
fileToUpload.upload(request, "fileUpload", true);
}
/**
* fake 5 megabytes of data
* 5 megabytes = 41943040 bits, in order to generate it - we need to create an array of 64 bit Numbers = 64 * 655360;
*/
private function create5MbObject():Object
{
var obj:Array=new Array();
var num:Number;
for (var i:int=0; i < FAKE_DATA_NUM; i++)
{
num=new Number();
obj.push(num);
}
return obj;
}
protected function urlLoaderSecurityErrorHandler(event:SecurityErrorEvent):void
{
systemConfiguration.uploadBandwidthTest.testResult=UNDEFINED;
systemConfiguration.uploadBandwidthTest.testSuccessfull=false;
}
protected function urlLoaderIoErrorHandler(event:IOErrorEvent):void
{
if (event.errorID != 2038)
{ //upload works despite of this error.
systemConfiguration.uploadBandwidthTest.testResult=UNDEFINED;
systemConfiguration.uploadBandwidthTest.testSuccessfull=false;
}
}
protected function urlLoaderLoadCompleteHandler(event:Event):void
{
}
private function calculateResults():void
{
var totalResult:Number=0;
for (var i:int=0; i < systemConfiguration.uploadBandwidthTest.testResultArray.length; i++)
{
totalResult+=systemConfiguration.uploadBandwidthTest.testResultArray[i];
}
var formatter:NumberFormatter=new NumberFormatter();
formatter.precision=3;
formatter.rounding=NumberBaseRoundType.NEAREST;
var result:String=formatter.format(totalResult / systemConfiguration.uploadBandwidthTest.testResultArray.length);
systemConfiguration.uploadBandwidthTest.testResult=result + " Mbps";
systemConfiguration.uploadBandwidthTest.testSuccessfull=true;
}
}
}

View File

@ -0,0 +1,87 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.service.util
{
import flash.events.Event;
import flash.events.HTTPStatusEvent;
import flash.events.IOErrorEvent;
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
import mx.utils.ObjectUtil;
import org.osflash.signals.ISignal;
import org.osflash.signals.Signal;
public class URLFetcher
{
protected var _successSignal:Signal=new Signal();
protected var _unsuccessSignal:Signal=new Signal();
protected var _urlRequest:URLRequest=null;
protected var _responseUrl:String=null;
public function get successSignal():ISignal
{
return _successSignal;
}
public function get unsuccessSignal():ISignal
{
return _unsuccessSignal;
}
public function fetch(url:String, urlRequest:URLRequest=null, dataFormat:String=URLLoaderDataFormat.TEXT):void
{
trace("Fetching " + url);
_urlRequest=urlRequest;
if (_urlRequest == null)
{
_urlRequest=new URLRequest();
_urlRequest.method=URLRequestMethod.GET;
}
_urlRequest.url=url;
var urlLoader:URLLoader=new URLLoader();
urlLoader.addEventListener(Event.COMPLETE, handleComplete);
urlLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
urlLoader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
urlLoader.dataFormat=dataFormat;
urlLoader.load(_urlRequest);
}
private function httpStatusHandler(e:HTTPStatusEvent):void
{
// do nothing here
}
private function handleComplete(e:Event):void
{
successSignal.dispatch(e.target.data, _responseUrl, _urlRequest);
}
private function ioErrorHandler(e:IOErrorEvent):void
{
trace(ObjectUtil.toString(e));
unsuccessSignal.dispatch(e.text);
}
}
}

View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="400"
height="300">
<fx:Script>
<![CDATA[
import mx.managers.PopUpManager;
protected function closeButton_clickHandler(event:MouseEvent):void
{
PopUpManager.removePopUp(this);
}
]]>
</fx:Script>
<s:BorderContainer width="100%"
height="100%">
<s:layout>
<s:VerticalLayout paddingLeft="5"
paddingRight="5"
paddingTop="5"
paddingBottom="5"/>
</s:layout>
<mx:TextArea borderSkin="{null}"
editable="false"
text="{resourceManager.getString('resources', 'bbbsystemcheck.errorOccured')}"
styleName="windowTitleStyle"
width="400"
left="0"/>
<s:BorderContainer width="100%"
height="100%">
<s:layout>
<s:VerticalLayout paddingLeft="5"
paddingRight="5"
paddingTop="5"
paddingBottom="5"/>
</s:layout>
<mx:Text width="100%"
id="errorText"/>
</s:BorderContainer>
<s:BorderContainer width="100%"
height="100%">
<s:layout>
<s:HorizontalLayout horizontalAlign="right"
paddingLeft="5"
paddingRight="5"
paddingTop="5"
paddingBottom="5"/>
</s:layout>
<s:Button width="50"
height="50"
content="{resourceManager.getString('resources', 'bbbsystemcheck.closeButton')}"
click="closeButton_clickHandler(event)"/>
</s:BorderContainer>
</s:BorderContainer>
</s:TitleWindow>

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
clipAndEnableScrolling="true">
<fx:Script>
<![CDATA[
private static var FAILED:int = 1;
private static var WARNING:int = 2;
private static var LOADING:int = 3;
private static var SUCCEEDED:int = 4;
override public function prepare(hasBeenRecycled:Boolean):void
{
lblData.text = data[column.dataField];
}
override public function set data(value:Object):void
{
super.data=value;
switch (value.StatusPriority) {
case SUCCEEDED:
case LOADING:
colorRect.visible = false;
break;
case WARNING:
colorRect.visible = true;
solid.color = 0xFFFF00;
break;
case FAILED:
colorRect.visible = true;
solid.color = 0xFF0000;
break;
default:
colorRect.visible = false;
break;
}
}
]]>
</fx:Script>
<s:Rect id="colorRect" top="0" bottom="0" right="0" left="0">
<s:fill>
<s:SolidColor id="solid" alpha="0.4"/>
</s:fill>
</s:Rect>
<s:Label id="lblData"
top="9"
left="7"/>
</s:GridItemRenderer>

View File

@ -0,0 +1,26 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.view.mainview
{
public interface IMailButton
{
function dispose(): void;
}
}

View File

@ -0,0 +1,31 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.view.mainview
{
import spark.components.Button;
import spark.components.DataGrid;
import spark.components.BorderContainer;
public interface IMainView
{
function get dataGrid():DataGrid;
function get view():BorderContainer;
}
}

View File

@ -0,0 +1,26 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.view.mainview
{
public interface IRefreshButton
{
function dispose(): void;
}
}

View File

@ -0,0 +1,36 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.view.mainview
{
import spark.components.Button;
public class MailButton extends Button implements IMailButton
{
public function MailButton()
{
super();
}
public function dispose():void
{
}
}
}

View File

@ -0,0 +1,44 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.view.mainview
{
import robotlegs.bender.extensions.mediatorMap.api.IMediatorMap;
import robotlegs.bender.framework.api.IConfig;
import robotlegs.bender.framework.api.IInjector;
public class MailButtonConfig implements IConfig
{
[Inject]
public var injector:IInjector;
[Inject]
public var mediatorMap:IMediatorMap;
public function configure():void
{
configureMediators();
}
private function configureMediators():void
{
mediatorMap.map(IMailButton).toMediator(MailButtonMediator);
}
}
}

View File

@ -0,0 +1,118 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.view.mainview
{
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.net.URLVariables;
import flash.net.URLRequestMethod;
import flash.net.navigateToURL;
import mx.resources.ResourceManager;
import mx.collections.ArrayCollection;
import org.bigbluebutton.clientcheck.model.IXMLConfig;
import org.bigbluebutton.clientcheck.model.IDataProvider;
import robotlegs.bender.bundles.mvcs.Mediator;
public class MailButtonMediator extends Mediator
{
[Inject]
public var view: IMailButton;
[Inject]
public var config: IXMLConfig;
[Inject]
public var dp: IDataProvider;
private static var FAILED:int = 1;
private static var WARNING:int = 2;
private static var LOADING:int = 3;
private static var SUCCEEDED:int = 4;
/**
* Initialize listener
*/
override public function initialize():void
{
(view as MailButton).addEventListener(MouseEvent.CLICK, mouseClickHandler);
}
/**
* Handle events to compose email
*/
private function mouseClickHandler(e:MouseEvent):void
{
var mailMsg:URLRequest = new URLRequest('mailto:' + config.getMail());
var variables:URLVariables = new URLVariables();
variables.subject = signWithVersion(ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.title'));
variables.body = buildMailBody(dp.getData());
mailMsg.data = variables;
mailMsg.method = URLRequestMethod.GET;
navigateToURL(mailMsg, "_blank");
}
/**
* Concatenate with the client-check version
*/
private function signWithVersion(value:String):String
{
return value + " " + config.getVersion();
}
public function buildMailBody(data:ArrayCollection):String {
var body:String = "";
var statusPriority:int = 0;
for (var i:int = 0; i < data.length; i++)
{
if (data.getItemAt(i).StatusPriority != statusPriority)
{
statusPriority = data.getItemAt(i).StatusPriority;
var statusName:String = "";
switch (statusPriority)
{
case FAILED:
statusName = ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.status.failed');
break;
case WARNING:
statusName = ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.status.warning');
break;
case LOADING:
statusName = ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.status.loading');
break;
case SUCCEEDED:
statusName = ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.status.succeeded');
break;
default:
trace("Bad status name at MailButtonMediator!")
break;
}
body += "\n" + statusName + "\n";
}
body += data.getItemAt(i).Item + ":\t\t" + data.getItemAt(i).Result + "\n";
}
return body;
}
}
}

View File

@ -0,0 +1,83 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.view.mainview
{
import flash.events.ContextMenuEvent;
import flash.events.Event;
import flash.system.System;
import flash.ui.ContextMenu;
import flash.ui.ContextMenuItem;
import mx.events.FlexEvent;
import spark.components.BorderContainer;
import spark.components.Button;
import spark.components.DataGrid;
public class MainView extends MainViewBase implements IMainView
{
public function MainView():void
{
super.addEventListener(FlexEvent.CREATION_COMPLETE, creationCompleteHandler);
}
protected function creationCompleteHandler(event:Event):void
{
var contextMenu:ContextMenu=new ContextMenu();
contextMenu.hideBuiltInItems();
var copyAllButton:ContextMenuItem=new ContextMenuItem(resourceManager.getString('resources', 'bbbsystemcheck.copyAllText'));
copyAllButton.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuItemHandler);
contextMenu.customItems.push(copyAllButton);
this.contextMenu=contextMenu;
}
protected function menuItemHandler(e:ContextMenuEvent):void
{
if (e.target.caption == resourceManager.getString('resources', 'bbbsystemcheck.copyAllText'))
{
System.setClipboard(getAllInfoAsString());
}
}
private function getAllInfoAsString():String
{
var info:String="";
for (var i:int=0; i < dataGrid.dataProvider.length; i++)
{
info+=dataGrid.dataProvider.getItemAt(i).Item + ": " + dataGrid.dataProvider.getItemAt(i).Result + " : " + dataGrid.dataProvider.getItemAt(i).Status + "\n";
}
return info;
}
public function get dataGrid():DataGrid
{
return _dataGrid;
}
public function get view():BorderContainer
{
return super;
}
}
}

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<s:BorderContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="100%"
height="100%"
cornerRadius="10"
borderStyle="inset"
borderWeight="4">
<fx:Script>
<![CDATA[
import spark.components.gridClasses.GridSelectionMode;
]]>
</fx:Script>
<s:layout>
<s:VerticalLayout paddingLeft="10"
paddingRight="10"
paddingTop="10"
paddingBottom="10"/>
</s:layout>
<s:DataGrid width="100%"
height="100%"
id="_dataGrid"
selectionMode="{GridSelectionMode.NONE}"
itemRenderer="org.bigbluebutton.clientcheck.view.mainview.CustomItemRenderer">
<s:columns>
<s:ArrayList>
<s:GridColumn dataField="Item" headerText="{resourceManager.getString('resources', 'bbbsystemcheck.dataGridColumn.item')}" width="200"/>
<s:GridColumn dataField="Result" headerText="{resourceManager.getString('resources', 'bbbsystemcheck.dataGridColumn.result')}" width="500"/>
<s:GridColumn dataField="StatusMessage" headerText="{resourceManager.getString('resources', 'bbbsystemcheck.dataGridColumn.status')}"/>
</s:ArrayList>
</s:columns>
<s:ArrayCollection>
<fx:Object>
<fx:Item/>
<fx:Status/>
<fx:Result/>
</fx:Object>
</s:ArrayCollection>
</s:DataGrid>
</s:BorderContainer>

View File

@ -0,0 +1,54 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.view.mainview
{
import robotlegs.bender.extensions.mediatorMap.api.IMediatorMap;
import robotlegs.bender.extensions.signalCommandMap.api.ISignalCommandMap;
import robotlegs.bender.framework.api.IConfig;
import robotlegs.bender.framework.api.IInjector;
public class MainViewConfig implements IConfig
{
[Inject]
public var injector:IInjector;
[Inject]
public var mediatorMap:IMediatorMap;
[Inject]
public var signalCommandMap:ISignalCommandMap;
public function configure():void
{
configureMediators();
configureSignalsToCommands();
}
private function configureSignalsToCommands():void
{
}
private function configureMediators():void
{
mediatorMap.map(IMainView).toMediator(MainViewMediator);
}
}
}

View File

@ -0,0 +1,355 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.clientcheck.view.mainview
{
import flash.events.Event;
import flash.events.MouseEvent;
import mx.collections.ArrayCollection;
import mx.resources.ResourceManager;
import org.bigbluebutton.clientcheck.command.GetConfigXMLDataSignal;
import org.bigbluebutton.clientcheck.command.RequestBandwidthInfoSignal;
import org.bigbluebutton.clientcheck.command.RequestBrowserInfoSignal;
import org.bigbluebutton.clientcheck.command.RequestPortsSignal;
import org.bigbluebutton.clientcheck.command.RequestRTMPAppsSignal;
import org.bigbluebutton.clientcheck.model.ISystemConfiguration;
import org.bigbluebutton.clientcheck.model.IXMLConfig;
import org.bigbluebutton.clientcheck.model.IDataProvider;
import org.bigbluebutton.clientcheck.model.test.BrowserTest;
import org.bigbluebutton.clientcheck.model.test.CookieEnabledTest;
import org.bigbluebutton.clientcheck.model.test.DownloadBandwidthTest;
import org.bigbluebutton.clientcheck.model.test.FlashVersionTest;
import org.bigbluebutton.clientcheck.model.test.IsPepperFlashTest;
import org.bigbluebutton.clientcheck.model.test.JavaEnabledTest;
import org.bigbluebutton.clientcheck.model.test.LanguageTest;
import org.bigbluebutton.clientcheck.model.test.PingTest;
import org.bigbluebutton.clientcheck.model.test.PortTest;
import org.bigbluebutton.clientcheck.model.test.RTMPAppTest;
import org.bigbluebutton.clientcheck.model.test.ScreenSizeTest;
import org.bigbluebutton.clientcheck.model.test.UploadBandwidthTest;
import org.bigbluebutton.clientcheck.model.test.UserAgentTest;
import org.bigbluebutton.clientcheck.model.test.WebRTCEchoTest;
import org.bigbluebutton.clientcheck.model.test.WebRTCSocketTest;
import org.bigbluebutton.clientcheck.model.test.WebRTCSupportedTest;
import org.bigbluebutton.clientcheck.service.IExternalApiCallbacks;
import robotlegs.bender.bundles.mvcs.Mediator;
public class MainViewMediator extends Mediator
{
[Inject]
public var view:IMainView;
[Inject]
public var systemConfiguration:ISystemConfiguration;
[Inject]
public var externalApiCallbacks:IExternalApiCallbacks;
[Inject]
public var requestBrowserInfoSignal:RequestBrowserInfoSignal;
[Inject]
public var requestRTMPAppsInfoSignal:RequestRTMPAppsSignal;
[Inject]
public var requestPortsInfoSignal:RequestPortsSignal;
[Inject]
public var requestBandwidthInfoSignal:RequestBandwidthInfoSignal;
[Inject]
public var getConfigXMLDataSignal:GetConfigXMLDataSignal;
[Inject]
public var config:IXMLConfig;
[Inject]
public var dp:IDataProvider;
private static var VERSION:String=ResourceManager.getInstance().getString('resources', 'bbbsystemcheck.version');
override public function initialize():void
{
super.initialize();
view.view.addEventListener(Event.ADDED_TO_STAGE, viewAddedToStageHandler);
}
protected function viewAddedToStageHandler(event:Event):void
{
getConfigXMLDataSignal.dispatch();
config.configParsedSignal.add(configParsedHandler);
}
private function configParsedHandler():void
{
initPropertyListeners();
initDataProvider();
view.dataGrid.dataProvider=dp.getData();
requestBrowserInfoSignal.dispatch();
requestRTMPAppsInfoSignal.dispatch();
requestPortsInfoSignal.dispatch();
requestBandwidthInfoSignal.dispatch();
}
private function initPropertyListeners():void
{
systemConfiguration.userAgent.userAgentTestSuccessfullChangedSignal.add(userAgentChangedHandler);
systemConfiguration.browser.browserTestSuccessfullChangedSignal.add(browserChangedHandler);
systemConfiguration.screenSize.screenSizeTestSuccessfullChangedSignal.add(screenSizeChangedHandler);
systemConfiguration.flashVersion.flashVersionTestSuccessfullChangedSignal.add(flashVersionChangedHandler);
systemConfiguration.isPepperFlash.pepperFlashTestSuccessfullChangedSignal.add(isPepperFlashChangedHandler);
systemConfiguration.cookieEnabled.cookieEnabledTestSuccessfullChangedSignal.add(cookieEnabledChangedHandler);
systemConfiguration.language.languageTestSuccessfullChangedSignal.add(languageChangedHandler);
systemConfiguration.javaEnabled.javaEnabledTestSuccessfullChangedSignal.add(javaEnabledChangedHandler);
systemConfiguration.isWebRTCSupported.webRTCSupportedTestSuccessfullChangedSignal.add(isWebRTCSupportedChangedHandler);
systemConfiguration.webRTCEchoTest.webRTCEchoTestSuccessfullChangedSignal.add(webRTCEchoTestChangedHandler);
systemConfiguration.webRTCSocketTest.webRTCSocketTestSuccessfullChangedSignal.add(webRTCSocketTestChangedHandler);
systemConfiguration.downloadBandwidthTest.downloadSpeedTestSuccessfullChangedSignal.add(downloadSpeedTestChangedHandler);
systemConfiguration.uploadBandwidthTest.uploadSpeedTestSuccessfullChangedSignal.add(uploadSpeedTestChangedHandler);
systemConfiguration.pingTest.pingSpeedTestSuccessfullChangedSignal.add(pingSpeedTestChangedHandler);
for (var i:int=0; i < systemConfiguration.rtmpApps.length; i++)
{
systemConfiguration.rtmpApps[i].connectionResultSuccessfullChangedSignal.add(rtmpAppConnectionResultSuccessfullChangedHandler);
}
for (var j:int=0; j < systemConfiguration.ports.length; j++)
{
systemConfiguration.ports[j].tunnelResultSuccessfullChangedSignal.add(tunnelResultSuccessfullChangedHandler);
}
}
/**
* Gather all Item names even before it's tested
*/
private function initDataProvider():void
{
dp.addData({Item: BrowserTest.BROWSER, Result: null}, StatusENUM.LOADING);
dp.addData({Item: CookieEnabledTest.COOKIE_ENABLED, Result: null}, StatusENUM.LOADING);
dp.addData({Item: DownloadBandwidthTest.DOWNLOAD_SPEED, Result: null}, StatusENUM.LOADING);
dp.addData({Item: FlashVersionTest.FLASH_VERSION, Result: null}, StatusENUM.LOADING);
dp.addData({Item: IsPepperFlashTest.PEPPER_FLASH, Result: null}, StatusENUM.LOADING);
dp.addData({Item: JavaEnabledTest.JAVA_ENABLED, Result: null}, StatusENUM.LOADING);
dp.addData({Item: LanguageTest.LANGUAGE, Result: null}, StatusENUM.LOADING);
dp.addData({Item: PingTest.PING, Result: null}, StatusENUM.LOADING);
dp.addData({Item: ScreenSizeTest.SCREEN_SIZE, Result: null}, StatusENUM.LOADING);
// The upload is not working right now
// dp.addData({Item: UploadBandwidthTest.UPLOAD_SPEED, Result: "This is supposed to be failing right now"}, StatusENUM.FAILED);
dp.addData({Item: UserAgentTest.USER_AGENT, Result: null}, StatusENUM.LOADING);
dp.addData({Item: WebRTCEchoTest.WEBRTC_ECHO_TEST, Result: null}, StatusENUM.LOADING);
dp.addData({Item: WebRTCSocketTest.WEBRTC_SOCKET_TEST, Result: null}, StatusENUM.LOADING);
dp.addData({Item: WebRTCSupportedTest.WEBRTC_SUPPORTED, Result: null}, StatusENUM.LOADING);
if (systemConfiguration.rtmpApps)
{
for (var i:int=0; i < systemConfiguration.rtmpApps.length; i++)
{
dp.addData({Item: systemConfiguration.rtmpApps[i].applicationName, Result: null}, StatusENUM.LOADING);
}
}
if (systemConfiguration.ports)
{
for (var j:int=0; j < systemConfiguration.ports.length; j++)
{
dp.addData({Item: systemConfiguration.ports[j].portName, Result: null}, StatusENUM.LOADING);
}
}
dp.addData({Item: VERSION, Result: config.getVersion()}, StatusENUM.SUCCEED);
}
/**
* When RTMPApp item is getting updated we receive notification with 'applicationUri' of updated item
* We need to retrieve this item from the list of the available items and put it inside datagrid
**/
private function getRTMPAppItemByURI(applicationUri:String):RTMPAppTest
{
for (var i:int=0; i < systemConfiguration.rtmpApps.length; i++)
{
if (systemConfiguration.rtmpApps[i].applicationUri == applicationUri)
return systemConfiguration.rtmpApps[i];
}
return null;
}
private function rtmpAppConnectionResultSuccessfullChangedHandler(applicationUri:String):void
{
var appObj:RTMPAppTest=getRTMPAppItemByURI(applicationUri);
if (appObj)
{
var status:Object = (appObj.testSuccessfull == true) ? StatusENUM.SUCCEED : StatusENUM.FAILED;
dp.updateData({Item: appObj.applicationName, Result: appObj.testResult}, status);
}
else
{
trace("Coudn't find rtmp app by applicationUri, skipping item: " + applicationUri);
}
}
private function getPortItemByPortName(port:String):PortTest
{
for (var i:int=0; i < systemConfiguration.ports.length; i++)
{
if (systemConfiguration.ports[i].portNumber == port)
return systemConfiguration.ports[i];
}
return null;
}
private function tunnelResultSuccessfullChangedHandler(port:String):void
{
var portObj:PortTest=getPortItemByPortName(port);
if (portObj)
{
var status:Object = (portObj.testSuccessfull == true) ? StatusENUM.SUCCEED : StatusENUM.FAILED;
dp.updateData({Item: portObj.portName, Result: portObj.testResult}, status);
}
else
{
trace("Coudn't find port by port name, skipping item: " + port);
}
}
private function pingSpeedTestChangedHandler():void
{
var status:Object = (systemConfiguration.pingTest.testSuccessfull == true) ? StatusENUM.SUCCEED : StatusENUM.FAILED;
dp.updateData({Item: PingTest.PING, Result: systemConfiguration.pingTest.testResult}, status);
}
private function downloadSpeedTestChangedHandler():void
{
var status:Object = (systemConfiguration.downloadBandwidthTest.testSuccessfull == true) ? StatusENUM.SUCCEED : StatusENUM.FAILED;
dp.updateData({Item: DownloadBandwidthTest.DOWNLOAD_SPEED, Result: systemConfiguration.downloadBandwidthTest.testResult}, status);
}
private function uploadSpeedTestChangedHandler():void
{
var status:Object = (systemConfiguration.uploadBandwidthTest.testSuccessfull == true) ? StatusENUM.SUCCEED : StatusENUM.FAILED;
dp.updateData({Item: UploadBandwidthTest.UPLOAD_SPEED, Result: systemConfiguration.uploadBandwidthTest.testResult}, status);
}
private function webRTCSocketTestChangedHandler():void
{
var status:Object = (systemConfiguration.webRTCSocketTest.testSuccessfull == true) ? StatusENUM.SUCCEED : StatusENUM.FAILED;
dp.updateData({Item: WebRTCSocketTest.WEBRTC_SOCKET_TEST, Result: systemConfiguration.webRTCSocketTest.testResult}, status);
}
private function webRTCEchoTestChangedHandler():void
{
var status:Object = (systemConfiguration.webRTCEchoTest.testSuccessfull == true) ? StatusENUM.SUCCEED : StatusENUM.FAILED;
dp.updateData({Item: WebRTCEchoTest.WEBRTC_ECHO_TEST, Result: systemConfiguration.webRTCEchoTest.testResult}, status);
}
private function isPepperFlashChangedHandler():void
{
var status:Object = (systemConfiguration.isPepperFlash.testSuccessfull == true) ? StatusENUM.SUCCEED : StatusENUM.FAILED;
dp.updateData({Item: IsPepperFlashTest.PEPPER_FLASH, Result: systemConfiguration.isPepperFlash.testResult}, status);
}
private function languageChangedHandler():void
{
var status:Object = (systemConfiguration.language.testSuccessfull == true) ? StatusENUM.SUCCEED : StatusENUM.FAILED;
dp.updateData({Item: LanguageTest.LANGUAGE, Result: systemConfiguration.language.testResult}, status);
}
private function javaEnabledChangedHandler():void
{
var status:Object = (systemConfiguration.javaEnabled.testSuccessfull == true) ? StatusENUM.SUCCEED : StatusENUM.WARNING;
dp.updateData({Item: JavaEnabledTest.JAVA_ENABLED, Result: systemConfiguration.javaEnabled.testResult}, status);
}
private function isWebRTCSupportedChangedHandler():void
{
var status:Object = (systemConfiguration.isWebRTCSupported.testSuccessfull == true) ? StatusENUM.SUCCEED : StatusENUM.FAILED;
dp.updateData({Item: WebRTCSupportedTest.WEBRTC_SUPPORTED, Result: systemConfiguration.isWebRTCSupported.testResult}, status);
}
private function cookieEnabledChangedHandler():void
{
var status:Object = (systemConfiguration.cookieEnabled.testSuccessfull == true) ? StatusENUM.SUCCEED : StatusENUM.FAILED;
dp.updateData({Item: CookieEnabledTest.COOKIE_ENABLED, Result: systemConfiguration.cookieEnabled.testResult}, status);
}
private function screenSizeChangedHandler():void
{
var status:Object = (systemConfiguration.screenSize.testSuccessfull == true) ? StatusENUM.SUCCEED : StatusENUM.FAILED;
dp.updateData({Item: ScreenSizeTest.SCREEN_SIZE, Result: systemConfiguration.screenSize.testResult}, status);
}
private function browserChangedHandler():void
{
var status:Object = (systemConfiguration.browser.testSuccessfull == true) ? StatusENUM.SUCCEED : StatusENUM.FAILED;
dp.updateData({Item: BrowserTest.BROWSER, Result: systemConfiguration.browser.testResult}, status);
}
private function userAgentChangedHandler():void
{
var status:Object = (systemConfiguration.userAgent.testSuccessfull == true) ? StatusENUM.SUCCEED : StatusENUM.FAILED;
dp.updateData({Item: UserAgentTest.USER_AGENT, Result: systemConfiguration.userAgent.testResult}, status);
}
private function flashVersionChangedHandler():void
{
var status:Object = (systemConfiguration.flashVersion.testSuccessfull == true) ? StatusENUM.SUCCEED : StatusENUM.FAILED;
dp.updateData({Item: FlashVersionTest.FLASH_VERSION, Result: systemConfiguration.flashVersion.testResult}, status);
}
override public function destroy():void
{
if (systemConfiguration.rtmpApps)
{
for (var i:int=0; i < systemConfiguration.rtmpApps.length; i++)
{
systemConfiguration.rtmpApps[i].connectionResultSuccessfullChangedSignal.remove(rtmpAppConnectionResultSuccessfullChangedHandler);
}
}
if (systemConfiguration.ports)
{
for (var j:int=0; j < systemConfiguration.ports.length; j++)
{
systemConfiguration.ports[j].tunnelResultSuccessfullChangedSignal.remove(tunnelResultSuccessfullChangedHandler);
}
}
systemConfiguration.screenSize.screenSizeTestSuccessfullChangedSignal.remove(screenSizeChangedHandler);
systemConfiguration.userAgent.userAgentTestSuccessfullChangedSignal.remove(userAgentChangedHandler);
systemConfiguration.browser.browserTestSuccessfullChangedSignal.remove(browserChangedHandler);
systemConfiguration.flashVersion.flashVersionTestSuccessfullChangedSignal.remove(flashVersionChangedHandler);
systemConfiguration.isPepperFlash.pepperFlashTestSuccessfullChangedSignal.remove(isPepperFlashChangedHandler);
systemConfiguration.cookieEnabled.cookieEnabledTestSuccessfullChangedSignal.remove(cookieEnabledChangedHandler);
systemConfiguration.webRTCEchoTest.webRTCEchoTestSuccessfullChangedSignal.remove(webRTCEchoTestChangedHandler);
systemConfiguration.webRTCSocketTest.webRTCSocketTestSuccessfullChangedSignal.remove(webRTCSocketTestChangedHandler);
systemConfiguration.language.languageTestSuccessfullChangedSignal.remove(languageChangedHandler);
systemConfiguration.javaEnabled.javaEnabledTestSuccessfullChangedSignal.remove(javaEnabledChangedHandler);
systemConfiguration.isWebRTCSupported.webRTCSupportedTestSuccessfullChangedSignal.remove(isWebRTCSupportedChangedHandler);
systemConfiguration.downloadBandwidthTest.downloadSpeedTestSuccessfullChangedSignal.remove(downloadSpeedTestChangedHandler);
systemConfiguration.uploadBandwidthTest.uploadSpeedTestSuccessfullChangedSignal.remove(uploadSpeedTestChangedHandler);
systemConfiguration.pingTest.pingSpeedTestSuccessfullChangedSignal.remove(pingSpeedTestChangedHandler);
super.destroy();
}
}
}

Some files were not shown because too many files have changed in this diff Show More