- add deskshare button on toolbar when a participant becomes presenter
git-svn-id: http://bigbluebutton.googlecode.com/svn/trunk@1898 af16638f-c34d-0410-8cfa-b39d5352b314
This commit is contained in:
parent
8d5306fc13
commit
76c8e8de96
@ -45,6 +45,9 @@ package org.bigbluebutton.common.messaging
|
||||
|
||||
public static const TO_PRESENTATION_MODULE:String = "TO_PRESENTATION_MODULE";
|
||||
public static const FROM_PRESENTATION_MODULE:String = "FROM_PRESENTATION_MODULE";
|
||||
|
||||
public static const TO_DESK_SHARE_MODULE:String = "TO_DESK_SHARE_MODULE";
|
||||
public static const FROM_DESK_SHARE_MODULE:String = "FROM_DESK_SHARE_MODULE";
|
||||
|
||||
public static const OPEN_WINDOW:String = 'OPEN_WINDOW';
|
||||
public static const CLOSE_WINDOW:String = 'CLOSE_WINDOW';
|
||||
@ -72,5 +75,7 @@ package org.bigbluebutton.common.messaging
|
||||
|
||||
public static const NEW_PARTICIPANT:String = 'NEW_PARTICIPANT';
|
||||
public static const PARTICIPANT_LEFT:String = 'PARTICIPANT_LEFT';
|
||||
|
||||
public static const PARTICIPANT_IS_PRESENTER:String = 'PARTICIPANT_IS_PRESENTER';
|
||||
}
|
||||
}
|
@ -125,6 +125,10 @@ package org.bigbluebutton.main
|
||||
LogUtil.debug(NAME + "::Got ADD_BUTTON from " + message.getHeader().SRC as String);
|
||||
sendNotification(MainApplicationConstants.ADD_BUTTON, message.getBody());
|
||||
break;
|
||||
case EndpointMessageConstants.REMOVE_BUTTON:
|
||||
LogUtil.debug(NAME + "::Got REMOVE_BUTTON from " + message.getHeader().SRC as String);
|
||||
sendNotification(MainApplicationConstants.REMOVE_BUTTON, message.getBody());
|
||||
break;
|
||||
case EndpointMessageConstants.REMOVE_WINDOW:
|
||||
LogUtil.debug(NAME + "::Got REMOVE_WINDOW from " + message.getHeader().SRC as String);
|
||||
sendNotification(MainApplicationConstants.REMOVE_WINDOW_MSG, message.getBody());
|
||||
@ -139,6 +143,11 @@ package org.bigbluebutton.main
|
||||
_endpoint.sendMessage(EndpointMessageConstants.BECOME_VIEWER,
|
||||
EndpointMessageConstants.TO_PRESENTATION_MODULE, message.getBody());
|
||||
break;
|
||||
case EndpointMessageConstants.PARTICIPANT_IS_PRESENTER:
|
||||
LogUtil.debug(NAME + "::Got PARTICIPANT_IS_PRESENTER from " + message.getHeader().SRC as String);
|
||||
_endpoint.sendMessage(EndpointMessageConstants.PARTICIPANT_IS_PRESENTER,
|
||||
EndpointMessageConstants.TO_DESK_SHARE_MODULE, message.getBody());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ package org.bigbluebutton.main.view
|
||||
toolbar.addedBtns.addChild(notification.getBody() as Button);
|
||||
break;
|
||||
case MainApplicationConstants.REMOVE_BUTTON:
|
||||
toolbar.removeChild(notification.getBody() as Button);
|
||||
toolbar.addedBtns.removeChild(notification.getBody() as Button);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,9 @@ package org.bigbluebutton.modules.deskShare
|
||||
DeskShareModuleConstants.ADD_WINDOW,
|
||||
DeskShareModuleConstants.REMOVE_WINDOW,
|
||||
DeskShareModuleConstants.CONNECTED,
|
||||
DeskShareModuleConstants.DISCONNECTED
|
||||
DeskShareModuleConstants.DISCONNECTED,
|
||||
DeskShareModuleConstants.ADD_BUTTON,
|
||||
DeskShareModuleConstants.REMOVE_BUTTON
|
||||
];
|
||||
}
|
||||
|
||||
@ -106,6 +108,16 @@ package org.bigbluebutton.modules.deskShare
|
||||
var info:Object = new Object();
|
||||
info["moduleId"] = _module.moduleId;
|
||||
_endpoint.sendMessage(EndpointMessageConstants.MODULE_STOPPED, EndpointMessageConstants.TO_MAIN_APP, info);
|
||||
break;
|
||||
case DeskShareModuleConstants.ADD_BUTTON:
|
||||
LogUtil.debug('Sending DeskShare ADD_BUTTON message to main');
|
||||
_endpoint.sendMessage(EndpointMessageConstants.ADD_BUTTON,
|
||||
EndpointMessageConstants.TO_MAIN_APP, notification.getBody());
|
||||
break;
|
||||
case DeskShareModuleConstants.REMOVE_BUTTON:
|
||||
LogUtil.debug('Sending DeskShare REMOVE_BUTTON message to main');
|
||||
_endpoint.sendMessage(EndpointMessageConstants.REMOVE_BUTTON,
|
||||
EndpointMessageConstants.TO_MAIN_APP, notification.getBody());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -115,13 +127,17 @@ package org.bigbluebutton.modules.deskShare
|
||||
* @param message
|
||||
*
|
||||
*/
|
||||
private function messageReceiver(message:IPipeMessage):void{
|
||||
public function messageReceiver(message:IPipeMessage):void{
|
||||
var msg:String = message.getHeader().MSG as String;
|
||||
switch(msg){
|
||||
case EndpointMessageConstants.OPEN_WINDOW:
|
||||
break;
|
||||
case EndpointMessageConstants.CLOSE_WINDOW:
|
||||
facade.sendNotification(DeskShareModuleConstants.CLOSE_WINDOW);
|
||||
break;
|
||||
case EndpointMessageConstants.PARTICIPANT_IS_PRESENTER:
|
||||
LogUtil.debug('Received EndpointMessageConstants.PARTICIPANT_IS_PRESENTER message from main');
|
||||
facade.sendNotification(DeskShareModuleConstants.PARTICIPANT_IS_PRESENTER, message.getBody());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -45,6 +45,9 @@ package org.bigbluebutton.modules.deskShare
|
||||
public static const GOT_HEIGHT:String = "GOT_HEIGHT";
|
||||
|
||||
public static const APPLET_STARTED:String = "APPLET_STARTED";
|
||||
|
||||
public static const START_DESKSHARE_EVENT:String = 'START_DESKSHARE_EVENT';
|
||||
public static const ADD_BUTTON:String = 'ADD_BUTTON';
|
||||
public static const REMOVE_BUTTON:String = 'REMOVE_BUTTON';
|
||||
public static const PARTICIPANT_IS_PRESENTER:String = 'PARTICIPANT_IS_PRESENTER';
|
||||
}
|
||||
}
|
@ -24,6 +24,7 @@ package org.bigbluebutton.modules.deskShare.controller
|
||||
import org.bigbluebutton.modules.deskShare.DeskShareModuleMediator;
|
||||
import org.bigbluebutton.modules.deskShare.model.business.DeskShareProxy;
|
||||
import org.bigbluebutton.modules.deskShare.view.DeskShareWindowMediator;
|
||||
import org.bigbluebutton.modules.deskShare.view.ToolbarButtonMediator;
|
||||
import org.puremvc.as3.multicore.interfaces.ICommand;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
|
||||
@ -46,7 +47,8 @@ package org.bigbluebutton.modules.deskShare.controller
|
||||
|
||||
facade.registerMediator(new DeskShareModuleMediator(module));
|
||||
facade.registerMediator(new DeskShareEndpointMediator(module));
|
||||
facade.registerMediator(new DeskShareWindowMediator(module));
|
||||
facade.registerMediator(new DeskShareWindowMediator(module));
|
||||
facade.registerMediator(new ToolbarButtonMediator(module));
|
||||
facade.registerProxy(new DeskShareProxy(module));
|
||||
sendNotification(DeskShareModuleConstants.CONNECTED);
|
||||
}
|
||||
|
@ -172,7 +172,6 @@ package org.bigbluebutton.modules.deskShare.view
|
||||
|
||||
var room:String = _module.getRoom();
|
||||
_window.ns.play(room);
|
||||
//_window.lblStatus.text = "You are viewing the desktop for presenter of room " + room;
|
||||
_window.resizable = true;
|
||||
|
||||
viewing = true;
|
||||
@ -228,7 +227,6 @@ package org.bigbluebutton.modules.deskShare.view
|
||||
*/
|
||||
private function onStartSharingEvent(e:Event):void{
|
||||
if (!sharing){
|
||||
//Alert.show(_module.getRoom().toString());
|
||||
var captureX:Number = _window.dimensionsBox.box.x * DeskShareModuleConstants.SCALE;
|
||||
var captureY:Number = _window.dimensionsBox.box.y * DeskShareModuleConstants.SCALE;
|
||||
captureWidth = Math.round(_window.dimensionsBox.box.width * DeskShareModuleConstants.SCALE - 5);
|
||||
@ -237,9 +235,6 @@ package org.bigbluebutton.modules.deskShare.view
|
||||
ExternalInterface.call("startApplet", _module.getCaptureServerUri(), _module.getRoom(),
|
||||
captureX, captureY, captureWidth, captureHeight,
|
||||
_module.tunnel().toString());
|
||||
|
||||
//ExternalInterface.addCallback("appletStartNotification", onAppletStart);
|
||||
|
||||
} else{
|
||||
sharing = false;
|
||||
_window.btnStartApplet.label = "Start Sharing";
|
||||
@ -261,7 +256,6 @@ package org.bigbluebutton.modules.deskShare.view
|
||||
_window.height = _window.bar.height + _window.dimensionsBox.height + 33;
|
||||
_window.width = _window.dimensionsBox.width + 7;
|
||||
_window.btnStartApplet.label = "Stop Sharing";
|
||||
//_window.lblStatus.text = "You are sharing your desktop with room " + _module.getRoom();
|
||||
_window.dimensionsBox.x = 0;
|
||||
_window.dimensionsBox.y = _window.bar.height + 5;
|
||||
_window.dimensionsBox.startThumbnail(proxy.getConnection(), _module.getRoom());
|
||||
|
@ -0,0 +1,81 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.modules.deskShare.view
|
||||
{
|
||||
import flash.events.Event;
|
||||
|
||||
import org.bigbluebutton.modules.deskShare.DeskShareModuleConstants;
|
||||
import org.bigbluebutton.modules.deskShare.view.components.ToolbarButton;
|
||||
import org.puremvc.as3.multicore.interfaces.IMediator;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
|
||||
|
||||
public class ToolbarButtonMediator extends Mediator implements IMediator
|
||||
{
|
||||
public static const NAME:String = "ToolbarButtonMediator";
|
||||
|
||||
private var button:ToolbarButton;
|
||||
private var module:DeskShareModule;
|
||||
private var deskshareButtonDisplayed:Boolean;
|
||||
|
||||
public function ToolbarButtonMediator(module:DeskShareModule)
|
||||
{
|
||||
super(NAME);
|
||||
this.module = module;
|
||||
button = new ToolbarButton();
|
||||
button.enabled = true;
|
||||
deskshareButtonDisplayed = false;
|
||||
button.addEventListener(DeskShareModuleConstants.START_DESKSHARE_EVENT, onStartDeskShareEvent);
|
||||
}
|
||||
|
||||
private function onStartDeskShareEvent(e:Event):void {
|
||||
button.enabled = false;
|
||||
// facade.sendNotification(DeskShareModuleConstants.OPEN_WINDOW);
|
||||
}
|
||||
|
||||
override public function listNotificationInterests():Array
|
||||
{
|
||||
return [
|
||||
DeskShareModuleConstants.PARTICIPANT_IS_PRESENTER
|
||||
];
|
||||
}
|
||||
|
||||
override public function handleNotification(notification:INotification):void
|
||||
{
|
||||
switch(notification.getName()){
|
||||
case DeskShareModuleConstants.PARTICIPANT_IS_PRESENTER:
|
||||
var showButton:Boolean = notification.getBody();
|
||||
if (showButton) {
|
||||
LogUtil.debug(NAME + ": Opening DeskShare Toolbar Button");
|
||||
facade.sendNotification(DeskShareModuleConstants.ADD_BUTTON, button);
|
||||
deskshareButtonDisplayed = true;
|
||||
} else {
|
||||
LogUtil.debug(NAME + ": Removing DeskShare Toolbar Button");
|
||||
if (deskshareButtonDisplayed) {
|
||||
facade.sendNotification(DeskShareModuleConstants.REMOVE_BUTTON, button);
|
||||
deskshareButtonDisplayed = false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
@ -0,0 +1,29 @@
|
||||
/**
|
||||
* 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.deskShare.view.components
|
||||
{
|
||||
[Bindable]
|
||||
public class Images
|
||||
{
|
||||
|
||||
[Embed(source="../assets/images/deskshare_icon.png")]
|
||||
public var deskShareIcon:Class;
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="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/>.
|
||||
|
||||
$Id: $
|
||||
-->
|
||||
|
||||
<mx:Button xmlns:mx="http://www.adobe.com/2006/mxml"
|
||||
icon="{deskShareIcon}" click="startPhone()">
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
import org.bigbluebutton.modules.deskShare.DeskShareModuleConstants;
|
||||
import org.bigbluebutton.modules.deskShare.view.components.Images;
|
||||
|
||||
private var images:Images = new Images();
|
||||
|
||||
[Bindable] public var deskShareIcon:Class = images.deskShareIcon;
|
||||
|
||||
private function startPhone():void {
|
||||
dispatchEvent(new Event(DeskShareModuleConstants.START_DESKSHARE_EVENT));
|
||||
}
|
||||
]]>
|
||||
</mx:Script>
|
||||
</mx:Button>
|
Binary file not shown.
Before Width: | Height: | Size: 137 KiB |
@ -51,10 +51,6 @@ package org.bigbluebutton.modules.phone.view
|
||||
red5Manager.connectRed5();
|
||||
}
|
||||
|
||||
private function onMyCameraWindowClose(e:Event):void {
|
||||
button.enabled = true;
|
||||
}
|
||||
|
||||
override public function listNotificationInterests():Array
|
||||
{
|
||||
return [
|
||||
|
@ -63,6 +63,8 @@ package org.bigbluebutton.modules.presentation
|
||||
PresentModuleConstants.CONNECTED,
|
||||
PresentModuleConstants.DISCONNECTED,
|
||||
PresentModuleConstants.ADD_WINDOW,
|
||||
PresentModuleConstants.PRESENTER_MODE,
|
||||
PresentModuleConstants.VIEWER_MODE,
|
||||
PresentModuleConstants.REMOVE_WINDOW
|
||||
];
|
||||
}
|
||||
@ -97,6 +99,16 @@ package org.bigbluebutton.modules.presentation
|
||||
_endpoint.sendMessage(EndpointMessageConstants.REMOVE_WINDOW,
|
||||
EndpointMessageConstants.TO_MAIN_APP, notification.getBody());
|
||||
break;
|
||||
case PresentModuleConstants.PRESENTER_MODE:
|
||||
LogUtil.debug('Sending Present PARTICIPANT_IS_PRESENTER TRUE message to main');
|
||||
_endpoint.sendMessage(EndpointMessageConstants.PARTICIPANT_IS_PRESENTER,
|
||||
EndpointMessageConstants.TO_MAIN_APP, new Boolean(true));
|
||||
break;
|
||||
case PresentModuleConstants.VIEWER_MODE:
|
||||
LogUtil.debug('Sending Present PARTICIPANT_IS_PRESENTER FALSE message to main');
|
||||
_endpoint.sendMessage(EndpointMessageConstants.PARTICIPANT_IS_PRESENTER,
|
||||
EndpointMessageConstants.TO_MAIN_APP, new Boolean(false));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -123,6 +135,8 @@ package org.bigbluebutton.modules.presentation
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function get presentProxy():PresentProxy {
|
||||
return facade.retrieveProxy(PresentProxy.NAME) as PresentProxy;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user