This is an automated email from the ASF dual-hosted git repository.

solomax pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openmeetings.git


The following commit(s) were added to refs/heads/master by this push:
     new 967b435  [OPENMEETINGS-2107] 'auto.open.sharing' config is added, 
screen-sharing is now can be auto-opened
967b435 is described below

commit 967b4354fd83f63f9bd23974687014566c7a3921
Author: Maxim Solodovnik <[email protected]>
AuthorDate: Tue Sep 10 15:53:49 2019 +0700

    [OPENMEETINGS-2107] 'auto.open.sharing' config is added, screen-sharing is 
now can be auto-opened
---
 .../openmeetings/db/dao/basic/ConfigurationDao.java   |  3 +++
 .../openmeetings/installation/ImportInitvalues.java   |  2 ++
 .../openmeetings/util/OpenmeetingsVariables.java      |  1 +
 .../apache/openmeetings/web/room/raw-video-manager.js | 19 +++++++++++++------
 4 files changed, 19 insertions(+), 6 deletions(-)

diff --git 
a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/basic/ConfigurationDao.java
 
b/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/basic/ConfigurationDao.java
index f3636df..24bffe9 100644
--- 
a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/basic/ConfigurationDao.java
+++ 
b/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/basic/ConfigurationDao.java
@@ -22,6 +22,7 @@ import static org.apache.commons.lang3.math.NumberUtils.toInt;
 import static org.apache.openmeetings.db.util.DaoHelper.setLimits;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_APPLICATION_BASE_URL;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_APPLICATION_NAME;
+import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_AUTO_OPEN_SHARING;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CAM_FPS;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CHAT_SEND_ON_ENTER;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CRYPT;
@@ -306,6 +307,7 @@ public class ConfigurationDao implements 
IDataProviderDao<Configuration> {
                        case CONFIG_KEYCODE_MUTE_OTHERS:
                        case CONFIG_KEYCODE_MUTE:
                        case CONFIG_KEYCODE_QUICKPOLL:
+                       case CONFIG_AUTO_OPEN_SHARING:
                                reloadRoomSettings();
                                break;
                        case CONFIG_MAX_UPLOAD_SIZE:
@@ -583,6 +585,7 @@ public class ConfigurationDao implements 
IDataProviderDao<Configuration> {
                                                        .put("echo", 
getBool(CONFIG_MIC_ECHO, true))
                                                        .put("noise", 
getBool(CONFIG_MIC_NOISE, true))
                                                )
+                                       .put("autoOpenSharing", 
getBool(CONFIG_AUTO_OPEN_SHARING, false))
                                );
                } catch (Exception e) {
                        log.error("Unexpected exception while reloading room 
settings: ", e);
diff --git 
a/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
 
b/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
index 8852aae..abd3fb8 100644
--- 
a/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
+++ 
b/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
@@ -26,6 +26,7 @@ import static 
org.apache.openmeetings.db.dto.user.OAuthUser.PARAM_LOGIN;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_APPLICATION_BASE_URL;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_APPLICATION_NAME;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_APPOINTMENT_REMINDER_MINUTES;
+import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_AUTO_OPEN_SHARING;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CALENDAR_ROOM_CAPACITY;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CAM_FPS;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CHAT_SEND_ON_ENTER;
@@ -354,6 +355,7 @@ public class ImportInitvalues {
                addCfg(list, CONFIG_DISPLAY_NAME_EDITABLE, 
String.valueOf(false), Configuration.Type.BOOL, "Is user will be able to edit 
his/her display name (default false).", "4.0.7");
                addCfg(list, CONFIG_KEYCODE_QUICKPOLL, "Ctrl+Alt+KeyQ", 
Configuration.Type.HOTKEY
                                , "A hot key code to start quick poll", 
"4.0.10");
+               addCfg(list, CONFIG_AUTO_OPEN_SHARING, String.valueOf(false), 
Configuration.Type.BOOL, "Whether shared screen should be auto-opened.", 
VER_5_0_0);
                return list;
        }
        public void loadConfiguration(InstallationConfig cfg) {
diff --git 
a/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
 
b/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
index 575e469..6c47ad5 100644
--- 
a/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
+++ 
b/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
@@ -96,6 +96,7 @@ public class OpenmeetingsVariables {
        public static final String CONFIG_CHAT_SEND_ON_ENTER = 
"chat.send.on.enter";
        public static final String CONFIG_DISPLAY_NAME_EDITABLE = 
"display.name.editable";
        public static final String CONFIG_KEYCODE_QUICKPOLL = 
"start.quickpoll.keycode";
+       public static final String CONFIG_AUTO_OPEN_SHARING = 
"auto.open.sharing";
 
        public static final String HEADER_XFRAME_SELF = "'self'";
        public static final String HEADER_CSP_SELF = "default-src 'self'; 
style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 
'unsafe-eval'; img-src 'self' data:; media-src 'self' blob:;";
diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-video-manager.js
 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-video-manager.js
index fad9045..bb9cab8 100644
--- 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-video-manager.js
+++ 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-video-manager.js
@@ -171,6 +171,15 @@ var VideoManager = (function() {
                v.remove();
                WbArea.updateAreaClass();
        }
+       function _playSharing(sd, iceServers) {
+               const m = {stream: sd, iceServers: iceServers};
+               let v = $('#' + VideoUtil.getVid(sd.uid))
+               if (v.length === 1) {
+                       v.remove();
+               }
+               v = Video().init(m);
+               VideoUtil.setPos(v, {left: 0, top: 35});
+       }
        function _play(streams, iceServers) {
                if (!inited) {
                        return;
@@ -184,13 +193,11 @@ var VideoManager = (function() {
                                                .data('cuid', sd.cuid)
                                                .show(), 10);
                                share.tooltip().off('click').click(function() {
-                                       let v = $('#' + 
VideoUtil.getVid(sd.uid))
-                                       if (v.length === 1) {
-                                               v.remove();
-                                       }
-                                       v = Video().init(m);
-                                       VideoUtil.setPos(v, {left: 0, top: 35});
+                                       _playSharing(sd, iceServers);
                                });
+                               if (Room.getOptions().autoOpenSharing === true) 
{
+                                       _playSharing(sd, iceServers);
+                               }
                        } else {
                                _onReceive(m);
                        }

Reply via email to