Przeglądaj źródła

fix(JitsiConference,RTC): add onCallEnded to the RTC service

master
paweldomas 9 lat temu
rodzic
commit
8a00c803b6
2 zmienionych plików z 16 dodań i 0 usunięć
  1. 2
    0
      JitsiConference.js
  2. 14
    0
      modules/RTC/RTC.js

+ 2
- 0
JitsiConference.js Wyświetl plik

@@ -869,6 +869,8 @@ JitsiConference.prototype.onCallEnded
869 869
     if (this.statistics) {
870 870
         this.statistics.stopRemoteStats();
871 871
     }
872
+    // Let the RTC service do any cleanups
873
+    this.rtc.onCallEnded();
872 874
     // PeerConnection has been closed which means that SSRCs stored in
873 875
     // JitsiLocalTrack will not match those assigned by the old PeerConnection
874 876
     // and SSRC replacement logic will not work as expected.

+ 14
- 0
modules/RTC/RTC.js Wyświetl plik

@@ -89,6 +89,20 @@ RTC.prototype.onIncommingCall = function(event) {
89 89
             this.eventEmitter);
90 90
 };
91 91
 
92
+/**
93
+ * Should be called when current media session ends and after the PeerConnection
94
+ * has been closed using PeerConnection.close() method.
95
+ */
96
+RTC.prototype.onCallEnded = function() {
97
+    if (this.dataChannels) {
98
+        // DataChannels are not explicitly closed as the PeerConnection
99
+        // is closed on call ended which triggers data channel onclose events.
100
+        // The reference is cleared to disable any logic related to the data
101
+        // channels.
102
+        this.dataChannels = null;
103
+    }
104
+};
105
+
92 106
 /**
93 107
  * Elects the participant with the given id to be the pinned participant in
94 108
  * order to always receive video for this participant (even when last n is

Ładowanie…
Anuluj
Zapisz