Преглед изворни кода

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 година
родитељ
комит
5a45b52881
3 измењених фајлова са 14 додато и 10 уклоњено
  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 Прегледај датотеку

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

+ 13
- 9
modules/UI/UI.js Прегледај датотеку

28
     participantPresenceChanged,
28
     participantPresenceChanged,
29
     showParticipantJoinedNotification
29
     showParticipantJoinedNotification
30
 } from '../../react/features/base/participants';
30
 } from '../../react/features/base/participants';
31
+import { destroyLocalTracks } from '../../react/features/base/tracks';
31
 import { openDisplayNamePrompt } from '../../react/features/display-name';
32
 import { openDisplayNamePrompt } from '../../react/features/display-name';
32
 import {
33
 import {
33
     setNotificationsEnabled,
34
     setNotificationsEnabled,
376
     document.title = interfaceConfig.APP_NAME;
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
  * Setup some UI event listeners.
381
  * Setup some UI event listeners.
390
  */
382
  */
1291
     VideoLayout.setLocalRemoteControlActiveChanged();
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
 // TODO: Export every function separately. For now there is no point of doing
1298
 // TODO: Export every function separately. For now there is no point of doing
1295
 // this because we are importing everything.
1299
 // this because we are importing everything.
1296
 export default UI;
1300
 export default UI;

+ 0
- 1
react/features/conference/components/Conference.web.js Прегледај датотеку

87
      * @inheritdoc
87
      * @inheritdoc
88
      */
88
      */
89
     componentWillUnmount() {
89
     componentWillUnmount() {
90
-        APP.UI.stopDaemons();
91
         APP.UI.unregisterListeners();
90
         APP.UI.unregisterListeners();
92
         APP.UI.unbindEvents();
91
         APP.UI.unbindEvents();
93
 
92
 

Loading…
Откажи
Сачувај