Ver código fonte

ref(SmallVideo): add 'isCurrentlyOnLargeVideo'

j8
paweldomas 8 anos atrás
pai
commit
fceb512a03

+ 1
- 1
modules/UI/videolayout/LocalVideo.js Ver arquivo

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

+ 1
- 1
modules/UI/videolayout/RemoteVideo.js Ver arquivo

@@ -223,7 +223,7 @@ RemoteVideo.prototype.removeRemoteStreamElement = function (stream) {
223 223
 
224 224
     // when removing only the video element and we are on stage
225 225
     // update the stage
226
-    if (isVideo && this.VideoLayout.isCurrentlyOnLarge(this.id))
226
+    if (isVideo && this.isCurrentlyOnLargeVideo())
227 227
         this.VideoLayout.updateLargeVideo(this.id);
228 228
 };
229 229
 

+ 12
- 1
modules/UI/videolayout/SmallVideo.js Ver arquivo

@@ -369,6 +369,17 @@ SmallVideo.prototype.hasVideo = function () {
369 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 384
  * Hides or shows the user's avatar.
374 385
  * This update assumes that large video had been updated and we will
@@ -392,7 +403,7 @@ SmallVideo.prototype.updateView = function () {
392 403
 
393 404
     let avatar = this.$avatar;
394 405
 
395
-    var isCurrentlyOnLarge = this.VideoLayout.isCurrentlyOnLarge(this.id);
406
+    var isCurrentlyOnLarge = this.isCurrentlyOnLargeVideo();
396 407
 
397 408
     var showVideo = !this.isVideoMuted && !isCurrentlyOnLarge;
398 409
     var showAvatar;

Carregando…
Cancelar
Salvar