make gloweffect configurable

This commit is contained in:
Markos Calderon 2013-04-04 15:50:12 -05:00
parent 8092532740
commit 0db6cfedb6
5 changed files with 297 additions and 257 deletions

View File

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

View File

@ -22,14 +22,14 @@ package org.bigbluebutton.modules.videoconf.model
public class VideoConfOptions public class VideoConfOptions
{ {
public var uri:String = "rtmp://localhost/video"; public var uri:String = "rtmp://localhost/video";
[Bindable] [Bindable]
public var videoQuality:Number = 100; public var videoQuality:Number = 100;
[Bindable] [Bindable]
public var resolutions:String = "320x240,640x480,1280x720"; public var resolutions:String = "320x240,640x480,1280x720";
[Bindable] [Bindable]
public var autoStart:Boolean = false; public var autoStart:Boolean = false;
@ -44,10 +44,10 @@ package org.bigbluebutton.modules.videoconf.model
[Bindable] [Bindable]
public var viewerWindowMaxed:Boolean = false; public var viewerWindowMaxed:Boolean = false;
[Bindable] [Bindable]
public var viewerWindowLocation:String = "middle"; public var viewerWindowLocation:String = "middle";
[Bindable] [Bindable]
public var camKeyFrameInterval:Number = 5; public var camKeyFrameInterval:Number = 5;
@ -56,25 +56,25 @@ package org.bigbluebutton.modules.videoconf.model
[Bindable] [Bindable]
public var camQualityBandwidth:Number = 0; public var camQualityBandwidth:Number = 0;
[Bindable] [Bindable]
public var smoothVideo:Boolean = false; public var smoothVideo:Boolean = false;
[Bindable] [Bindable]
public var applyConvolutionFilter:Boolean = false; public var applyConvolutionFilter:Boolean = false;
[Bindable] [Bindable]
public var convolutionFilter:Array = [-1, 0, -1, 0, 6, 0, -1, 0, -1]; public var convolutionFilter:Array = [-1, 0, -1, 0, 6, 0, -1, 0, -1];
[Bindable] [Bindable]
public var filterBias:Number = 0; public var filterBias:Number = 0;
[Bindable] [Bindable]
public var filterDivisor:Number = 4; public var filterDivisor:Number = 4;
[Bindable] [Bindable]
public var enableH264:Boolean = false; public var enableH264:Boolean = false;
[Bindable] [Bindable]
public var h264Level:String = "2.1"; public var h264Level:String = "2.1";
@ -86,34 +86,40 @@ package org.bigbluebutton.modules.videoconf.model
[Bindable] public var baseTabIndex:int; [Bindable] public var baseTabIndex:int;
[Bindable] [Bindable]
public var presenterShareOnly:Boolean = false; public var presenterShareOnly:Boolean = false;
[Bindable] [Bindable]
public var controlsForPresenter:Boolean = false; public var controlsForPresenter:Boolean = false;
[Bindable] [Bindable]
public var displayAvatar:Boolean = false; public var displayAvatar:Boolean = false;
[Bindable] [Bindable]
public var focusTalking:Boolean = false; public var focusTalking:Boolean = false;
public function VideoConfOptions() { [Bindable]
parseOptions(); public var glowColor:String = "0x4A931D";
}
[Bindable]
public var glowBlurSize:Number = 30.0;
public function VideoConfOptions() {
parseOptions();
}
public function parseOptions():void { public function parseOptions():void {
var vxml:XML = BBB.getConfigForModule("VideoconfModule"); var vxml:XML = BBB.getConfigForModule("VideoconfModule");
if (vxml != null) { if (vxml != null) {
if (vxml.@uri != undefined) { if (vxml.@uri != undefined) {
uri = vxml.@uri.toString(); uri = vxml.@uri.toString();
} }
if (vxml.@videoQuality != undefined) { if (vxml.@videoQuality != undefined) {
videoQuality = Number(vxml.@videoQuality.toString()); videoQuality = Number(vxml.@videoQuality.toString());
} }
if (vxml.@resolutions != undefined) { if (vxml.@resolutions != undefined) {
resolutions = vxml.@resolutions.toString(); resolutions = vxml.@resolutions.toString();
} }
if (vxml.@showCloseButton != undefined) { if (vxml.@showCloseButton != undefined) {
showCloseButton = (vxml.@showCloseButton.toString().toUpperCase() == "TRUE") ? true : false; showCloseButton = (vxml.@showCloseButton.toString().toUpperCase() == "TRUE") ? true : false;
} }
@ -126,12 +132,12 @@ package org.bigbluebutton.modules.videoconf.model
if (vxml.@publishWindowVisible != undefined) { if (vxml.@publishWindowVisible != undefined) {
publishWindowVisible = (vxml.@publishWindowVisible.toString().toUpperCase() == "TRUE") ? true : false; publishWindowVisible = (vxml.@publishWindowVisible.toString().toUpperCase() == "TRUE") ? true : false;
} }
if (vxml.@presenterShareOnly != undefined) { if (vxml.@presenterShareOnly != undefined) {
presenterShareOnly = (vxml.@presenterShareOnly.toString().toUpperCase() == "TRUE") ? true : false; presenterShareOnly = (vxml.@presenterShareOnly.toString().toUpperCase() == "TRUE") ? true : false;
} }
if (vxml.@controlsForPresenter != undefined) { if (vxml.@controlsForPresenter != undefined) {
controlsForPresenter = (vxml.@controlsForPresenter.toString().toUpperCase() == "TRUE") ? true : false; controlsForPresenter = (vxml.@controlsForPresenter.toString().toUpperCase() == "TRUE") ? true : false;
} }
if (vxml.@viewerWindowMaxed != undefined) { if (vxml.@viewerWindowMaxed != undefined) {
viewerWindowMaxed = (vxml.@viewerWindowMaxed.toString().toUpperCase() == "TRUE") ? true : false; viewerWindowMaxed = (vxml.@viewerWindowMaxed.toString().toUpperCase() == "TRUE") ? true : false;
} }
@ -188,13 +194,21 @@ package org.bigbluebutton.modules.videoconf.model
else{ else{
baseTabIndex = 101; baseTabIndex = 101;
} }
if (vxml.@displayAvatar != undefined) { if (vxml.@displayAvatar != undefined) {
displayAvatar = (vxml.@displayAvatar.toString().toUpperCase() == "TRUE") ? true : false; displayAvatar = (vxml.@displayAvatar.toString().toUpperCase() == "TRUE") ? true : false;
} }
if (vxml.@focusTalking != undefined) { if (vxml.@focusTalking != undefined) {
focusTalking = (vxml.@focusTalking.toString().toUpperCase() == "TRUE") ? true : false; focusTalking = (vxml.@focusTalking.toString().toUpperCase() == "TRUE") ? true : false;
}
if (vxml.@glowColor != undefined) {
glowColor = vxml.@glowColor.toString();
}
if (vxml.@glowBlurSize != undefined) {
glowBlurSize = Number(vxml.@glowBlurSize.toString());
} }
} }
} }

View File

@ -24,8 +24,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:pubVid="org.bigbluebutton.modules.videoconf.business.*" xmlns:pubVid="org.bigbluebutton.modules.videoconf.business.*"
implements="org.bigbluebutton.common.IBbbModuleWindow" implements="org.bigbluebutton.common.IBbbModuleWindow"
styleNameFocus="videoAvatarStyleFocus" styleNameFocus="videoAvatarStyleFocus"
styleNameNoFocus="videoAvatarStyleNoFocus" styleNameNoFocus="videoAvatarStyleNoFocus"
creationComplete="onCreationComplete()" creationComplete="onCreationComplete()"
width="{defaultWidth + 6}" height="{defaultHeight + 6}" width="{defaultWidth + 6}" height="{defaultHeight + 6}"
xmlns:mate="http://mate.asfusion.com/" xmlns:mate="http://mate.asfusion.com/"
@ -34,158 +34,168 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
verticalScrollPolicy="off" verticalScrollPolicy="off"
layout="absolute"> layout="absolute">
<mate:Listener type="{BBBEvent.USER_VOICE_MUTED}" method="handleUserVoiceMutedEvent" /> <mate:Listener type="{BBBEvent.USER_VOICE_MUTED}" method="handleUserVoiceMutedEvent" />
<mate:Listener type="{EventConstants.USER_TALKING}" method="handleUserTalkingEvent" /> <mate:Listener type="{EventConstants.USER_TALKING}" method="handleUserTalkingEvent" />
<mate:Listener type="{SwitchedPresenterEvent.SWITCHED_PRESENTER}" method="handleNewRoleEvent" /> <mate:Listener type="{SwitchedPresenterEvent.SWITCHED_PRESENTER}" method="handleNewRoleEvent" />
<mate:Listener type="{CloseAllWindowsEvent.CLOSE_ALL_WINDOWS}" method="closeWindow" /> <mate:Listener type="{CloseAllWindowsEvent.CLOSE_ALL_WINDOWS}" method="closeWindow" />
<mx:Script> <mx:Script>
<![CDATA[ <![CDATA[
import flexlib.mdi.events.MDIWindowEvent; import flexlib.mdi.events.MDIWindowEvent;
import mx.core.UIComponent;
import mx.events.ResizeEvent; import mx.core.UIComponent;
import org.bigbluebutton.common.Images; import mx.events.ResizeEvent;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.Role; import org.bigbluebutton.common.Images;
import org.bigbluebutton.common.events.CloseWindowEvent; import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.events.LocaleChangeEvent; import org.bigbluebutton.common.Role;
import org.bigbluebutton.core.EventConstants; import org.bigbluebutton.common.events.CloseWindowEvent;
import org.bigbluebutton.core.UsersUtil; import org.bigbluebutton.common.events.LocaleChangeEvent;
import org.bigbluebutton.core.events.CoreEvent; import org.bigbluebutton.core.EventConstants;
import org.bigbluebutton.core.events.SwitchedLayoutEvent; import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.core.managers.UserManager; import org.bigbluebutton.core.events.CoreEvent;
import org.bigbluebutton.main.events.BBBEvent; import org.bigbluebutton.core.events.SwitchedLayoutEvent;
import org.bigbluebutton.main.events.SwitchedPresenterEvent; import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.main.views.MainCanvas; import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.modules.videoconf.business.TalkingButtonOverlay; import org.bigbluebutton.main.events.SwitchedPresenterEvent;
import org.bigbluebutton.modules.videoconf.events.CloseAllWindowsEvent; import org.bigbluebutton.main.views.MainCanvas;
import org.bigbluebutton.modules.videoconf.events.OpenVideoWindowEvent; import org.bigbluebutton.modules.videoconf.business.TalkingButtonOverlay;
import org.bigbluebutton.modules.videoconf.events.StartBroadcastEvent; import org.bigbluebutton.modules.videoconf.events.CloseAllWindowsEvent;
import org.bigbluebutton.modules.videoconf.model.VideoConfOptions; import org.bigbluebutton.modules.videoconf.events.OpenVideoWindowEvent;
import org.bigbluebutton.util.i18n.ResourceUtil; import org.bigbluebutton.modules.videoconf.events.StartBroadcastEvent;
import org.bigbluebutton.modules.videoconf.model.VideoConfOptions;
import org.bigbluebutton.util.i18n.ResourceUtil;
[Bindable] private var defaultWidth:Number = 320; [Bindable] private var defaultWidth:Number = 320;
[Bindable] private var defaultHeight:Number = 240; [Bindable] private var defaultHeight:Number = 240;
[Bindable] public var glowColor:String = "";
[Bindable] public var glowBlurSize:Number = 0;
private var camWidth:Number = 320; private var camWidth:Number = 320;
private var camHeight:Number = 240; private var camHeight:Number = 240;
private var windowType:String = "AvatarWindowType"; private var videoconfOptions:VideoConfOptions = new VideoConfOptions();
override public function getWindowType():String { private var windowType:String = "AvatarWindowType";
return windowType;
} override public function getWindowType():String {
return windowType;
private var loader:Loader; }
private var request:URLRequest;
private var loader:Loader;
private function loadAvatar():void { private var request:URLRequest;
loader = new Loader();
request = new URLRequest(UsersUtil.getAvatarURL()); private function loadAvatar():void {
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadingComplete); loader = new Loader();
loader.load(request); request = new URLRequest(UsersUtil.getAvatarURL());
} loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadingComplete);
loader.load(request);
private function onLoadingComplete(event:Event):void { }
loader.x = (_videoHolder.width - loader.width) / 2;
loader.y = (_videoHolder.height - loader.height) / 2; private function onLoadingComplete(event:Event):void {
_videoHolder.addChild(loader); loader.x = (_videoHolder.width - loader.width) / 2;
loader.y = (_videoHolder.height - loader.height) / 2;
onResize(); _videoHolder.addChild(loader);
}
onResize();
}
private function onCreationComplete():void { private function onCreationComplete():void {
this.glowColor = videoconfOptions.glowColor;
this.glowBlurSize = videoconfOptions.glowBlurSize;
_videoHolder = new UIComponent(); _videoHolder = new UIComponent();
_videoHolder.width = camWidth; _videoHolder.width = camWidth;
_videoHolder.height = camHeight; _videoHolder.height = camHeight;
this.addChild(_videoHolder); this.addChild(_videoHolder);
_video = new Video(); _video = new Video();
this.minWidth = _minWidth; this.minWidth = _minWidth;
this.minHeight = _minHeight; this.minHeight = _minHeight;
maximizeRestoreBtn.visible = false; maximizeRestoreBtn.visible = false;
showCloseButton = false; showCloseButton = false;
this.resizable = false; this.resizable = false;
setAspectRatio(camWidth, camHeight); setAspectRatio(camWidth, camHeight);
addEventListener(MDIWindowEvent.RESIZE_START, onResizeStart); addEventListener(MDIWindowEvent.RESIZE_START, onResizeStart);
addEventListener(MDIWindowEvent.RESIZE_END, onResizeEnd); addEventListener(MDIWindowEvent.RESIZE_END, onResizeEnd);
addEventListener(MouseEvent.MOUSE_OVER, showButtons); addEventListener(MouseEvent.MOUSE_OVER, showButtons);
addEventListener(MouseEvent.MOUSE_OUT, hideButtons); addEventListener(MouseEvent.MOUSE_OUT, hideButtons);
startPublishing(); startPublishing();
loadAvatar(); loadAvatar();
}
override protected function onResize():void {
super.onResize();
if (loader != null && _videoHolder != null) {
loader.x = (_videoHolder.width - loader.width) / 2;
loader.y = (_videoHolder.height - loader.height) / 2;
}
}
private function handleNewRoleEvent(event:SwitchedPresenterEvent):void {
switchRole(event.amIPresenter);
}
private function handleUserVoiceMutedEvent(event:BBBEvent):void {
if (event.payload.userID == userID) {
userMuted(event.payload.muted);
}
}
private function handleUserTalkingEvent(event:CoreEvent):void {
if (event.message.userID == userID) {
if (event.message.talking) {
notTalkingEffect.end();
talkingEffect.play([this]);
simulateClick();
} else {
talkingEffect.end();
notTalkingEffect.play([this]);
}
}
} }
override protected function onResize():void {
super.onResize();
if (loader != null && _videoHolder != null) {
loader.x = (_videoHolder.width - loader.width) / 2;
loader.y = (_videoHolder.height - loader.height) / 2;
}
}
private function handleNewRoleEvent(event:SwitchedPresenterEvent):void {
switchRole(event.amIPresenter);
}
private function handleUserVoiceMutedEvent(event:BBBEvent):void {
if (event.payload.userID == userID) {
userMuted(event.payload.muted);
}
}
private function handleUserTalkingEvent(event:CoreEvent):void {
if (event.message.userID == userID) {
if (event.message.talking) {
notTalkingEffect.end();
talkingEffect.play([this]);
simulateClick();
} else {
talkingEffect.end();
notTalkingEffect.play([this]);
}
}
}
private function startPublishing():void{ private function startPublishing():void{
defaultWidth = originalWidth; defaultWidth = originalWidth;
defaultHeight = originalHeight; defaultHeight = originalHeight;
maximizeRestoreBtn.visible = true; maximizeRestoreBtn.visible = true;
this.resizable = true; this.resizable = true;
onResize(); onResize();
createButtons(); createButtons();
addControlButtons(); addControlButtons();
updateButtonsPosition(); updateButtonsPosition();
} }
override public function close(event:MouseEvent=null):void{ override public function close(event:MouseEvent=null):void{
closeThisWindow(); closeThisWindow();
super.close(event); super.close(event);
} }
private function closeWindow(e:CloseAllWindowsEvent):void{ private function closeWindow(e:CloseAllWindowsEvent):void{
closeThisWindow(); closeThisWindow();
} }
private function closeThisWindow():void { private function closeThisWindow():void {
trace("******************** Closing avatar window for user [" + userID + "]*********************"); trace("******************** Closing avatar window for user [" + userID + "]*********************");
} }
]]> ]]>
</mx:Script> </mx:Script>
<mx:Glow id="talkingEffect" duration="500" alphaFrom="1.0" alphaTo="0.3" <mx:Glow id="talkingEffect" duration="500" alphaFrom="1.0" alphaTo="0.3"
blurXFrom="0.0" blurXTo="30.0" blurYFrom="0.0" blurYTo="30.0" color="0x4A931D"/> blurXFrom="0.0" blurXTo="{glowBlurSize}" blurYFrom="0.0" blurYTo="{glowBlurSize}" color="{glowColor}"/>
<mx:Glow id="notTalkingEffect" duration="500" alphaFrom="0.3" alphaTo="1.0" <mx:Glow id="notTalkingEffect" duration="500" alphaFrom="0.3" alphaTo="1.0"
blurXFrom="30.0" blurXTo="0.0" blurYFrom="30.0" blurYTo="0.0" color="0x4A931D"/> blurXFrom="{glowBlurSize}" blurXTo="0.0" blurYFrom="{glowBlurSize}" blurYTo="0.0" color="{glowColor}"/>
</pubVid:VideoWindowItf> </pubVid:VideoWindowItf>

