瀏覽代碼

web,small-video: don't show screen content on thumbnails

This applies just to large view, not tile view.
j8
Saúl Ibarra Corretgé 4 年之前
父節點
當前提交
493ce8249e
共有 3 個檔案被更改,包括 20 行新增14 行删除
  1. 7
    1
      modules/UI/videolayout/RemoteVideo.js
  2. 7
    2
      modules/UI/videolayout/SmallVideo.js
  3. 6
    11
      modules/UI/videolayout/VideoLayout.js

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

@@ -373,6 +373,7 @@ export default class RemoteVideo extends SmallVideo {
373 373
 
374 374
         if (stream === this.videoStream) {
375 375
             this.videoStream = null;
376
+            this.videoType = undefined;
376 377
         }
377 378
 
378 379
         this.updateView();
@@ -481,7 +482,12 @@ export default class RemoteVideo extends SmallVideo {
481 482
 
482 483
         const isVideo = stream.isVideoTrack();
483 484
 
484
-        isVideo ? this.videoStream = stream : this.audioStream = stream;
485
+        if (isVideo) {
486
+            this.videoStream = stream;
487
+            this.videoType = stream.videoType;
488
+        } else {
489
+            this.audioStream = stream;
490
+        }
485 491
 
486 492
         if (!stream.getOriginalStream()) {
487 493
             logger.debug('Remote video stream has no original stream');

+ 7
- 2
modules/UI/videolayout/SmallVideo.js 查看文件

@@ -88,6 +88,7 @@ export default class SmallVideo {
88 88
         this.audioStream = null;
89 89
         this.VideoLayout = VideoLayout;
90 90
         this.videoIsHovered = false;
91
+        this.videoType = undefined;
91 92
 
92 93
         /**
93 94
          * The current state of the user's bridge connection. The value should be
@@ -243,6 +244,7 @@ export default class SmallVideo {
243 244
      */
244 245
     setScreenSharing(isScreenSharing) {
245 246
         this.isScreenSharing = isScreenSharing;
247
+        this.updateView();
246 248
         this.updateStatusBar();
247 249
     }
248 250
 
@@ -463,8 +465,10 @@ export default class SmallVideo {
463 465
      * or <tt>DISPLAY_BLACKNESS_WITH_NAME</tt>.
464 466
      */
465 467
     selectDisplayMode(input) {
466
-        // Display name is always and only displayed when user is on the stage
467
-        if (input.isCurrentlyOnLargeVideo && !input.tileViewActive) {
468
+        if (!input.tileViewActive && input.isScreenSharing) {
469
+            return input.isHovered ? DISPLAY_AVATAR_WITH_NAME : DISPLAY_AVATAR;
470
+        } else if (input.isCurrentlyOnLargeVideo && !input.tileViewActive) {
471
+            // Display name is always and only displayed when user is on the stage
468 472
             return input.isVideoPlayable && !input.isAudioOnly ? DISPLAY_BLACKNESS_WITH_NAME : DISPLAY_AVATAR_WITH_NAME;
469 473
         } else if (input.isVideoPlayable && input.hasVideo && !input.isAudioOnly) {
470 474
             // check hovering and change state to video with name
@@ -493,6 +497,7 @@ export default class SmallVideo {
493 497
             canPlayEventReceived: this._canPlayEventReceived,
494 498
             videoStream: Boolean(this.videoStream),
495 499
             isVideoMuted: this.isVideoMuted,
500
+            isScreenSharing: this.isScreenSharing,
496 501
             videoStreamMuted: this.videoStream ? this.videoStream.isMuted() : 'no stream'
497 502
         };
498 503
     }

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

@@ -177,10 +177,7 @@ const VideoLayout = {
177 177
             this.onAudioMute(id, stream.isMuted());
178 178
         } else {
179 179
             this.onVideoMute(id, stream.isMuted());
180
-
181
-            if (stream.videoType === 'desktop') {
182
-                remoteVideo.setScreenSharing(true);
183
-            }
180
+            remoteVideo.setScreenSharing(stream.videoType === 'desktop');
184 181
         }
185 182
     },
186 183
 
@@ -192,10 +189,7 @@ const VideoLayout = {
192 189
 
193 190
         if (remoteVideo) {
194 191
             remoteVideo.removeRemoteStreamElement(stream);
195
-
196
-            if (stream.videoType === 'desktop') {
197
-                remoteVideo.setScreenSharing(false);
198
-            }
192
+            remoteVideo.setScreenSharing(false);
199 193
         }
200 194
 
201 195
         this.updateMutedForNoTracks(id, stream.getType());
@@ -493,13 +487,14 @@ const VideoLayout = {
493 487
     },
494 488
 
495 489
     onVideoTypeChanged(id, newVideoType) {
496
-        if (VideoLayout.getRemoteVideoType(id) === newVideoType) {
490
+        const remoteVideo = remoteVideos[id];
491
+
492
+        if (!remoteVideo || remoteVideo.videoType === newVideoType) {
497 493
             return;
498 494
         }
499 495
 
500 496
         logger.info('Peer video type changed: ', id, newVideoType);
501
-
502
-        this._updateLargeVideoIfDisplayed(id, true);
497
+        remoteVideo.setScreenSharing(newVideoType === 'desktop');
503 498
     },
504 499
 
505 500
     /**

Loading…
取消
儲存