Skip to content

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

listen to CONNECTION_INTERRUPTED and CONNECTION_RESTORED events

isymchych4152106a06f1
diff --git a/app.js b/app.js
index 90eaf4e2b0..7580cf1981 100644
--- a/app.js
+++ b/app.js
@@ -119,7 +119,7 @@ function connect() {
connection.connect();
}).catch(function (errType, msg) {
// TODO handle OTHER_ERROR only
- UI.notifyConnectionFailed(msg);
+ APP.UI.notifyConnectionFailed(msg);
// rethrow
throw new Error(errType);
@@ -140,7 +140,7 @@ function initConference(connection, roomName) {
if (config.muteLocalVideoIfNotInLastN) {
// TODO mute or unmute if required
// mark video on UI
- // UI.markVideoMuted(true/false);
+ // APP.UI.markVideoMuted(true/false);
}
});
@@ -160,7 +160,7 @@ function initConference(connection, roomName) {
room.on(
ConferenceEvents.DISPLAY_NAME_CHANGED,
function (id, displayName) {
- UI.changeDisplayName(id, displayName);
+ APP.UI.changeDisplayName(id, displayName);
}
);
@@ -168,14 +168,14 @@ function initConference(connection, roomName) {
ConferenceEvents.USER_JOINED,
function (id) {
// FIXME ????
- UI.addUser();
+ APP.UI.addUser();
}
);
room.on(
ConferenceEvents.USER_LEFT,
function (id) {
- UI.removeUser(id);
+ APP.UI.removeUser(id);
}
);
@@ -189,7 +189,21 @@ function initConference(connection, roomName) {
room.on(
ConferenceEvents.TRACK_AUDIO_LEVEL_CHANGED,
function (id, lvl) {
- UI.setAudioLevel(id, lvl);
+ APP.UI.setAudioLevel(id, lvl);
+ }
+ );
+
+ room.on(
+ ConferenceEvents.CONNECTION_INTERRUPTED,
+ function () {
+ APP.UI.markVideoInterrupted(true);
+ }
+ );
+
+ room.on(
+ ConferenceEvents.CONNECTION_RESTORED,
+ function () {
+ APP.UI.markVideoInterrupted(false);
}
);
@@ -219,7 +233,7 @@ function initConference(connection, roomName) {
function init() {
connect().then(function (connection) {
- return initConference(connection, UI.generateRoomName());
+ return initConference(connection, APP.UI.generateRoomName());
}).then(function (conference) {
APP.conference = conference;
diff --git a/modules/UI/UI.js b/modules/UI/UI.js
index 25eb8edd63..c248639fa0 100644
--- a/modules/UI/UI.js
+++ b/modules/UI/UI.js
@@ -320,8 +320,8 @@ function chatSetSubject(text) {
return Chat.chatSetSubject(text);
}
-function updateChatConversation(from, displayName, message, myjid, stamp) {
- return Chat.updateChatConversation(from, displayName, message, myjid, stamp);
+function updateChatConversation(from, displayName, message, stamp) {
+ return Chat.updateChatConversation(from, displayName, message, stamp);
}
function initEtherpad(name) {
@@ -689,4 +689,12 @@ UI.showAuthenticateButton = function (show) {
Toolbar.showAuthenticateButton(show);
};
+UI.markVideoInterrupted = function (interrupted) {
+ if (interrupted) {
+ VideoLayout.onVideoInterrupted();
+ } else {
+ VideoLayout.onVideoRestored();
+ }
+};
+
module.exports = UI;
diff --git a/modules/UI/side_pannels/chat/Chat.js b/modules/UI/side_pannels/chat/Chat.js
index 34f4b4e5de..ccf63373f6 100644
--- a/modules/UI/side_pannels/chat/Chat.js
+++ b/modules/UI/side_pannels/chat/Chat.js
@@ -228,7 +228,7 @@ var Chat = (function (my) {
* Appends the given message to the chat conversation.
*/
my.updateChatConversation =
- function (from, displayName, message, myjid, stamp) {
+ function (from, displayName, message, stamp) {
var divClassName = '';
if (APP.xmpp.myJid() === from) {