瀏覽代碼

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
 
373
 
374
         if (stream === this.videoStream) {
374
         if (stream === this.videoStream) {
375
             this.videoStream = null;
375
             this.videoStream = null;
376
+            this.videoType = undefined;
376
         }
377
         }
377
 
378
 
378
         this.updateView();
379
         this.updateView();
481
 
482
 
482
         const isVideo = stream.isVideoTrack();
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
         if (!stream.getOriginalStream()) {
492
         if (!stream.getOriginalStream()) {
487
             logger.debug('Remote video stream has no original stream');
493
             logger.debug('Remote video stream has no original stream');

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

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

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

177
             this.onAudioMute(id, stream.isMuted());
177
             this.onAudioMute(id, stream.isMuted());
178
         } else {
178
         } else {
179
             this.onVideoMute(id, stream.isMuted());
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
 
189
 
193
         if (remoteVideo) {
190
         if (remoteVideo) {
194
             remoteVideo.removeRemoteStreamElement(stream);
191
             remoteVideo.removeRemoteStreamElement(stream);
195
-
196
-            if (stream.videoType === 'desktop') {
197
-                remoteVideo.setScreenSharing(false);
198
-            }
192
+            remoteVideo.setScreenSharing(false);
199
         }
193
         }
200
 
194
 
201
         this.updateMutedForNoTracks(id, stream.getType());
195
         this.updateMutedForNoTracks(id, stream.getType());
493
     },
487
     },
494
 
488
 
495
     onVideoTypeChanged(id, newVideoType) {
489
     onVideoTypeChanged(id, newVideoType) {
496
-        if (VideoLayout.getRemoteVideoType(id) === newVideoType) {
490
+        const remoteVideo = remoteVideos[id];
491
+
492
+        if (!remoteVideo || remoteVideo.videoType === newVideoType) {
497
             return;
493
             return;
498
         }
494
         }
499
 
495
 
500
         logger.info('Peer video type changed: ', id, newVideoType);
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…
取消
儲存