From b655c8d54a91abcdeb928ecdd2ef8b890d7bf343 Mon Sep 17 00:00:00 2001 From: Leonard Kim Date: Tue, 28 May 2019 13:30:27 -0700 Subject: [PATCH] fix(large-video): clear remote video stream on track removal VideoLayout schedules a large video update by passing in the video stream on the small video instance. When a stream is removed, the UI is removed from the small video instance but a reference to the stream is left. So when VideoLayout schedules the large video update after a stream removal, the old stream from the small video instance is re-used, even though it has been removed. This change also brings balance with RemoteVideo method "addRemoteStreamElement" which sets the stream on the small video instance, so now "removeRemoteStreamElement unsets it. --- modules/UI/videolayout/RemoteVideo.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/UI/videolayout/RemoteVideo.js b/modules/UI/videolayout/RemoteVideo.js index f6f2d4e27..d7a382985 100644 --- a/modules/UI/videolayout/RemoteVideo.js +++ b/modules/UI/videolayout/RemoteVideo.js @@ -357,6 +357,11 @@ RemoteVideo.prototype.removeRemoteStreamElement = function(stream) { logger.info(`${isVideo ? 'Video' : 'Audio' } removed ${this.id}`, select); + + if (stream === this.videoStream) { + this.videoStream = null; + } + this.updateView(); };