瀏覽代碼

Hide recorder local thumbnail

j8
yanas 9 年之前
父節點
當前提交
ab67b42eb9

+ 3
- 0
css/videolayout_default.css 查看文件

519
     margin-left: auto;
519
     margin-left: auto;
520
     background: rgba(0,0,0,.3);
520
     background: rgba(0,0,0,.3);
521
     color: rgba(255,255,255,.5);
521
     color: rgba(255,255,255,.5);
522
+}
523
+
524
+.hidden {
522
 }
525
 }

+ 2
- 1
modules/UI/recording/Recording.js 查看文件

228
         // everyone.
228
         // everyone.
229
         if (config.iAmRecorder) {
229
         if (config.iAmRecorder) {
230
             VideoLayout.enableDeviceAvailabilityIcons(
230
             VideoLayout.enableDeviceAvailabilityIcons(
231
-                APP.conference.localId, true);
231
+                APP.conference.localId, false);
232
+            VideoLayout.setLocalVideoVisible(false);
232
             Feedback.enableFeedback(false);
233
             Feedback.enableFeedback(false);
233
             Toolbar.enable(false);
234
             Toolbar.enable(false);
234
             BottomToolbar.enable(false);
235
             BottomToolbar.enable(false);

+ 9
- 0
modules/UI/util/UIUtil.js 查看文件

199
                 () => {selector.css({opacity: 0});}
199
                 () => {selector.css({opacity: 0});}
200
             );
200
             );
201
         }
201
         }
202
+    },
203
+
204
+    /**
205
+     * Parses the given cssValue as an Integer. If the value is not a number
206
+     * we return 0 instead of NaN.
207
+     * @param cssValue the string value we obtain when querying css properties
208
+     */
209
+    parseCssInt(cssValue) {
210
+        return parseInt(cssValue) || 0;
202
     }
211
     }
203
 };
212
 };
204
 
213
 

+ 31
- 14
modules/UI/videolayout/FilmStrip.js 查看文件

85
          */
85
          */
86
         let videoAreaAvailableWidth
86
         let videoAreaAvailableWidth
87
             = UIUtil.getAvailableVideoWidth(isSideBarVisible)
87
             = UIUtil.getAvailableVideoWidth(isSideBarVisible)
88
-                - parseInt(this.filmStrip.css('right'), 10)
89
-                - parseInt(this.filmStrip.css('paddingLeft'), 10)
90
-                - parseInt(this.filmStrip.css('paddingRight'), 10)
91
-                - parseInt(this.filmStrip.css('borderLeftWidth'), 10)
92
-                - parseInt(this.filmStrip.css('borderRightWidth'), 10) - 5;
93
-
94
-        let availableWidth = Math.floor(
88
+                - UIUtil.parseCssInt(this.filmStrip.css('right'), 10)
89
+                - UIUtil.parseCssInt(this.filmStrip.css('paddingLeft'), 10)
90
+                - UIUtil.parseCssInt(this.filmStrip.css('paddingRight'), 10)
91
+                - UIUtil.parseCssInt(this.filmStrip.css('borderLeftWidth'), 10)
92
+                - UIUtil.parseCssInt(this.filmStrip.css('borderRightWidth'), 10)
93
+            - 5;
94
+
95
+        let availableWidth = videoAreaAvailableWidth;
96
+
97
+        // If the number of videos is 0 or undefined we don't need to calculate
98
+        // further.
99
+        if (numvids)
100
+            availableWidth = Math.floor(
95
                 (videoAreaAvailableWidth - numvids * (
101
                 (videoAreaAvailableWidth - numvids * (
96
-                parseInt(localVideoContainer.css('borderLeftWidth'), 10)
97
-                + parseInt(localVideoContainer.css('borderRightWidth'), 10)
98
-                + parseInt(localVideoContainer.css('paddingLeft'), 10)
99
-                + parseInt(localVideoContainer.css('paddingRight'), 10)
100
-                + parseInt(localVideoContainer.css('marginLeft'), 10)
101
-                + parseInt(localVideoContainer.css('marginRight'), 10)))
102
+                UIUtil.parseCssInt(
103
+                    localVideoContainer.css('borderLeftWidth'), 10)
104
+                + UIUtil.parseCssInt(
105
+                    localVideoContainer.css('borderRightWidth'), 10)
106
+                + UIUtil.parseCssInt(
107
+                    localVideoContainer.css('paddingLeft'), 10)
108
+                + UIUtil.parseCssInt(
109
+                    localVideoContainer.css('paddingRight'), 10)
110
+                + UIUtil.parseCssInt(
111
+                    localVideoContainer.css('marginLeft'), 10)
112
+                + UIUtil.parseCssInt(
113
+                    localVideoContainer.css('marginRight'), 10)))
102
                 / numvids);
114
                 / numvids);
