Repository: openmeetings
Updated Branches:
  refs/heads/master af2425ae9 -> 0bf05e68a


[OPENMEETINGS-1644] exclusive audio seems to be implemented


Project: http://git-wip-us.apache.org/repos/asf/openmeetings/repo
Commit: http://git-wip-us.apache.org/repos/asf/openmeetings/commit/0bf05e68
Tree: http://git-wip-us.apache.org/repos/asf/openmeetings/tree/0bf05e68
Diff: http://git-wip-us.apache.org/repos/asf/openmeetings/diff/0bf05e68

Branch: refs/heads/master
Commit: 0bf05e68a221151464d2c061760aa069841fb67e
Parents: af2425a
Author: Maxim Solodovnik <[email protected]>
Authored: Thu Sep 7 22:51:38 2017 +0700
Committer: Maxim Solodovnik <[email protected]>
Committed: Thu Sep 7 22:51:38 2017 +0700

----------------------------------------------------------------------
 openmeetings-flash/src/main/flex/main.mxml      | 26 ++++++++++++++------
 .../apache/openmeetings/web/room/RoomPanel.java |  1 +
 .../org/apache/openmeetings/web/room/room.js    |  7 +++---
 3 files changed, 24 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/openmeetings/blob/0bf05e68/openmeetings-flash/src/main/flex/main.mxml
----------------------------------------------------------------------
diff --git a/openmeetings-flash/src/main/flex/main.mxml 
b/openmeetings-flash/src/main/flex/main.mxml
index 990083d..2962845 100644
--- a/openmeetings-flash/src/main/flex/main.mxml
+++ b/openmeetings-flash/src/main/flex/main.mxml
@@ -52,6 +52,7 @@
                private var activityTimer:Timer = new Timer(100);
                private var active:Boolean = false;
                private var userId:String = null;
+               private var cuid:String = null;
                [Bindable]
                private var interview:Boolean = false;
                [Embed(source="assets/micro.png")]
@@ -88,6 +89,10 @@
                        return _hasVideo(activities);
                }
 
+               private function hasRightExclusive():Boolean {
+                       return rights.indexOf('exclusive') > -1 || 
rights.indexOf('moderator') > -1 || rights.indexOf('superModerator') > -1;
+               }
+
                private function getIntParam(param:String, def:int):int {
                        var val:int = parseInt(param);
                        return (isNaN(val) || val < 1 ? def : val);
@@ -108,6 +113,7 @@
                        activities = params.av == null ? [] : 
params.av.split(',');
                        rights = params.rights == null ? [] : 
params.rights.split(',');
                        userId = params.userId;
+                       cuid = params.cuid;
                        switch (params.mode) {
                                case 'settings': {
                                        
ExternalInterface.addCallback("getDevices", function ():Object {
@@ -153,7 +159,7 @@
                                                        video.setVolume(vol);
                                                }
                                        });
-                                       
ExternalInterface.addCallback("rightsUpdated", rightsUpdatedCallback);
+                                       
ExternalInterface.addCallback("setRights", setRightsCallback);
                                        video.connect(function ():void {
                                                // trust no-one
                                                video.getNc().call("check", new 
Responder(function (check:Object):void {
@@ -206,14 +212,17 @@
                                        addImage(params.width, params.height);
                                        _resize(params.width, params.height);
                                        refreshCallback(null);
+                                       _updateExclusive();
                                        
ExternalInterface.addCallback("setVolume", function (vol:int):void {
                                                video.setStreamVolume(vol);
                                        });
                                        ExternalInterface.addCallback("update", 
function (c:Object):void {
-                                               //no-op for now
+                                               debug("update Callback", 
c.activities);
+                                               activities = c.activities;
+                                               _updateExclusive();
                                        });
                                        
ExternalInterface.addCallback("refresh", refreshCallback);
-                                       
ExternalInterface.addCallback("rightsUpdated", rightsUpdatedCallback);
+                                       
ExternalInterface.addCallback("setRights", setRightsCallback);
                                }
                                        break;
                        }
@@ -221,7 +230,8 @@
                }
 
                private function _updateExclusive():void {
-                       if (hasAudio()) {
+                       debug("_updateExclusive", rights, activities);
+                       if (hasAudio() && hasRightExclusive()) {
                                addEventListener(MouseEvent.MOUSE_OUT, 
exclMouseOutHandler);
                                addEventListener(MouseEvent.MOUSE_OVER, 
exclMouseOverHandler);
                                addEventListener(MouseEvent.CLICK, 
exclMouseClickHandler);
@@ -241,7 +251,7 @@
                }
 
                private function exclMouseClickHandler(event:MouseEvent):void {
-                       //exclusiveMic.visible = true;
+                       ExternalInterface.call("VideoManager.clickExclusive", 
cuid);
                }
 
                private function _resize(_width:int, _height:int):void {
@@ -281,8 +291,10 @@
                        }
                }
 
-               private function rightsUpdatedCallback(rights:Array):void {
-                       debug("rightsUpdatedCallback", rights);
+               private function setRightsCallback(_rights:Array):void {
+                       debug("setRightsCallback", _rights);
+                       rights = _rights;
+                       _updateExclusive();
                }
 
                private function refreshCallback(opts:Object):void {

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/0bf05e68/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
----------------------------------------------------------------------
diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
index b1dbc02..3735608 100644
--- 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
+++ 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
@@ -135,6 +135,7 @@ public class RoomPanel extends BasePanel {
                        Client _c = getClient();
                        JSONObject options = VideoSettings.getInitJson(cp, 
r.getId(), _c.getSid())
                                        .put("uid", _c.getUid())
+                                       .put("rights", 
_c.toJson(true).getJSONArray("rights"))
                                        .put("interview", isInterview)
                                        .put("showMicStatus", 
!r.getHiddenElements().contains(RoomElement.MicrophoneStatus))
                                        .put("exclusiveTitle", 
getString("1386"));

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/0bf05e68/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js
----------------------------------------------------------------------
diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js
index c47b2f9..4a47f33 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js
@@ -312,15 +312,16 @@ var Video = (function() {
                        o.cam = c.cam;
                        o.mic = c.mic;
                        o.mode = 'broadcast';
-                       o.av = c.activities.join();
                } else {
                        o.mode = 'play';
                }
+               o.av = c.activities.join();
                o.rights = o.rights.join();
                o.width = c.width;
                o.height = c.height;
                o.sid = c.sid;
                o.uid = c.uid;
+               o.cuid = c.cuid;
                o.userId = c.user.id;
                o.broadcastId = c.broadcastId;
                delete o.keycode;
@@ -342,8 +343,8 @@ var Video = (function() {
                        c.pod = _c.pod;
                        v.dialog('option', 'appendTo', '.pod.pod-' + c.pod);
                }
-               if (c.self && swf[0].update !== undefined) {
-                       swf[0].update();
+               if (swf[0].update !== undefined) {
+                       c.self ? swf[0].update() : swf[0].update(c);
                }
        }
        function _refresh(_opts) {

Reply via email to