Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

LargeVideo: detach previous stream when attaching new one

isymchych6476503240dc
diff --git a/modules/UI/videolayout/LargeVideo.js b/modules/UI/videolayout/LargeVideo.js
index 57e603e4f5..40148449cc 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]);