Explorar el Código

fix(hangup): remove device change listener

When closing and reopening a notebook, the browser will fire
a devicechange event. This event should not be listened to
after hangup because the current listener will call gum if
there is no current audio/video, which is the case after
hangup.

Initially this change was going to be remove all conference
listeners but then I noticed that the listener for devicechange
is set differently. It might be worthwhile future work, although
potentially unnecessary right now, to ensure all listeners
registered in conference.js are properly cleaned up on hangup.
j8
Leonard Kim hace 7 años
padre
commit
d94093a01e
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5
    0
      conference.js

+ 5
- 0
conference.js Ver fichero

@@ -2525,6 +2525,11 @@ export default {
2525 2525
         eventEmitter.emit(JitsiMeetConferenceEvents.BEFORE_HANGUP);
2526 2526
         APP.UI.removeLocalMedia();
2527 2527
 
2528
+        // Remove unnecessary event listeners from firing callbacks.
2529
+        JitsiMeetJS.mediaDevices.removeEventListener(
2530
+            JitsiMediaDevicesEvents.DEVICE_LIST_CHANGED,
2531
+            this.deviceChangeListener);
2532
+
2528 2533
         let requestFeedbackPromise;
2529 2534
 
2530 2535
         if (requestFeedback) {

Loading…
Cancelar
Guardar