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"
h264Profile = "main"
displayAvatar = "false"
focusTalking = "false"
focusTalking = "false"
glowColor = "0x4A931D"
glowBlurSize = "30.0"
/>
<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 var uri:String = "rtmp://localhost/video";
[Bindable]
public var videoQuality:Number = 100;
[Bindable]
public var resolutions:String = "320x240,640x480,1280x720";
public var uri:String = "rtmp://localhost/video";
[Bindable]
public var videoQuality:Number = 100;
[Bindable]
public var resolutions:String = "320x240,640x480,1280x720";
[Bindable]
public var autoStart:Boolean = false;
@ -44,10 +44,10 @@ package org.bigbluebutton.modules.videoconf.model
[Bindable]
public var viewerWindowMaxed:Boolean = false;
[Bindable]
public var viewerWindowLocation:String = "middle";
[Bindable]
public var camKeyFrameInterval:Number = 5;
@ -56,25 +56,25 @@ package org.bigbluebutton.modules.videoconf.model
[Bindable]
public var camQualityBandwidth:Number = 0;
[Bindable]
public var smoothVideo:Boolean = false;
[Bindable]
public var applyConvolutionFilter:Boolean = false;
[Bindable]
public var convolutionFilter:Array = [-1, 0, -1, 0, 6, 0, -1, 0, -1];
[Bindable]
public var filterBias:Number = 0;
[Bindable]
public var filterDivisor:Number = 4;
[Bindable]
public var enableH264:Boolean = false;
[Bindable]
public var h264Level:String = "2.1";
@ -86,34 +86,40 @@ package org.bigbluebutton.modules.videoconf.model
[Bindable] public var baseTabIndex:int;
[Bindable]
public var presenterShareOnly:Boolean = false;
[Bindable]
public var controlsForPresenter:Boolean = false;
[Bindable]
public var displayAvatar:Boolean = false;
[Bindable]
public var focusTalking:Boolean = false;
public function VideoConfOptions() {
parseOptions();
}
[Bindable]
public var presenterShareOnly:Boolean = false;
[Bindable]
public var controlsForPresenter:Boolean = false;
[Bindable]
public var displayAvatar:Boolean = false;
[Bindable]
public var focusTalking:Boolean = false;
[Bindable]
public var glowColor:String = "0x4A931D";
[Bindable]
public var glowBlurSize:Number = 30.0;
public function VideoConfOptions() {
parseOptions();
}
public function parseOptions():void {
var vxml:XML = BBB.getConfigForModule("VideoconfModule");
if (vxml != null) {
if (vxml.@uri != undefined) {
uri = vxml.@uri.toString();
}
if (vxml.@videoQuality != undefined) {
videoQuality = Number(vxml.@videoQuality.toString());
}
if (vxml.@resolutions != undefined) {
resolutions = vxml.@resolutions.toString();
}
if (vxml.@uri != undefined) {
uri = vxml.@uri.toString();
}
if (vxml.@videoQuality != undefined) {
videoQuality = Number(vxml.@videoQuality.toString());
}
if (vxml.@resolutions != undefined) {
resolutions = vxml.@resolutions.toString();
}
if (vxml.@showCloseButton != undefined) {
showCloseButton = (vxml.@showCloseButton.toString().toUpperCase() == "TRUE") ? true : false;
}
@ -126,12 +132,12 @@ 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.@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;
}
@ -188,13 +194,21 @@ package org.bigbluebutton.modules.videoconf.model
else{
baseTabIndex = 101;
}
if (vxml.@displayAvatar != undefined) {
displayAvatar = (vxml.@displayAvatar.toString().toUpperCase() == "TRUE") ? true : false;
}
if (vxml.@focusTalking != undefined) {
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:pubVid="org.bigbluebutton.modules.videoconf.business.*"
implements="org.bigbluebutton.common.IBbbModuleWindow"
styleNameFocus="videoAvatarStyleFocus"
styleNameNoFocus="videoAvatarStyleNoFocus"
styleNameFocus="videoAvatarStyleFocus"
styleNameNoFocus="videoAvatarStyleNoFocus"
creationComplete="onCreationComplete()"
width="{defaultWidth + 6}" height="{defaultHeight + 6}"
xmlns:mate="http://mate.asfusion.com/"
@ -34,158 +34,168 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
verticalScrollPolicy="off"
layout="absolute">
<mate:Listener type="{BBBEvent.USER_VOICE_MUTED}" method="handleUserVoiceMutedEvent" />
<mate:Listener type="{EventConstants.USER_TALKING}" method="handleUserTalkingEvent" />
<mate:Listener type="{SwitchedPresenterEvent.SWITCHED_PRESENTER}" method="handleNewRoleEvent" />
<mate:Listener type="{CloseAllWindowsEvent.CLOSE_ALL_WINDOWS}" method="closeWindow" />
<mate:Listener type="{BBBEvent.USER_VOICE_MUTED}" method="handleUserVoiceMutedEvent" />
<mate:Listener type="{EventConstants.USER_TALKING}" method="handleUserTalkingEvent" />
<mate:Listener type="{SwitchedPresenterEvent.SWITCHED_PRESENTER}" method="handleNewRoleEvent" />
<mate:Listener type="{CloseAllWindowsEvent.CLOSE_ALL_WINDOWS}" method="closeWindow" />
<mx:Script>
<![CDATA[
import flexlib.mdi.events.MDIWindowEvent;
import mx.core.UIComponent;
import mx.events.ResizeEvent;
import org.bigbluebutton.common.Images;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.Role;
import org.bigbluebutton.common.events.CloseWindowEvent;
import org.bigbluebutton.common.events.LocaleChangeEvent;
import org.bigbluebutton.core.EventConstants;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.core.events.CoreEvent;
import org.bigbluebutton.core.events.SwitchedLayoutEvent;
import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.SwitchedPresenterEvent;
import org.bigbluebutton.main.views.MainCanvas;
import org.bigbluebutton.modules.videoconf.business.TalkingButtonOverlay;
import org.bigbluebutton.modules.videoconf.events.CloseAllWindowsEvent;
import org.bigbluebutton.modules.videoconf.events.OpenVideoWindowEvent;
import org.bigbluebutton.modules.videoconf.events.StartBroadcastEvent;
import org.bigbluebutton.modules.videoconf.model.VideoConfOptions;
import org.bigbluebutton.util.i18n.ResourceUtil;
import flexlib.mdi.events.MDIWindowEvent;
import mx.core.UIComponent;
import mx.events.ResizeEvent;
import org.bigbluebutton.common.Images;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.Role;
import org.bigbluebutton.common.events.CloseWindowEvent;
import org.bigbluebutton.common.events.LocaleChangeEvent;
import org.bigbluebutton.core.EventConstants;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.core.events.CoreEvent;
import org.bigbluebutton.core.events.SwitchedLayoutEvent;
import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.SwitchedPresenterEvent;
import org.bigbluebutton.main.views.MainCanvas;
import org.bigbluebutton.modules.videoconf.business.TalkingButtonOverlay;
import org.bigbluebutton.modules.videoconf.events.CloseAllWindowsEvent;
import org.bigbluebutton.modules.videoconf.events.OpenVideoWindowEvent;
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 defaultHeight:Number = 240;
[Bindable] public var glowColor:String = "";
[Bindable] public var glowBlurSize:Number = 0;
private var camWidth:Number = 320;
private var camHeight:Number = 240;
private var windowType:String = "AvatarWindowType";
override public function getWindowType():String {
return windowType;
}
private var loader:Loader;
private var request:URLRequest;
private function loadAvatar():void {
loader = new Loader();
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;
_videoHolder.addChild(loader);
onResize();
}
private var videoconfOptions:VideoConfOptions = new VideoConfOptions();
private var windowType:String = "AvatarWindowType";
override public function getWindowType():String {
return windowType;
}
private var loader:Loader;
private var request:URLRequest;
private function loadAvatar():void {
loader = new Loader();
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;
_videoHolder.addChild(loader);
onResize();
}
private function onCreationComplete():void {
this.glowColor = videoconfOptions.glowColor;
this.glowBlurSize = videoconfOptions.glowBlurSize;
_videoHolder = new UIComponent();
_videoHolder.width = camWidth;
_videoHolder.height = camHeight;
this.addChild(_videoHolder);
_video = new Video();
_video = new Video();
this.minWidth = _minWidth;
this.minHeight = _minHeight;
maximizeRestoreBtn.visible = false;
showCloseButton = false;
showCloseButton = false;
this.resizable = false;
setAspectRatio(camWidth, camHeight);
addEventListener(MDIWindowEvent.RESIZE_START, onResizeStart);
addEventListener(MDIWindowEvent.RESIZE_END, onResizeEnd);
addEventListener(MouseEvent.MOUSE_OVER, showButtons);
addEventListener(MouseEvent.MOUSE_OUT, hideButtons);
startPublishing();
loadAvatar();
addEventListener(MDIWindowEvent.RESIZE_START, onResizeStart);
addEventListener(MDIWindowEvent.RESIZE_END, onResizeEnd);
addEventListener(MouseEvent.MOUSE_OVER, showButtons);
addEventListener(MouseEvent.MOUSE_OUT, hideButtons);
startPublishing();
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{
defaultWidth = originalWidth;
defaultHeight = originalHeight;
maximizeRestoreBtn.visible = true;
this.resizable = true;
onResize();
createButtons();
addControlButtons();
updateButtonsPosition();
createButtons();
addControlButtons();
updateButtonsPosition();
}
override public function close(event:MouseEvent=null):void{
closeThisWindow();
closeThisWindow();
super.close(event);
}
private function closeWindow(e:CloseAllWindowsEvent):void{
closeThisWindow();
}
private function closeThisWindow():void {
trace("******************** Closing avatar window for user [" + userID + "]*********************");
trace("******************** Closing avatar window for user [" + userID + "]*********************");
}
]]>
</mx:Script>
<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"/>
<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"/>
<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}"/>
</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 baseIndex:int;
[Bindable] public var glowColor:String = "";
[Bindable] public var glowBlurSize:Number = 0;
private function init():void{
videoOptions = new VideoConfOptions();
@ -107,6 +110,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function onCreationComplete():void{
this.glowColor = videoOptions.glowColor;
this.glowBlurSize = videoOptions.glowBlurSize;
_videoHolder = new UIComponent();
_videoHolder.width = camWidth;
_videoHolder.height = camHeight;
@ -402,9 +408,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
</mx:Script>
<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"
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"/>

View File

@ -21,57 +21,65 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
-->
<viewVid:VideoWindowItf
xmlns:viewVid="org.bigbluebutton.modules.videoconf.business.*"
xmlns:viewVid="org.bigbluebutton.modules.videoconf.business.*"
xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="onCreationComplete()"
implements="org.bigbluebutton.common.IBbbModuleWindow"
xmlns:mate="http://mate.asfusion.com/"
styleNameFocus="videoViewStyleFocus"
styleNameNoFocus="videoViewStyleNoFocus"
horizontalScrollPolicy="off"
verticalScrollPolicy="off"
styleNameFocus="videoViewStyleFocus"
styleNameNoFocus="videoViewStyleNoFocus"
horizontalScrollPolicy="off"
verticalScrollPolicy="off"
resize="onResize()"
layout="absolute">
<mate:Listener type="{BBBEvent.USER_VOICE_MUTED}" method="handleUserVoiceMutedEvent" />
<mate:Listener type="{EventConstants.USER_TALKING}" method="handleUserTalkingEvent" />
<mate:Listener type="{SwitchedPresenterEvent.SWITCHED_PRESENTER}" method="handleNewRoleEvent" />
<mate:Listener type="{CloseAllWindowsEvent.CLOSE_ALL_WINDOWS}" method="closeWindow" />
<mate:Listener type="{BBBEvent.USER_VOICE_MUTED}" method="handleUserVoiceMutedEvent" />
<mate:Listener type="{EventConstants.USER_TALKING}" method="handleUserTalkingEvent" />
<mate:Listener type="{SwitchedPresenterEvent.SWITCHED_PRESENTER}" method="handleNewRoleEvent" />
<mate:Listener type="{CloseAllWindowsEvent.CLOSE_ALL_WINDOWS}" method="closeWindow" />
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import flexlib.mdi.events.MDIWindowEvent;
import mx.core.UIComponent;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.Role;
import org.bigbluebutton.common.events.CloseWindowEvent;
import org.bigbluebutton.core.EventConstants;
import org.bigbluebutton.core.events.CoreEvent;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.StoppedViewingWebcamEvent;
import org.bigbluebutton.main.events.SwitchedPresenterEvent;
import org.bigbluebutton.main.views.MainCanvas;
import org.bigbluebutton.modules.videoconf.business.TalkingButtonOverlay;
import org.bigbluebutton.modules.videoconf.events.CloseAllWindowsEvent;
import org.bigbluebutton.modules.videoconf.model.VideoConfOptions;
import com.asfusion.mate.events.Dispatcher;
import flexlib.mdi.events.MDIWindowEvent;
import mx.core.UIComponent;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.Role;
import org.bigbluebutton.common.events.CloseWindowEvent;
import org.bigbluebutton.core.EventConstants;
import org.bigbluebutton.core.events.CoreEvent;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.StoppedViewingWebcamEvent;
import org.bigbluebutton.main.events.SwitchedPresenterEvent;
import org.bigbluebutton.main.views.MainCanvas;
import org.bigbluebutton.modules.videoconf.business.TalkingButtonOverlay;
import org.bigbluebutton.modules.videoconf.events.CloseAllWindowsEvent;
import org.bigbluebutton.modules.videoconf.model.VideoConfOptions;
private var ns:NetStream;
private var globalDispatcher:Dispatcher;
[Bindable]
public var videoOptions:VideoConfOptions;
public var videoOptions:VideoConfOptions = new VideoConfOptions();
private var windowType:String = "VideoWindowType";
override public function getWindowType():String {
return windowType;
}
private var windowType:String = "VideoWindowType";
[Bindable] public var glowColor:String = "";
[Bindable] public var glowBlurSize:Number = 0;
override public function getWindowType():String {
return windowType;
}
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.addChild(_video);
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_END, onResizeEnd);
addEventListener(MDIWindowEvent.CLOSE, onCloseEvent);
addEventListener(MouseEvent.MOUSE_OVER, showButtons);
addEventListener(MouseEvent.MOUSE_OUT, hideButtons);
addEventListener(MouseEvent.DOUBLE_CLICK, onDoubleClick);
createButtons();
addControlButtons();
addControlButtons();
globalDispatcher = new Dispatcher();
this.minWidth = _minWidth;
this.minHeight = _minHeight;
maximizeRestoreBtn.visible = true;
@ -109,43 +117,43 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
this.showCloseButton = videoOptions.showCloseButton;
}
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 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 handleNewRoleEvent(event:SwitchedPresenterEvent):void {
switchRole(event.amIPresenter)
}
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 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 {
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{
ns = new NetStream(connection);
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]);
setAspectRatio(Number(res[0]), Number(res[1]));
_video.attachNetStream(ns);
if (videoOptions.smoothVideo) {
trace("Smoothing video.")
_video.smoothing = true;
@ -180,14 +188,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
filter.divisor = videoOptions.filterDivisor;
_video.filters = [filter];
}
ns.play(stream);
this.streamName = stream;
this.width = _video.width + paddingHorizontal;
this.height = _video.height + paddingVertical;
}
private function onAsyncError(e:AsyncErrorEvent):void{
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);
onResize();
}
private function onNetStatus(e:NetStatusEvent):void{
switch(e.info.code){
case "NetStream.Publish.Start":
@ -233,14 +241,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private function closeWindow(e:CloseAllWindowsEvent):void{
this.close();
}
]]>
</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>