Browse Source

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 years ago
parent
commit
39eea17e7e
2 changed files with 11 additions and 0 deletions
  1. 4
    0
      JitsiConference.js
  2. 7
    0
      JitsiConferenceEvents.js

+ 4
- 0
JitsiConference.js View File

2264
             { value: establishmentDurationDiff });
2264
             { value: establishmentDurationDiff });
2265
     }
2265
     }
2266
 
2266
 
2267
+    if (jingleSession.isP2P === this.isP2PActive()) {
2268
+        this.eventEmitter.emit(JitsiConferenceEvents.CONNECTION_ESTABLISHED);
2269
+    }
2270
+
2267
     if (done) {
2271
     if (done) {
2268
 
2272
 
2269
         return;
2273
         return;

+ 7
- 0
JitsiConferenceEvents.js View File

45
  */
45
  */
46
 export const CONFERENCE_LEFT = 'conference.left';
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
  * Indicates that the connection to the conference has been interrupted for some
56
  * Indicates that the connection to the conference has been interrupted for some
50
  * reason.
57
  * reason.

Loading…
Cancel
Save