103
 
115
 
104
         let maxHeight
116
         let maxHeight
155
             selector += ':visible';
167
             selector += ':visible';
156
         }
168
         }
157
 
169
 
158
-        return this.filmStrip.children(selector);
170
+        // Exclude the local video container if it has been hidden.
171
+        if ($("#localVideoContainer").hasClass("hidden"))
172
+            return this.filmStrip.children(selector)
173
+                    .not("#localVideoContainer");
174
+        else
175
+            return this.filmStrip.children(selector);
159
     }
176
     }
160
 };
177
 };
161
 
178
 

+ 23
- 1
modules/UI/videolayout/LocalVideo.js 查看文件

1
-/* global $, interfaceConfig, APP, JitsiMeetJS */
1
+/* global $, config, interfaceConfig, APP, JitsiMeetJS */
2
 import ConnectionIndicator from "./ConnectionIndicator";
2
 import ConnectionIndicator from "./ConnectionIndicator";
3
 import UIUtil from "../util/UIUtil";
3
 import UIUtil from "../util/UIUtil";
4
 import UIEvents from "../../../service/UI/UIEvents";
4
 import UIEvents from "../../../service/UI/UIEvents";
200
     stream.on(TrackEvents.LOCAL_TRACK_STOPPED, endedHandler);
200
     stream.on(TrackEvents.LOCAL_TRACK_STOPPED, endedHandler);
201
 };
201
 };
202
 
202
 
203
+/**
204
+ * Shows or hides the local video container.
205
+ * @param {boolean} true to make the local video container visible, false
206
+ * otherwise
207
+ */
208
+LocalVideo.prototype.setVisible = function(visible) {
209
+
210
+    // We toggle the hidden class as an indication to other interested parties
211
+    // that this container has been hidden on purpose.
212
+    $("#localVideoContainer").toggleClass("hidden");
213
+
214
+    // We still show/hide it as we need to overwrite the style property if we
215
+    // want our action to take effect. Toggling the display property through
216
+    // the above css class didn't succeed in overwriting the style.
217
+    if (visible) {
218
+        $("#localVideoContainer").show();
219
+    }
220
+    else {
221
+        $("#localVideoContainer").hide();
222
+    }
223
+};
224
+
203
 export default LocalVideo;
225
 export default LocalVideo;

+ 8
- 0
modules/UI/videolayout/VideoLayout.js 查看文件

215
             video.enableDeviceAvailabilityIcons(enable);
215
             video.enableDeviceAvailabilityIcons(enable);
216
     },
216
     },
217
 
217
 
218
+    /**
219
+     * Shows/hides local video.
220
+     * @param {boolean} true to make the local video visible, false - otherwise
221
+     */
222
+    setLocalVideoVisible(visible) {
223
+        localVideoThumbnail.setVisible(visible);
224
+    },
225
+
218
     /**
226
     /**
219
      * Checks if removed video is currently displayed and tries to display
227
      * Checks if removed video is currently displayed and tries to display
220
      * another one instead.
228
      * another one instead.

Loading…
取消
儲存