feat: moves isConnectionInterrupted to lib-jitsi-meet.

This commit is contained in:
Boris Grozev 2016-10-27 13:25:01 -05:00
parent 051db50b3f
commit 4aa47a7901
1 changed files with 3 additions and 11 deletions

View File

@ -26,11 +26,6 @@ const ConnectionQualityEvents = JitsiMeetJS.events.connectionQuality;
let room, connection, localAudio, localVideo; let room, connection, localAudio, localVideo;
/**
* Indicates whether the connection is interrupted or not.
*/
let connectionIsInterrupted = false;
/** /**
* Indicates whether extension external installation is in progress or not. * Indicates whether extension external installation is in progress or not.
*/ */
@ -677,7 +672,7 @@ export default {
* false otherwise. * false otherwise.
*/ */
isConnectionInterrupted () { isConnectionInterrupted () {
return connectionIsInterrupted; return this._room.isConnectionInterrupted();
}, },
/** /**
* Finds JitsiParticipant for given id. * Finds JitsiParticipant for given id.
@ -1100,7 +1095,6 @@ export default {
room.on(ConferenceEvents.CONFERENCE_JOINED, () => { room.on(ConferenceEvents.CONFERENCE_JOINED, () => {
APP.UI.mucJoined(); APP.UI.mucJoined();
APP.API.notifyConferenceJoined(APP.conference.roomName); APP.API.notifyConferenceJoined(APP.conference.roomName);
connectionIsInterrupted = false;
APP.UI.markVideoInterrupted(false); APP.UI.markVideoInterrupted(false);
}); });
@ -1249,12 +1243,10 @@ export default {
} }
room.on(ConferenceEvents.CONNECTION_INTERRUPTED, () => { room.on(ConferenceEvents.CONNECTION_INTERRUPTED, () => {
connectionIsInterrupted = true;
APP.UI.showLocalConnectionInterrupted(true); APP.UI.showLocalConnectionInterrupted(true);
}); });
room.on(ConferenceEvents.CONNECTION_RESTORED, () => { room.on(ConferenceEvents.CONNECTION_RESTORED, () => {
connectionIsInterrupted = false;
APP.UI.showLocalConnectionInterrupted(false); APP.UI.showLocalConnectionInterrupted(false);
}); });
@ -1307,12 +1299,12 @@ export default {
} }
// TODO: Move this to the library. // TODO: Move this to the library.
room.on(ConferenceEvents.CONNECTION_STATS, function (stats) { room.on(ConferenceEvents.CONNECTION_STATS, (stats) => {
// if we say video muted we will use old method of calculating // if we say video muted we will use old method of calculating
// quality and will not depend on localVideo if it is missing // quality and will not depend on localVideo if it is missing
room.connectionQuality.updateLocalStats( room.connectionQuality.updateLocalStats(
stats, stats,
connectionIsInterrupted, this.isConnectionInterrupted(),
localVideo ? localVideo.videoType : undefined, localVideo ? localVideo.videoType : undefined,
localVideo ? localVideo.isMuted() : true, localVideo ? localVideo.isMuted() : true,
localVideo ? localVideo.resolution : null); localVideo ? localVideo.resolution : null);