浏览代码

feat(JitsiConference): add CONNECTION_ESTABLISHED event

Will emit CONNECTION_ESTABLISHED event to fill up the gap where the lib
users are not able to tell whether or not the connection has been
established if there were no interrupted/restored events emitted.
dev1
paweldomas 7 年前
父节点
当前提交
39eea17e7e
共有 2 个文件被更改,包括 11 次插入0 次删除
  1. 4
    0
      JitsiConference.js
  2. 7
    0
      JitsiConferenceEvents.js

+ 4
- 0
JitsiConference.js 查看文件

@@ -2264,6 +2264,10 @@ JitsiConference.prototype._onIceConnectionEstablished = function(
2264 2264
             { value: establishmentDurationDiff });
2265 2265
     }
2266 2266
 
2267
+    if (jingleSession.isP2P === this.isP2PActive()) {
2268
+        this.eventEmitter.emit(JitsiConferenceEvents.CONNECTION_ESTABLISHED);
2269
+    }
2270
+
2267 2271
     if (done) {
2268 2272
 
2269 2273
         return;

+ 7
- 0
JitsiConferenceEvents.js 查看文件

@@ -45,6 +45,13 @@ export const CONFERENCE_JOINED = 'conference.joined';
45 45
  */
46 46
 export const CONFERENCE_LEFT = 'conference.left';
47 47
 
48
+/**
49
+ * Indicates that the connection to the conference has been established
50
+ * XXX This is currently fired whenVthe *ICE* connection enters 'connected'
51
+ * state for the first time.
52
+ */
53
+export const CONNECTION_ESTABLISHED = 'conference.connectionEstablished';
54
+
48 55
 /**
49 56
  * Indicates that the connection to the conference has been interrupted for some
50 57
  * reason.

正在加载...
取消
保存