Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
do not use xmpp in settings menu
isymchychfe77846b89c1
diff --git a/app.js b/app.jsindex 26aa7c8515..ba8e331255 100644--- a/app.js+++ b/app.js@@ -40,6 +40,14 @@ function createConference(connection, room) {room.setDisplayName(nickname);},+ setEmail: function (email) {+ // FIXME room.setEmail+ },++ setStartMuted: function (audio, video) {+ // FIXME room.setStartMuted+ },+sendMessage: function (message) {room.sendTextMessage(message);},@@ -50,6 +58,10 @@ function createConference(connection, room) {localId: function () {return room.myUserId();+ },++ isLocalId: function (id) {+ return id === this.localId();}};}@@ -173,8 +185,8 @@ function initConference(connection, roomName) {room.on(ConferenceEvents.USER_JOINED,function (id) {- // FIXME ????- APP.UI.addUser();+ // FIXME email???+ APP.UI.addUser(id);});@@ -263,6 +275,23 @@ function init() {APP.conference.sendMessage(message);});+ APP.UI.addListener(UIEvents.LANG_CHANGED, function (language) {+ APP.translation.setLanguage(language);+ APP.settings.setLanguage(language);+ });++ APP.UI.addListener(UIEvents.EMAIL_CHANGED, function (email) {+ APP.conference.setEmail(email);+ APP.settings.setEmail(email);+ });++ APP.UI.addListener(+ UIEvents.START_MUTED_CHANGED,+ function (startAudioMuted, startVideoMuted) {+ APP.conference.setStartMuted(startAudioMuted, startVideoMuted);+ }+ );+APP.desktopsharing.init();APP.statistics.start();APP.connectionquality.init();diff --git a/modules/UI/UI.js b/modules/UI/UI.jsindex 1ead4fd8d0..d24fe94277 100644--- a/modules/UI/UI.js+++ b/modules/UI/UI.js@@ -129,10 +129,10 @@ UI.notifyBridgeDown = function () {messageHandler.showError("dialog.error", "dialog.bridgeUnavailable");};-UI.changeDisplayName = function (jid, displayName) {- ContactList.onDisplayNameChange(jid, displayName);- SettingsMenu.onDisplayNameChange(jid, displayName);- VideoLayout.onDisplayNameChanged(jid, displayName);+UI.changeDisplayName = function (id, displayName) {+ ContactList.onDisplayNameChange(id, displayName);+ SettingsMenu.onDisplayNameChange(id, displayName);+ VideoLayout.onDisplayNameChanged(id, displayName);};UI.initConference = function (jid) {@@ -171,6 +171,10 @@ function registerListeners() {UI.addListener(UIEvents.FILM_STRIP_TOGGLED, function (isToggled) {VideoLayout.onFilmStripToggled(isToggled);});++ UI.addListener(UIEvents.EMAIL_CHANGED, function (email) {+ Avatar.setUserAvatar(APP.xmpp.myJid(), email);+ });}function onResize() {diff --git a/modules/UI/side_pannels/contactlist/ContactList.js b/modules/UI/side_pannels/contactlist/ContactList.jsindex 4e3c29466d..2fc830d528 100644--- a/modules/UI/side_pannels/contactlist/ContactList.js+++ b/modules/UI/side_pannels/contactlist/ContactList.js@@ -169,16 +169,15 @@ var ContactList = {}},- onDisplayNameChange: function (peerJid, displayName) {- if (peerJid === 'localVideoContainer')- peerJid = APP.xmpp.myJid();-- var resourceJid = Strophe.getResourceFromJid(peerJid);-- var contactName = $('#contacts #' + resourceJid + '>p');+ onDisplayNameChange: function (id, displayName) {+ if (id === 'localVideoContainer') {+ id = APP.conference.localId();+ }+ var contactName = $('#contacts #' + id + '>p');- if (contactName && displayName && displayName.length > 0)+ if (contactName && displayName && displayName.length > 0) {contactName.html(displayName);+ }},userAvatarChanged: function (resourceJid, contactListUrl) {diff --git a/modules/UI/side_pannels/settings/SettingsMenu.js b/modules/UI/side_pannels/settings/SettingsMenu.jsindex c502e02d73..bb9547c582 100644--- a/modules/UI/side_pannels/settings/SettingsMenu.js+++ b/modules/UI/side_pannels/settings/SettingsMenu.js@@ -1,8 +1,8 @@/* global APP, $ */-var Avatar = require("../../avatar/Avatar");var Settings = require("./../../../settings/Settings");var UIUtil = require("../../util/UIUtil");var languages = require("../../../../service/translation/languages");+var UIEvents = require("../../../../service/UI/UIEvents");function generateLanguagesSelectBox() {var currentLang = APP.translation.getCurrentLanguage();@@ -24,7 +24,9 @@ function generateLanguagesSelectBox() {var SettingsMenu = {- init: function () {+ init: function (emitter) {+ this.emitter = emitter;+var startMutedSelector = $("#startMutedOptions");startMutedSelector.before(generateLanguagesSelectBox());APP.translation.translateElement($("#languages_selectbox"));@@ -36,8 +38,7 @@ var SettingsMenu = {if (APP.conference.isModerator()) {startMutedSelector.css("display", "block");- }- else {+ } else {startMutedSelector.css("display", "none");}@@ -61,43 +62,35 @@ var SettingsMenu = {},update: function() {+ // FIXME check if this values really changed:+ // compare them with Settings etc.var newDisplayName =- UIUtil.escapeHtml($('#setDisplayName').get(0).value);- var newEmail = UIUtil.escapeHtml($('#setEmail').get(0).value);+ UIUtil.escapeHtml($('#setDisplayName').get(0).value);- if(newDisplayName) {- var displayName = Settings.setDisplayName(newDisplayName);- APP.xmpp.addToPresence("displayName", displayName, true);+ if (newDisplayName) {+ this.emitter.emit(UIEvents.NICKNAME_CHANGED, newDisplayName);}var language = $("#languages_selectbox").val();- APP.translation.setLanguage(language);- Settings.setLanguage(language);+ this.emitter.emit(UIEvents.LANG_CHANGED, language);- APP.xmpp.addToPresence("email", newEmail);- var email = Settings.setEmail(newEmail);+ var newEmail = UIUtil.escapeHtml($('#setEmail').get(0).value);+ this.emitter.emit(UIEvents.EMAIL_CHANGED, newEmail);var startAudioMuted = ($("#startAudioMuted").is(":checked"));var startVideoMuted = ($("#startVideoMuted").is(":checked"));- APP.xmpp.addToPresence("startMuted",- [startAudioMuted, startVideoMuted]);-- Avatar.setUserAvatar(APP.xmpp.myJid(), email);+ this.emitter.emit(+ UIEvents.START_MUTED_CHANGED, startAudioMuted, startVideoMuted+ );},isVisible: function() {return $('#settingsmenu').is(':visible');},- setDisplayName: function(newDisplayName) {- var displayName = Settings.setDisplayName(newDisplayName);- $('#setDisplayName').get(0).value = displayName;- },-- onDisplayNameChange: function(peerJid, newDisplayName) {- if(peerJid === 'localVideoContainer' ||- peerJid === APP.xmpp.myJid()) {- this.setDisplayName(newDisplayName);+ onDisplayNameChange: function(id, newDisplayName) {+ if(id === 'localVideoContainer' || APP.conference.isLocalId(id)) {+ $('#setDisplayName').get(0).value = newDisplayName;}},changeAvatar: function (thumbUrl) {diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.jsindex ae12d18e79..d80f95f425 100644--- a/modules/UI/videolayout/VideoLayout.js+++ b/modules/UI/videolayout/VideoLayout.js@@ -590,16 +590,13 @@ var VideoLayout = (function (my) {/*** Display name changed.*/- my.onDisplayNameChanged =- function (jid, displayName, status) {- if (jid === 'localVideoContainer' ||- jid === APP.xmpp.myJid()) {+ my.onDisplayNameChanged = function (id, displayName, status) {+ if (id === 'localVideoContainer' ||+ APP.conference.isLocalId(id)) {localVideoThumbnail.setDisplayName(displayName);} else {- VideoLayout.ensurePeerContainerExists(jid);- remoteVideos[Strophe.getResourceFromJid(jid)].setDisplayName(- displayName,- status);+ VideoLayout.ensurePeerContainerExists(id);+ remoteVideos[id].setDisplayName(displayName, status);}};diff --git a/service/UI/UIEvents.js b/service/UI/UIEvents.jsindex 3cf53e5fc3..70b0dd0ed7 100644--- a/service/UI/UIEvents.js+++ b/service/UI/UIEvents.js@@ -7,6 +7,18 @@ var UIEvents = {* Notifies that local user created text message.*/MESSAGE_CREATED: "UI.message_created",+ /**+ * Notifies that local user changed language.+ */+ LANG_CHANGED: "UI.lang_changed",+ /**+ * Notifies that local user changed email.+ */+ EMAIL_CHANGED: "UI.email_changed",+ /**+ * Notifies that "start muted" settings changed.+ */+ START_MUTED_CHANGED: "UI.start_muted_changed",/*** Notifies interested parties when the film strip (remote video's panel)* is hidden (toggled) or shown (un-toggled).