diff --git a/conference.js b/conference.js index a2d0c46b0..b04d49840 100644 --- a/conference.js +++ b/conference.js @@ -2645,6 +2645,7 @@ export default { */ hangup(requestFeedback = false) { eventEmitter.emit(JitsiMeetConferenceEvents.BEFORE_HANGUP); + APP.UI.removeLocalMedia(); let requestFeedbackPromise; diff --git a/modules/UI/UI.js b/modules/UI/UI.js index 4dd50e059..c6f5ef4b1 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -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; diff --git a/react/features/conference/components/Conference.web.js b/react/features/conference/components/Conference.web.js index 0ecbbcc5e..6a117d35b 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 { * @inheritdoc */ componentWillUnmount() { - APP.UI.stopDaemons(); APP.UI.unregisterListeners(); APP.UI.unbindEvents();