瀏覽代碼

fix(SmallVideo) screen-sharing indicator

The stream is attached before the video type change event is fired, so comparing
them is too late. Unconditionally update the screen-sharing indicator, and
perform the check for a change right there, to avoid re-renders.
master
Saúl Ibarra Corretgé 4 年之前
父節點
當前提交
119b79fd84

+ 0
- 2
modules/UI/videolayout/RemoteVideo.js 查看文件

@@ -373,7 +373,6 @@ export default class RemoteVideo extends SmallVideo {
373 373
 
374 374
         if (stream === this.videoStream) {
375 375
             this.videoStream = null;
376
-            this.videoType = undefined;
377 376
         }
378 377
 
379 378
         this.updateView();
@@ -484,7 +483,6 @@ export default class RemoteVideo extends SmallVideo {
484 483
 
485 484
         if (isVideo) {
486 485
             this.videoStream = stream;
487
-            this.videoType = stream.videoType;
488 486
         } else {
489 487
             this.audioStream = stream;
490 488
         }

+ 4
- 0
modules/UI/videolayout/SmallVideo.js 查看文件

@@ -243,6 +243,10 @@ export default class SmallVideo {
243 243
      * or hidden
244 244
      */
245 245
     setScreenSharing(isScreenSharing) {
246
+        if (isScreenSharing === this.isScreenSharing) {
247
+            return;
248
+        }
249
+
246 250
         this.isScreenSharing = isScreenSharing;
247 251
         this.updateView();
248 252
         this.updateStatusBar();

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

@@ -489,7 +489,7 @@ const VideoLayout = {
489 489
     onVideoTypeChanged(id, newVideoType) {
490 490
         const remoteVideo = remoteVideos[id];
491 491
 
492
-        if (!remoteVideo || remoteVideo.videoType === newVideoType) {
492
+        if (!remoteVideo) {
493 493
             return;
494 494
         }
495 495
 

Loading…
取消
儲存