From 6865b03338cb4eae24030f787f316b7696d55986 Mon Sep 17 00:00:00 2001 From: paweldomas Date: Tue, 30 May 2017 15:05:07 -0500 Subject: [PATCH] fix(RemoteVideo): broken grey avatar Also moves the logic about participant connection status from SmallVideo to RemoteVideo, because it doesn't make sense for local videos. --- modules/UI/videolayout/RemoteVideo.js | 13 ++++++++++++- modules/UI/videolayout/SmallVideo.js | 9 +-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/modules/UI/videolayout/RemoteVideo.js b/modules/UI/videolayout/RemoteVideo.js index a8beb3835..945ca0dfa 100644 --- a/modules/UI/videolayout/RemoteVideo.js +++ b/modules/UI/videolayout/RemoteVideo.js @@ -544,13 +544,24 @@ RemoteVideo.prototype.isConnectionActive = function() { /** * The remote video is considered "playable" once the stream has started * according to the {@link #hasVideoStarted} result. + * It will be allowed to display video also in + * {@link ParticipantConnectionStatus.INTERRUPTED} if the video was ever played + * and was not muted while not in ACTIVE state. This basically means that there + * is stalled video image cached that could be displayed. It's used to show + * "grey video image" in user's thumbnail when there are connectivity issues. * * @inheritdoc * @override */ RemoteVideo.prototype.isVideoPlayable = function () { + const connectionState + = APP.conference.getParticipantConnectionStatus(this.id); + return SmallVideo.prototype.isVideoPlayable.call(this) - && this.hasVideoStarted() && !this.mutedWhileDisconnected; + && this.hasVideoStarted() + && (connectionState === ParticipantConnectionStatus.ACTIVE + || (connectionState === ParticipantConnectionStatus.INTERRUPTED + && !this.mutedWhileDisconnected)); }; /** diff --git a/modules/UI/videolayout/SmallVideo.js b/modules/UI/videolayout/SmallVideo.js index 54a4da53e..acd5a1d37 100644 --- a/modules/UI/videolayout/SmallVideo.js +++ b/modules/UI/videolayout/SmallVideo.js @@ -6,8 +6,6 @@ import UIUtil from "../util/UIUtil"; import UIEvents from "../../../service/UI/UIEvents"; import AudioLevels from "../audio_levels/AudioLevels"; -const ParticipantConnectionStatus - = JitsiMeetJS.constants.participantConnectionStatus; const RTCUIHelper = JitsiMeetJS.util.RTCUIHelper; /** @@ -446,13 +444,8 @@ SmallVideo.prototype.isCurrentlyOnLargeVideo = function () { * or false otherwise. */ SmallVideo.prototype.isVideoPlayable = function() { - const connectionState - = APP.conference.getParticipantConnectionStatus(this.id); - return this.videoStream // Is there anything to display ? - && !this.isVideoMuted && !this.videoStream.isMuted() // Muted ? - && (this.isLocal - || connectionState === ParticipantConnectionStatus.ACTIVE); + && !this.isVideoMuted && !this.videoStream.isMuted(); // Muted ? }; /**