added video option to prioritize a user's webcam when they start talking

This commit is contained in:
Chad Pilkey 2013-03-23 13:49:30 -04:00
parent 65c28bf90a
commit 3dd69116d9
9 changed files with 86 additions and 6 deletions

View File

@ -88,6 +88,7 @@
h264Level = "2.1"
h264Profile = "main"
displayAvatar = "false"
focusTalking = "false"
/>
<module name="WhiteboardModule" url="http://HOST/client/WhiteboardModule.swf?v=4105"

View File

@ -141,7 +141,6 @@
]]>
</mx:Script>
<mx:Image id="showLock" visible="{data.voiceLocked}" source="{images.lock_close}" width="20" height="20" />
<mx:Image id="talkingIcon" visible="{data.talking}" source="{images.sound_new}" width="20" height="20"
toolTip="{ResourceUtil.getInstance().getString('bbb.users.usersGrid.mediaItemRenderer.talking')}" />
<mx:Button id="webcamBtn" visible="{data.hasStream}" click="viewCamera()" icon="{images.webcam_new}"
@ -157,6 +156,7 @@
width="20" height="20" visible="{rolledOver}"
toolTip="{ResourceUtil.getInstance().getString('bbb.users.usersGrid.mediaItemRenderer.kickUser')}"
click="kickUser()"/>
<mx:Image id="showLock" visible="{data.voiceLocked}" source="{images.lock_close}" width="20" height="20" />
<!-- Helper objects because direct bindings to data break when the itemRenderer is recycled -->
<mx:Image id="muteInd" includeInLayout="false" visible="{data.voiceMuted}" />

View File

@ -45,6 +45,8 @@ package org.bigbluebutton.modules.videoconf.business
import org.bigbluebutton.main.model.users.events.KickUserEvent;
import org.bigbluebutton.main.model.users.events.RoleChangeEvent;
import org.bigbluebutton.main.views.MainCanvas;
import org.bigbluebutton.modules.videoconf.events.UserTalkingEvent;
import org.bigbluebutton.modules.videoconf.model.VideoConfOptions;
import org.bigbluebutton.modules.videoconf.views.ControlButtons;
import org.bigbluebutton.util.i18n.ResourceUtil;
@ -76,6 +78,8 @@ package org.bigbluebutton.modules.videoconf.business
[Bindable] public var resolutions:Array;
protected var videoConfOptions:VideoConfOptions = new VideoConfOptions();
public function getWindowType():String {
return windowType;
}
@ -324,5 +328,12 @@ package org.bigbluebutton.modules.videoconf.business
protected function userMuted(muted:Boolean):void {
_controlButtons.userMuted(muted);
}
protected function simulateClick():void {
if (videoConfOptions.focusTalking) {
var talkingEvent:UserTalkingEvent = new UserTalkingEvent(UserTalkingEvent.TALKING);
dispatchEvent(talkingEvent);
}
}
}
}

View File

@ -0,0 +1,32 @@
/*
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2012 BigBlueButton Inc. and 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 3.0 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, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.modules.videoconf.events
{
import flash.events.Event;
public class UserTalkingEvent extends Event
{
public static const TALKING:String = "USER TALKING PRIORITIZE";
public function UserTalkingEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
{
super(type, bubbles, cancelable);
}
}
}

View File

@ -95,6 +95,9 @@ package org.bigbluebutton.modules.videoconf.model
[Bindable]
public var displayAvatar:Boolean = false;
[Bindable]
public var focusTalking:Boolean = false;
public function VideoConfOptions() {
parseOptions();
}
@ -189,6 +192,10 @@ package org.bigbluebutton.modules.videoconf.model
if (vxml.@displayAvatar != undefined) {
displayAvatar = (vxml.@displayAvatar.toString().toUpperCase() == "TRUE") ? true : false;
}
if (vxml.@focusTalking != undefined) {
focusTalking = (vxml.@focusTalking.toString().toUpperCase() == "TRUE") ? true : false;
}
}
}
}

View File

@ -145,6 +145,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
if (event.message.talking) {
notTalkingEffect.end();
talkingEffect.play([this]);
simulateClick();
} else {
talkingEffect.end();
notTalkingEffect.play([this]);

View File

@ -172,6 +172,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
if (event.message.talking) {
notTalkingEffect.end();
talkingEffect.play([this]);
simulateClick();
} else {
talkingEffect.end();
notTalkingEffect.play([this]);

View File

@ -137,6 +137,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
if (event.message.talking) {
notTalkingEffect.end();
talkingEffect.play([this]);
simulateClick();
} else {
talkingEffect.end();
notTalkingEffect.play([this]);

View File

@ -55,6 +55,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.main.views.MainCanvas;
import org.bigbluebutton.modules.videoconf.business.VideoWindowItf;
import org.bigbluebutton.modules.videoconf.events.OpenVideoWindowEvent;
import org.bigbluebutton.modules.videoconf.events.UserTalkingEvent;
import org.bigbluebutton.modules.videoconf.model.VideoConfOptions;
import org.bigbluebutton.util.i18n.ResourceUtil;
import org.bigbluebutton.common.events.LocaleChangeEvent;
@ -71,6 +73,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private var priorityWindowWeight:Number = 2/3;
private var options:DockOptions = new DockOptions();
private var confOptions:VideoConfOptions = new VideoConfOptions();
private var dispatcher:Dispatcher;
private var keyCombos:Object;
@ -264,6 +267,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
window.draggable = false;
window.addEventListener(MouseEvent.CLICK, onWindowClick);
window.addEventListener(UserTalkingEvent.TALKING, onTalking);
var e:CloseWindowEvent = new CloseWindowEvent();
e.window = window;
@ -422,6 +426,28 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
updateChildrenDimensions(mutableChildrenArray);
}
protected function onTalking(event:UserTalkingEvent):void {
prioritizeTalking(event.currentTarget);
}
private function prioritizeTalking(window:Object):void {
if (mutableChildrenArray.length <= 1
|| options.layout == DockOptions.LAYOUT_NONE)
return;
if (window == priorityWindow) //window already prioritized
return;
var index:int = mutableChildrenArray.indexOf(window);
if (index != -1) {
mutableChildrenArray[index] = mutableChildrenArray[0];
mutableChildrenArray[0] = window;
_prioritizeWindow = true;
}
updateChildrenDimensions(mutableChildrenArray);
}
private function prioritizeAnyWindow():void {
if (mutableChildrenArray.length > 0)
prioritizeWindow(mutableChildrenArray[0]);