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

Destroy local tracks and also destroy large video so the
user does not wonder why camera (and mic) are still enabled
even though hangup has been pressed.
pull/2457/head jitsi-meet_2819
virtuacoplenny 7 years ago committed by bbaldino
parent 9f69c4d730
commit 88325aeef2
  1. 5
      modules/UI/UI.js
  2. 2
      modules/UI/videolayout/LargeVideoManager.js
  3. 7
      react/features/base/conference/middleware.js
  4. 1
      react/features/conference/components/Conference.web.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} * @returns {void}
*/ */
UI.stopDaemons = () => { UI.resetLargeVideo = () => {
VideoLayout.resetLargeVideo(); VideoLayout.resetLargeVideo();
}; };

@ -129,6 +129,8 @@ export default class LargeVideoManager {
this._onVideoResolutionUpdate); this._onVideoResolutionUpdate);
this.removePresenceLabel(); this.removePresenceLabel();
this.$container.remove();
} }
/** /**

@ -17,7 +17,7 @@ import {
} from '../participants'; } from '../participants';
import { MiddlewareRegistry } from '../redux'; import { MiddlewareRegistry } from '../redux';
import UIEvents from '../../../../service/UI/UIEvents'; import UIEvents from '../../../../service/UI/UIEvents';
import { TRACK_ADDED, TRACK_REMOVED } from '../tracks'; import { TRACK_ADDED, TRACK_REMOVED, destroyLocalTracks } from '../tracks';
import { import {
createConference, createConference,
@ -144,6 +144,11 @@ function _conferenceFailedOrLeft({ dispatch, getState }, next, action) {
dispatch(setAudioOnly(true)); dispatch(setAudioOnly(true));
} }
if (typeof APP === 'object') {
dispatch(destroyLocalTracks());
APP.UI.resetLargeVideo();
}
return result; return result;
} }

@ -87,7 +87,6 @@ class Conference extends Component<Props> {
* @inheritdoc * @inheritdoc
*/ */
componentWillUnmount() { componentWillUnmount() {
APP.UI.stopDaemons();
APP.UI.unregisterListeners(); APP.UI.unregisterListeners();
APP.UI.unbindEvents(); APP.UI.unbindEvents();

Loading…
Cancel
Save