Skip to content

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

fix(hangup): destroy local tracks on conference leave (#2502)

virtuacoplenny88325aeef26b
diff --git a/modules/UI/UI.js b/modules/UI/UI.js
index 4dd50e0598..bef9937521 100644
--- a/modules/UI/UI.js
+++ b/modules/UI/UI.js
@@ -377,11 +377,12 @@ UI.start = function() {
};
/**
- * Invokes cleanup of any deferred execution within relevant UI modules.
+ * Invokes cleanup of large video so it stops running polling tasks and stops
+ * displaying.
*
* @returns {void}
*/
-UI.stopDaemons = () => {
+UI.resetLargeVideo = () => {
VideoLayout.resetLargeVideo();
};
diff --git a/modules/UI/videolayout/LargeVideoManager.js b/modules/UI/videolayout/LargeVideoManager.js
index 9ddafa45ad..930e0ff0ac 100644
--- a/modules/UI/videolayout/LargeVideoManager.js
+++ b/modules/UI/videolayout/LargeVideoManager.js
@@ -129,6 +129,8 @@ export default class LargeVideoManager {
this._onVideoResolutionUpdate);
this.removePresenceLabel();
+
+ this.$container.remove();
}
/**
diff --git a/react/features/base/conference/middleware.js b/react/features/base/conference/middleware.js
index e4fa976629..405db843d6 100644
--- a/react/features/base/conference/middleware.js
+++ b/react/features/base/conference/middleware.js
@@ -17,7 +17,7 @@ import {
} from '../participants';
import { MiddlewareRegistry } from '../redux';
import UIEvents from '../../../../service/UI/UIEvents';
-import { TRACK_ADDED, TRACK_REMOVED } from '../tracks';
+import { TRACK_ADDED, TRACK_REMOVED, destroyLocalTracks } from '../tracks';
import {
createConference,
@@ -144,6 +144,11 @@ function _conferenceFailedOrLeft({ dispatch, getState }, next, action) {
dispatch(setAudioOnly(true));
}
+ if (typeof APP === 'object') {
+ dispatch(destroyLocalTracks());
+ APP.UI.resetLargeVideo();
+ }
+
return result;
}
diff --git a/react/features/conference/components/Conference.web.js b/react/features/conference/components/Conference.web.js
index 0ecbbcc5e8..6a117d35b7 100644
--- a/react/features/conference/components/Conference.web.js
+++ b/react/features/conference/components/Conference.web.js
@@ -87,7 +87,6 @@ class Conference extends Component<Props> {
* @inheritdoc
*/
componentWillUnmount() {
- APP.UI.stopDaemons();
APP.UI.unregisterListeners();
APP.UI.unbindEvents();