Browse Source

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 years ago
parent
commit
7d0cd00a50
4 changed files with 13 additions and 14 deletions
  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 View File

1114
         room.addCommandListener(
1114
         room.addCommandListener(
1115
             Commands.SHARED_VIDEO, ({value, attributes}, id) => {
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
                 if (attributes.state === 'stop') {
1117
                 if (attributes.state === 'stop') {
1128
                     APP.UI.stopSharedVideo(id, attributes);
1118
                     APP.UI.stopSharedVideo(id, attributes);
1129
                 } else if (attributes.state === 'start') {
1119
                 } else if (attributes.state === 'start') {

+ 1
- 0
lang/main.json View File

166
         "shareVideoLinkError": "Please provide a correct youtube link.",
166
         "shareVideoLinkError": "Please provide a correct youtube link.",
167
         "removeSharedVideoTitle": "Remove shared video",
167
         "removeSharedVideoTitle": "Remove shared video",
168
         "removeSharedVideoMsg": "Are you sure you would like to remove your shared video?",
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
         "WaitingForHost": "Waiting for the host ...",
170
         "WaitingForHost": "Waiting for the host ...",
170
         "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
         "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
         "IamHost": "I am the host",
172
         "IamHost": "I am the host",

+ 9
- 2
modules/UI/shared_video/SharedVideo.js View File

43
             return;
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 View File

289
     },
289
     },
290
 
290
 
291
     // Shows or hides the 'shared video' button.
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
             $('#toolbar_button_sharedvideo').css({display: "inline-block"});
295
             $('#toolbar_button_sharedvideo').css({display: "inline-block"});
295
         } else {
296
         } else {
296
             $('#toolbar_button_sharedvideo').css({display: "none"});
297
             $('#toolbar_button_sharedvideo').css({display: "none"});

Loading…
Cancel
Save