View File

@ -94,6 +94,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
[Bindable] public var videoOptions:VideoConfOptions; [Bindable] public var videoOptions:VideoConfOptions;
[Bindable] public var baseIndex:int; [Bindable] public var baseIndex:int;
[Bindable] public var glowColor:String = "";
[Bindable] public var glowBlurSize:Number = 0;
private function init():void{ private function init():void{
videoOptions = new VideoConfOptions(); videoOptions = new VideoConfOptions();
@ -107,6 +110,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
} }
private function onCreationComplete():void{ private function onCreationComplete():void{
this.glowColor = videoOptions.glowColor;
this.glowBlurSize = videoOptions.glowBlurSize;
_videoHolder = new UIComponent(); _videoHolder = new UIComponent();
_videoHolder.width = camWidth; _videoHolder.width = camWidth;
_videoHolder.height = camHeight; _videoHolder.height = camHeight;
@ -402,9 +408,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
</mx:Script> </mx:Script>
<mx:Glow id="talkingEffect" duration="500" alphaFrom="1.0" alphaTo="0.3" <mx:Glow id="talkingEffect" duration="500" alphaFrom="1.0" alphaTo="0.3"
blurXFrom="0.0" blurXTo="30.0" blurYFrom="0.0" blurYTo="30.0" color="0x4A931D"/> blurXFrom="0.0" blurXTo="{glowBlurSize}" blurYFrom="0.0" blurYTo="{glowBlurSize}" color="{glowColor}"/>
<mx:Glow id="notTalkingEffect" duration="500" alphaFrom="0.3" alphaTo="1.0" <mx:Glow id="notTalkingEffect" duration="500" alphaFrom="0.3" alphaTo="1.0"
blurXFrom="30.0" blurXTo="0.0" blurYFrom="30.0" blurYTo="0.0" color="0x4A931D"/> blurXFrom="{glowBlurSize}" blurXTo="0.0" blurYFrom="{glowBlurSize}" blurYTo="0.0" color="{glowColor}"/>
<mx:Fade id="dissolveOut" duration="1000" alphaFrom="1.0" alphaTo="0.0"/> <mx:Fade id="dissolveOut" duration="1000" alphaFrom="1.0" alphaTo="0.0"/>

View File

@ -21,57 +21,65 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
--> -->
<viewVid:VideoWindowItf <viewVid:VideoWindowItf
xmlns:viewVid="org.bigbluebutton.modules.videoconf.business.*" xmlns:viewVid="org.bigbluebutton.modules.videoconf.business.*"
xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="onCreationComplete()" creationComplete="onCreationComplete()"
implements="org.bigbluebutton.common.IBbbModuleWindow" implements="org.bigbluebutton.common.IBbbModuleWindow"
xmlns:mate="http://mate.asfusion.com/" xmlns:mate="http://mate.asfusion.com/"
styleNameFocus="videoViewStyleFocus" styleNameFocus="videoViewStyleFocus"
styleNameNoFocus="videoViewStyleNoFocus" styleNameNoFocus="videoViewStyleNoFocus"
horizontalScrollPolicy="off" horizontalScrollPolicy="off"
verticalScrollPolicy="off" verticalScrollPolicy="off"
resize="onResize()" resize="onResize()"
layout="absolute"> layout="absolute">
<mate:Listener type="{BBBEvent.USER_VOICE_MUTED}" method="handleUserVoiceMutedEvent" /> <mate:Listener type="{BBBEvent.USER_VOICE_MUTED}" method="handleUserVoiceMutedEvent" />
<mate:Listener type="{EventConstants.USER_TALKING}" method="handleUserTalkingEvent" /> <mate:Listener type="{EventConstants.USER_TALKING}" method="handleUserTalkingEvent" />
<mate:Listener type="{SwitchedPresenterEvent.SWITCHED_PRESENTER}" method="handleNewRoleEvent" /> <mate:Listener type="{SwitchedPresenterEvent.SWITCHED_PRESENTER}" method="handleNewRoleEvent" />
<mate:Listener type="{CloseAllWindowsEvent.CLOSE_ALL_WINDOWS}" method="closeWindow" /> <mate:Listener type="{CloseAllWindowsEvent.CLOSE_ALL_WINDOWS}" method="closeWindow" />
<mx:Script> <mx:Script>
<![CDATA[ <![CDATA[
import com.asfusion.mate.events.Dispatcher; import com.asfusion.mate.events.Dispatcher;
import flexlib.mdi.events.MDIWindowEvent; import flexlib.mdi.events.MDIWindowEvent;
import mx.core.UIComponent; import mx.core.UIComponent;
import org.bigbluebutton.common.LogUtil; import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.Role; import org.bigbluebutton.common.Role;
import org.bigbluebutton.common.events.CloseWindowEvent; import org.bigbluebutton.common.events.CloseWindowEvent;
import org.bigbluebutton.core.EventConstants; import org.bigbluebutton.core.EventConstants;
import org.bigbluebutton.core.events.CoreEvent; import org.bigbluebutton.core.events.CoreEvent;
import org.bigbluebutton.main.events.BBBEvent; import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.StoppedViewingWebcamEvent; import org.bigbluebutton.main.events.StoppedViewingWebcamEvent;
import org.bigbluebutton.main.events.SwitchedPresenterEvent; import org.bigbluebutton.main.events.SwitchedPresenterEvent;
import org.bigbluebutton.main.views.MainCanvas; import org.bigbluebutton.main.views.MainCanvas;
import org.bigbluebutton.modules.videoconf.business.TalkingButtonOverlay; import org.bigbluebutton.modules.videoconf.business.TalkingButtonOverlay;
import org.bigbluebutton.modules.videoconf.events.CloseAllWindowsEvent; import org.bigbluebutton.modules.videoconf.events.CloseAllWindowsEvent;
import org.bigbluebutton.modules.videoconf.model.VideoConfOptions; import org.bigbluebutton.modules.videoconf.model.VideoConfOptions;
private var ns:NetStream; private var ns:NetStream;
private var globalDispatcher:Dispatcher; private var globalDispatcher:Dispatcher;
[Bindable] [Bindable]
public var videoOptions:VideoConfOptions; public var videoOptions:VideoConfOptions = new VideoConfOptions();
private var windowType:String = "VideoWindowType"; private var windowType:String = "VideoWindowType";
override public function getWindowType():String { [Bindable] public var glowColor:String = "";
return windowType; [Bindable] public var glowBlurSize:Number = 0;
}
override public function getWindowType():String {
return windowType;
}
private function onCreationComplete():void{ private function onCreationComplete():void{
this.glowColor = videoOptions.glowColor;
this.glowBlurSize = videoOptions.glowBlurSize;
LogUtil.debug("checking glow values: "+this.glowColor+" and "+this.glowBlurSize);
_videoHolder = new UIComponent(); _videoHolder = new UIComponent();
_videoHolder.addChild(_video); _videoHolder.addChild(_video);
this.addChild(_videoHolder); this.addChild(_videoHolder);
@ -79,16 +87,16 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
addEventListener(MDIWindowEvent.RESIZE_START, onResizeStart); addEventListener(MDIWindowEvent.RESIZE_START, onResizeStart);
addEventListener(MDIWindowEvent.RESIZE_END, onResizeEnd); addEventListener(MDIWindowEvent.RESIZE_END, onResizeEnd);
addEventListener(MDIWindowEvent.CLOSE, onCloseEvent); addEventListener(MDIWindowEvent.CLOSE, onCloseEvent);
addEventListener(MouseEvent.MOUSE_OVER, showButtons); addEventListener(MouseEvent.MOUSE_OVER, showButtons);
addEventListener(MouseEvent.MOUSE_OUT, hideButtons); addEventListener(MouseEvent.MOUSE_OUT, hideButtons);
addEventListener(MouseEvent.DOUBLE_CLICK, onDoubleClick); addEventListener(MouseEvent.DOUBLE_CLICK, onDoubleClick);
createButtons(); createButtons();
addControlButtons(); addControlButtons();
globalDispatcher = new Dispatcher(); globalDispatcher = new Dispatcher();
this.minWidth = _minWidth; this.minWidth = _minWidth;
this.minHeight = _minHeight; this.minHeight = _minHeight;
maximizeRestoreBtn.visible = true; maximizeRestoreBtn.visible = true;
@ -109,43 +117,43 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
this.showCloseButton = videoOptions.showCloseButton; this.showCloseButton = videoOptions.showCloseButton;
} }
private function handleNewRoleEvent(event:SwitchedPresenterEvent):void { private function handleNewRoleEvent(event:SwitchedPresenterEvent):void {
switchRole(event.amIPresenter) switchRole(event.amIPresenter)
}
private function handleUserVoiceMutedEvent(event:BBBEvent):void {
if (event.payload.userID == userID) {
userMuted(event.payload.muted);
}
}
private var _closing:Boolean = false;
private function onCloseEvent(event:MDIWindowEvent = null):void {
LogUtil.debug("ViewWindow closing " + streamName);
if (!_closing) {
_closing = true;
var stopEvent:StoppedViewingWebcamEvent = new StoppedViewingWebcamEvent();
stopEvent.webcamUserID = userID;
globalDispatcher.dispatchEvent(stopEvent);
}
} }
private function handleUserTalkingEvent(event:CoreEvent):void { private function handleUserVoiceMutedEvent(event:BBBEvent):void {
if (event.message.userID == userID) { if (event.payload.userID == userID) {
if (event.message.talking) { userMuted(event.payload.muted);
notTalkingEffect.end(); }
talkingEffect.play([this]); }
simulateClick();
} else { private var _closing:Boolean = false;
talkingEffect.end();
notTalkingEffect.play([this]); private function onCloseEvent(event:MDIWindowEvent = null):void {
} LogUtil.debug("ViewWindow closing " + streamName);
} if (!_closing) {
} _closing = true;
var stopEvent:StoppedViewingWebcamEvent = new StoppedViewingWebcamEvent();
stopEvent.webcamUserID = userID;
globalDispatcher.dispatchEvent(stopEvent);
}
}
private function handleUserTalkingEvent(event:CoreEvent):void {
if (event.message.userID == userID) {
if (event.message.talking) {
notTalkingEffect.end();
talkingEffect.play([this]);
simulateClick();
} else {
talkingEffect.end();
notTalkingEffect.play([this]);
}
}
}
public function startVideo(connection:NetConnection, stream:String):void{ public function startVideo(connection:NetConnection, stream:String):void{
ns = new NetStream(connection); ns = new NetStream(connection);
ns.addEventListener( NetStatusEvent.NET_STATUS, onNetStatus ); ns.addEventListener( NetStatusEvent.NET_STATUS, onNetStatus );
@ -163,8 +171,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
_video.height = originalHeight = Number(res[1]); _video.height = originalHeight = Number(res[1]);
setAspectRatio(Number(res[0]), Number(res[1])); setAspectRatio(Number(res[0]), Number(res[1]));
_video.attachNetStream(ns); _video.attachNetStream(ns);
if (videoOptions.smoothVideo) { if (videoOptions.smoothVideo) {
trace("Smoothing video.") trace("Smoothing video.")
_video.smoothing = true; _video.smoothing = true;
@ -180,14 +188,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
filter.divisor = videoOptions.filterDivisor; filter.divisor = videoOptions.filterDivisor;
_video.filters = [filter]; _video.filters = [filter];
} }
ns.play(stream); ns.play(stream);
this.streamName = stream; this.streamName = stream;
this.width = _video.width + paddingHorizontal; this.width = _video.width + paddingHorizontal;
this.height = _video.height + paddingVertical; this.height = _video.height + paddingVertical;
} }
private function onAsyncError(e:AsyncErrorEvent):void{ private function onAsyncError(e:AsyncErrorEvent):void{
LogUtil.debug("VideoWindow::asyncerror " + e.toString()); LogUtil.debug("VideoWindow::asyncerror " + e.toString());
} }
@ -199,7 +207,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
setAspectRatio(info.width, info.height); setAspectRatio(info.width, info.height);
onResize(); onResize();
} }
private function onNetStatus(e:NetStatusEvent):void{ private function onNetStatus(e:NetStatusEvent):void{
switch(e.info.code){ switch(e.info.code){
case "NetStream.Publish.Start": case "NetStream.Publish.Start":
@ -233,14 +241,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private function closeWindow(e:CloseAllWindowsEvent):void{ private function closeWindow(e:CloseAllWindowsEvent):void{
this.close(); this.close();
} }
]]> ]]>
</mx:Script> </mx:Script>
<mx:Glow id="talkingEffect" duration="500" alphaFrom="1.0" alphaTo="0.3"
blurXFrom="0.0" blurXTo="10.0" blurYFrom="0.0" blurYTo="10.0" color="0x4A931D"/>
<mx:Glow id="notTalkingEffect" duration="500" alphaFrom="0.3" alphaTo="1.0"
blurXFrom="10.0" blurXTo="0.0" blurYFrom="10.0" blurYTo="0.0" color="0x4A931D"/>
<mx:Glow id="talkingEffect" duration="500" alphaFrom="1.0" alphaTo="0.3"
blurXFrom="0.0" blurXTo="{glowBlurSize}" blurYFrom="0.0" blurYTo="{glowBlurSize}" color="{glowColor}"/>
<mx:Glow id="notTalkingEffect" duration="500" alphaFrom="0.3" alphaTo="1.0"
blurXFrom="{glowBlurSize}" blurXTo="0.0" blurYFrom="{glowBlurSize}" blurYTo="0.0" color="{glowColor}"/>
</viewVid:VideoWindowItf> </viewVid:VideoWindowItf>