Просмотр исходного кода

feat: Fires an event when the ICE state changes.

dev1
Boris Grozev 9 лет назад
Родитель
Сommit
f56dbca640
2 измененных файлов: 8 добавлений и 2 удалений
  1. 4
    1
      modules/xmpp/JingleSessionPC.js
  2. 4
    1
      service/xmpp/XMPPEvents.js

+ 4
- 1
modules/xmpp/JingleSessionPC.js Просмотреть файл

@@ -142,6 +142,9 @@ JingleSessionPC.prototype.doInitialize = function () {
142 142
                     ":\t", now);
143 143
         Statistics.analytics.sendEvent(
144 144
             'ice.' + self.peerconnection.iceConnectionState, {value: now});
145
+        self.room.eventEmitter.emit(
146
+            XMPPEvents.ICE_CONNECTION_STATE_CHANGED,
147
+            self.peerconnection.iceConnectionState);
145 148
         switch (self.peerconnection.iceConnectionState) {
146 149
             case 'connected':
147 150
 
@@ -813,7 +816,7 @@ JingleSessionPC.prototype._modifySources = function (successCallback, queueCallb
813 816
      * optional error through (1) logger, (2) GlobalOnErrorHandler, and (3)
814 817
      * queueCallback.
815 818
      *
816
-     * @param {string} errmsg the error messsage to report
819
+     * @param {string} errmsg the error message to report
817 820
      * @param {*} error an optional error to report in addition to errmsg
818 821
      */
819 822
     function reportError(errmsg, err) {

+ 4
- 1
service/xmpp/XMPPEvents.js Просмотреть файл

@@ -183,6 +183,9 @@ var XMPPEvents = {
183 183
     LOCAL_UFRAG_CHANGED: "xmpp.local_ufrag_changed",
184 184
     // Designates an event indicating that the local ICE username fragment of
185 185
     // the jingle session has changed.
186
-    REMOTE_UFRAG_CHANGED: "xmpp.remote_ufrag_changed"
186
+    REMOTE_UFRAG_CHANGED: "xmpp.remote_ufrag_changed",
187
+    // Designates an event indicating that the local ICE connection state has
188
+    // changed.
189
+    ICE_CONNECTION_STATE_CHANGED: "xmpp.ice_connection_state_changed"
187 190
 };
188 191
 module.exports = XMPPEvents;

Загрузка…
Отмена
Сохранить