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 43dfff7  [OPENMEETINGS-2000] sharer should be fixed
43dfff7 is described below

commit 43dfff706b099b8e970ed4808742294e01408236
Author: Maxim Solodovnik <[email protected]>
AuthorDate: Mon Dec 28 13:46:11 2020 +0700

    [OPENMEETINGS-2000] sharer should be fixed
---
 openmeetings-web/src/main/front/room/src/sharer.js       | 16 ++++++++++------
 .../src/main/front/room/src/video-manager.js             |  4 ++--
 openmeetings-web/src/main/front/room/src/video.js        | 10 +++++-----
 3 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/openmeetings-web/src/main/front/room/src/sharer.js 
b/openmeetings-web/src/main/front/room/src/sharer.js
index 755d821..03517b1 100644
--- a/openmeetings-web/src/main/front/room/src/sharer.js
+++ b/openmeetings-web/src/main/front/room/src/sharer.js
@@ -1,9 +1,9 @@
 /* Licensed under the Apache License, Version 2.0 (the "License") 
http://www.apache.org/licenses/LICENSE-2.0 */
 const VideoMgrUtil = require('./video-manager-util');
 
-var SHARE_STARTING = 'starting';
-var SHARE_STARTED = 'started';
-var SHARE_STOPPED = 'stopped';
+const SHARE_STARTING = 'starting'
+       , SHARE_STARTED = 'started'
+       , SHARE_STOPPED = 'stopped';
 
 let sharer, type, fps, sbtn, rbtn
        , shareState = SHARE_STOPPED, recState = SHARE_STOPPED;
@@ -34,7 +34,7 @@ function _init() {
                sharer.find('.alert').show();
        } else {
                type = sharer.find('select.type');
-               const b = kurentoUtils.WebRtcPeer.browser;
+               const b = VideoUtil.browser;
                fps = sharer.find('select.fps');
                _disable(fps, VideoUtil.isEdge(b));
                sbtn = sharer.find('.share-start-stop').off().click(function() {
@@ -83,7 +83,7 @@ function _disable(e, state) {
        }
 }
 function _typeDisabled(_b) {
-       const b = _b || kurentoUtils.WebRtcPeer.browser;
+       const b = _b || VideoUtil.browser;
        return VideoUtil.isEdge(b) || VideoUtil.isChrome(b) || 
VideoUtil.isEdgeChromium(b);
 }
 function _setBtnState(btn, state) {
@@ -114,7 +114,11 @@ function _getShareUid() {
 }
 
 module.exports = {
-       init: _init
+       SHARE_STARTING: SHARE_STARTING
+       , SHARE_STARTED: SHARE_STARTED
+       , SHARE_STOPPED: SHARE_STOPPED
+
+       , init: _init
        , open: function() {
                if (sharer && sharer.dialog('instance')) {
                        sharer.dialog('open');
diff --git a/openmeetings-web/src/main/front/room/src/video-manager.js 
b/openmeetings-web/src/main/front/room/src/video-manager.js
index 0a0bfda..0195749 100644
--- a/openmeetings-web/src/main/front/room/src/video-manager.js
+++ b/openmeetings-web/src/main/front/room/src/video-manager.js
@@ -32,8 +32,8 @@ function _onShareUpdated(msg) {
                // Update activities in the current data object
                v.stream().activities = sd.activities;
        }
-       Sharer.setShareState(VideoUtil.isSharing(sd) ? SHARE_STARTED : 
SHARE_STOPPED);
-       Sharer.setRecState(VideoUtil.isRecording(sd) ? SHARE_STARTED : 
SHARE_STOPPED);
+       Sharer.setShareState(VideoUtil.isSharing(sd) ? Sharer.SHARE_STARTED : 
Sharer.SHARE_STOPPED);
+       Sharer.setRecState(VideoUtil.isRecording(sd) ? Sharer.SHARE_STARTED : 
Sharer.SHARE_STOPPED);
 }
 function _onReceive(msg) {
        const uid = msg.stream.uid;
diff --git a/openmeetings-web/src/main/front/room/src/video.js 
b/openmeetings-web/src/main/front/room/src/video.js
index 2bb752f..3411cca 100644
--- a/openmeetings-web/src/main/front/room/src/video.js
+++ b/openmeetings-web/src/main/front/room/src/video.js
@@ -31,11 +31,11 @@ module.exports = class Video {
                function _getScreenStream(msg, state, callback) {
                        function __handleScreenError(err) {
                                VideoMgrUtil.sendMessage({id: 'errorSharing'});
-                               Sharer.setShareState(SHARE_STOPPED);
-                               Sharer.setRecState(SHARE_STOPPED);
+                               Sharer.setShareState(Sharer.SHARE_STOPPED);
+                               Sharer.setRecState(Sharer.SHARE_STOPPED);
                                OmUtil.error(err);
                        }
-                       const b = kurentoUtils.WebRtcPeer.browser;
+                       const b = VideoUtil.browser;
                        let promise, cnts;
                        if (VideoUtil.isEdge(b) && b.major > 16) {
                                cnts = {
@@ -199,10 +199,10 @@ module.exports = class Video {
                                                }
                                                VideoMgrUtil.sendMessage(bmsg);
                                                if (isSharing) {
-                                                       
Sharer.setShareState(SHARE_STARTED);
+                                                       
Sharer.setShareState(Sharer.SHARE_STARTED);
                                                }
                                                if (isRecording) {
-                                                       
Sharer.setRecState(SHARE_STARTED);
+                                                       
Sharer.setRecState(Sharer.SHARE_STARTED);
                                                }
                                        });
                                });

Reply via email to