Fix for several 0.7 release bugs, as well as a new way for modules to receive updates about users joining and leaving
This commit is contained in:
parent
a3b4603aa3
commit
13790e0bbb
@ -37,6 +37,6 @@
|
||||
<classpathentry kind="lib" path="lib/spring-integration-stream-2.0.0.M2.jar"/>
|
||||
<classpathentry kind="con" path="ch.epfl.lamp.sdt.launching.SCALA_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/bbb-common-messaging"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/bbb-common-message"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
2
bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/WhiteboardApplication.java
Normal file → Executable file
2
bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/whiteboard/WhiteboardApplication.java
Normal file → Executable file
@ -141,7 +141,7 @@ public class WhiteboardApplication extends MultiThreadedApplicationAdapter imple
|
||||
|
||||
@Override
|
||||
public void roomStop(IScope scope) {
|
||||
|
||||
roomManager.removeRoom(scope.getName());
|
||||
}
|
||||
|
||||
private IScope getLocalScope(){
|
||||
|
@ -20,6 +20,7 @@
|
||||
<sourceAttachmentPath>
|
||||
<sourceAttachmentPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/datavisualization.swc" sourcepath="${PROJECT_FRAMEWORKS}/source" useDefaultLinkType="false"/>
|
||||
<sourceAttachmentPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/framework.swc" sourcepath="${PROJECT_FRAMEWORKS}/source" useDefaultLinkType="true"/>
|
||||
<sourceAttachmentPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_flashflexkit.swc" sourcepath="${PROJECT_FBPRO}/projects/automation_flashflexkit/src" useDefaultLinkType="false"/>
|
||||
</sourceAttachmentPath>
|
||||
</compiler>
|
||||
<applications>
|
||||
@ -31,15 +32,15 @@
|
||||
<application path="DeskshareStandalone.mxml"/>
|
||||
</applications>
|
||||
<modules>
|
||||
<module application="src/BigBlueButton.mxml" destPath="VideoconfModule.swf" optimize="true" sourcePath="src/VideoconfModule.mxml"/>
|
||||
<module application="src/BigBlueButton.mxml" destPath="ChatModule.swf" optimize="true" sourcePath="src/ChatModule.mxml"/>
|
||||
<module application="src/BigBlueButton.mxml" destPath="ViewersModule.swf" optimize="true" sourcePath="src/ViewersModule.mxml"/>
|
||||
<module application="src/BigBlueButton.mxml" destPath="HighlighterModule.swf" optimize="true" sourcePath="src/HighlighterModule.mxml"/>
|
||||
<module application="src/BigBlueButton.mxml" destPath="PresentModule.swf" optimize="true" sourcePath="src/PresentModule.mxml"/>
|
||||
<module application="src/BigBlueButton.mxml" destPath="ListenersModule.swf" optimize="true" sourcePath="src/ListenersModule.mxml"/>
|
||||
<module application="src/BigBlueButton.mxml" destPath="HighlighterModule.swf" optimize="true" sourcePath="src/HighlighterModule.mxml"/>
|
||||
<module application="src/BigBlueButton.mxml" destPath="VideoconfModule.swf" optimize="true" sourcePath="src/VideoconfModule.mxml"/>
|
||||
<module application="src/BigBlueButton.mxml" destPath="DeskShareModule.swf" optimize="true" sourcePath="src/DeskShareModule.mxml"/>
|
||||
<module application="src/BigBlueButton.mxml" destPath="DynamicInfoModule.swf" optimize="true" sourcePath="src/DynamicInfoModule.mxml"/>
|
||||
<module application="src/BigBlueButton.mxml" destPath="PhoneModule.swf" optimize="true" sourcePath="src/PhoneModule.mxml"/>
|
||||
<module application="src/BigBlueButton.mxml" destPath="ViewersModule.swf" optimize="true" sourcePath="src/ViewersModule.mxml"/>
|
||||
</modules>
|
||||
<buildCSSFiles/>
|
||||
</actionScriptProperties>
|
||||
|
||||
|
@ -1,3 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="1"/>
|
||||
|
||||
|
@ -153,7 +153,7 @@ bbb.publishVideo.startPublishBtn.toolTip = start streaming
|
||||
|
||||
|
||||
# DesktopPublishWindow.mxml
|
||||
bbb.desktopPublish.title = Desktop Sharing: Thumbnail
|
||||
bbb.desktopPublish.title = Desktop Sharing: Presenter's Preview
|
||||
bbb.desktopView.title = Desktop Sharing
|
||||
bbb.desktopView.fitToWindow = Fit to Window
|
||||
bbb.desktopView.actualSize = Display actual size
|
||||
|
4
bigbluebutton-client/src/org/bigbluebutton/main/events/ConnectedEvent.as
Normal file → Executable file
4
bigbluebutton-client/src/org/bigbluebutton/main/events/ConnectedEvent.as
Normal file → Executable file
@ -21,13 +21,13 @@ package org.bigbluebutton.main.events
|
||||
{
|
||||
import flash.events.Event;
|
||||
|
||||
import org.bigbluebutton.main.model.Participant;
|
||||
import org.bigbluebutton.main.model.User;
|
||||
|
||||
public class ConnectedEvent extends Event
|
||||
{
|
||||
public static const CONNECTED_EVENT:String = 'connectedEvent';
|
||||
|
||||
public var participant:Participant;
|
||||
public var participant:User;
|
||||
|
||||
public function ConnectedEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
|
||||
{
|
||||
|
4
bigbluebutton-client/src/org/bigbluebutton/main/events/ParticipantJoinEvent.as
Normal file → Executable file
4
bigbluebutton-client/src/org/bigbluebutton/main/events/ParticipantJoinEvent.as
Normal file → Executable file
@ -21,13 +21,13 @@ package org.bigbluebutton.main.events
|
||||
{
|
||||
import flash.events.Event;
|
||||
|
||||
import org.bigbluebutton.main.model.Participant;
|
||||
import org.bigbluebutton.main.model.User;
|
||||
|
||||
public class ParticipantJoinEvent extends Event
|
||||
{
|
||||
public static const PARTICIPANT_JOINED_EVENT:String = 'PARTICIPANT_JOINED_EVENT';
|
||||
|
||||
public var participant:Participant;
|
||||
public var participant:User;
|
||||
public var join:Boolean = false;
|
||||
public function ParticipantJoinEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
|
||||
{
|
||||
|
4
bigbluebutton-client/src/org/bigbluebutton/main/managers/ApplicationManager.as
Normal file → Executable file
4
bigbluebutton-client/src/org/bigbluebutton/main/managers/ApplicationManager.as
Normal file → Executable file
@ -1,10 +1,10 @@
|
||||
package org.bigbluebutton.main.managers
|
||||
{
|
||||
import org.bigbluebutton.main.model.Participant;
|
||||
import org.bigbluebutton.main.model.User;
|
||||
|
||||
public class ApplicationManager
|
||||
{
|
||||
public var participant:Participant;
|
||||
public var participant:User;
|
||||
|
||||
public function ApplicationManager()
|
||||
{
|
||||
|
4
bigbluebutton-client/src/org/bigbluebutton/main/model/ApplicationModel.as
Normal file → Executable file
4
bigbluebutton-client/src/org/bigbluebutton/main/model/ApplicationModel.as
Normal file → Executable file
@ -2,13 +2,13 @@ package org.bigbluebutton.main.model
|
||||
{
|
||||
public class ApplicationModel
|
||||
{
|
||||
private var _participant:Participant;
|
||||
private var _participant:User;
|
||||
|
||||
public function ApplicationModel()
|
||||
{
|
||||
}
|
||||
|
||||
public function setParticipant(p:Participant):void {
|
||||
public function setParticipant(p:User):void {
|
||||
LogUtil.debug("Setting participant");
|
||||
_participant = p;
|
||||
}
|
||||
|
@ -1,12 +0,0 @@
|
||||
package org.bigbluebutton.main.model
|
||||
{
|
||||
public class Participant
|
||||
{
|
||||
public var room:String;
|
||||
public var conference:String;
|
||||
public var userid:String;
|
||||
public var name:String;
|
||||
public var role:String;
|
||||
public var authToken:String;
|
||||
}
|
||||
}
|
6
bigbluebutton-client/src/org/bigbluebutton/main/services/JoiningParticipant.as
Normal file → Executable file
6
bigbluebutton-client/src/org/bigbluebutton/main/services/JoiningParticipant.as
Normal file → Executable file
@ -1,12 +1,12 @@
|
||||
package org.bigbluebutton.main.services
|
||||
{
|
||||
import org.bigbluebutton.main.model.Participant;
|
||||
import org.bigbluebutton.main.model.User;
|
||||
|
||||
public class JoiningParticipant
|
||||
{
|
||||
public function parse(xml:XML):Participant{
|
||||
public function parse(xml:XML):User{
|
||||
|
||||
var participant:Participant = new Participant();
|
||||
var participant:User = new User();
|
||||
participant.conference = xml.@conference;
|
||||
participant.room = xml.@room;
|
||||
participant.role = xml.@role;
|
||||
|
@ -26,7 +26,7 @@
|
||||
xmlns:main="org.bigbluebutton.main.view.components.*"
|
||||
xmlns:mate="http://mate.asfusion.com/"
|
||||
width="100%" height="100%"
|
||||
creationComplete="initializeShell()" xmlns:maps="org.bigbluebutton.main.maps.*">
|
||||
creationComplete="initializeShell()" xmlns:maps="org.bigbluebutton.main.maps.*" xmlns:api="org.bigbluebutton.main.api.*">
|
||||
|
||||
<mate:Listener type="{OpenWindowEvent.OPEN_WINDOW_EVENT}" method="handleOpenWindowEvent" />
|
||||
<mate:Listener type="{CloseWindowEvent.CLOSE_WINDOW_EVENT}" method="handleCloseWindowEvent"/>
|
||||
@ -34,6 +34,7 @@
|
||||
<mate:Listener type="{AddUIComponentToMainCanvas.ADD_COMPONENT}" method="addComponentToCanvas" />
|
||||
|
||||
<maps:CrossModuleEventMap />
|
||||
<api:APIEventMap />
|
||||
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
|
@ -15,6 +15,8 @@
|
||||
public static const RIGHT:String = "RIGHT_WINDOW";
|
||||
public static const POPUP:String = "POP_UP_WINDOW";
|
||||
|
||||
public static const DESKTOP_SHARING_VIEW:String = "POP_UP_DESKSHARE";
|
||||
|
||||
private var leftWindowWidth:Number;
|
||||
private var leftWindowHeight:Number;
|
||||
|
||||
@ -94,6 +96,10 @@
|
||||
x = 200;
|
||||
y = 200;
|
||||
break;
|
||||
case DESKTOP_SHARING_VIEW:
|
||||
x = 1;
|
||||
y = 1;
|
||||
break;
|
||||
}
|
||||
windowManager.absPos(win, x, y);
|
||||
}
|
||||
|
4
bigbluebutton-client/src/org/bigbluebutton/modules/chat/services/PrivateChatSharedObjectService.as
Normal file → Executable file
4
bigbluebutton-client/src/org/bigbluebutton/modules/chat/services/PrivateChatSharedObjectService.as
Normal file → Executable file
@ -28,7 +28,7 @@ package org.bigbluebutton.modules.chat.services
|
||||
import flash.net.SharedObject;
|
||||
|
||||
import org.bigbluebutton.main.events.ParticipantJoinEvent;
|
||||
import org.bigbluebutton.main.model.Participant;
|
||||
import org.bigbluebutton.main.model.User;
|
||||
import org.bigbluebutton.modules.chat.events.PrivateChatMessageEvent;
|
||||
import org.bigbluebutton.modules.chat.model.MessageVO;
|
||||
|
||||
@ -123,7 +123,7 @@ package org.bigbluebutton.modules.chat.services
|
||||
}
|
||||
|
||||
public function participantJoined(joinedUser:Object):void {
|
||||
var participant:Participant = new Participant();
|
||||
var participant:User = new User();
|
||||
participant.userid = joinedUser.userid;
|
||||
participant.name = joinedUser.name;
|
||||
trace("ParticipantJoined " + joinedUser.name + "[" + joinedUser.userid + "]");
|
||||
|
@ -27,11 +27,11 @@
|
||||
xmlns:mx="http://www.adobe.com/2006/mxml"
|
||||
width="600" height="400"
|
||||
creationComplete="onCreationComplete()"
|
||||
implements="org.bigbluebutton.common.IBbbModuleWindow"
|
||||
implements="org.bigbluebutton.common.IBbbModuleWindow, org.bigbluebutton.main.api.IUserListener"
|
||||
xmlns:mate="http://mate.asfusion.com/"
|
||||
title="{ResourceUtil.getInstance().getString('bbb.desktopView.title')}"
|
||||
showCloseButton="false"
|
||||
resize="fitToWindow()">
|
||||
resize="fitToWindow()" >
|
||||
|
||||
<mate:Listener type="{ViewStreamEvent.STOP}" method="onStopViewStreamEvent" />
|
||||
<mate:Listener type="{CursorEvent.UPDATE_CURSOR_LOC_EVENT}" method="onUpdateCursorEvent" />
|
||||
@ -40,11 +40,17 @@
|
||||
<![CDATA[
|
||||
import com.asfusion.mate.events.Dispatcher;
|
||||
|
||||
import flash.sampler.NewObjectSample;
|
||||
|
||||
import flexlib.mdi.events.MDIWindowEvent;
|
||||
|
||||
import mx.controls.Alert;
|
||||
import mx.core.UIComponent;
|
||||
|
||||
import org.bigbluebutton.common.Images;
|
||||
import org.bigbluebutton.main.api.IUserListener;
|
||||
import org.bigbluebutton.main.api.UserManager;
|
||||
import org.bigbluebutton.main.model.User;
|
||||
import org.bigbluebutton.main.view.components.MainCanvas;
|
||||
import org.bigbluebutton.modules.deskShare.events.CursorEvent;
|
||||
import org.bigbluebutton.modules.deskShare.events.StartedViewingEvent;
|
||||
@ -131,6 +137,10 @@
|
||||
videoHolder.addChild(cursor);
|
||||
videoHolder.addChild(cursorImg);
|
||||
cursor.visible = false;
|
||||
|
||||
var manager:UserManager = UserManager.getInstance();
|
||||
manager.registerListener(this);
|
||||
this.title = manager.getPresenter().name + " is sharing their desktop with you";
|
||||
}
|
||||
|
||||
private function onResizeEndEvent(event:MDIWindowEvent):void {
|
||||
@ -168,7 +178,7 @@
|
||||
video.height = height;
|
||||
video.attachNetStream(ns);
|
||||
ns.play(stream);
|
||||
this.stream = stream;
|
||||
this.stream = stream;
|
||||
}
|
||||
|
||||
public function stopViewing():void {
|
||||
@ -200,7 +210,7 @@
|
||||
}
|
||||
|
||||
public function getPrefferedPosition():String{
|
||||
return MainCanvas.POPUP;
|
||||
return MainCanvas.DESKTOP_SHARING_VIEW;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -286,12 +296,27 @@
|
||||
private function closeWindow():void {
|
||||
dispatchEvent(new ViewWindowEvent(ViewWindowEvent.CLOSE));
|
||||
}
|
||||
|
||||
/** Inherited from IUserListener */
|
||||
public function presenterChanged(newPresenter:User):void{
|
||||
this.title = newPresenter.name + " is sharing their desktop with you";
|
||||
}
|
||||
|
||||
public function userJoined(user:User):void{
|
||||
|
||||
}
|
||||
|
||||
public function userLeft(user:User):void{
|
||||
|
||||
}
|
||||
/** End IUserListener implementation */
|
||||
|
||||
]]>
|
||||
</mx:Script>
|
||||
<mx:Move id="cursorMove" target="{cursorImg}"/>
|
||||
<mx:Image id="cursorImg" visible="false" source="@Embed('../../assets/images/cursor4.png')"/>
|
||||
|
||||
<mx:ControlBar id="bottomBar" height="35">
|
||||
<mx:ControlBar id="bottomBar" height="35" horizontalAlign="center">
|
||||
<mx:Button id="btnActualSize" toggle="true" click="determineHowToDisplayVideo()" selected="true"
|
||||
height="90%" label="{btnActualSize.selected ? ResourceUtil.getInstance().getString('bbb.desktopView.fitToWindow') : ResourceUtil.getInstance().getString('bbb.desktopView.actualSize')}"
|
||||
toolTip="{ResourceUtil.getInstance().getString('bbb.desktopView.fitToWindow')}" />
|
||||
|
2
bigbluebutton-client/src/org/bigbluebutton/modules/highlighter/business/DrawProxy.as
Normal file → Executable file
2
bigbluebutton-client/src/org/bigbluebutton/modules/highlighter/business/DrawProxy.as
Normal file → Executable file
@ -348,7 +348,7 @@ package org.bigbluebutton.modules.highlighter.business
|
||||
if (result == null) return;
|
||||
|
||||
var shapes:Array = result as Array;
|
||||
LogUtil.debug("Whiteboard::recievedShapesHistory() : recieved " + shapes.length);
|
||||
//LogUtil.debug("Whiteboard::recievedShapesHistory() : recieved " + shapes.length);
|
||||
|
||||
for (var i:int=0; i<shapes.length; i++){
|
||||
var shape:Array = shapes[i] as Array;
|
||||
|
4
bigbluebutton-client/src/org/bigbluebutton/modules/viewers/ViewersFacade.as
Normal file → Executable file
4
bigbluebutton-client/src/org/bigbluebutton/modules/viewers/ViewersFacade.as
Normal file → Executable file
@ -21,7 +21,7 @@ package org.bigbluebutton.modules.viewers
|
||||
{
|
||||
import org.bigbluebutton.modules.viewers.controller.StartupCommand;
|
||||
import org.bigbluebutton.modules.viewers.controller.StopCommand;
|
||||
import org.bigbluebutton.modules.viewers.model.vo.User;
|
||||
import org.bigbluebutton.modules.viewers.model.vo.BBBUser;
|
||||
import org.puremvc.as3.multicore.interfaces.IFacade;
|
||||
import org.puremvc.as3.multicore.patterns.facade.Facade;
|
||||
|
||||
@ -92,7 +92,7 @@ package org.bigbluebutton.modules.viewers
|
||||
sendNotification(STOP, app);
|
||||
}
|
||||
|
||||
public function sendViewCamera(usr:User):void{
|
||||
public function sendViewCamera(usr:BBBUser):void{
|
||||
sendNotification(VIEW_CAMERA, usr);
|
||||
}
|
||||
|
||||
|
4
bigbluebutton-client/src/org/bigbluebutton/modules/viewers/ViewersModuleMediator.as
Normal file → Executable file
4
bigbluebutton-client/src/org/bigbluebutton/modules/viewers/ViewersModuleMediator.as
Normal file → Executable file
@ -22,7 +22,7 @@ package org.bigbluebutton.modules.viewers
|
||||
import com.asfusion.mate.events.Dispatcher;
|
||||
|
||||
import org.bigbluebutton.modules.viewers.events.JoinFailedEvent;
|
||||
import org.bigbluebutton.modules.viewers.model.vo.User;
|
||||
import org.bigbluebutton.modules.viewers.model.vo.BBBUser;
|
||||
import org.bigbluebutton.modules.viewers.view.ViewersWindowMediator;
|
||||
import org.bigbluebutton.modules.viewers.view.components.ViewersWindow;
|
||||
import org.puremvc.as3.multicore.interfaces.IMediator;
|
||||
@ -84,7 +84,7 @@ package org.bigbluebutton.modules.viewers
|
||||
];
|
||||
}
|
||||
|
||||
private function openViewCamera(usr:User):void{
|
||||
private function openViewCamera(usr:BBBUser):void{
|
||||
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ package org.bigbluebutton.modules.viewers.model
|
||||
import org.bigbluebutton.modules.viewers.model.services.JoinService;
|
||||
import org.bigbluebutton.modules.viewers.model.services.ViewersSOService;
|
||||
import org.bigbluebutton.modules.viewers.model.vo.Status;
|
||||
import org.bigbluebutton.modules.viewers.model.vo.User;
|
||||
import org.bigbluebutton.modules.viewers.model.vo.BBBUser;
|
||||
import org.puremvc.as3.multicore.interfaces.IProxy;
|
||||
import org.puremvc.as3.multicore.patterns.proxy.Proxy;
|
||||
|
||||
@ -113,7 +113,7 @@ package org.bigbluebutton.modules.viewers.model
|
||||
_viewersService.disconnect();
|
||||
}
|
||||
|
||||
public function get me():User {
|
||||
public function get me():BBBUser {
|
||||
return _participants.me;
|
||||
}
|
||||
|
||||
|
30
bigbluebutton-client/src/org/bigbluebutton/modules/viewers/model/business/Conference.as
Normal file → Executable file
30
bigbluebutton-client/src/org/bigbluebutton/modules/viewers/model/business/Conference.as
Normal file → Executable file
@ -23,19 +23,19 @@ package org.bigbluebutton.modules.viewers.model.business
|
||||
|
||||
import org.bigbluebutton.common.Role;
|
||||
import org.bigbluebutton.modules.viewers.model.vo.Status;
|
||||
import org.bigbluebutton.modules.viewers.model.vo.User;
|
||||
import org.bigbluebutton.modules.viewers.model.vo.BBBUser;
|
||||
|
||||
|
||||
public class Conference implements IViewers
|
||||
{
|
||||
private var _myUserid : Number;
|
||||
|
||||
[Bindable] public var me:User = null;
|
||||
[Bindable] public var me:BBBUser = null;
|
||||
[Bindable] public var users:ArrayCollection = null;
|
||||
|
||||
public function Conference() : void
|
||||
{
|
||||
me = new User();
|
||||
me = new BBBUser();
|
||||
users = new ArrayCollection();
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ package org.bigbluebutton.modules.viewers.model.business
|
||||
* @param newuser
|
||||
*
|
||||
*/
|
||||
public function addUser(newuser:User) : void
|
||||
public function addUser(newuser:BBBUser) : void
|
||||
{
|
||||
if (! hasParticipant(newuser.userid)) {
|
||||
|
||||
@ -74,12 +74,12 @@ package org.bigbluebutton.modules.viewers.model.business
|
||||
}
|
||||
|
||||
public function hasOnlyOneModerator():Boolean {
|
||||
var p:User;
|
||||
var p:BBBUser;
|
||||
var moderatorCount:int = 0;
|
||||
|
||||
for (var i:int = 0; i < users.length; i++)
|
||||
{
|
||||
p = users.getItemAt(i) as User;
|
||||
p = users.getItemAt(i) as BBBUser;
|
||||
if (p.role == Role.MODERATOR) {
|
||||
moderatorCount++;
|
||||
}
|
||||
@ -89,13 +89,13 @@ package org.bigbluebutton.modules.viewers.model.business
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getTheOnlyModerator():User {
|
||||
var p:User;
|
||||
public function getTheOnlyModerator():BBBUser {
|
||||
var p:BBBUser;
|
||||
for (var i:int = 0; i < users.length; i++)
|
||||
{
|
||||
p = users.getItemAt(i) as User;
|
||||
p = users.getItemAt(i) as BBBUser;
|
||||
if (p.role == Role.MODERATOR) {
|
||||
return User.copy(p);
|
||||
return BBBUser.copy(p);
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,11 +108,11 @@ package org.bigbluebutton.modules.viewers.model.business
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
public function getParticipant(userid:Number) : User
|
||||
public function getParticipant(userid:Number) : BBBUser
|
||||
{
|
||||
var p:Object = getParticipantIndex(userid);
|
||||
if (p != null) {
|
||||
return p.participant as User;
|
||||
return p.participant as BBBUser;
|
||||
}
|
||||
|
||||
return null;
|
||||
@ -141,11 +141,11 @@ package org.bigbluebutton.modules.viewers.model.business
|
||||
*/
|
||||
private function getParticipantIndex(userid:Number):Object
|
||||
{
|
||||
var aUser : User;
|
||||
var aUser : BBBUser;
|
||||
|
||||
for (var i:int = 0; i < users.length; i++)
|
||||
{
|
||||
aUser = users.getItemAt(i) as User;
|
||||
aUser = users.getItemAt(i) as BBBUser;
|
||||
|
||||
if (aUser.userid == userid) {
|
||||
return {index:i, participant:aUser};
|
||||
@ -167,7 +167,7 @@ package org.bigbluebutton.modules.viewers.model.business
|
||||
|
||||
public function newUserStatus(id:Number, status:String, value:Object):void
|
||||
{
|
||||
var aUser:User = getParticipant(id);
|
||||
var aUser:BBBUser = getParticipant(id);
|
||||
|
||||
if (aUser != null) {
|
||||
var s:Status = new Status(status, value);
|
||||
|
10
bigbluebutton-client/src/org/bigbluebutton/modules/viewers/model/business/IViewers.as
Normal file → Executable file
10
bigbluebutton-client/src/org/bigbluebutton/modules/viewers/model/business/IViewers.as
Normal file → Executable file
@ -21,18 +21,18 @@ package org.bigbluebutton.modules.viewers.model.business
|
||||
{
|
||||
import mx.collections.ArrayCollection;
|
||||
|
||||
import org.bigbluebutton.modules.viewers.model.vo.User;
|
||||
import org.bigbluebutton.modules.viewers.model.vo.BBBUser;
|
||||
|
||||
public interface IViewers {
|
||||
function get me():User;
|
||||
function get me():BBBUser;
|
||||
function get users():ArrayCollection;
|
||||
function addUser(newuser:User):void;
|
||||
function addUser(newuser:BBBUser):void;
|
||||
function hasParticipant(id:Number):Boolean;
|
||||
function getParticipant(id:Number):User;
|
||||
function getParticipant(id:Number):BBBUser;
|
||||
function removeParticipant(userid:Number):void;
|
||||
function removeAllParticipants():void;
|
||||
function newUserStatus(id:Number, status:String, value:Object):void;
|
||||
function hasOnlyOneModerator():Boolean;
|
||||
function getTheOnlyModerator():User;
|
||||
function getTheOnlyModerator():BBBUser;
|
||||
}
|
||||
}
|
43
bigbluebutton-client/src/org/bigbluebutton/modules/viewers/model/services/ViewersSOService.as
Normal file → Executable file
43
bigbluebutton-client/src/org/bigbluebutton/modules/viewers/model/services/ViewersSOService.as
Normal file → Executable file
@ -29,10 +29,11 @@ package org.bigbluebutton.modules.viewers.model.services
|
||||
|
||||
import org.bigbluebutton.main.events.BBBEvent;
|
||||
import org.bigbluebutton.main.events.ParticipantJoinEvent;
|
||||
import org.bigbluebutton.main.model.Participant;
|
||||
import org.bigbluebutton.main.events.PresenterStatusEvent;
|
||||
import org.bigbluebutton.main.model.User;
|
||||
import org.bigbluebutton.modules.viewers.ViewersModuleConstants;
|
||||
import org.bigbluebutton.modules.viewers.model.business.IViewers;
|
||||
import org.bigbluebutton.modules.viewers.model.vo.User;
|
||||
import org.bigbluebutton.modules.viewers.model.vo.BBBUser;
|
||||
|
||||
public class ViewersSOService implements IViewersService
|
||||
{
|
||||
@ -172,7 +173,7 @@ package org.bigbluebutton.modules.viewers.model.services
|
||||
private function becomePresenterIfLoneModerator():void {
|
||||
if (_participants.hasOnlyOneModerator()) {
|
||||
trace("There is only one moderator");
|
||||
var user:User = _participants.getTheOnlyModerator();
|
||||
var user:BBBUser = _participants.getTheOnlyModerator();
|
||||
if (user.me) {
|
||||
trace("I am the only moderator");
|
||||
sendMessage(ViewersModuleConstants.ASSIGN_PRESENTER, {assignTo:user.userid, name:user.name});
|
||||
@ -195,9 +196,9 @@ package org.bigbluebutton.modules.viewers.model.services
|
||||
}
|
||||
|
||||
public function participantLeft(user:Object):void {
|
||||
var participant:User = _participants.getParticipant(Number(user));
|
||||
var participant:BBBUser = _participants.getParticipant(Number(user));
|
||||
|
||||
var p:Participant = new Participant();
|
||||
var p:User = new User();
|
||||
p.userid = String(participant.userid);
|
||||
p.name = participant.name;
|
||||
|
||||
@ -211,30 +212,32 @@ package org.bigbluebutton.modules.viewers.model.services
|
||||
}
|
||||
|
||||
public function participantJoined(joinedUser:Object):void {
|
||||
var user:User = new User();
|
||||
var user:BBBUser = new BBBUser();
|
||||
user.userid = Number(joinedUser.userid);
|
||||
user.name = joinedUser.name;
|
||||
user.role = joinedUser.role;
|
||||
|
||||
user.name = joinedUser.name;
|
||||
user.role = joinedUser.role;
|
||||
|
||||
LogUtil.debug("User status: " + joinedUser.status.hasStream);
|
||||
|
||||
|
||||
LogUtil.info("Joined as [" + user.userid + "," + user.name + "," + user.role + "]");
|
||||
_participants.addUser(user);
|
||||
|
||||
|
||||
participantStatusChange(user.userid, "hasStream", joinedUser.status.hasStream);
|
||||
participantStatusChange(user.userid, "streamName", joinedUser.status.streamName);
|
||||
participantStatusChange(user.userid, "presenter", joinedUser.status.presenter);
|
||||
participantStatusChange(user.userid, "raiseHand", joinedUser.status.raiseHand);
|
||||
|
||||
var participant:Participant = new Participant();
|
||||
var participant:User = new User();
|
||||
participant.userid = String(user.userid);
|
||||
participant.name = user.name;
|
||||
participant.isPresenter = joinedUser.status.presenter;
|
||||
participant.role = user.role;
|
||||
|
||||
var dispatcher:Dispatcher = new Dispatcher();
|
||||
var joinEvent:ParticipantJoinEvent = new ParticipantJoinEvent(ParticipantJoinEvent.PARTICIPANT_JOINED_EVENT);
|
||||
joinEvent.participant = participant;
|
||||
joinEvent.join = true;
|
||||
dispatcher.dispatchEvent(joinEvent);
|
||||
dispatcher.dispatchEvent(joinEvent);
|
||||
}
|
||||
|
||||
public function logout():void {
|
||||
@ -247,6 +250,14 @@ package org.bigbluebutton.modules.viewers.model.services
|
||||
LogUtil.debug("Received status change [" + userid + "," + status + "," + value + "]")
|
||||
|
||||
_participants.newUserStatus(userid, status, value);
|
||||
|
||||
if (status == "presenter"){
|
||||
var e:PresenterStatusEvent = new PresenterStatusEvent(PresenterStatusEvent.PRESENTER_NAME_CHANGE);
|
||||
e.userid = userid;
|
||||
var dispatcher:Dispatcher = new Dispatcher();
|
||||
dispatcher.dispatchEvent(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function assignPresenter(userid:Number, assignedBy:Number):void {
|
||||
@ -324,9 +335,9 @@ package org.bigbluebutton.modules.viewers.model.services
|
||||
// status - On error occurred
|
||||
function(status:Object):void {
|
||||
LogUtil.error("Error occurred:");
|
||||
for (var x:Object in status) {
|
||||
LogUtil.error(x + " : " + status[x]);
|
||||
}
|
||||
for (var x:Object in status) {
|
||||
LogUtil.error(x + " : " + status[x]);
|
||||
}
|
||||
}
|
||||
), //new Responder
|
||||
userid,
|
||||
|
@ -1,133 +0,0 @@
|
||||
/**
|
||||
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
|
||||
*
|
||||
* Copyright (c) 2008 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 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program 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 this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package org.bigbluebutton.modules.viewers.model.vo
|
||||
{
|
||||
import com.asfusion.mate.events.Dispatcher;
|
||||
|
||||
import mx.collections.ArrayCollection;
|
||||
import mx.controls.Alert;
|
||||
|
||||
import org.bigbluebutton.common.Role;
|
||||
import org.bigbluebutton.modules.viewers.view.events.StreamStartedEvent;
|
||||
|
||||
public class User
|
||||
{
|
||||
[Bindable] public var me:Boolean = false;
|
||||
[Bindable] public var userid:Number;
|
||||
[Bindable] public var name:String;
|
||||
[Bindable] public var hasStream:Boolean = false;
|
||||
[Bindable] public var streamName:String = "";
|
||||
[Bindable] public var presenter:Boolean = false;
|
||||
[Bindable] public var raiseHand:Boolean = false;
|
||||
[Bindable] public var role:String = Role.VIEWER;
|
||||
[Bindable] public var room:String = "";
|
||||
[Bindable] public var authToken:String = "";
|
||||
|
||||
private var _status:StatusCollection = new StatusCollection();
|
||||
|
||||
public function get status():ArrayCollection {
|
||||
return _status.getAll();
|
||||
}
|
||||
|
||||
public function set status(s:ArrayCollection):void {
|
||||
_status.status = s;
|
||||
}
|
||||
|
||||
public function addStatus(status:Status):void {
|
||||
_status.addStatus(status);
|
||||
}
|
||||
|
||||
public function changeStatus(status:Status):void {
|
||||
//_status.changeStatus(status);
|
||||
if (status.name == "presenter") {
|
||||
presenter = status.value
|
||||
}
|
||||
switch (status.name) {
|
||||
case "presenter":
|
||||
presenter = status.value;
|
||||
break;
|
||||
case "hasStream":
|
||||
hasStream = status.value;
|
||||
if (hasStream) sendStreamStartedEvent();
|
||||
break;
|
||||
case "streamName":
|
||||
streamName = status.value as String;
|
||||
break;
|
||||
case "raiseHand":
|
||||
raiseHand = status.value as Boolean;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function removeStatus(name:String):void {
|
||||
_status.removeStatus(name);
|
||||
}
|
||||
|
||||
public function getStatus(name:String):Status {
|
||||
return _status.getStatus(name);
|
||||
}
|
||||
/*
|
||||
public var me:Boolean = false;
|
||||
public var userid:Number;
|
||||
public var name:String;
|
||||
|
||||
public var role:String = Role.VIEWER;
|
||||
public var room:String = "";
|
||||
public var authToken:String = "";
|
||||
*/
|
||||
/**
|
||||
* This is a workaround until we figure out how to make
|
||||
* status Bindable in StatusItemRenderer.mxml (ralam 2/20/2009)
|
||||
*/
|
||||
/* private var _status:Object;
|
||||
public var streamName:String = "";
|
||||
public var presenter:Boolean = false;
|
||||
public var hasStream:Boolean = false;
|
||||
|
||||
public function set status(s:Object):void {
|
||||
_status = s;
|
||||
hasStream = s["hasStream"];
|
||||
presenter = s["presenter"];
|
||||
streamName = s["streamName"];
|
||||
}
|
||||
*/
|
||||
|
||||
public static function copy(user:User):User {
|
||||
var n:User = new User();
|
||||
n.authToken = user.authToken;
|
||||
n.me = user.me;
|
||||
n.userid = user.userid;
|
||||
n.name = user.name;
|
||||
n.hasStream = user.hasStream;
|
||||
n.streamName = user.streamName;
|
||||
n.presenter = user.presenter;
|
||||
n.raiseHand = user.raiseHand;
|
||||
n.role = user.role;
|
||||
n.room = user.room;
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
private function sendStreamStartedEvent():void{
|
||||
var dispatcher:Dispatcher = new Dispatcher();
|
||||
dispatcher.dispatchEvent(new StreamStartedEvent(this.name, this.streamName));
|
||||
}
|
||||
}
|
||||
}
|
@ -85,6 +85,9 @@
|
||||
|
||||
private function viewerSelectEvent(event:ListEvent):void {
|
||||
dispatchEvent(new Event(ViewersModuleConstants.VIEWER_SELECTED_EVENT));
|
||||
|
||||
if (viewersGrid.selectedItem.presenter) presentBtn.enabled = false;
|
||||
else presentBtn.enabled = true;
|
||||
}
|
||||
|
||||
private function assignPresenterClicked():void {
|
||||
@ -92,6 +95,8 @@
|
||||
if (viewersGrid.selectedItem.presenter) return;
|
||||
|
||||
dispatchEvent(new AssignPresenterEvent(viewersGrid.selectedItem.userid, viewersGrid.selectedItem.name));
|
||||
|
||||
presentBtn.enabled = false;
|
||||
}
|
||||
|
||||
]]>
|
||||
@ -110,7 +115,7 @@
|
||||
</mx:DataGrid>
|
||||
|
||||
<mx:ControlBar width="100%">
|
||||
<mx:Button id="presentBtn" label="{ResourceUtil.getInstance().getString('bbb.viewers.presentBtn.label')}" visible="{isModerator}" enabled="{viewersGrid.selectedItem != null}"
|
||||
<mx:Button id="presentBtn" label="{ResourceUtil.getInstance().getString('bbb.viewers.presentBtn.label')}" visible="{isModerator}"
|
||||
width="130" height="20"
|
||||
toolTip="{ResourceUtil.getInstance().getString('bbb.viewers.presentBtn.toolTip')}"
|
||||
click="assignPresenterClicked()"/>
|
||||
|
Loading…
Reference in New Issue
Block a user