Browse Source

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.
master
virtuacoplenny 7 years ago
parent
commit
5a45b52881
3 changed files with 14 additions and 10 deletions
  1. 1
    0
      conference.js
  2. 13
    9
      modules/UI/UI.js
  3. 0
    1
      react/features/conference/components/Conference.web.js

+ 1
- 0
conference.js View File

@@ -2645,6 +2645,7 @@ export default {
2645 2645
      */
2646 2646
     hangup(requestFeedback = false) {
2647 2647
         eventEmitter.emit(JitsiMeetConferenceEvents.BEFORE_HANGUP);
2648
+        APP.UI.removeLocalMedia();
2648 2649
 
2649 2650
         let requestFeedbackPromise;
2650 2651
 

+ 13
- 9
modules/UI/UI.js View File

@@ -28,6 +28,7 @@ import {
28 28
     participantPresenceChanged,
29 29
     showParticipantJoinedNotification
30 30
 } from '../../react/features/base/participants';
31
+import { destroyLocalTracks } from '../../react/features/base/tracks';
31 32
 import { openDisplayNamePrompt } from '../../react/features/display-name';
32 33
 import {
33 34
     setNotificationsEnabled,
@@ -376,15 +377,6 @@ UI.start = function() {
376 377
     document.title = interfaceConfig.APP_NAME;
377 378
 };
378 379
 
379
-/**
380
- * Invokes cleanup of any deferred execution within relevant UI modules.
381
- *
382
- * @returns {void}
383
- */
384
-UI.stopDaemons = () => {
385
-    VideoLayout.resetLargeVideo();
386
-};
387
-
388 380
 /**
389 381
  * Setup some UI event listeners.
390 382
  */
@@ -1291,6 +1283,18 @@ UI.setLocalRemoteControlActiveChanged = function() {
1291 1283
     VideoLayout.setLocalRemoteControlActiveChanged();
1292 1284
 };
1293 1285
 
1286
+/**
1287
+ * Remove media tracks and UI elements so the user no longer sees media in the
1288
+ * UI. The intent is to provide a feeling that the meeting has ended.
1289
+ *
1290
+ * @returns {void}
1291
+ */
1292
+UI.removeLocalMedia = function() {
1293
+    APP.store.dispatch(destroyLocalTracks());
1294
+    VideoLayout.resetLargeVideo();
1295
+    $('#videospace').hide();
1296
+};
1297
+
1294 1298
 // TODO: Export every function separately. For now there is no point of doing
1295 1299
 // this because we are importing everything.
1296 1300
 export default UI;

+ 0
- 1
react/features/conference/components/Conference.web.js View File

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

Loading…
Cancel
Save