Преглед на файлове

Enables shared video for all participants, the first to share is the video all will see, later attempts will result just a dialog informing that video is already shared.

master
damencho преди 9 години
родител
ревизия
7d0cd00a50
променени са 4 файла, в които са добавени 13 реда и са изтрити 14 реда
  1. 0
    10
      conference.js
  2. 1
    0
      lang/main.json
  3. 9
    2
      modules/UI/shared_video/SharedVideo.js
  4. 3
    2
      modules/UI/toolbars/Toolbar.js

+ 0
- 10
conference.js Целия файл

@@ -1114,16 +1114,6 @@ export default {
1114 1114
         room.addCommandListener(
1115 1115
             Commands.SHARED_VIDEO, ({value, attributes}, id) => {
1116 1116
 
1117
-                // if we are not the moderator or
1118
-                // the command is coming from a user which is not the moderator
1119
-                if (!(this.isLocalId(id) && room.isModerator())
1120
-                    && !this.isParticipantModerator(id))
1121
-                {
1122
-                    console.warn('Received shared video command ' +
1123
-                        'not from moderator');
1124
-                    return;
1125
-                }
1126
-
1127 1117
                 if (attributes.state === 'stop') {
1128 1118
                     APP.UI.stopSharedVideo(id, attributes);
1129 1119
                 } else if (attributes.state === 'start') {

+ 1
- 0
lang/main.json Целия файл

@@ -166,6 +166,7 @@
166 166
         "shareVideoLinkError": "Please provide a correct youtube link.",
167 167
         "removeSharedVideoTitle": "Remove shared video",
168 168
         "removeSharedVideoMsg": "Are you sure you would like to remove your shared video?",
169
+        "alreadySharedVideoMsg": "Another participant is already sharing video. This conference allows only one shared video at a time.",
169 170
         "WaitingForHost": "Waiting for the host ...",
170 171
         "WaitForHostMsg": "The conference <b>__room__ </b> has not yet started. If you are the host then please authenticate. Otherwise, please wait for the host to arrive.",
171 172
         "IamHost": "I am the host",

+ 9
- 2
modules/UI/shared_video/SharedVideo.js Целия файл

@@ -43,8 +43,15 @@ export default class SharedVideoManager {
43 43
             return;
44 44
         }
45 45
 
46
-        showStopVideoPropmpt().then(() =>
47
-            this.emitter.emit(UIEvents.UPDATE_SHARED_VIDEO, null, 'stop'));
46
+        if(APP.conference.isLocalId(this.from)) {
47
+            showStopVideoPropmpt().then(() =>
48
+                this.emitter.emit(UIEvents.UPDATE_SHARED_VIDEO, null, 'stop'));
49
+        } else {
50
+            messageHandler.openMessageDialog(
51
+                "dialog.shareVideoTitle",
52
+                "dialog.alreadySharedVideoMsg"
53
+            );
54
+        }
48 55
     }
49 56
 
50 57
     /**

+ 3
- 2
modules/UI/toolbars/Toolbar.js Целия файл

@@ -289,8 +289,9 @@ const Toolbar = {
289 289
     },
290 290
 
291 291
     // Shows or hides the 'shared video' button.
292
-    showSharedVideoButton (show) {
293
-        if (UIUtil.isButtonEnabled('sharedvideo') && show) {
292
+    showSharedVideoButton () {
293
+        if (UIUtil.isButtonEnabled('sharedvideo')
294
+                && config.disableThirdPartyRequests !== true) {
294 295
             $('#toolbar_button_sharedvideo').css({display: "inline-block"});
295 296
         } else {
296 297
             $('#toolbar_button_sharedvideo').css({display: "none"});

Loading…
Отказ
Запис