Merge branch 'master' into embed-flash-client-in-another-app

This commit is contained in:
Richard Alam 2013-09-19 21:27:52 +00:00
commit f6b5959992
2 changed files with 35 additions and 16 deletions

View File

@ -62,15 +62,15 @@ package org.bigbluebutton.modules.videoconf.maps
private var webcamWindows:WindowManager = new WindowManager();
private var button:ToolbarButton;
private var button:ToolbarButton = new ToolbarButton();
private var proxy:VideoProxy;
private var streamName:String;
private var _dispatcher:IEventDispatcher;
private var _ready:Boolean = false;
private var _isPublishing:Boolean = false;
private var _isPreviewWebcamOpen:Boolean = false;
private var _isWaitingActivation:Boolean = false;
private var _isPreviewWebcamOpen:Boolean = false;
private var _isWaitingActivation:Boolean = false;
public function VideoEventMapDelegate(dispatcher:IEventDispatcher)
{
@ -114,10 +114,25 @@ package org.bigbluebutton.modules.videoconf.maps
}
}
private function displayToolbarButton():void {
button.isPresenter = true;
if (options.presenterShareOnly) {
if (UsersUtil.amIPresenter()) {
button.isPresenter = true;
} else {
button.isPresenter = false;
}
}
}
private function addToolbarButton():void{
if (proxy.videoOptions.showButton || proxy.videoOptions.presenterShareOnly) {
button = new ToolbarButton();
button.isPresenter = !options.presenterShareOnly;
LogUtil.debug("****************** Adding toolbar button. presenter?=[" + UsersUtil.amIPresenter() + "]");
if (proxy.videoOptions.showButton) {
displayToolbarButton();
var event:ToolbarButtonEvent = new ToolbarButtonEvent(ToolbarButtonEvent.ADD);
event.button = button;
event.module="Webcam";
@ -365,20 +380,21 @@ package org.bigbluebutton.modules.videoconf.maps
public function switchToPresenter(event:MadePresenterEvent):void{
trace("VideoEventMapDelegate:: [" + me + "] Got Switch to presenter event. ready = [" + _ready + "]");
if (!_ready) return;
// if (!_ready) return;
if (options.presenterShareOnly){
button.isPresenter = true;
}
if (options.showButton) {
displayToolbarButton();
}
}
public function switchToViewer(event:MadePresenterEvent):void{
trace("VideoEventMapDelegate:: [" + me + "] Got Switch to viewer event. ready = [" + _ready + "]");
if (!_ready) return;
// if (!_ready) return;
if (options.presenterShareOnly){
button.isPresenter = false;
if (options.showButton){
LogUtil.debug("****************** Switching to viewer. Show video button?=[" + UsersUtil.amIPresenter() + "]");
displayToolbarButton();
if (_isPublishing) {
stopBroadcasting();
}

View File

@ -27,7 +27,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
mouseOut = "mouseOutHandler(event)"
height="24"
toolTip="{this.selected ? ResourceUtil.getInstance().getString('bbb.toolbar.video.toolTip.stop') : ResourceUtil.getInstance().getString('bbb.toolbar.video.toolTip.start')}"
visible="{isPresenter}"
visible="false"
implements="org.bigbluebutton.common.IBbbToolbarComponent">
<mate:Listener type="{ShortcutEvent.SHARE_WEBCAM}" method="remoteClick" />
@ -46,7 +46,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.modules.videoconf.events.ShareCameraRequestEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
[Bindable] public var isPresenter:Boolean;
private var images:Images = new Images();
[Bindable] public var camIcon:Class = images.webcam;
@ -71,6 +70,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
_currentState = OFF_STATE;
}
public function set isPresenter(presenter:Boolean):void {
visible = presenter;
}
public function remoteClick(e:ShortcutEvent):void{
openPublishWindow();
dispatchEvent(new ShortcutEvent(ShortcutEvent.REMOTE_FOCUS_WEBCAM));