fix(hangup): destroy local tracks on conference leave (#2546)
The difference from this change and 88325ae
is there is no
attempt to do this in redux. This is the safer change in that
the cleanup logic is known only to trigger on hangup.
This commit is contained in:
parent
ce6e8472f0
commit
5a45b52881
|
@ -2645,6 +2645,7 @@ export default {
|
|||
*/
|
||||
hangup(requestFeedback = false) {
|
||||
eventEmitter.emit(JitsiMeetConferenceEvents.BEFORE_HANGUP);
|
||||
APP.UI.removeLocalMedia();
|
||||
|
||||
let requestFeedbackPromise;
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ import {
|
|||
participantPresenceChanged,
|
||||
showParticipantJoinedNotification
|
||||
} from '../../react/features/base/participants';
|
||||
import { destroyLocalTracks } from '../../react/features/base/tracks';
|
||||
import { openDisplayNamePrompt } from '../../react/features/display-name';
|
||||
import {
|
||||
setNotificationsEnabled,
|
||||
|
@ -376,15 +377,6 @@ UI.start = function() {
|
|||
document.title = interfaceConfig.APP_NAME;
|
||||
};
|
||||
|
||||
/**
|
||||
* Invokes cleanup of any deferred execution within relevant UI modules.
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
UI.stopDaemons = () => {
|
||||
VideoLayout.resetLargeVideo();
|
||||
};
|
||||
|
||||
/**
|
||||
* Setup some UI event listeners.
|
||||
*/
|
||||
|
@ -1291,6 +1283,18 @@ UI.setLocalRemoteControlActiveChanged = function() {
|
|||
VideoLayout.setLocalRemoteControlActiveChanged();
|
||||
};
|
||||
|
||||
/**
|
||||
* Remove media tracks and UI elements so the user no longer sees media in the
|
||||
* UI. The intent is to provide a feeling that the meeting has ended.
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
UI.removeLocalMedia = function() {
|
||||
APP.store.dispatch(destroyLocalTracks());
|
||||
VideoLayout.resetLargeVideo();
|
||||
$('#videospace').hide();
|
||||
};
|
||||
|
||||
// TODO: Export every function separately. For now there is no point of doing
|
||||
// this because we are importing everything.
|
||||
export default UI;
|
||||
|
|
|
@ -87,7 +87,6 @@ class Conference extends Component<Props> {
|
|||
* @inheritdoc
|
||||
*/
|
||||
componentWillUnmount() {
|
||||
APP.UI.stopDaemons();
|
||||
APP.UI.unregisterListeners();
|
||||
APP.UI.unbindEvents();
|
||||
|
||||
|
|
Loading…
Reference in New Issue