From 6476503240dc4749ddb9d3c70b074ea340c796f4 Mon Sep 17 00:00:00 2001 From: isymchych Date: Thu, 18 Feb 2016 15:38:57 +0200 Subject: [PATCH] LargeVideo: detach previous stream when attaching new one --- modules/UI/videolayout/LargeVideo.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/UI/videolayout/LargeVideo.js b/modules/UI/videolayout/LargeVideo.js index 57e603e4f..40148449c 100644 --- a/modules/UI/videolayout/LargeVideo.js +++ b/modules/UI/videolayout/LargeVideo.js @@ -270,11 +270,17 @@ class VideoContainer extends LargeContainer { * @param {string} videoType video type */ setStream (stream, videoType) { + // detach old stream + if (this.stream) { + this.stream.detach(this.$video[0]); + } + this.stream = stream; this.videoType = videoType; - if(!stream) + if (!stream) { return; + } stream.attach(this.$video[0]);