- add options in config.xml to display the webcam controls

This commit is contained in:
Richard Alam 2012-11-01 17:46:43 +00:00
parent 69a9e980e4
commit c85ae5b760
5 changed files with 47 additions and 6 deletions

View File

@ -55,6 +55,7 @@
dependson = "ViewersModule"
videoQuality = "100"
presenterShareOnly = "false"
controlsForPresenter = "false"
resolutions = "320x240,640x480,1280x720"
autoStart = "false"
showButton = "true"

View File

@ -6,6 +6,10 @@ package org.bigbluebutton.core
public class UsersUtil
{
public static function amIModerator():Boolean {
return UserManager.getInstance().getConference().amIModerator();
}
public static function amIPresenter():Boolean {
return UserManager.getInstance().getConference().amIPresenter();
}

View File

@ -275,8 +275,7 @@ package org.bigbluebutton.modules.videoconf.business
//_buttons.add("fitVideoBtn", img_fit_video, ResourceUtil.getInstance().getString('bbb.video.fitVideoBtn.tooltip'), onFitVideoClick);
_controlButtons.visible = false;
}
return _controlButtons;
}

View File

@ -58,6 +58,16 @@ package org.bigbluebutton.modules.videoconf.model
[Bindable]
public var camQualityPicture:Number = 50;
[Bindable]
public var presenterShareOnly:Boolean = false;
[Bindable]
public var controlsForPresenter:Boolean = false;
public function VideoConfOptions() {
parseOptions();
}
public function parseOptions():void {
var vxml:XML = BBB.getConfigForModule("VideoconfModule");
if (vxml != null) {
@ -72,7 +82,13 @@ package org.bigbluebutton.modules.videoconf.model
}
if (vxml.@publishWindowVisible != undefined) {
publishWindowVisible = (vxml.@publishWindowVisible.toString().toUpperCase() == "TRUE") ? true : false;
}
}
if (vxml.@presenterShareOnly != undefined) {
presenterShareOnly = (vxml.@presenterShareOnly.toString().toUpperCase() == "TRUE") ? true : false;
}
if (vxml.@controlsForPresenter != undefined) {
controlsForPresenter = (vxml.@controlsForPresenter.toString().toUpperCase() == "TRUE") ? true : false;
}
if (vxml.@viewerWindowMaxed != undefined) {
viewerWindowMaxed = (vxml.@viewerWindowMaxed.toString().toUpperCase() == "TRUE") ? true : false;
}

View File

@ -15,7 +15,9 @@
import org.bigbluebutton.main.model.users.BBBUser;
import org.bigbluebutton.main.model.users.events.KickUserEvent;
import org.bigbluebutton.main.model.users.events.RoleChangeEvent;
import org.bigbluebutton.modules.chat.model.ChatOptions;
import org.bigbluebutton.modules.listeners.events.ListenersCommand;
import org.bigbluebutton.modules.videoconf.model.VideoConfOptions;
import org.bigbluebutton.util.i18n.ResourceUtil;
public var sharerUserID:String;
@ -38,7 +40,8 @@
private var showButton:Boolean;
private function onCreationComplete():void {
showButton = UsersUtil.amIPresenter();
showControlButtons(UsersUtil.amIPresenter());
showPrivateChatButton();
}
public function get padding():int {
@ -46,7 +49,7 @@
}
public function handleNewRoleEvent(presenter:Boolean):void {
muteUnmuteBtn.visible = switchPresenter.visible = ejectUserBtn.visible = presenter;
showControlButtons(presenter);
}
private function onKickUserClicked():void {
@ -79,6 +82,24 @@
gd.dispatchEvent(e);
}
}
private function showControlButtons(presenter:Boolean):void {
var vidOptions:VideoConfOptions = new VideoConfOptions();
if (UsersUtil.amIModerator()) {
muteUnmuteBtn.visible = switchPresenter.visible = ejectUserBtn.visible = true;
} else if (vidOptions.controlsForPresenter) {
muteUnmuteBtn.visible = switchPresenter.visible = ejectUserBtn.visible = presenter;
} else {
muteUnmuteBtn.visible = switchPresenter.visible = ejectUserBtn.visible = false;
}
}
private function showPrivateChatButton():void {
var chatOptions:ChatOptions = new ChatOptions();
if (chatOptions.privateEnabled) {
privateChatBtn.visible = true;
}
}
]]>
</mx:Script>
<mx:Button id="muteUnmuteBtn" visible="{showButton}" click="onMuteUnmuteClicked()"
@ -93,7 +114,7 @@
icon="{signOutIcon}" width="{BUTTONS_SIZE}" height="{BUTTONS_SIZE}"
toolTip="{ResourceUtil.getInstance().getString('bbb.viewers.viewersGrid.statusItemRenderer.raiseHand.toolTip'),
[new Date()]}"/>
<mx:Button id="privateChatBtn" visible="{true}" click="onPrivateChatClicked()"
<mx:Button id="privateChatBtn" click="onPrivateChatClicked()"
icon="{chatIcon}" width="{BUTTONS_SIZE}" height="{BUTTONS_SIZE}"
toolTip="{ResourceUtil.getInstance().getString('bbb.viewers.viewersGrid.statusItemRenderer.raiseHand.toolTip'),
[new Date()]}"/>