Procházet zdrojové kódy

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.
j8
virtuacoplenny před 7 roky
rodič
revize
88325aeef2

+ 3
- 2
modules/UI/UI.js Zobrazit soubor

@@ -377,11 +377,12 @@ UI.start = function() {
377 377
 };
378 378
 
379 379
 /**
380
- * Invokes cleanup of any deferred execution within relevant UI modules.
380
+ * Invokes cleanup of large video so it stops running polling tasks and stops
381
+ * displaying.
381 382
  *
382 383
  * @returns {void}
383 384
  */
384
-UI.stopDaemons = () => {
385
+UI.resetLargeVideo = () => {
385 386
     VideoLayout.resetLargeVideo();
386 387
 };
387 388
 

+ 2
- 0
modules/UI/videolayout/LargeVideoManager.js Zobrazit soubor

@@ -129,6 +129,8 @@ export default class LargeVideoManager {
129 129
             this._onVideoResolutionUpdate);
130 130
 
131 131
         this.removePresenceLabel();
132
+
133
+        this.$container.remove();
132 134
     }
133 135
 
134 136
     /**

+ 6
- 1
react/features/base/conference/middleware.js Zobrazit soubor

@@ -17,7 +17,7 @@ import {
17 17
 } from '../participants';
18 18
 import { MiddlewareRegistry } from '../redux';
19 19
 import UIEvents from '../../../../service/UI/UIEvents';
20
-import { TRACK_ADDED, TRACK_REMOVED } from '../tracks';
20
+import { TRACK_ADDED, TRACK_REMOVED, destroyLocalTracks } from '../tracks';
21 21
 
22 22
 import {
23 23
     createConference,
@@ -144,6 +144,11 @@ function _conferenceFailedOrLeft({ dispatch, getState }, next, action) {
144 144
         dispatch(setAudioOnly(true));
145 145
     }
146 146
 
147
+    if (typeof APP === 'object') {
148
+        dispatch(destroyLocalTracks());
149
+        APP.UI.resetLargeVideo();
150
+    }
151
+
147 152
     return result;
148 153
 }
149 154
 

+ 0
- 1
react/features/conference/components/Conference.web.js Zobrazit soubor

@@ -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
 

Načítá se…
Zrušit
Uložit