Author: solomax
Date: Mon Jan 16 08:24:29 2017
New Revision: 1778985
URL: http://svn.apache.org/viewvc?rev=1778985&view=rev
Log:
[OPENMEETINGS-895] exclusive audio seems to work as expected
Modified:
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/base/hibernate/hibRtmpConnection.lzx
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/base/remote/baseVideoStream.lzx
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/commonVideoViewContentSWF10.lzx
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/modules/conference/flexibleConferenceRoom/baseConferenceRoom.lzx
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/modules/conference/flexibleConferenceRoom/roomSidebar/baseRoomSidebar.lzx
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/video/baseVideoObject.lzx
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.java
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/util/AjaxDownload.java
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.java
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/util/AjaxDownload.java
Modified:
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
URL:
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java?rev=1778985&r1=1778984&r2=1778985&view=diff
==============================================================================
---
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
(original)
+++
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
Mon Jan 16 08:24:29 2017
@@ -875,46 +875,6 @@ public class ScopeApplicationAdapter ext
return -1L;
}
- public long giveExclusiveAudio(String publicSID) {
- try {
- log.debug("----------- giveExclusiveAudio: " +
publicSID);
-
- IConnection current = Red5.getConnectionLocal();
- // String streamid = current.getClient().getId();
-
- final Client currentClient =
sessionManager.getClientByPublicSID(publicSID, null);
-
- if (currentClient == null) {
- return -1L;
- }
-
- // Put the mod-flag to true for this client
- currentClient.setMicMuted(false);
-
sessionManager.updateClientByStreamId(currentClient.getStreamid(),
currentClient, false, null);
-
- // Notify all clients of the same scope (room)
- new MessageSender(current, "receiveExclusiveAudioFlag",
currentClient) {
- @Override
- public boolean filter(IConnection conn) {
- Client rcl =
sessionManager.getClientByStreamId(conn.getClient().getId(), null);
- if (rcl == null) {
- } else if (rcl.isScreenClient()) {
- } else {
- if (rcl != currentClient) {
- rcl.setMicMuted(true);
-
sessionManager.updateClientByStreamId(rcl.getStreamid(), rcl, false, null);
- }
- return false;
- }
- return true;
- }
- }.start();
- } catch (Exception err) {
- log.error("[giveExclusiveAudio]", err);
- }
- return -1L;
- }
-
public long switchMicMuted(String publicSID, boolean mute) {
try {
log.debug("----------- switchMicMuted: " + publicSID);
Modified:
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/base/hibernate/hibRtmpConnection.lzx
URL:
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/base/hibernate/hibRtmpConnection.lzx?rev=1778985&r1=1778984&r2=1778985&view=diff
==============================================================================
---
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/base/hibernate/hibRtmpConnection.lzx
(original)
+++
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/base/hibernate/hibRtmpConnection.lzx
Mon Jan 16 08:24:29 2017
@@ -689,19 +689,14 @@
]]>
</method>
- <netRemoteCallHib name="giveExclusiveAudio"
funcname="giveExclusiveAudio">
- <attribute name="publicSID" value="0" type="string" />
- <netparam><method name="getValue">return
parent.publicSID;</method></netparam>
- <method name="setExclusiveAudio" args="tPublicSID">
- this.publicSID = tPublicSID;
- this.doCall();
- </method>
- </netRemoteCallHib>
+ <method name="giveExclusiveAudio" args="uid">
+ ExternalInterface.call("roomAction", "exclusive", uid);
+ </method>
<method name="receiveExclusiveAudioFlag" args="value">
<![CDATA[
//The onResult-Handler will be called be the rtmpconnection
-
canvas._videocontainer.receiveExclusiveAudioFlag(value.publicSID)
+
canvas.commonVideoViewContent.receiveExclusiveAudioFlag(value.publicSID)
]]>
</method>
@@ -854,12 +849,11 @@
canvas.setAttribute("canVideo", client.canVideo);
if (client.isBroadcasting) {
-
canvas.commonVideoViewContent._startAvBroadcast();
+
canvas.commonVideoViewContent.startAvBroadcast();
canvas.setAttribute("lastBroadCastingUser",
client);
} else {
canvas.commonVideoViewContent.removeVideoByUser(canvas.publicSID);
}
- } else {
}
]]>
</method>
Modified:
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/base/remote/baseVideoStream.lzx
URL:
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/base/remote/baseVideoStream.lzx?rev=1778985&r1=1778984&r2=1778985&view=diff
==============================================================================
---
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/base/remote/baseVideoStream.lzx
(original)
+++
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/base/remote/baseVideoStream.lzx
Mon Jan 16 08:24:29 2017
@@ -245,7 +245,7 @@
if (micReference != null) {
this.setAttribute('micro', micReference);
this._ns.attachAudio(micReference);
- muteMicro(this.micMuted);
+ //FIXME TODO muteMicro(this.micMuted);
}
this._ns.publish("" + streamName, (mode == "broadcast") ?
"live" : mode);
]]>
Modified:
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/commonVideoViewContentSWF10.lzx
URL:
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/commonVideoViewContentSWF10.lzx?rev=1778985&r1=1778984&r2=1778985&view=diff
==============================================================================
---
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/commonVideoViewContentSWF10.lzx
(original)
+++
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/commonVideoViewContentSWF10.lzx
Mon Jan 16 08:24:29 2017
@@ -117,7 +117,6 @@
</method>
<!--
-
Method that creates the video views when user(self) initially
entering a room.
Creates the video-view AND starts to stream/play the video
-->
@@ -126,31 +125,33 @@
if ($debug) Debug.info("createVideo::: ", cl.publicSID,
cl.broadCastID, cl.avsettings, cl.interviewPodId);
if ($debug) Debug.write(" createVideo ALL vars ", cl);
var vidContainer = getVideoObjectByPublicSID(cl.publicSID);
- if (vidContainer == null) {
- vidContainer = getNewVideoObjectByPos(cl.publicSID);
- }
- vidContainer.clientVars = cl;
- setPartnerName(vidContainer, cl.firstname, cl.lastname);
- switch (cl.avsettings) {
- case 'a':
- if ($debug) Debug.warn("start play");
-
vidContainer._chatvideoinner._videostream.playStream(cl.broadCastID, -1);
- break;
- case 'v':
- case 'av':
- //this means avsettings is either: "v" or "av"
-
vidContainer._chatvideoinner._videostream.playStream(cl.broadCastID, -1);
- break;
- case 'n':
- default:
- break;
- }
- vidContainer.updateAVSettingsSymbol(cl);
- if (cl.micMuted) {
- vidContainer.setMicMuted(cl.micMuted);
+ if (cl.avsettings != 'n') {
+ if (vidContainer == null) {
+ vidContainer =
getNewVideoObjectByPos(cl.publicSID);
+ }
+ vidContainer.clientVars = cl;
+ setPartnerName(vidContainer, cl.firstname, cl.lastname);
+ switch (cl.avsettings) {
+ case 'a':
+ if ($debug) Debug.warn("start play");
+
vidContainer._chatvideoinner._videostream.playStream(cl.broadCastID, -1);
+ break;
+ case 'v':
+ case 'av':
+ //this means avsettings is either: "v"
or "av"
+
vidContainer._chatvideoinner._videostream.playStream(cl.broadCastID, -1);
+ break;
+ case 'n':
+ default:
+ break;
+ }
+ vidContainer.updateAVSettingsSymbol(cl);
+ if (cl.micMuted) {
+ vidContainer.setMicMuted(cl.micMuted);
+ }
+ if ($debug) Debug.write(" createVideo ALL vars ",
vidContainer);
+ placeInterviewPod(vidContainer, cl.interviewPodId);
}
- if ($debug) Debug.write(" createVideo ALL vars ", vidContainer);
- placeInterviewPod(vidContainer, cl.interviewPodId);
enableRecordingButton();
return vidContainer;
]]>
@@ -214,6 +215,15 @@
]]>
</method>
+ <method name="receiveExclusiveAudioFlag" args="publicSID">
+ <![CDATA[
+ for (var i = 0; i < this.subviews.length; ++i) {
+ var item = this.subviews[i];
+ muteSound(item.publicSID, !(publicSID ==
item.publicSID));
+ }
+ ]]>
+ </method>
+
<method name="getVideoObjectFreePos"
args="offsetLength,videoWidth,videoHeight">
<![CDATA[
if (canvas.isInterview) {
@@ -264,13 +274,13 @@
</method>
<method name="muteSound" args="publicSID, bool">
- <![CDATA[
- var obj = this.getVideoObjectByPublicSID(publicSID);
- if (obj != null) {
- obj.silenceMicrophone(bool);
- }
- return;
- ]]>
+ <![CDATA[
+ var obj = this.getVideoObjectByPublicSID(publicSID);
+ if (obj != null) {
+ obj.silenceMicrophone(bool);
+ }
+ return;
+ ]]>
</method>
<method name="resetAllValues">
@@ -378,11 +388,11 @@
</method>
<method name="setExclusiveAudioAllowStatus" args="canGiveAudio">
- <![CDATA[
- if ($debug) Debug.write("setExclusiveAudioAllowStatus
:: ",canGiveAudio);
-
canvas.setAttribute("isAllowedToGiveExclusiveAudio",canGiveAudio);
- return;
- ]]>
+ <![CDATA[
+ if ($debug) Debug.write("setExclusiveAudioAllowStatus ::
",canGiveAudio);
+
canvas.setAttribute("isAllowedToGiveExclusiveAudio",canGiveAudio);
+ return;
+ ]]>
</method>
<method name="updateFirstLastName" args="publicSID, first, last">
@@ -773,37 +783,56 @@
</handler>
</netRemoteCallHib>
+ <method name="videoEnabled" args="settings">
+ <![CDATA[
+ return settings.indexOf('v') > -1;
+ ]]>
+ </method>
+
<method name="startAvBroadcast">
<![CDATA[
var g = canvas.commonVideoViewContent.loadAVsettings();
- var myvideocontainer = createVideoObject(canvas.publicSID,
true, canvas.currentClient.interviewPodId, canvas.currentClient);
- if ($debug) Debug.write("startAvBroadcast::doninitalize");
var settings = getAVmode();
- if ($debug) Debug.write("startAvBroadcast::mode, ", settings,
canvas.currentClient.avsettings);
+ if ($debug) Debug.write("startAvBroadcast::mode ", settings);
+ if ('n' != settings) {
+ var videoWindow =
getVideoObjectByPublicSID(canvas.publicSID);
+ if (videoWindow != null && videoEnabled(settings) &&
videoEnabled(videoWindow.clientVars.avsettings)) {
+ var videoview =
videoWindow._chatvideoinner._videostream;
+ if (settings == 'av' &&
videoWindow.clientVars.avsettings == 'v') {
+ videoview.muteMicro(false);
+ } else if (settings == 'v' &&
videoWindow.clientVars.avsettings == 'av') {
+ videoview.muteMicro(true);
+ }
+ videoWindow.clientVars = canvas.currentClient;
+ } else {
+ videoWindow =
createVideoObject(canvas.publicSID, true, canvas.currentClient.interviewPodId,
canvas.currentClient);
+ if ($debug)
Debug.write("startAvBroadcast::doninitalize");
- var videoview = myvideocontainer._chatvideoinner._videostream;
- if ($debug) Debug.write("myvideocontainer: ", myvideocontainer);
- myvideocontainer.setAttribute('isremote', false);
- var _micro = getMic(getAvSetting('mic', g, 0));
- var _camera = getCam(getAvSetting('cam', g, 0), videoview);
- if ($debug) Debug.write("startAvBroadcast", _camera, _micro,
settings, videoview);
-
- if ($debug) Debug.write("BroadcastId: ",
canvas.currentClient.broadCastID);
- switch (settings) {
- case "av":
-
videoview.broadcast(canvas.currentClient.broadCastID, _camera, _micro);
- break;
- case "a":
-
videoview.broadcast(canvas.currentClient.broadCastID, null, _micro);
- break;
- case "v":
-
videoview.broadcast(canvas.currentClient.broadCastID, _camera, null);
- break;
- case "n":
- default:
- break;
+ var videoview =
videoWindow._chatvideoinner._videostream;
+ if ($debug) Debug.write("videoWindow: ",
videoWindow);
+ videoWindow.setAttribute('isremote', false);
+ var _micro = getMic(getAvSetting('mic', g, 0));
+ var _camera = getCam(getAvSetting('cam', g, 0),
videoview);
+ if ($debug) Debug.write("startAvBroadcast",
_camera, _micro, settings, videoview);
+
+ if ($debug) Debug.write("BroadcastId: ",
canvas.currentClient.broadCastID);
+ switch (settings) {
+ case "av":
+
videoview.broadcast(canvas.currentClient.broadCastID, _camera, _micro);
+ break;
+ case "a":
+
videoview.broadcast(canvas.currentClient.broadCastID, null, _micro);
+ break;
+ case "v":
+
videoview.broadcast(canvas.currentClient.broadCastID, _camera, _micro);
+ videoview.muteMicro(true);
+ break;
+ default:
+ break;
+ }
+ }
+
videoWindow.updateAVSettingsSymbol(canvas.currentClient);
}
- myvideocontainer.updateAVSettingsSymbol(canvas.currentClient);
enableRecordingButton();
]]>
</method>
Modified:
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/modules/conference/flexibleConferenceRoom/baseConferenceRoom.lzx
URL:
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/modules/conference/flexibleConferenceRoom/baseConferenceRoom.lzx?rev=1778985&r1=1778984&r2=1778985&view=diff
==============================================================================
---
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/modules/conference/flexibleConferenceRoom/baseConferenceRoom.lzx
(original)
+++
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/modules/conference/flexibleConferenceRoom/baseConferenceRoom.lzx
Mon Jan 16 08:24:29 2017
@@ -79,7 +79,7 @@
}
if (canvas.GIVE_EXCLUSIVE_AUDIO_KEY == keyCode) {
if (canvas.ismoderator ||
canvas.isAllowedToGiveExclusiveAudio) {
-
canvas.thishib.giveExclusiveAudio.setExclusiveAudio(canvas.publicSID);
+
canvas.thishib.giveExclusiveAudio(canvas.publicSID);
} else {
new
lz.rpcErrorDialog(canvas.main_content._content.inner,{errorid:-54});
}
Modified:
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/modules/conference/flexibleConferenceRoom/roomSidebar/baseRoomSidebar.lzx
URL:
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/modules/conference/flexibleConferenceRoom/roomSidebar/baseRoomSidebar.lzx?rev=1778985&r1=1778984&r2=1778985&view=diff
==============================================================================
---
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/modules/conference/flexibleConferenceRoom/roomSidebar/baseRoomSidebar.lzx
(original)
+++
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/modules/conference/flexibleConferenceRoom/roomSidebar/baseRoomSidebar.lzx
Mon Jan 16 08:24:29 2017
@@ -130,20 +130,6 @@
]]>
</method>
- <method name="receiveExclusiveAudioFlag" args="publicSID">
- <![CDATA[
- var vList = this._participants._table.renderList;
- for (var i = 0;i < vList.length; ++i) {
- var item = vList[i];
- var rcl = new Object();
-
- rcl.publicSID = item.publicSID;
- rcl.micMuted = !(publicSID == item.publicSID);
- canvas.setMuteStatus(rcl);
- }
- ]]>
- </method>
-
<method name="addItem"
args="connectedSince,isMod,streamid,username,userroom,formatedDate,position,color,object">
<![CDATA[
if ($debug) Debug.write("initializeStreams addItem:
",connectedSince,isMod,streamid,username,formatedDate);
Modified:
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/video/baseVideoObject.lzx
URL:
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/video/baseVideoObject.lzx?rev=1778985&r1=1778984&r2=1778985&view=diff
==============================================================================
---
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/video/baseVideoObject.lzx
(original)
+++
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/video/baseVideoObject.lzx
Mon Jan 16 08:24:29 2017
@@ -573,11 +573,6 @@
]]>
</handler>
- <method name="giveExclusiveAudio">
- canvas.thishib.giveExclusiveAudio.publicSID =
this.publicSID;
- canvas.thishib.giveExclusiveAudio.doCall();
- </method>
-
<method name="confirmExclusiveAudio">
var so:SharedObject = SharedObject.getLocal('userdata');
var userData = so.data;
@@ -586,7 +581,7 @@
exclusiveAudioListener.sendNoConfirmation =
function(none) {};
exclusiveAudioListener.sendConfirmation =
function(answer, remember) {
if (answer) {
- giveExclusiveAudio();
+
canvas.thishib.giveExclusiveAudio(this.publicSID);
if (remember) {
userData["dontShowExclusiveAudioConfirmation"] = true;
so.flush();
Modified:
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
URL:
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java?rev=1778985&r1=1778984&r2=1778985&view=diff
==============================================================================
---
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
(original)
+++
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
Mon Jan 16 08:24:29 2017
@@ -231,7 +231,6 @@ public class Application extends Authent
}
rcl.setIsSuperModerator(client.hasRight(Right.superModerator));
rcl.setIsMod(client.hasRight(Right.moderator));
- rcl.setIsBroadcasting(client.hasRight(Right.audio));
rcl.setCanVideo(client.hasRight(Right.video) &&
client.isCamEnabled() && client.hasActivity(Activity.broadcastV));
rcl.setCanDraw(client.hasRight(Right.whiteBoard));
if (client.hasActivity(Activity.broadcastA) ||
client.hasActivity(Activity.broadcastV)) {
@@ -240,8 +239,6 @@ public class Application extends Authent
if (client.getPod() != Pod.none) {
rcl.setInterviewPodId(client.getPod()
== Pod.left ? 1 : 2);
}
- rcl.setIsBroadcasting(true);
-
rcl.setBroadCastID(ScopeApplicationAdapter.nextBroadCastId());
StringBuilder sb = new StringBuilder();
if (client.hasActivity(Activity.broadcastA)) {
sb.append('a');
@@ -249,6 +246,10 @@ public class Application extends Authent
if (client.hasActivity(Activity.broadcastV)) {
sb.append('v');
}
+ if (!rcl.getIsBroadcasting()) {
+ rcl.setIsBroadcasting(true);
+
rcl.setBroadCastID(ScopeApplicationAdapter.nextBroadCastId());
+ }
rcl.setAvsettings(sb.toString());
} else {
rcl.setAvsettings("n");
Modified:
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
URL:
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java?rev=1778985&r1=1778984&r2=1778985&view=diff
==============================================================================
---
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
(original)
+++
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
Mon Jan 16 08:24:29 2017
@@ -103,6 +103,7 @@ public class RoomPanel extends BasePanel
kick
, settings
, refresh
+ , exclusive
}
private final Room r;
private final WebMarkupContainer room = new
WebMarkupContainer("roomContainer");
Modified:
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.java
URL:
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.java?rev=1778985&r1=1778984&r2=1778985&view=diff
==============================================================================
---
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.java
(original)
+++
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.java
Mon Jan 16 08:24:29 2017
@@ -31,6 +31,7 @@ import java.util.List;
import org.apache.openmeetings.db.entity.room.Room;
import org.apache.openmeetings.db.entity.room.Room.Right;
import org.apache.openmeetings.db.entity.room.Room.RoomElement;
+import org.apache.openmeetings.web.app.Application;
import org.apache.openmeetings.web.app.Client;
import org.apache.openmeetings.web.app.Client.Activity;
import org.apache.openmeetings.web.app.Client.Pod;
@@ -103,20 +104,33 @@ public class RoomSidebar extends Panel {
if (Strings.isEmpty(uid)) {
return;
}
- if (room.getClient().hasRight(Right.moderator))
{
- Action a =
Action.valueOf(getRequest().getRequestParameters().getParameterValue(PARAM_ACTION).toString());
- kickedClient = getOnlineClient(uid);
- if (kickedClient == null) {
- return;
- }
- switch (a) {
- case kick:
- if
(!kickedClient.hasRight(Right.superModerator) &&
!room.getClient().getUid().equals(kickedClient.getUid())) {
+ Client cl = room.getClient();
+ Action a =
Action.valueOf(getRequest().getRequestParameters().getParameterValue(PARAM_ACTION).toString());
+ switch (a) {
+ case kick:
+ if
(cl.hasRight(Right.moderator)) {
+ kickedClient =
getOnlineClient(uid);
+ if (kickedClient ==
null) {
+ return;
+ }
+ if
(!kickedClient.hasRight(Right.superModerator) &&
!cl.getUid().equals(kickedClient.getUid())) {
confirmKick.getDialog().open(target);
}
- break;
- default:
- }
+ }
+ break;
+ case exclusive:
+ if
(room.getClient().hasRight(Right.exclusive)) {
+ for (Client c :
Application.getRoomClients(room.getRoom().getId())) {
+ if
(cl.getUid().equals(c.getUid())) {
+
c.set(Activity.broadcastA);
+ } else {
+
c.remove(Activity.broadcastA);
+ }
+
room.broadcast(target, c);
+ }
+ }
+ break;
+ default:
}
} catch (Exception e) {
log.error("Unexpected exception while toggle
'action'", e);
@@ -253,6 +267,7 @@ public class RoomSidebar extends Panel {
setActiveTab(selectedIdx);
}
+ @Override
public void onActivate(AjaxRequestTarget target, int
index, ITab tab) {
selectedIdx = index;
}
Modified:
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/util/AjaxDownload.java
URL:
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/util/AjaxDownload.java?rev=1778985&r1=1778984&r2=1778985&view=diff
==============================================================================
---
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/util/AjaxDownload.java
(original)
+++
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/util/AjaxDownload.java
Mon Jan 16 08:24:29 2017
@@ -27,6 +27,7 @@ import org.apache.wicket.behavior.Abstra
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
+import org.apache.wicket.markup.head.PriorityHeaderItem;
import org.apache.wicket.request.handler.resource.ResourceStreamRequestHandler;
import org.apache.wicket.request.resource.ContentDisposition;
import org.apache.wicket.request.resource.JavaScriptResourceReference;
@@ -84,7 +85,7 @@ public class AjaxDownload extends Abstra
@Override
public void renderHead(Component component, IHeaderResponse response) {
super.renderHead(component, response);
-
response.render(JavaScriptHeaderItem.forReference(newResourceReference()));
+ response.render(new
PriorityHeaderItem(JavaScriptHeaderItem.forReference(newResourceReference())));
response.render(OnDomReadyHeaderItem.forScript(String.format("addDwnldIframe('%s',
'%s');", component instanceof Page ? "" : component.getMarkupId(), iframeId)));
}
Modified:
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
URL:
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java?rev=1778985&r1=1778984&r2=1778985&view=diff
==============================================================================
---
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
(original)
+++
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
Mon Jan 16 08:24:29 2017
@@ -875,46 +875,6 @@ public class ScopeApplicationAdapter ext
return -1L;
}
- public long giveExclusiveAudio(String publicSID) {
- try {
- log.debug("----------- giveExclusiveAudio: " +
publicSID);
-
- IConnection current = Red5.getConnectionLocal();
- // String streamid = current.getClient().getId();
-
- final Client currentClient =
sessionManager.getClientByPublicSID(publicSID, null);
-
- if (currentClient == null) {
- return -1L;
- }
-
- // Put the mod-flag to true for this client
- currentClient.setMicMuted(false);
-
sessionManager.updateClientByStreamId(currentClient.getStreamid(),
currentClient, false, null);
-
- // Notify all clients of the same scope (room)
- new MessageSender(current, "receiveExclusiveAudioFlag",
currentClient) {
- @Override
- public boolean filter(IConnection conn) {
- Client rcl =
sessionManager.getClientByStreamId(conn.getClient().getId(), null);
- if (rcl == null) {
- } else if (rcl.isScreenClient()) {
- } else {
- if (rcl != currentClient) {
- rcl.setMicMuted(true);
-
sessionManager.updateClientByStreamId(rcl.getStreamid(), rcl, false, null);
- }
- return false;
- }
- return true;
- }
- }.start();
- } catch (Exception err) {
- log.error("[giveExclusiveAudio]", err);
- }
- return -1L;
- }
-
public long switchMicMuted(String publicSID, boolean mute) {
try {
log.debug("----------- switchMicMuted: " + publicSID);
Modified:
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
URL:
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java?rev=1778985&r1=1778984&r2=1778985&view=diff
==============================================================================
---
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
(original)
+++
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/Application.java
Mon Jan 16 08:24:29 2017
@@ -231,7 +231,6 @@ public class Application extends Authent
}
rcl.setIsSuperModerator(client.hasRight(Right.superModerator));
rcl.setIsMod(client.hasRight(Right.moderator));
- rcl.setIsBroadcasting(client.hasRight(Right.audio));
rcl.setCanVideo(client.hasRight(Right.video) &&
client.isCamEnabled() && client.hasActivity(Activity.broadcastV));
rcl.setCanDraw(client.hasRight(Right.whiteBoard));
if (client.hasActivity(Activity.broadcastA) ||
client.hasActivity(Activity.broadcastV)) {
@@ -240,8 +239,6 @@ public class Application extends Authent
if (client.getPod() != Pod.none) {
rcl.setInterviewPodId(client.getPod()
== Pod.left ? 1 : 2);
}
- rcl.setIsBroadcasting(true);
-
rcl.setBroadCastID(ScopeApplicationAdapter.nextBroadCastId());
StringBuilder sb = new StringBuilder();
if (client.hasActivity(Activity.broadcastA)) {
sb.append('a');
@@ -249,6 +246,10 @@ public class Application extends Authent
if (client.hasActivity(Activity.broadcastV)) {
sb.append('v');
}
+ if (!rcl.getIsBroadcasting()) {
+ rcl.setIsBroadcasting(true);
+
rcl.setBroadCastID(ScopeApplicationAdapter.nextBroadCastId());
+ }
rcl.setAvsettings(sb.toString());
} else {
rcl.setAvsettings("n");
Modified:
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
URL:
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java?rev=1778985&r1=1778984&r2=1778985&view=diff
==============================================================================
---
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
(original)
+++
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
Mon Jan 16 08:24:29 2017
@@ -102,6 +102,7 @@ public class RoomPanel extends BasePanel
kick
, settings
, refresh
+ , exclusive
}
private final Room r;
private final WebMarkupContainer room = new
WebMarkupContainer("roomContainer");
Modified:
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.java
URL:
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.java?rev=1778985&r1=1778984&r2=1778985&view=diff
==============================================================================
---
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.java
(original)
+++
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.java
Mon Jan 16 08:24:29 2017
@@ -31,6 +31,7 @@ import java.util.List;
import org.apache.openmeetings.db.entity.room.Room;
import org.apache.openmeetings.db.entity.room.Room.Right;
import org.apache.openmeetings.db.entity.room.Room.RoomElement;
+import org.apache.openmeetings.web.app.Application;
import org.apache.openmeetings.web.app.Client;
import org.apache.openmeetings.web.app.Client.Activity;
import org.apache.openmeetings.web.app.Client.Pod;
@@ -103,20 +104,33 @@ public class RoomSidebar extends Panel {
if (Strings.isEmpty(uid)) {
return;
}
- if (room.getClient().hasRight(Right.moderator))
{
- Action a =
Action.valueOf(getRequest().getRequestParameters().getParameterValue(PARAM_ACTION).toString());
- kickedClient = getOnlineClient(uid);
- if (kickedClient == null) {
- return;
- }
- switch (a) {
- case kick:
- if
(!kickedClient.hasRight(Right.superModerator) &&
!room.getClient().getUid().equals(kickedClient.getUid())) {
+ Client cl = room.getClient();
+ Action a =
Action.valueOf(getRequest().getRequestParameters().getParameterValue(PARAM_ACTION).toString());
+ switch (a) {
+ case kick:
+ if
(cl.hasRight(Right.moderator)) {
+ kickedClient =
getOnlineClient(uid);
+ if (kickedClient ==
null) {
+ return;
+ }
+ if
(!kickedClient.hasRight(Right.superModerator) &&
!cl.getUid().equals(kickedClient.getUid())) {
confirmKick.getDialog().open(target);
}
- break;
- default:
- }
+ }
+ break;
+ case exclusive:
+ if
(room.getClient().hasRight(Right.exclusive)) {
+ for (Client c :
Application.getRoomClients(room.getRoom().getId())) {
+ if
(cl.getUid().equals(c.getUid())) {
+
c.set(Activity.broadcastA);
+ } else {
+
c.remove(Activity.broadcastA);
+ }
+
room.broadcast(target, c);
+ }
+ }
+ break;
+ default:
}
} catch (Exception e) {
log.error("Unexpected exception while toggle
'action'", e);
@@ -253,6 +267,7 @@ public class RoomSidebar extends Panel {
setActiveTab(selectedIdx);
}
+ @Override
public void onActivate(AjaxRequestTarget target, int
index, ITab tab) {
selectedIdx = index;
}
Modified:
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/util/AjaxDownload.java
URL:
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/util/AjaxDownload.java?rev=1778985&r1=1778984&r2=1778985&view=diff
==============================================================================
---
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/util/AjaxDownload.java
(original)
+++
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/util/AjaxDownload.java
Mon Jan 16 08:24:29 2017
@@ -27,6 +27,7 @@ import org.apache.wicket.behavior.Abstra
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
+import org.apache.wicket.markup.head.PriorityHeaderItem;
import org.apache.wicket.request.handler.resource.ResourceStreamRequestHandler;
import org.apache.wicket.request.resource.ContentDisposition;
import org.apache.wicket.request.resource.JavaScriptResourceReference;
@@ -84,7 +85,7 @@ public class AjaxDownload extends Abstra
@Override
public void renderHead(Component component, IHeaderResponse response) {
super.renderHead(component, response);
-
response.render(JavaScriptHeaderItem.forReference(newResourceReference()));
+ response.render(new
PriorityHeaderItem(JavaScriptHeaderItem.forReference(newResourceReference())));
response.render(OnDomReadyHeaderItem.forScript(String.format("addDwnldIframe('%s',
'%s');", component instanceof Page ? "" : component.getMarkupId(), iframeId)));
}