This commit is contained in:
Oleksandr Zhurbenko 2015-02-24 09:23:17 -08:00
commit 138ae3f353
14 changed files with 165 additions and 120 deletions

View File

@ -14,7 +14,7 @@ String locIP=request.getLocalAddr();
<running><%= isMeetingRunning(request.getParameter("meetingID")) %></running>
</response>
<% } else if(request.getParameter("command").equals("getRecords")){%>
<%= getRecordings("English 101,English 102,English 103,English 104,English 105,english 106,English 107,English 108,English 109,English 110")%>
<%= getRecordings("English 101,English 102,English 103,English 104,English 105,English 106,English 107,English 108,English 109,English 110")%>
<% } else if(request.getParameter("command").equals("publish")||request.getParameter("command").equals("unpublish")){%>
<%= setPublishRecordings( (request.getParameter("command").equals("publish")) ? true : false , request.getParameter("recordID"))%>
<% } else if(request.getParameter("command").equals("delete")){%>

View File

@ -62,7 +62,6 @@ package org.bigbluebutton.core.model
var a:Object = new Object();
a.uri = config.application.@uri;
a.host = config.application.@host;
a.stuns = config.application.@stuns;
return a;
}

View File

@ -35,8 +35,8 @@ package org.bigbluebutton.main.model {
private var uri:String;
private var modulesDispatcher:ModulesDispatcher;
public function PortTestProxy() {
modulesDispatcher = new ModulesDispatcher();
public function PortTestProxy(modulesDispatcher: ModulesDispatcher) {
this.modulesDispatcher = modulesDispatcher;
}
public function connect(protocol:String = "", hostname:String = "", port:String = "", application:String = "", testTimeout:Number = 10000):void {

View File

@ -0,0 +1,90 @@
package org.bigbluebutton.main.model.modules
{
import com.asfusion.mate.events.Dispatcher;
import flash.events.*;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
import flash.net.URLVariables;
import flash.net.navigateToURL;
import mx.collections.ArrayCollection;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.core.model.Me;
import org.bigbluebutton.core.model.MeBuilder;
import org.bigbluebutton.core.model.MeetingBuilder;
import org.bigbluebutton.core.model.MeetingModel;
import org.bigbluebutton.core.model.StunOption;
import org.bigbluebutton.core.model.users.User;
import org.bigbluebutton.core.model.users.UsersModel;
import org.bigbluebutton.main.events.MeetingNotFoundEvent;
import org.bigbluebutton.main.model.users.events.ConnectionFailedEvent;
public class EnterApiService
{
private static const LOG:String = "Modules::EnterApiService - ";
private var request:URLRequest = new URLRequest();
private var vars:URLVariables = new URLVariables();
private var urlLoader:URLLoader;
private var _resultListener:Function;
public function EnterApiService()
{
urlLoader = new URLLoader();
}
public function load(url:String):void {
var date:Date = new Date();
trace(LOG + "load " + url);
request = new URLRequest(url);
request.method = URLRequestMethod.GET;
urlLoader.addEventListener(Event.COMPLETE, handleComplete);
urlLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
urlLoader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
urlLoader.load(request);
}
public function addResultListener(listener:Function):void {
_resultListener = listener;
}
private function httpStatusHandler(event:HTTPStatusEvent):void {
LogUtil.debug(LOG + "httpStatusHandler: " + event);
}
private function ioErrorHandler(event:IOErrorEvent):void {
trace(LOG + "ioErrorHandler: " + event);
if (_resultListener != null) _resultListener(false, null);
}
private function handleComplete(e:Event):void {
var result:Object = JSON.parse(e.target.data);
trace(LOG + "Enter response = " + JSON.stringify(result));
var returncode:String = result.response.returncode;
if (returncode == 'FAILED') {
trace(LOG + "Enter API call FAILED = " + JSON.stringify(result));
var dispatcher:Dispatcher = new Dispatcher();
dispatcher.dispatchEvent(new MeetingNotFoundEvent(result.response.logoutURL));
} else if (returncode == 'SUCCESS') {
trace(LOG + "Enter API call SUCESS = " + JSON.stringify(result));
var response:Object = new Object();
response.username = result.response.fullname;
response.userId = result.response.internalUserID;
response.meetingName = result.response.confname;
response.meetingId = result.response.meetingID;
if (_resultListener != null) _resultListener(true, response);
}
}
public function get loader():URLLoader{
return this.urlLoader;
}
}
}

View File

@ -51,17 +51,15 @@ package org.bigbluebutton.main.model.modules
private var modulesDispatcher:ModulesDispatcher;
public function ModuleManager()
public function ModuleManager(modulesDispatcher: ModulesDispatcher)
{
_applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
modulesDispatcher = new ModulesDispatcher();
this.modulesDispatcher = modulesDispatcher;
_applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
configParameters = new ConfigParameters(handleComplete);
}
private function handleComplete():void{
var modules:Dictionary = configParameters.getModules();
modulesDispatcher.sendPortTestEvent();
var modules:Dictionary = configParameters.getModules();
for (var key:Object in modules) {
var m:ModuleDescriptor = modules[key] as ModuleDescriptor;
m.setApplicationDomain(_applicationDomain);
@ -71,6 +69,8 @@ package org.bigbluebutton.main.model.modules
sorted = resolver.buildDependencyTree(modules);
modulesDispatcher.sendConfigParameters(configParameters);
modulesDispatcher.sendPortTestEvent();
}
public function useProtocol(protocol:String):void {

View File

@ -24,6 +24,7 @@ package org.bigbluebutton.main.model.modules
import flash.utils.Timer;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.core.vo.Config;
import org.bigbluebutton.core.vo.ConfigBuilder;
@ -34,15 +35,20 @@ package org.bigbluebutton.main.model.modules
import org.bigbluebutton.main.events.PortTestEvent;
import org.bigbluebutton.main.events.UserServicesEvent;
import org.bigbluebutton.main.model.ConfigParameters;
import org.bigbluebutton.main.model.modules.EnterApiService;
public class ModulesDispatcher
{
private static const LOG:String = "Main::ModulesDispatcher - ";
private var dispatcher:Dispatcher;
private var enterApiService: EnterApiService;
private var meetingInfo:Object = new Object();
private var enterApiUrl:String;
public function ModulesDispatcher()
{
dispatcher = new Dispatcher();
}
public function sendLoadProgressEvent(moduleName:String, loadProgress:Number):void{
@ -73,11 +79,38 @@ package org.bigbluebutton.main.model.modules
dispatcher.dispatchEvent(e);
}
public function sendPortTestEvent():void{
public function sendPortTestEvent():void {
getMeetingAndUserInfo();
}
private function getMeetingAndUserInfo():void {
enterApiService = new EnterApiService();
enterApiService.addResultListener(resultListener);
enterApiService.load(enterApiUrl);
}
private function resultListener(success:Boolean, result:Object):void {
if (success) {
trace(LOG + "Saving meeting and user info " + JSON.stringify(result));
meetingInfo.username = result.username;
meetingInfo.userId = result.userId;
meetingInfo.meetingName = result.meetingName;
meetingInfo.meetingId = result.meetingId;
doPortTesting();
} else {
var logData:Object = new Object();
JSLog.critical("Failed to get meeting and user info from Enter API", logData);
dispatcher.dispatchEvent(new PortTestEvent(PortTestEvent.TUNNELING_FAILED));
}
}
private function doPortTesting():void {
trace(LOG + "Sending TEST_RTMP Event");
var e:PortTestEvent = new PortTestEvent(PortTestEvent.TEST_RTMP);
dispatcher.dispatchEvent(e);
dispatcher.dispatchEvent(e);
}
private function timerHandler(e:TimerEvent):void{
@ -91,7 +124,12 @@ package org.bigbluebutton.main.model.modules
var logData:Object = new Object();
logData.server = server;
logData.app = app;
JSLog.info("Failed RTMP and RTMPT test connection.", logData);
logData.userId = meetingInfo.userId;
logData.username = meetingInfo.username;
logData.meetingName = meetingInfo.meetingName;
logData.meetingId = meetingInfo.meetingId;
trace(LOG + "Cannot connect to Red5 using RTMP and RTMPT", JSON.stringify(logData));
JSLog.critical("Cannot connect to Red5 using RTMP and RTMPT", logData);
dispatcher.dispatchEvent(new PortTestEvent(PortTestEvent.TUNNELING_FAILED));
}
@ -103,6 +141,10 @@ package org.bigbluebutton.main.model.modules
logData.server = host;
logData.protocol = protocol;
logData.app = app;
logData.userId = meetingInfo.userId;
logData.username = meetingInfo.username;
logData.meetingName = meetingInfo.meetingName;
logData.meetingId = meetingInfo.meetingId;
JSLog.info("Successfully connected on test connection.", logData);
var portEvent:PortTestEvent = new PortTestEvent(PortTestEvent.PORT_TEST_SUCCESS);
@ -132,6 +174,8 @@ package org.bigbluebutton.main.model.modules
}
public function sendConfigParameters(c:ConfigParameters):void{
enterApiUrl = c.host;
var event:ConfigEvent = new ConfigEvent(ConfigEvent.CONFIG_EVENT);
var config:Config;
config = new ConfigBuilder(c.version, c.localeVersion)

View File

@ -35,8 +35,8 @@ package org.bigbluebutton.main.model.modules
public function ModulesProxy() {
modulesDispatcher = new ModulesDispatcher();
portTestProxy = new PortTestProxy();
modulesManager = new ModuleManager();
portTestProxy = new PortTestProxy(modulesDispatcher);
modulesManager = new ModuleManager(modulesDispatcher);
}
public function get username():String {

View File

@ -26,9 +26,7 @@ package org.bigbluebutton.main.model.users
import flash.net.URLRequestMethod;
import flash.net.URLVariables;
import flash.net.navigateToURL;
import mx.collections.ArrayCollection;
import mx.collections.ArrayCollection;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.core.model.Me;
@ -154,71 +152,7 @@ package org.bigbluebutton.main.model.users
}
}
private function loadStuns():void {
var stunOptions: StunOption = new StunOption();
stunOptions.parseOptions();
if (stunOptions.stuns) {
request = new URLRequest(stunOptions.stuns);
request.method = URLRequestMethod.GET;
urlLoader.removeEventListener(Event.COMPLETE, handleComplete);
urlLoader.addEventListener(Event.COMPLETE, handleCompleteStuns);
urlLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
urlLoader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
urlLoader.load(request);
}
}
private function handleCompleteStuns(e:Event):void {
var result:Object = JSON.parse(e.target.data);
trace(LOG + "Stun response = " + JSON.stringify(result));
var stunAndTurnServers: Object = new Object();
stunAndTurnServers.stuns = decodeStunServers(result);
stunAndTurnServers.turns = decodeTurnServers(result);
MeetingModel.getInstance().stunAndTurnServers = stunAndTurnServers;
//trace(LOG + "STUNS=[" + JSON.stringify(MeetingModel.getInstance().stunAndTurnServers) + "]");
}
private function decodeStunServers(result: Object):Object {
var stunServers: ArrayCollection = new ArrayCollection();
if (result.hasOwnProperty("stunServers")) {
var stunsArray:Array = result.stunServers as Array;
for each (var stun:Object in stunsArray) {
var stunData:Object = new Object();
for (var id:String in stun) {
var value:String = stun[id] as String;
stunData[id] = value;
}
stunServers.addItem(stunData);
}
}
return stunServers;
}
private function decodeTurnServers(result: Object):Object {
var turnServers: ArrayCollection = new ArrayCollection();
if (result.hasOwnProperty("turnServers")) {
var turnsArray:Array = result.turnServers as Array;
for each (var turn:Object in turnsArray) {
var turnData:Object = new Object();
for (var id:String in turn) {
var value:Object = turn[id] as Object;
turnData[id] = value;
}
turnServers.addItem(turnData);
}
}
return turnServers;
}
public function get loader():URLLoader{
return this.urlLoader;
}

View File

@ -210,31 +210,6 @@ Handlebars.registerHelper "visibility", (section) ->
tabs.push {userId: u.userId, name: u.username, gotMail: false, class: 'privateChatTab'}
setInSession 'chatTabs', tabs
@resizeWindows = ->
chat = $('#chat')
navbarHeight = $('#navbar').height()
footerHeight = $('#footer').height()
bodyHeight = $('body').height()
margins = parseInt(chat.css('margin-top'))*2 # *2 for top & bottom
paddingSpace = 10
windowHeight = ( bodyHeight - ( navbarHeight + footerHeight + margins + paddingSpace ) )
if window.matchMedia('(orientation: landscape)').matches
chat.height(windowHeight + 'px') #TODO move to stylesheets
$("#chatbody").height( (windowHeight- ($("#chatInput").outerHeight())*2) + 'px') #TODO move to stylesheets
$("#users").height((windowHeight-paddingSpace) + 'px') #TODO move to stylesheets
$("#user-contents").height((windowHeight-$("#users").find('h3').outerHeight()) + 'px') #TODO move to stylesheets
else # the orientation is portrait. The values seem fine for a handheld but not for a narrow browser window
$('#chat').height('700px') #TODO move to stylesheets
$("#chatbody").height('470px') #TODO move to stylesheets
$("#users").height('400px') #TODO move to stylesheets
$("#user-contents").height('300px') #TODO move to stylesheets
@setInSession = (k, v) -> SessionAmplify.set k, v
@safeString = (str) ->

View File

@ -206,7 +206,3 @@ Template.makeButton.rendered = ->
Template.recordingStatus.rendered = ->
$('button[rel=tooltip]').tooltip()
$(window).resize( ->
resizeWindows()
)

View File

@ -22,6 +22,7 @@
padding-right: 0px;
width: 100%;
@media @landscape {
height:98%;
-webkit-order: 3;
order: 3;
}
@ -56,6 +57,10 @@
}
#chatbody {
@media @landscape {
height: 80%;
}
height: 90%;
overflow-y: scroll;
padding-left: 0px;
@ -147,7 +152,7 @@
border-radius:4px;
border:1px solid extract(@lightGrey, 3);
@media @landscape, @desktop-portrait {
height: 40px;
height: 15%;
}
@media @mobile-portrait-with-keyboard, @mobile-portrait {
height: 60px;
@ -206,7 +211,10 @@
@media @mobile-portrait-with-keyboard, @mobile-portrait {
height: 60px;
}
@media @desktop-portrait, @landscape {
@media @desktop-portrait {
height: 60px;
}
@media @landscape {
height: 40px;
}
@media @landscape {

View File

@ -44,11 +44,11 @@ body {
.myFooter {
color: black;
max-height: 20px;
padding-top: 13px;
text-align: center;
@media @landscape {
font-size: 10px;
max-height: 20px;
}
@media @mobile-portrait-with-keyboard, @desktop-portrait, @mobile-portrait {
font-size: 18px;

View File

@ -33,7 +33,7 @@
height: 20px;
}
@media @desktop-portrait {
height: 20px;
height: 25px;
}
@media @desktop-portrait, @mobile-portrait {
font-size: 2vh;
@ -47,6 +47,7 @@
-webkit-flex: 1 1 25%;
flex: 1 1 25%;
@media @landscape {
height:98%;
-webkit-order: 1;
order: 1;
min-width: 0;
@ -55,7 +56,7 @@
-webkit-order: 3;
order: 3;
margin-bottom: 0px;
padding-bottom: 0px;
padding-bottom: 55px; /*so that the footer does not overlap */
max-height: 20%;
min-height: 20%;
}

View File

@ -135,7 +135,6 @@ Template.chatbar.helpers
# When chatbar gets rendered, launch the auto-check for unread chat
Template.chatbar.rendered = ->
detectUnreadChat()
resizeWindows()
# When message gets rendered, scroll to the bottom
Template.message.rendered = ->
@ -166,7 +165,6 @@ Template.chatInput.rendered = ->
$('input[rel=tooltip]').tooltip()
$('button[rel=tooltip]').tooltip()
$("#newMessageInput").focus()
resizeWindows()
Template.extraConversations.events
"click .extraConversation": (event) ->