ref(SmallVideo): add 'isCurrentlyOnLargeVideo'

pull/938/head
paweldomas 8 years ago
parent 4722054c3e
commit fceb512a03
  1. 2
      modules/UI/videolayout/LocalVideo.js
  2. 2
      modules/UI/videolayout/RemoteVideo.js
  3. 13
      modules/UI/videolayout/SmallVideo.js

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

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

@ -369,6 +369,17 @@ SmallVideo.prototype.hasVideo = function () {
return this.selectVideoElement().length !== 0;
};
/**
* Checks whether the user associated with this <tt>SmallVideo</tt> is currently
* being displayed on the "large video".
*
* @return {boolean} <tt>true</tt> if the user is displayed on the large video
* or <tt>false</tt> otherwise.
*/
SmallVideo.prototype.isCurrentlyOnLargeVideo = function () {
return this.VideoLayout.isCurrentlyOnLarge(this.id);
};
/**
* Hides or shows the user's avatar.
* This update assumes that large video had been updated and we will
@ -392,7 +403,7 @@ SmallVideo.prototype.updateView = function () {
let avatar = this.$avatar;
var isCurrentlyOnLarge = this.VideoLayout.isCurrentlyOnLarge(this.id);
var isCurrentlyOnLarge = this.isCurrentlyOnLargeVideo();
var showVideo = !this.isVideoMuted && !isCurrentlyOnLarge;
var showAvatar;

Loading…
Cancel
Save