diff --git a/bigbluebutton-client/src/org/bigbluebutton/core/model/users/Users2x.as b/bigbluebutton-client/src/org/bigbluebutton/core/model/users/Users2x.as index a792da174a69376da33bac591d70af4a39e55236..1621e42b987200c8a0967bef7abaa3be07b6dd07 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/core/model/users/Users2x.as +++ b/bigbluebutton-client/src/org/bigbluebutton/core/model/users/Users2x.as @@ -4,9 +4,6 @@ package org.bigbluebutton.core.model.users import org.as3commons.lang.ArrayUtils; import org.as3commons.lang.StringUtils; - import org.bigbluebutton.core.model.BreakoutUser; - import org.bigbluebutton.main.model.users.BBBUser; - import org.bigbluebutton.main.model.users.BreakoutRoom; public class Users2x { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/maps/VideoEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/maps/VideoEventMap.mxml index 2ec35ab8d59c9119782235ea0431e54f523167b6..64205624f0667ad277d02cf89f3db4c3f58adca9 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/maps/VideoEventMap.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/maps/VideoEventMap.mxml @@ -40,108 +40,113 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. import org.bigbluebutton.modules.videoconf.events.StopBroadcastEvent; import org.bigbluebutton.modules.videoconf.events.StopShareCameraRequestEvent; import org.bigbluebutton.modules.videoconf.events.VideoModuleStartEvent; - import org.bigbluebutton.modules.videoconf.events.VideoModuleStopEvent; + import org.bigbluebutton.modules.videoconf.events.VideoModuleStopEvent; ]]> </fx:Script> <fx:Declarations> - <EventHandlers type="{VideoModuleStartEvent.START}"> - <ObjectBuilder generator="{VideoEventMapDelegate}" cache="global" constructorArguments="{scope.dispatcher}"/> - <MethodInvoker generator="{VideoEventMapDelegate}" method="start" arguments="{event.uri}"/> - <EventAnnouncer generator="{ConnectAppEvent}" type="{ConnectAppEvent.CONNECT_VIDEO_APP}" /> - </EventHandlers> - - <EventHandlers type="{VideoModuleStopEvent.STOP}"> - <MethodInvoker generator="{VideoEventMapDelegate}" method="stopModule"/> - </EventHandlers> - - <EventHandlers type="{BBBEvent.CAMERA_SETTING}" > - <MethodInvoker generator="{VideoEventMapDelegate}" method="handleCameraSetting" arguments="{event}"/> - </EventHandlers> - + <EventHandlers type="{VideoModuleStartEvent.START}"> + <ObjectBuilder generator="{VideoEventMapDelegate}" cache="global" constructorArguments="{scope.dispatcher}"/> + <MethodInvoker generator="{VideoEventMapDelegate}" method="start" arguments="{event.uri}"/> + <EventAnnouncer generator="{ConnectAppEvent}" type="{ConnectAppEvent.CONNECT_VIDEO_APP}" /> + </EventHandlers> + + <EventHandlers type="{VideoModuleStopEvent.STOP}"> + <MethodInvoker generator="{VideoEventMapDelegate}" method="stopModule"/> + </EventHandlers> + + <EventHandlers type="{BBBEvent.CAMERA_SETTING}" > + <MethodInvoker generator="{VideoEventMapDelegate}" method="handleCameraSetting" arguments="{event}"/> + </EventHandlers> + <EventHandlers type="{BBBEvent.ERASE_CAMERA_SETTING}" > <MethodInvoker generator="{VideoEventMapDelegate}" method="handleEraseCameraSetting" arguments="{event}"/> </EventHandlers> - - <EventHandlers type="{ConnectAppEvent.CONNECT_VIDEO_APP}"> - <MethodInvoker generator="{VideoEventMapDelegate}" method="connectToVideoApp"/> - </EventHandlers> - + + <EventHandlers type="{ConnectAppEvent.CONNECT_VIDEO_APP}"> + <MethodInvoker generator="{VideoEventMapDelegate}" method="connectToVideoApp"/> + </EventHandlers> + <EventHandlers type="{ShareCameraRequestEvent.SHARE_CAMERA_REQUEST}"> - <MethodInvoker generator="{VideoEventMapDelegate}" method="handleShareCameraRequestEvent" arguments="{event}"/> - </EventHandlers> - - <EventHandlers type="{StopShareCameraRequestEvent.STOP_SHARE_CAMERA_REQUEST}"> - <MethodInvoker generator="{VideoEventMapDelegate}" method="handleStopShareCameraRequestEvent" arguments="{event}"/> - </EventHandlers> - - <EventHandlers type="{StopShareCameraRequestEvent.STOP_SHARE_ALL_CAMERA_REQUEST}"> - <MethodInvoker generator="{VideoEventMapDelegate}" method="handleStopAllShareCameraRequestEvent" arguments="{event}"/> - </EventHandlers> - + <MethodInvoker generator="{VideoEventMapDelegate}" method="handleShareCameraRequestEvent" arguments="{event}"/> + </EventHandlers> + + <EventHandlers type="{StopShareCameraRequestEvent.STOP_SHARE_CAMERA_REQUEST}"> + <MethodInvoker generator="{VideoEventMapDelegate}" method="handleStopShareCameraRequestEvent" arguments="{event}"/> + </EventHandlers> + + <EventHandlers type="{StopShareCameraRequestEvent.STOP_SHARE_ALL_CAMERA_REQUEST}"> + <MethodInvoker generator="{VideoEventMapDelegate}" method="handleStopAllShareCameraRequestEvent" arguments="{event}"/> + </EventHandlers> + <EventHandlers type="{StartBroadcastEvent.START_BROADCAST}" > - <MethodInvoker generator="{VideoEventMapDelegate}" method="startPublishing" arguments="{event}" /> + <MethodInvoker generator="{VideoEventMapDelegate}" method="startPublishing" arguments="{event}" /> </EventHandlers> - + <EventHandlers type="{StopBroadcastEvent.STOP_BROADCASTING}" > - <MethodInvoker generator="{VideoEventMapDelegate}" method="stopPublishing" arguments="{event}" /> + <MethodInvoker generator="{VideoEventMapDelegate}" method="stopPublishing" arguments="{event}" /> </EventHandlers> - + <EventHandlers type="{StreamStartedEvent.STREAM_STARTED}"> - <ObjectBuilder generator="{VideoEventMapDelegate}" cache="global" constructorArguments="{scope.dispatcher}"/> - <MethodInvoker generator="{VideoEventMapDelegate}" method="viewCamera" arguments="{[event.userID]}" /> + <ObjectBuilder generator="{VideoEventMapDelegate}" cache="global" constructorArguments="{scope.dispatcher}"/> + <MethodInvoker generator="{VideoEventMapDelegate}" method="viewCamera" arguments="{[event.userID]}" /> </EventHandlers> + <EventHandlers type="{BBBEvent.CHANGE_WEBCAMS_ONLY_FOR_MODERATOR}"> + <ObjectBuilder generator="{VideoEventMapDelegate}" cache="global" constructorArguments="{scope.dispatcher}"/> + <MethodInvoker generator="{VideoEventMapDelegate}" method="webcamsOnlyForModeratorChanged"/> + </EventHandlers> + <EventHandlers type="{StreamStoppedEvent.STREAM_STOPPED}"> <MethodInvoker generator="{VideoEventMapDelegate}" method="handleStreamStoppedEvent" arguments="{event}" /> </EventHandlers> - + <EventHandlers type="{ViewCameraEvent.VIEW_CAMERA_EVENT}"> - <MethodInvoker generator="{VideoEventMapDelegate}" method="viewCamera" arguments="{[event.userID]}" /> - </EventHandlers> - - <EventHandlers type="{UserJoinedEvent.JOINED}"> - <ObjectBuilder generator="{VideoEventMapDelegate}" cache="global" constructorArguments="{scope.dispatcher}"/> - <MethodInvoker generator="{VideoEventMapDelegate}" method="handleUserJoinedEvent" arguments="{event}" /> - </EventHandlers> - - <EventHandlers type="{UserLeftEvent.LEFT}"> - <ObjectBuilder generator="{VideoEventMapDelegate}" cache="global" constructorArguments="{scope.dispatcher}"/> - <MethodInvoker generator="{VideoEventMapDelegate}" method="handleUserLeftEvent" arguments="{event}" /> - </EventHandlers> - + <MethodInvoker generator="{VideoEventMapDelegate}" method="viewCamera" arguments="{[event.userID]}" /> + </EventHandlers> + + <EventHandlers type="{UserJoinedEvent.JOINED}"> + <ObjectBuilder generator="{VideoEventMapDelegate}" cache="global" constructorArguments="{scope.dispatcher}"/> + <MethodInvoker generator="{VideoEventMapDelegate}" method="handleUserJoinedEvent" arguments="{event}" /> + </EventHandlers> + + <EventHandlers type="{UserLeftEvent.LEFT}"> + <ObjectBuilder generator="{VideoEventMapDelegate}" cache="global" constructorArguments="{scope.dispatcher}"/> + <MethodInvoker generator="{VideoEventMapDelegate}" method="handleUserLeftEvent" arguments="{event}" /> + </EventHandlers> + <EventHandlers type="{MadePresenterEvent.SWITCH_TO_PRESENTER_MODE}" > - <ObjectBuilder generator="{VideoEventMapDelegate}" cache="global" constructorArguments="{scope.dispatcher}"/> - <MethodInvoker generator="{VideoEventMapDelegate}" method="switchToPresenter" arguments="{event}"/> + <ObjectBuilder generator="{VideoEventMapDelegate}" cache="global" constructorArguments="{scope.dispatcher}"/> + <MethodInvoker generator="{VideoEventMapDelegate}" method="switchToPresenter" arguments="{event}"/> </EventHandlers> - + <EventHandlers type="{MadePresenterEvent.SWITCH_TO_VIEWER_MODE}"> - <ObjectBuilder generator="{VideoEventMapDelegate}" cache="global" constructorArguments="{scope.dispatcher}"/> - <MethodInvoker generator="{VideoEventMapDelegate}" method="switchToViewer" arguments="{event}"/> - </EventHandlers> - - <EventHandlers type="{ConnectedEvent.VIDEO_CONNECTED}"> - <MethodInvoker generator="{VideoEventMapDelegate}" method="connectedToVideoApp" arguments="{event}"/> - </EventHandlers> - - <EventHandlers type="{ClosePublishWindowEvent.CLOSE_PUBLISH_WINDOW}"> - <MethodInvoker generator="{VideoEventMapDelegate}" method="handleClosePublishWindowEvent" arguments="{event}"/> - </EventHandlers> - - <EventHandlers type="{StoppedViewingWebcamEvent.STOPPED_VIEWING_WEBCAM}"> - <MethodInvoker generator="{VideoEventMapDelegate}" method="handleStoppedViewingWebcamEvent" arguments="{event}"/> - </EventHandlers> - - <EventHandlers type="{BBBEvent.CAM_SETTINGS_CLOSED}"> - <MethodInvoker generator="{VideoEventMapDelegate}" method="handleCamSettingsClosedEvent" arguments="{event}"/> - </EventHandlers> - - <EventHandlers type="{BBBEvent.RECONNECT_DISCONNECTED_EVENT}"> - <MethodInvoker generator="{VideoEventMapDelegate}" method="handleReconnectDisconnectedEvent" arguments="{event}"/> - </EventHandlers> - - <EventHandlers type="{AddStaticComponent.ADD_STATIC_COMPONENT}"> - <MethodInvoker generator="{VideoEventMapDelegate}" method="addStaticComponent" arguments="{[event.component]}" /> - </EventHandlers> - <!-- ~~~~~~~~~~~~~~~~~~ INJECTORS ~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> + <ObjectBuilder generator="{VideoEventMapDelegate}" cache="global" constructorArguments="{scope.dispatcher}"/> + <MethodInvoker generator="{VideoEventMapDelegate}" method="switchToViewer" arguments="{event}"/> + </EventHandlers> + + <EventHandlers type="{ConnectedEvent.VIDEO_CONNECTED}"> + <MethodInvoker generator="{VideoEventMapDelegate}" method="connectedToVideoApp" arguments="{event}"/> + </EventHandlers> + + <EventHandlers type="{ClosePublishWindowEvent.CLOSE_PUBLISH_WINDOW}"> + <MethodInvoker generator="{VideoEventMapDelegate}" method="handleClosePublishWindowEvent" arguments="{event}"/> + </EventHandlers> + + <EventHandlers type="{StoppedViewingWebcamEvent.STOPPED_VIEWING_WEBCAM}"> + <MethodInvoker generator="{VideoEventMapDelegate}" method="handleStoppedViewingWebcamEvent" arguments="{event}"/> + </EventHandlers> + + <EventHandlers type="{BBBEvent.CAM_SETTINGS_CLOSED}"> + <MethodInvoker generator="{VideoEventMapDelegate}" method="handleCamSettingsClosedEvent" arguments="{event}"/> + </EventHandlers> + + <EventHandlers type="{BBBEvent.RECONNECT_DISCONNECTED_EVENT}"> + <MethodInvoker generator="{VideoEventMapDelegate}" method="handleReconnectDisconnectedEvent" arguments="{event}"/> + </EventHandlers> + + <EventHandlers type="{AddStaticComponent.ADD_STATIC_COMPONENT}"> + <MethodInvoker generator="{VideoEventMapDelegate}" method="addStaticComponent" arguments="{[event.component]}" /> + </EventHandlers> + <!-- ~~~~~~~~~~~~~~~~~~ INJECTORS ~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> </fx:Declarations> </EventMap> diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/maps/VideoEventMapDelegate.as b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/maps/VideoEventMapDelegate.as index 0580752401e1de240a0bfffa972a4d519991547c..e74ba40e7103ddcb97c4104449d6b6b5582ba5ae 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/maps/VideoEventMapDelegate.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/maps/VideoEventMapDelegate.as @@ -48,6 +48,7 @@ package org.bigbluebutton.modules.videoconf.maps import org.bigbluebutton.main.events.UserLeftEvent; import org.bigbluebutton.main.model.users.events.BroadcastStartedEvent; import org.bigbluebutton.main.model.users.events.BroadcastStoppedEvent; + import org.bigbluebutton.main.model.users.events.StreamStartedEvent; import org.bigbluebutton.main.model.users.events.StreamStoppedEvent; import org.bigbluebutton.modules.videoconf.business.VideoProxy; import org.bigbluebutton.modules.videoconf.events.ClosePublishWindowEvent; @@ -114,6 +115,25 @@ package org.bigbluebutton.modules.videoconf.maps public function addStaticComponent(component:IUIComponent):void { _graphics.addStaticComponent(component); } + + public function webcamsOnlyForModeratorChanged():void { + if (!UsersUtil.amIModerator()) { + var webcamsOnlyForModerator:Boolean = LiveMeeting.inst().meeting.webcamsOnlyForModerator; + for (var i:int = 0; i < UsersUtil.getUsers().length; i++) { + var user : User2x = User2x(UsersUtil.getUsers()[i]); + if (user.role != Role.MODERATOR) { + var streamNames:Array = LiveMeeting.inst().webcams.getStreamIdsForUser(user.intId); + if (webcamsOnlyForModerator && !UsersUtil.isMe(user.intId)) { + for (var j:int = 0; j < streamNames.length; j++) { + _dispatcher.dispatchEvent(new StreamStoppedEvent(user.intId, streamNames[j])); + } + } else { + _dispatcher.dispatchEvent(new StreamStartedEvent(user.intId, user.name, streamNames[j])); + } + } + } + } + } public function viewCamera(userID:String):void { LOGGER.debug("VideoEventMapDelegate:: [{0}] viewCamera. ready = [{1}]", [me, _ready]);