- update loading screen with guest wait status
This commit is contained in:
parent
e981a874c3
commit
0a5f4dfc33
@ -4,6 +4,9 @@ package org.bigbluebutton.air {
|
||||
import org.bigbluebutton.air.main.commands.DisconnectUserCommandAIR;
|
||||
import org.bigbluebutton.air.main.models.IUISession;
|
||||
import org.bigbluebutton.air.main.models.UISession;
|
||||
import org.bigbluebutton.air.main.services.GuestWaitPageService;
|
||||
import org.bigbluebutton.air.main.views.LoadingScreen;
|
||||
import org.bigbluebutton.air.main.views.LoadingScreenMediator;
|
||||
import org.bigbluebutton.lib.chat.models.ChatMessagesSession;
|
||||
import org.bigbluebutton.lib.chat.models.IChatMessagesSession;
|
||||
import org.bigbluebutton.lib.chat.services.ChatMessageService;
|
||||
@ -29,7 +32,6 @@ package org.bigbluebutton.air {
|
||||
import org.bigbluebutton.lib.main.models.MeetingData;
|
||||
import org.bigbluebutton.lib.main.models.UserSession;
|
||||
import org.bigbluebutton.lib.main.services.BigBlueButtonConnection;
|
||||
import org.bigbluebutton.lib.main.services.GuestWaitPageService;
|
||||
import org.bigbluebutton.lib.main.services.IBigBlueButtonConnection;
|
||||
import org.bigbluebutton.lib.main.services.IGuestWaitPageService;
|
||||
import org.bigbluebutton.lib.main.services.ILoginService;
|
||||
@ -74,6 +76,7 @@ package org.bigbluebutton.air {
|
||||
injector.map(IGuestWaitPageService).toType(GuestWaitPageService);
|
||||
injector.map(IBigBlueButtonConnection).toType(BigBlueButtonConnection);
|
||||
injector.map(IVideoConnection).toType(VideoConnection);
|
||||
|
||||
// Signal to Command mapping
|
||||
signalCommandMap.map(ConnectSignal).toCommand(ConnectCommand);
|
||||
signalCommandMap.map(DisconnectUserSignal).toCommand(DisconnectUserCommandAIR);
|
||||
|
@ -17,7 +17,6 @@ package org.bigbluebutton.air.main {
|
||||
import org.bigbluebutton.lib.main.commands.JoinMeetingSignal;
|
||||
import org.bigbluebutton.lib.main.views.MenuButtonsBase;
|
||||
import org.bigbluebutton.lib.main.views.TopToolbarBase;
|
||||
|
||||
import robotlegs.bender.extensions.matching.TypeMatcher;
|
||||
import robotlegs.bender.extensions.mediatorMap.api.IMediatorMap;
|
||||
import robotlegs.bender.extensions.signalCommandMap.api.ISignalCommandMap;
|
||||
@ -57,6 +56,7 @@ package org.bigbluebutton.air.main {
|
||||
mediatorMap.map(BannerView).toMediator(BannerViewMediator);
|
||||
mediatorMap.mapMatcher(new TypeMatcher().allOf(TopToolbarBase, TopToolbarAIR)).toMediator(TopToolbarMediatorAIR);
|
||||
mediatorMap.map(MenuButtonsBase).toMediator(MenuButtonsMediatorAIR);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -50,8 +50,7 @@ package org.bigbluebutton.air.main.commands {
|
||||
}
|
||||
|
||||
protected function onGuestWaitSignal(waitUrl: String, urlRequest:URLRequest, responseUrl:String, sessionToken:String):void {
|
||||
trace("GUEST WAIT URL = " + waitUrl);
|
||||
|
||||
//trace("GUEST WAIT URL = " + waitUrl);
|
||||
guestWaitService.wait(waitUrl, urlRequest, responseUrl, sessionToken);
|
||||
}
|
||||
|
||||
|
@ -1,16 +1,19 @@
|
||||
package org.bigbluebutton.lib.main.services
|
||||
package org.bigbluebutton.air.main.services
|
||||
{
|
||||
import flash.events.TimerEvent;
|
||||
import flash.net.URLRequest;
|
||||
import flash.net.URLVariables;
|
||||
import flash.utils.Timer;
|
||||
|
||||
import org.bigbluebutton.air.main.models.IUISession;
|
||||
import org.bigbluebutton.lib.common.utils.GuestWaitURLFetcher;
|
||||
import org.bigbluebutton.lib.main.services.IGuestWaitPageService;
|
||||
import org.osflash.signals.ISignal;
|
||||
import org.osflash.signals.Signal;
|
||||
|
||||
public class GuestWaitPageService implements IGuestWaitPageService
|
||||
{
|
||||
[Inject]
|
||||
public var uiSession:IUISession;
|
||||
|
||||
private static const URL_REQUEST_ERROR_TYPE:String = "TypeError";
|
||||
|
||||
@ -54,7 +57,7 @@ package org.bigbluebutton.lib.main.services
|
||||
}
|
||||
|
||||
protected function fail(reason:String):void {
|
||||
trace("Login failed. " + reason);
|
||||
//trace("Login failed. " + reason);
|
||||
_failureSignal.dispatch(reason);
|
||||
//TODO: show message to user saying that the meeting identifier is invalid
|
||||
}
|
||||
@ -75,6 +78,7 @@ package org.bigbluebutton.lib.main.services
|
||||
|
||||
var reqVars:URLVariables = new URLVariables();
|
||||
reqVars.sessionToken = sessionToken;
|
||||
// Prevent redirecting the client. We want a json return to parse.
|
||||
reqVars.redirect = "false";
|
||||
|
||||
fetcher.fetch(_guestWaitUrl, null, reqVars);
|
||||
@ -87,21 +91,23 @@ package org.bigbluebutton.lib.main.services
|
||||
}
|
||||
|
||||
public function connectionTimeout (e:TimerEvent) : void {
|
||||
trace("Timedout connecting to " + _guestWaitUrl);
|
||||
//trace("Timedout connecting to " + _guestWaitUrl);
|
||||
fetch();
|
||||
}
|
||||
|
||||
protected function onSuccess(data:Object, responseUrl:String, urlRequest:URLRequest, httpStatusCode:Number = 200):void {
|
||||
trace(JSON.stringify(data));
|
||||
//trace(JSON.stringify(data));
|
||||
if (httpStatusCode == 200) {
|
||||
var result:Object = JSON.parse(data as String);
|
||||
var guestStatus: String = result.response.guestStatus;
|
||||
if (guestStatus == "WAIT") {
|
||||
uiSession.setLoading(true, "Waiting for moderator approval.");
|
||||
queueFetch();
|
||||
} else if(guestStatus == "ALLOW") {
|
||||
guestAccessAllowedSignal.dispatch(urlRequest, responseUrl, sessionToken);
|
||||
} else if (guestStatus == "DENIED") {
|
||||
} else if (guestStatus == "DENY") {
|
||||
// signal denied
|
||||
uiSession.setLoading(true, "Guest access denied.");
|
||||
}
|
||||
} else {
|
||||
onFailure(URL_REQUEST_GENERIC_ERROR);
|
@ -1,12 +1,9 @@
|
||||
package org.bigbluebutton.air.main.services {
|
||||
|
||||
import com.freshplanet.nativeExtensions.AirCapabilities;
|
||||
|
||||
import flash.desktop.NativeApplication;
|
||||
import flash.net.URLRequest;
|
||||
|
||||
import org.bigbluebutton.lib.common.utils.URLFetcher;
|
||||
import org.bigbluebutton.lib.common.utils.URLParser;
|
||||
import org.osflash.signals.ISignal;
|
||||
import org.osflash.signals.Signal;
|
||||
|
||||
@ -107,9 +104,9 @@ package org.bigbluebutton.air.main.services {
|
||||
if (xml.hasOwnProperty("guestStatus")) {
|
||||
var guestStatus:String = xml.guestStatus.toString();
|
||||
var waitUrl:String = xml.url.toString();
|
||||
trace("******************** GUEST STATUS = " + guestStatus + " waitUrl=" + waitUrl);
|
||||
//trace("******************** GUEST STATUS = " + guestStatus + " waitUrl=" + waitUrl);
|
||||
//trace("******************** responseUrl = " + responseUrl);
|
||||
trace("******************** sessionToken = " + sessionToken);
|
||||
//trace("******************** sessionToken = " + sessionToken);
|
||||
var waitUrlTrim:String = getServerUrl(waitUrl);
|
||||
guestWaitSignal.dispatch(waitUrlTrim, urlRequest, responseUrl, sessionToken);
|
||||
} else {
|
||||
|
@ -38,7 +38,7 @@ package org.bigbluebutton.lib.common.utils
|
||||
|
||||
public function fetch(url:String, urlRequest:URLRequest, reqVars: URLVariables,
|
||||
dataFormat:String = URLLoaderDataFormat.TEXT):void {
|
||||
trace("Fetching " + url);
|
||||
//trace("Fetching " + url);
|
||||
_urlRequest = urlRequest;
|
||||
if (_urlRequest == null) {
|
||||
_urlRequest = new URLRequest();
|
||||
@ -52,7 +52,7 @@ package org.bigbluebutton.lib.common.utils
|
||||
_urlRequest.url = _responseURL = url;
|
||||
|
||||
if (reqVars != null) {
|
||||
trace("reqVars " + reqVars.toString());
|
||||
//trace("reqVars " + reqVars.toString());
|
||||
_urlRequest.data = reqVars;
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ package org.bigbluebutton.lib.common.utils
|
||||
|
||||
private function httpResponseStatusHandler(e:HTTPStatusEvent):void {
|
||||
_responseURL = e.responseURL;
|
||||
trace("httpResponseStatusHandler Redirected to " + _responseURL);
|
||||
//trace("httpResponseStatusHandler Redirected to " + _responseURL);
|
||||
}
|
||||
|
||||
private function httpStatusHandler(e:HTTPStatusEvent):void {
|
||||
@ -77,7 +77,7 @@ package org.bigbluebutton.lib.common.utils
|
||||
}
|
||||
|
||||
private function handleComplete(e:Event):void {
|
||||
trace("httpResponseStatusHandler Redirected to " + _responseURL);
|
||||
//trace("httpResponseStatusHandler Redirected to " + _responseURL);
|
||||
successSignal.dispatch(e.target.data, _responseURL, _urlRequest);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user