Просмотр исходного кода

Merge pull request #540 from damencho/fix-etherpad

Fix etherpad
j8
yanas 9 лет назад
Родитель
Сommit
eec8129026

+ 12
- 4
modules/UI/etherpad/Etherpad.js Просмотреть файл

@@ -52,7 +52,7 @@ const DEFAULT_WIDTH = 640;
52 52
  */
53 53
 const DEFAULT_HEIGHT = 480;
54 54
 
55
-const EtherpadContainerType = "etherpad";
55
+const ETHERPAD_CONTAINER_TYPE = "etherpad";
56 56
 
57 57
 /**
58 58
  * Container for Etherpad iframe.
@@ -133,6 +133,13 @@ class Etherpad extends LargeContainer {
133 133
             });
134 134
         });
135 135
     }
136
+
137
+    /**
138
+     * @return {boolean} do not switch on dominant speaker event if on stage.
139
+     */
140
+    stayOnStage () {
141
+        return true;
142
+    }
136 143
 }
137 144
 
138 145
 /**
@@ -159,7 +166,7 @@ export default class EtherpadManager {
159 166
     openEtherpad () {
160 167
         this.etherpad = new Etherpad(this.domain, this.name);
161 168
         VideoLayout.addLargeVideoContainer(
162
-            EtherpadContainerType,
169
+            ETHERPAD_CONTAINER_TYPE,
163 170
             this.etherpad
164 171
         );
165 172
     }
@@ -174,9 +181,10 @@ export default class EtherpadManager {
174 181
         }
175 182
 
176 183
         let isVisible = VideoLayout.isLargeContainerTypeVisible(
177
-            EtherpadContainerType
184
+            ETHERPAD_CONTAINER_TYPE
178 185
         );
179 186
 
180
-        VideoLayout.showLargeVideoContainer(EtherpadContainerType, !isVisible);
187
+        VideoLayout.showLargeVideoContainer(
188
+            ETHERPAD_CONTAINER_TYPE, !isVisible);
181 189
     }
182 190
 }

+ 7
- 0
modules/UI/videolayout/LargeContainer.js Просмотреть файл

@@ -54,4 +54,11 @@ export default class LargeContainer {
54 54
     showAvatar (show) {
55 55
     }
56 56
 
57
+    /**
58
+     * Whether current container needs to be switched on dominant speaker event
59
+     * when the container is on stage.
60
+     * @return {boolean}
61
+     */
62
+    stayOnStage () {
63
+    }
57 64
 }

+ 7
- 0
modules/UI/videolayout/LargeVideo.js Просмотреть файл

@@ -349,6 +349,13 @@ class VideoContainer extends LargeContainer {
349 349
             });
350 350
         });
351 351
     }
352
+
353
+    /**
354
+     * @return {boolean} switch on dominant speaker event if on stage.
355
+     */
356
+    stayOnStage () {
357
+        return false;
358
+    }
352 359
 }
353 360
 
354 361
 /**

+ 11
- 1
modules/UI/videolayout/VideoLayout.js Просмотреть файл

@@ -524,7 +524,9 @@ var VideoLayout = {
524 524
         // since we don't want to switch to local video.
525 525
         // Update the large video if the video source is already available,
526 526
         // otherwise wait for the "videoactive.jingle" event.
527
-        if (!focusedVideoResourceJid && remoteVideo.hasVideoStarted()) {
527
+        if (!focusedVideoResourceJid
528
+            && remoteVideo.hasVideoStarted()
529
+            && !this.getCurrentlyOnLargeContainer().stayOnStage()) {
528 530
             this.updateLargeVideo(id);
529 531
         }
530 532
     },
@@ -889,6 +891,14 @@ var VideoLayout = {
889 891
         return this.isLargeContainerTypeVisible(VideoContainerType);
890 892
     },
891 893
 
894
+    /**
895
+     * @return {LargeContainer} the currently displayed container on large
896
+     * video.
897
+     */
898
+    getCurrentlyOnLargeContainer () {
899
+        return largeVideo.getContainer(largeVideo.state);
900
+    },
901
+
892 902
     isCurrentlyOnLarge (id) {
893 903
         return largeVideo && largeVideo.id === id;
894 904
     },

Загрузка…
Отмена
Сохранить