use data binding to update viewers window

git-svn-id: http://bigbluebutton.googlecode.com/svn/trunk@764 af16638f-c34d-0410-8cfa-b39d5352b314
This commit is contained in:
Richard Alam 2008-12-03 18:30:30 +00:00
parent 598f765875
commit 3830f76f84
12 changed files with 85 additions and 165 deletions

View File

@ -1,6 +1,7 @@
<!-- saved from url=(0014)about:internet -->
<html lang="en">
<head>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>${title}</title>
<script src="AC_OETags.js" language="javascript"></script>

View File

@ -30,7 +30,7 @@ package org.bigbluebutton.common
*/
public class Constants
{
public static const VERSION:String = "0.35h";
public static const VERSION:String = "0.35n";
public static const NUM_MODULES:String = "5";
public static const LOG_TARGET_NAME:String = "BBBLOGGER";

View File

@ -31,6 +31,7 @@ package org.bigbluebutton.modules.listeners.model.service
public class ListenersSOService implements IListenersService
{
public static const NAME:String = "ListenersSOService";
private static const LOGNAME:String = "[ListenersSOService]";
private var _listenersSO : SharedObject;
private static const SHARED_OBJECT:String = "meetMeUsersSO";
@ -62,11 +63,11 @@ package org.bigbluebutton.modules.listeners.model.service
private function connectionListener(connected:Boolean, errors:Array=null):void {
if (connected) {
LogUtil.debug(NAME + ":Connected to the VOice application");
LogUtil.debug(LOGNAME + ":Connected to the VOice application");
join();
} else {
leave();
LogUtil.debug(NAME + ":Disconnected from the Voice application");
LogUtil.debug(LOGNAME + ":Disconnected from the Voice application");
notifyConnectionStatusListener(false, errors);
}
}
@ -78,7 +79,7 @@ package org.bigbluebutton.modules.listeners.model.service
_listenersSO.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
_listenersSO.client = this;
_listenersSO.connect(netConnectionDelegate.connection);
LogUtil.debug(NAME + ":Voice is connected to Shared object");
LogUtil.debug(LOGNAME + ":Voice is connected to Shared object");
notifyConnectionStatusListener(true);
// Query the server if there are already listeners in the conference.
@ -109,10 +110,10 @@ package org.bigbluebutton.modules.listeners.model.service
n.muted = muted;
n.userid = userId;
n.talking = talking;
LogUtil.debug("Add listener with userid " + userId + " to the conference.");
LogUtil.info(LOGNAME + "Adding listener [" + n.callerName + "," + userId + "]");
_listeners.addListener(n);
} else {
LogUtil.debug("There is a listener with userid " + userId + " " + cidName + " in the conference.");
LogUtil.debug(LOGNAME + "There is a listener with userid " + userId + " " + cidName + " in the conference.");
}
}
@ -121,7 +122,7 @@ package org.bigbluebutton.modules.listeners.model.service
var l:Listener = _listeners.getListener(userId);
if (l != null) {
l.muted = mute;
LogUtil.debug('Un/Muting user ' + userId + " mute=" + mute);
LogUtil.debug(LOGNAME + 'Un/Muting user ' + userId + " mute=" + mute);
sendMessage(ListenersModuleConstants.USER_MUTE_NOTIFICATION, {userid:userId, mute:mute});
}
}
@ -164,17 +165,16 @@ package org.bigbluebutton.modules.listeners.model.service
var cidNum:String = meetmeUser[items][2];
var muted:Boolean = meetmeUser[items][3];
var talking:Boolean = meetmeUser[items][4];
LogUtil.debug("in getMeetMeUsers for user " + userId);
userJoin(userId, cidName, cidNum, muted, talking);
}
}
private function notifyConnectionStatusListener(connected:Boolean, errors:Array=null):void {
if (_connectionListener != null) {
LogUtil.debug('notifying connectionListener for Voice');
LogUtil.debug(LOGNAME + 'notifying connectionListener for Voice');
_connectionListener(connected, errors);
} else {
LogUtil.debug("_connectionListener is null");
LogUtil.debug(LOGNAME + "_connectionListener is null");
}
}
@ -189,7 +189,7 @@ package org.bigbluebutton.modules.listeners.model.service
switch ( statusCode )
{
case "NetConnection.Connect.Success" :
LogUtil.debug(NAME + ":Connection Success");
LogUtil.debug(LOGNAME + ":Connection Success");
//notifyConnectionStatusListener(true);
break;

View File

@ -40,8 +40,8 @@ package org.bigbluebutton.modules.listeners.model.vo
public function hasListener(id:Number):Boolean
{
var index:int = getListenerIndex(id);
if (index > -1) {
var l:Object = getListenerIndex(id);
if (l != null) {
return true;
}
return false;
@ -49,9 +49,9 @@ package org.bigbluebutton.modules.listeners.model.vo
public function getListener(id:Number):Listener
{
var index:int = getListenerIndex(id);
if (index > -1) {
return listeners.getItemAt(index) as Listener;
var l:Object = getListenerIndex(id);
if (l != null) {
return l.listener as Listener;
}
return null;
@ -59,28 +59,28 @@ package org.bigbluebutton.modules.listeners.model.vo
public function removeListener(id:Number):void
{
var index:int = getListenerIndex(id);
LogUtil.debug( "removing listener[" + id + " at index=" + index + "]")
if (index > -1) {
LogUtil.debug( "remove listener[" + id + " at index=" + index + "]");
listeners.removeItemAt(index);
var l:Object = getListenerIndex(id);
LogUtil.debug( "removing listener[" + l.listener.callerName + "," + l.listener.userid + "]")
if (l != null) {
LogUtil.info( "removing listener[" + l.listener.callerName + "," + l.listener.userid + "]")
listeners.removeItemAt(l.index);
sort();
}
}
private function getListenerIndex(id:Number):int
private function getListenerIndex(id:Number):Object
{
var l:Listener;
for (var i:int = 0; i < listeners.length; i++)
{
l = listeners.getItemAt(i) as Listener;
if (l.userid == id) {
return i;
return {index:i, listener:l};
}
}
// Listener not found.
return -1;
return null;
}
public function removeAllListeners():void

View File

@ -61,7 +61,6 @@ package org.bigbluebutton.modules.viewers
public static const QUERY_PRESENTER_EVENT:String = "QUERY_PRESENTER_EVENT";
public static const QUERY_PRESENTER_REPLY:String = "QUERY_PRESENTER_REPLY";
public static const CHANGE_STATUS:String = "CHANGE_STATUS";
public static const CONNECT_SUCCESS:String = "CONNECT_SUCCESS";
public static const CONNECT_FAILED:String = "CONNECT_FAILED";
public static const CONNECT_CLOSED:String = "CONNECT_CLOSED";

View File

@ -30,9 +30,8 @@ package org.bigbluebutton.modules.viewers.model.business
private var _myUserid : Number;
[Bindable] public var me:User = null;
[Bindable] public var users : ArrayCollection = null;
[Bindable] public var connected : Boolean = false;
[Bindable] public var users:ArrayCollection = null;
public function Conference() : void
{
me = new User();
@ -63,11 +62,10 @@ package org.bigbluebutton.modules.viewers.model.business
* @return
*
*/
public function hasParticipant(id : Number) : Boolean
public function hasParticipant(userid:Number) : Boolean
{
var index : int = getParticipantIndex(id);
if (index > -1) {
var p:Object = getParticipantIndex(userid);
if (p != null) {
return true;
}
@ -80,12 +78,11 @@ package org.bigbluebutton.modules.viewers.model.business
* @return
*
*/
public function getParticipant(id : Number) : User
public function getParticipant(userid:Number) : User
{
var index : int = getParticipantIndex(id);
if (index > -1) {
return users.getItemAt(index) as User;
var p:Object = getParticipantIndex(userid);
if (p != null) {
return p.participant as User;
}
return null;
@ -96,16 +93,13 @@ package org.bigbluebutton.modules.viewers.model.business
* @param userid
*
*/
public function removeParticipant(userid : Number) : void
public function removeParticipant(userid:Number) : void
{
var index : int = getParticipantIndex(userid);
LogUtil.debug( "removing user[" + userid + " at index=" + index + "]")
if (index > -1) {
LogUtil.debug( "remove user[" + userid + " at index=" + index + "]");
var p:Object = getParticipantIndex(userid);
if (p != null) {
LogUtil.debug("removing user[" + p.participant.name + "," + p.participant.userid + "]");
users.removeItemAt(index);
users.removeItemAt(p.index);
sort();
}
}
@ -116,7 +110,7 @@ package org.bigbluebutton.modules.viewers.model.business
* @return -1 if participant not found
*
*/
private function getParticipantIndex(userid : Number) : int
private function getParticipantIndex(userid:Number):Object
{
var aUser : User;
@ -125,12 +119,12 @@ package org.bigbluebutton.modules.viewers.model.business
aUser = users.getItemAt(i) as User;
if (aUser.userid == userid) {
return i;
return {index:i, participant:aUser};
}
}
// Participant not found.
return -1;
return null;
}
/**

View File

@ -5,8 +5,6 @@ package org.bigbluebutton.modules.viewers.model.services
import flash.events.SyncEvent;
import flash.net.SharedObject;
import mx.collections.ArrayCollection;
import org.bigbluebutton.modules.viewers.ViewersModuleConstants;
import org.bigbluebutton.modules.viewers.model.business.IViewers;
import org.bigbluebutton.modules.viewers.model.vo.Status;
@ -15,6 +13,7 @@ package org.bigbluebutton.modules.viewers.model.services
public class ViewersSOService implements IViewersService
{
public static const NAME:String = "ViewersSOService";
public static const LOGNAME:String = "[ViewersSOService]";
private var _participantsSO : SharedObject;
private static const SO_NAME : String = "participantsSO";
@ -57,7 +56,7 @@ package org.bigbluebutton.modules.viewers.model.services
private function connectionSuccessListener(connected:Boolean, user:Object=null, failReason:String=""):void {
if (connected) {
LogUtil.debug(NAME + ":Connected to the Viewers application " + user.userid + " " + user.role);
LogUtil.debug(LOGNAME + ":Connected to the Viewers application " + user.userid + " " + user.role);
_participants.me.role = user.role;
_participants.me.userid = user.userid;
_participants.me.room = user.room;
@ -65,7 +64,7 @@ package org.bigbluebutton.modules.viewers.model.services
join();
} else {
leave();
LogUtil.debug(NAME + ":Disconnected from the Viewers application");
LogUtil.debug(LOGNAME + ":Disconnected from the Viewers application");
notifyConnectionStatusListener(false, failReason);
}
}
@ -82,7 +81,7 @@ package org.bigbluebutton.modules.viewers.model.services
_participantsSO.addEventListener(SyncEvent.SYNC, sharedObjectSyncHandler);
_participantsSO.client = this;
_participantsSO.connect(netConnectionDelegate.connection);
LogUtil.debug(NAME + ":ViewersModules is connected to Shared object");
LogUtil.debug(LOGNAME + ":ViewersModules is connected to Shared object");
notifyConnectionStatusListener(true);
}
@ -100,7 +99,7 @@ package org.bigbluebutton.modules.viewers.model.services
var aUser:User = _participants.getParticipant(userid);
if (aUser != null) {
aUser.addStatus(status);
LogUtil.debug('setting newStatus ' + status.name);
LogUtil.debug(LOGNAME + 'setting newStatus ' + status.name);
_participantsSO.setProperty(userid.toString() + STATUS, aUser.status.source);
_participantsSO.setDirty(userid.toString() + STATUS);
//_participantsSO.send("addStatusCallback", userid, status);
@ -117,7 +116,7 @@ package org.bigbluebutton.modules.viewers.model.services
public function changeStatus(userid:Number, status:Status):void {
var aUser:User = _participants.getParticipant(userid);
if (aUser != null) {
LogUtil.debug('setting changeStatus ' + status.name);
LogUtil.debug(LOGNAME + 'setting changeStatus ' + status.name);
aUser.changeStatus(status);
_participantsSO.setProperty(userid.toString() + STATUS, aUser.status.source);
_participantsSO.setDirty(userid.toString() + STATUS);
@ -135,7 +134,7 @@ package org.bigbluebutton.modules.viewers.model.services
public function removeStatus(userid:Number, statusName:String):void {
var aUser:User = _participants.getParticipant(userid);
if (aUser != null) {
LogUtil.debug('setting removeStatus ' + statusName);
LogUtil.debug(LOGNAME + 'setting removeStatus ' + statusName);
aUser.removeStatus(statusName);
_participantsSO.setProperty(userid.toString() + STATUS, aUser.status.source);
_participantsSO.setDirty(userid.toString() + STATUS);
@ -153,7 +152,7 @@ package org.bigbluebutton.modules.viewers.model.services
public function iAmPresenter(userid:Number, presenter:Boolean):void {
var aUser:User = _participants.getParticipant(userid);
if (aUser != null) {
LogUtil.debug('iampresenter ' + userid);
LogUtil.debug(LOGNAME + 'iampresenter ' + userid);
aUser.presenter = presenter;
_participantsSO.setProperty(userid.toString(), aUser);
_participantsSO.setDirty(userid.toString());
@ -195,7 +194,7 @@ package org.bigbluebutton.modules.viewers.model.services
_participantsSO.setProperty(userid.toString(), aUser);
_participantsSO.setDirty(userid.toString());
LogUtil.debug( "Conference::addStream::found =[" + userid + ","
LogUtil.debug(LOGNAME + "Conference::addStream::found =[" + userid + ","
+ aUser.hasStream + "," + aUser.streamName + "]");
}
}
@ -209,7 +208,7 @@ package org.bigbluebutton.modules.viewers.model.services
_participantsSO.setProperty(userid.toString(), aUser);
_participantsSO.setDirty(userid.toString());
LogUtil.debug( "Conference::removeStream::found =[" + userid + ","
LogUtil.debug(LOGNAME + "Conference::removeStream::found =[" + userid + ","
+ aUser.hasStream + "," + aUser.streamName + "]");
}
}
@ -221,11 +220,11 @@ package org.bigbluebutton.modules.viewers.model.services
*/
private function sharedObjectSyncHandler( event : SyncEvent) : void
{
LogUtil.debug( "Conference::sharedObjectSyncHandler " + event.changeList.length);
LogUtil.debug(LOGNAME + "Conference::sharedObjectSyncHandler " + event.changeList.length);
for (var i : uint = 0; i < event.changeList.length; i++)
{
LogUtil.debug( "Conference::handlingChanges[" + event.changeList[i].name + "][" + i + "][" + event.changeList[i].code + "]");
LogUtil.debug(LOGNAME + "Conference::handlingChanges[" + event.changeList[i].name + "][" + i + "][" + event.changeList[i].code + "]");
handleChangesToSharedObject(event.changeList[i].code,
event.changeList[i].name, event.changeList[i].oldValue);
}
@ -249,7 +248,7 @@ package org.bigbluebutton.modules.viewers.model.services
* with the server object. In the latter case, SyncEvent.SYNC is dispatched
* and the "code" value is set to "change".
*/
LogUtil.debug("Got clear sync event for participants");
LogUtil.debug(LOGNAME + "Got clear sync event for participants");
_participants.removeAllParticipants();
break;
@ -260,8 +259,7 @@ package org.bigbluebutton.modules.viewers.model.services
*/
// do nothing... just log it ;
LogUtil.debug( "Conference::success =[" + code + "," + name + "," + oldValue + "]");
sendMessage(ViewersModuleConstants.CHANGE_STATUS);
LogUtil.info(LOGNAME + "Conference::success =[" + code + "," + name + "," + oldValue + "]");
break;
case "reject":
@ -273,7 +271,7 @@ package org.bigbluebutton.modules.viewers.model.services
// do nothing... just log it
// Or...maybe we should check if the value is the same as what we wanted it
// to be..if not...change it?
LogUtil.debug( "Conference::reject =[" + code + "," + name + "," + oldValue + "]");
LogUtil.warn(LOGNAME + "Conference::reject =[" + code + "," + name + "," + oldValue + "]");
break;
case "change":
@ -283,7 +281,7 @@ package org.bigbluebutton.modules.viewers.model.services
*/
if (name != null) {
LogUtil.debug('seraching status ' + name.search(STATUS));
/* LogUtil.debug('seraching status ' + name.search(STATUS));
var statusIndex:int = name.search(STATUS);
if (statusIndex > -1) {
var uid:String = name.slice(0,statusIndex);
@ -296,13 +294,12 @@ package org.bigbluebutton.modules.viewers.model.services
LogUtil.debug('User id NULL');
}
} else {
if (_participants.hasParticipant(_participantsSO.data[name].userid)) {
LogUtil.debug('Changed user[' + _participantsSO.data[name].userid + "]");
*/ if (_participants.hasParticipant(_participantsSO.data[name].userid)) {
var cUser:User = _participants.getParticipant(Number(name));
cUser.presenter = _participantsSO.data[name].presenter;
cUser.hasStream = _participantsSO.data[name].hasStream;
cUser.streamName = _participantsSO.data[name].streamName;
sendMessage(ViewersModuleConstants.CHANGE_STATUS);
LogUtil.debug(LOGNAME + 'Changed user[' + cUser.name + "," + _participantsSO.data[name].userid + "]");
} else {
// The server sent us a new user.
var user:User = new User();
@ -311,11 +308,11 @@ package org.bigbluebutton.modules.viewers.model.services
user.role = _participantsSO.data[name].role;
user.presenter = _participantsSO.data[name].presenter;
user.hasStream = _participantsSO.data[name].hasStream;
user.streamName = _participantsSO.data[name].streamName;
user.streamName = _participantsSO.data[name].streamName;
LogUtil.info(LOGNAME + "New user[" + user.name + "," + user.userid + "]");
_participants.addUser(user);
sendMessage(ViewersModuleConstants.CHANGE_STATUS);
}
}
// }
}
break;
@ -325,14 +322,14 @@ package org.bigbluebutton.modules.viewers.model.services
* A value of "delete" means the attribute was deleted.
*/
LogUtil.debug( "Conference::delete =[" + code + "," + name + "," + oldValue + "]");
LogUtil.info(LOGNAME + "Removing user[" + code + "," + name + "," + oldValue + "]");
// The participant has left. Cast name (string) into a Number.
_participants.removeParticipant(Number(name));
break;
default:
LogUtil.debug( "Conference::default[" + _participantsSO.data[name].userid
LogUtil.debug(LOGNAME + "Conference::default[" + _participantsSO.data[name].userid
+ "," + _participantsSO.data[name].name + "]");
break;
}
@ -351,37 +348,37 @@ package org.bigbluebutton.modules.viewers.model.services
switch ( statusCode )
{
case "NetConnection.Connect.Success" :
LogUtil.debug(NAME + ":Connection Success");
LogUtil.debug(LOGNAME + ":Connection Success");
notifyConnectionStatusListener(true);
break;
case "NetConnection.Connect.Failed" :
LogUtil.debug(NAME + ":Connection to viewers application failed");
LogUtil.debug(LOGNAME + ":Connection to viewers application failed");
notifyConnectionStatusListener(false);
break;
case "NetConnection.Connect.Closed" :
LogUtil.debug(NAME + ":Connection to viewers application closed");
LogUtil.debug(LOGNAME + ":Connection to viewers application closed");
notifyConnectionStatusListener(false);
break;
case "NetConnection.Connect.InvalidApp" :
LogUtil.debug(NAME + ":Viewers application not found on server");
LogUtil.debug(LOGNAME + ":Viewers application not found on server");
notifyConnectionStatusListener(false);
break;
case "NetConnection.Connect.AppShutDown" :
LogUtil.debug(NAME + ":Viewers application has been shutdown");
LogUtil.debug(LOGNAME + ":Viewers application has been shutdown");
notifyConnectionStatusListener(false);
break;
case "NetConnection.Connect.Rejected" :
LogUtil.debug(NAME + ":No permissions to connect to the viewers application" );
LogUtil.debug(LOGNAME + ":No permissions to connect to the viewers application" );
notifyConnectionStatusListener(false);
break;
default :
LogUtil.debug(NAME + ":default - " + event.info.code );
LogUtil.debug(LOGNAME + ":default - " + event.info.code );
notifyConnectionStatusListener(false);
break;
}
@ -389,7 +386,7 @@ package org.bigbluebutton.modules.viewers.model.services
private function asyncErrorHandler ( event : AsyncErrorEvent ) : void
{
LogUtil.debug( "participantsSO asyncErrorHandler " + event.error);
LogUtil.debug(LOGNAME + "participantsSO asyncErrorHandler " + event.error);
notifyConnectionStatusListener(false);
}
}

View File

@ -87,8 +87,7 @@ package org.bigbluebutton.modules.viewers.view
ViewersModuleConstants.OPEN_VIEWERS_WINDOW,
ViewersModuleConstants.CLOSE_VIEWERS_WINDOW,
ViewersModuleConstants.BECOME_VIEWER,
ViewersModuleConstants.ASSIGN_PRESENTER,
ViewersModuleConstants.CHANGE_STATUS
ViewersModuleConstants.ASSIGN_PRESENTER
];
}
@ -110,10 +109,6 @@ package org.bigbluebutton.modules.viewers.view
LogUtil.debug('Sending BECOME_VIEWER_EVENT');
// _viewersWindow.becomeViewer(notification.getBody());
break;
case ViewersModuleConstants.CHANGE_STATUS:
LogUtil.debug('Handling CHANGE_STATUS');
_viewersWindow.changeStatus(notification.getBody() as ArrayCollection);
break;
case ViewersModuleConstants.ASSIGN_PRESENTER:
LogUtil.debug('Sending ASSIGN_PRESENTER_EVENT');
// _viewersWindow.becomePresenter(notification.getBody());

View File

@ -1,25 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"
verticalScrollPolicy="off" horizontalScrollPolicy="off" creationComplete="checkIfUserIsMe()">
verticalScrollPolicy="off" horizontalScrollPolicy="off">
<mx:Script>
<![CDATA[
private function checkIfUserIsMe():void {
if (data.me) {
myNameLabel.visible = true;
myNameLabel.text = data.name;
myNameLabel.toolTip = "You are logged in as this user.";
otherNameLabel.visible = false;
this.removeChild(otherNameLabel);
} else {
myNameLabel.visible = false;
otherNameLabel.text = data.name;
otherNameLabel.visible = true;
this.removeChild(myNameLabel);
}
}
]]>
</mx:Script>
<mx:Label id="myNameLabel" visible="false" textAlign="left" fontWeight="bold" color="blue"/>
<mx:Label id="otherNameLabel" visible="false" textAlign="left" fontWeight="normal"/>
<mx:Label id="nameLabel" textAlign="left" text="{data.name}"
fontWeight="{data.me ? 'bold' : 'normal'}"
color="{data.me ? 0x003399 : 0x000000}"
toolTip="{data.me ? 'You are logged in as this user.' : ''}"/>
</mx:HBox>

View File

@ -4,7 +4,6 @@
<mx:Script>
<![CDATA[
import org.bigbluebutton.modules.viewers.ViewersModuleConstants;
import org.bigbluebutton.modules.viewers.view.components.Images;
import org.bigbluebutton.common.Role;
@ -12,23 +11,8 @@
[Bindable] private var adminIcon : Object = images.admin;
[Bindable] private var viewerIcon : Object = images.participant;
private function setRole():void {
if (data.role == Role.MODERATOR) {
roleImage.source = adminIcon;
roleImage.toolTip = "Moderator";
roleImage.visible = true;
} else {
roleImage.source = viewerIcon;
roleImage.toolTip = "Viewer";
roleImage.visible = false;
}
}
]]>
</mx:Script>
<mx:Image id="roleImage" creationComplete="setRole()"/>
<!--mx:Image id="roleImage" source="{data.role == Role.MODERATOR ? adminIcon : viewerIcon}"/-->
<mx:Image id="roleImage" source="{data.role == Role.MODERATOR ? adminIcon : ''}"/>
</mx:HBox>

View File

@ -1,14 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"
verticalScrollPolicy="off" horizontalScrollPolicy="off" creationComplete="init()">
verticalScrollPolicy="off" horizontalScrollPolicy="off">
<mx:Script>
<![CDATA[
import org.bigbluebutton.modules.viewers.view.events.ViewCameraEvent;
import org.bigbluebutton.modules.viewers.model.vo.Status;
import mx.collections.ArrayCollection;
import org.bigbluebutton.modules.viewers.view.events.ChangeStatusEvent;
import org.bigbluebutton.modules.viewers.ViewersModuleConstants;
import org.bigbluebutton.modules.viewers.view.components.Images;
private var images:Images = new Images();
@ -21,40 +18,9 @@
[Bindable] private var webcamIcon:Object = images.webcam;
[Bindable] private var handIcon:Object = images.raisehand;
[Bindable] private var presenterIcon:Object = images.presenter;
private function init():void {
LogUtil.debug('registering for change status events');
parentDocument.addEventListener(ChangeStatusEvent.CHANGE_STATUS_EVENT, onChangeStatusEvent);
updateStatus('init');
}
private function onChangeStatusEvent(e:ChangeStatusEvent):void {
LogUtil.debug('changing status icon');
updateStatus('onChangeStatusEvent');
}
private function updateStatus(from:String):void {
LogUtil.debug('updating status from ' + from + " user=" + data.name + " presenter=" + data.presenter + " stream=" + data.hasStream);
if (data.presenter) {
presIcon.source = presenterIcon;
presIcon.toolTip = "Presenter";
presIcon.visible = true;
} else {
presIcon.visible = false;
}
if (data.hasStream) {
streamIcon.source = webcamIcon;
streamIcon.toolTip = "Double-Click to view";
streamIcon.visible = true;
} else {
streamIcon.visible = false;
}
}
]]>
</mx:Script>
<mx:Image id="streamIcon" visible="false" doubleClick="viewCamera()" creationComplete="updateStatus('streamIcon')"/>
<mx:Image id="presIcon" visible="false" creationComplete="updateStatus('presIcon')"/>
<mx:Image id="streamIcon" visible="{data.hasStream}" doubleClick="viewCamera()" source="{webcamIcon}" toolTip="Double-Click to view."/>
<mx:Image id="presIcon" visible="{data.presenter}" source="{presenterIcon}" toolTip="Presenter"/>
</mx:HBox>

View File

@ -16,7 +16,7 @@
public static const TITLE:String = "Viewers";
[Bindable]
public var participants:ArrayCollection = new ArrayCollection();
public var participants:ArrayCollection;
[Bindable]
public var isModerator:Boolean = false;