瀏覽代碼

ref(SmallVideo): add 'isCurrentlyOnLargeVideo'

j8
paweldomas 8 年之前
父節點
當前提交
fceb512a03
共有 3 個檔案被更改,包括 14 行新增3 行删除
  1. 1
    1
      modules/UI/videolayout/LocalVideo.js
  2. 1
    1
      modules/UI/videolayout/RemoteVideo.js
  3. 12
    1
      modules/UI/videolayout/SmallVideo.js

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

201
         localVideoContainer.removeChild(localVideo);
201
         localVideoContainer.removeChild(localVideo);
202
         // when removing only the video element and we are on stage
202
         // when removing only the video element and we are on stage
203
         // update the stage
203
         // update the stage
204
-        if(this.VideoLayout.isCurrentlyOnLarge(this.id))
204
+        if(this.isCurrentlyOnLargeVideo())
205
             this.VideoLayout.updateLargeVideo(this.id);
205
             this.VideoLayout.updateLargeVideo(this.id);
206
         stream.off(TrackEvents.LOCAL_TRACK_STOPPED, endedHandler);
206
         stream.off(TrackEvents.LOCAL_TRACK_STOPPED, endedHandler);
207
     };
207
     };

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

223
 
223
 
224
     // when removing only the video element and we are on stage
224
     // when removing only the video element and we are on stage
225
     // update the stage
225
     // update the stage
226
-    if (isVideo && this.VideoLayout.isCurrentlyOnLarge(this.id))
226
+    if (isVideo && this.isCurrentlyOnLargeVideo())
227
         this.VideoLayout.updateLargeVideo(this.id);
227
         this.VideoLayout.updateLargeVideo(this.id);
228
 };
228
 };
229
 
229
 

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

369
     return this.selectVideoElement().length !== 0;
369
     return this.selectVideoElement().length !== 0;
370
 };
370
 };
371
 
371
 
372
+/**
373
+ * Checks whether the user associated with this <tt>SmallVideo</tt> is currently
374
+ * being displayed on the "large video".
375
+ *
376
+ * @return {boolean} <tt>true</tt> if the user is displayed on the large video
377
+ * or <tt>false</tt> otherwise.
378
+ */
379
+SmallVideo.prototype.isCurrentlyOnLargeVideo = function () {
380
+    return this.VideoLayout.isCurrentlyOnLarge(this.id);
381
+};
382
+
372
 /**
383
 /**
373
  * Hides or shows the user's avatar.
384
  * Hides or shows the user's avatar.
374
  * This update assumes that large video had been updated and we will
385
  * This update assumes that large video had been updated and we will
392
 
403
 
393
     let avatar = this.$avatar;
404
     let avatar = this.$avatar;
394
 
405
 
395
-    var isCurrentlyOnLarge = this.VideoLayout.isCurrentlyOnLarge(this.id);
406
+    var isCurrentlyOnLarge = this.isCurrentlyOnLargeVideo();
396
 
407
 
397
     var showVideo = !this.isVideoMuted && !isCurrentlyOnLarge;
408
     var showVideo = !this.isVideoMuted && !isCurrentlyOnLarge;
398
     var showAvatar;
409
     var showAvatar;

Loading…
取消
儲存