瀏覽代碼

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

master
paweldomas 9 年之前
父節點
當前提交
8a00c803b6
共有 2 個檔案被更改,包括 16 行新增0 行删除
  1. 2
    0
      JitsiConference.js
  2. 14
    0
      modules/RTC/RTC.js

+ 2
- 0
JitsiConference.js 查看文件

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

+ 14
- 0
modules/RTC/RTC.js 查看文件

89
             this.eventEmitter);
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
  * Elects the participant with the given id to be the pinned participant in
107
  * Elects the participant with the given id to be the pinned participant in
94
  * order to always receive video for this participant (even when last n is
108
  * order to always receive video for this participant (even when last n is

Loading…
取消
儲存