Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Fixes the gsm bars during ice disconnected

hristoterezov9d170e4c59b0
diff --git a/conference.js b/conference.js
index 4386e08789..1dfa27a858 100644
--- a/conference.js
+++ b/conference.js
@@ -25,6 +25,11 @@ const TrackErrors = JitsiMeetJS.errors.track;
let room, connection, localAudio, localVideo, roomLocker;
+/**
+ * Indicates whether the connection is interrupted or not.
+ */
+let connectionIsInterrupted = false;
+
import {VIDEO_CONTAINER_TYPE} from "./modules/UI/videolayout/LargeVideo";
/**
@@ -1076,6 +1081,15 @@ export default {
});
}
+ room.on(ConferenceEvents.CONNECTION_INTERRUPTED, () => {
+ connectionIsInterrupted = true;
+ ConnectionQuality.updateLocalConnectionQuality(0);
+ });
+
+ room.on(ConferenceEvents.CONNECTION_RESTORED, () => {
+ connectionIsInterrupted = false;
+ });
+
room.on(ConferenceEvents.DISPLAY_NAME_CHANGED, (id, displayName) => {
APP.API.notifyDisplayNameChanged(id, displayName);
APP.UI.changeDisplayName(id, displayName);
@@ -1131,7 +1145,7 @@ export default {
}
room.on(ConferenceEvents.CONNECTION_STATS, function (stats) {
- ConnectionQuality.updateLocalStats(stats);
+ ConnectionQuality.updateLocalStats(stats, connectionIsInterrupted);
});
ConnectionQuality.addListener(CQEvents.LOCALSTATS_UPDATED,
diff --git a/modules/connectionquality/connectionquality.js b/modules/connectionquality/connectionquality.js
index 7bcceca2c6..3b24417e93 100644
--- a/modules/connectionquality/connectionquality.js
+++ b/modules/connectionquality/connectionquality.js
@@ -41,12 +41,26 @@ export default {
/**
* Updates the local statistics
* @param data new statistics
+ * @param dontUpdateLocalConnectionQuality {boolean} if true -
+ * localConnectionQuality wont be recalculated.
*/
- updateLocalStats: function (data) {
+ updateLocalStats: function (data, dontUpdateLocalConnectionQuality) {
stats = data;
- var newVal = 100 - stats.packetLoss.total;
- localConnectionQuality =
- calculateQuality(newVal, localConnectionQuality);
+ if(!dontUpdateLocalConnectionQuality) {
+ var newVal = 100 - stats.packetLoss.total;
+ localConnectionQuality =
+ calculateQuality(newVal, localConnectionQuality);
+ }
+ eventEmitter.emit(CQEvents.LOCALSTATS_UPDATED, localConnectionQuality,
+ stats);
+ },
+
+ /**
+ * Updates only the localConnectionQuality value
+ * @param values {int} the new value. should be from 0 - 100.
+ */
+ updateLocalConnectionQuality: function (value) {
+ localConnectionQuality = value;
eventEmitter.emit(CQEvents.LOCALSTATS_UPDATED, localConnectionQuality,
stats);
},