diff --git a/JitsiConference.js b/JitsiConference.js index 4cdd5cda3..143349448 100644 --- a/JitsiConference.js +++ b/JitsiConference.js @@ -496,6 +496,16 @@ JitsiConference.prototype.sendTones = function (tones, duration, pause) { this.dtmfManager.sendTones(tones, duration, pause); }; +/** + * Returns the connection state for the current room. Its ice connection state + * for its session. + */ +JitsiConference.prototype.getConnectionState = function () { + if(this.room) + return this.room.getConnectionState(); + return null; +} + /** * Setups the listeners needed for the conference. * @param conference the conference diff --git a/lib-jitsi-meet.js b/lib-jitsi-meet.js index 9ab1f7f6a..57db95810 100644 --- a/lib-jitsi-meet.js +++ b/lib-jitsi-meet.js @@ -498,6 +498,16 @@ JitsiConference.prototype.sendTones = function (tones, duration, pause) { this.dtmfManager.sendTones(tones, duration, pause); }; +/** + * Returns the connection state for the current room. Its ice connection state + * for its session. + */ +JitsiConference.prototype.getConnectionState = function () { + if(this.room) + return this.room.getConnectionState(); + return null; +} + /** * Setups the listeners needed for the conference. * @param conference the conference @@ -6501,6 +6511,15 @@ ChatRoom.prototype.getJidBySSRC = function (ssrc) { return this.session.getSsrcOwner(ssrc); }; +/** + * Returns the connection state for the current session. + */ +ChatRoom.prototype.getConnectionState = function () { + if(!this.session) + return null; + return this.session.getIceConnectionState(); +} + module.exports = ChatRoom; }).call(this,"/modules/xmpp/ChatRoom.js") @@ -8270,6 +8289,14 @@ JingleSessionPC.prototype.remoteStreamAdded = function (data, times) { } } +/** + * Returns the ice connection state for the peer connection. + * @returns the ice connection state for the peer connection. + */ +JingleSessionPC.prototype.getIceConnectionState = function () { + return this.peerconnection.iceConnectionState; +} + module.exports = JingleSessionPC; }).call(this,"/modules/xmpp/JingleSessionPC.js") diff --git a/modules/xmpp/ChatRoom.js b/modules/xmpp/ChatRoom.js index 5484e307d..97863ead7 100644 --- a/modules/xmpp/ChatRoom.js +++ b/modules/xmpp/ChatRoom.js @@ -639,4 +639,13 @@ ChatRoom.prototype.getJidBySSRC = function (ssrc) { return this.session.getSsrcOwner(ssrc); }; +/** + * Returns the connection state for the current session. + */ +ChatRoom.prototype.getConnectionState = function () { + if(!this.session) + return null; + return this.session.getIceConnectionState(); +} + module.exports = ChatRoom; diff --git a/modules/xmpp/JingleSessionPC.js b/modules/xmpp/JingleSessionPC.js index 24fc8df92..0f7e7d298 100644 --- a/modules/xmpp/JingleSessionPC.js +++ b/modules/xmpp/JingleSessionPC.js @@ -1626,4 +1626,12 @@ JingleSessionPC.prototype.remoteStreamAdded = function (data, times) { } } +/** + * Returns the ice connection state for the peer connection. + * @returns the ice connection state for the peer connection. + */ +JingleSessionPC.prototype.getIceConnectionState = function () { + return this.peerconnection.iceConnectionState; +} + module.exports = JingleSessionPC;