Skip to content

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

Implements functionality that forces the user to enter display name.

hristoterezov47b6355d6673
diff --git a/config.js b/config.js
index ebf7d26989..ff17490441 100644
--- a/config.js
+++ b/config.js
@@ -32,6 +32,7 @@ var config = {
enableWelcomePage: true,
enableSimulcast: false, // blocks FF support
logStats: false, // Enable logging of PeerConnection stats via the focus
+// requireDisplayName: true,//Forces the participants that doesn't have display name to enter it when they enter the room.
// startAudioMuted: 10, //every participant after the Nth will start audio muted
// startVideoMuted: 10, //every participant after the Nth will start video muted
// defaultLanguage: "en",
diff --git a/index.html b/index.html
index b4422f31b6..861b078d62 100644
--- a/index.html
+++ b/index.html
@@ -13,7 +13,7 @@
<script src="libs/jquery-2.1.1.min.js"></script>
<script src="https://cdn.socket.io/socket.io-1.2.0.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jsSHA/1.5.0/sha.js"></script>
- <script src="config.js?v=10"></script><!-- adapt to your needs, i.e. set hosts and bosh path -->
+ <script src="config.js?v=11"></script><!-- adapt to your needs, i.e. set hosts and bosh path -->
<script src="libs/strophe/strophe.min.js?v=1"></script>
<script src="libs/strophe/strophe.disco.min.js?v=1"></script>
<script src="libs/strophe/strophe.caps.jsonly.min.js?v=1"></script>
@@ -22,7 +22,7 @@
<script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
<script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
<script src="interface_config.js?v=5"></script>
- <script src="libs/app.bundle.js?v=94"></script>
+ <script src="libs/app.bundle.js?v=95"></script>
<script src="analytics.js?v=1"></script><!-- google analytics plugin -->
<link rel="stylesheet" href="css/font.css?v=7"/>
<link rel="stylesheet" href="css/toastr.css?v=1">
diff --git a/lang/main.json b/lang/main.json
index 41c62a8aec..6548cd7634 100644
--- a/lang/main.json
+++ b/lang/main.json
@@ -194,7 +194,8 @@
"reservationErrorMsg": "Error code: __code__, message: __msg__",
"password": "password",
"userPassword": "user password",
- "token": "token"
+ "token": "token",
+ "displayNameRequired": "Please enter your display name:"
},
"email":
{
diff --git a/libs/app.bundle.js b/libs/app.bundle.js
index f14f88758f..244bfe0433 100644
--- a/libs/app.bundle.js
+++ b/libs/app.bundle.js
@@ -1552,6 +1552,51 @@ var eventEmitter = new EventEmitter();
var roomName = null;
+function promptDisplayName() {
+ var message = '<h2 data-i18n="dialog.displayNameRequired">';
+ message += APP.translation.translateString(
+ "dialog.displayNameRequired");
+ message += '</h2>' +
+ '<input name="displayName" type="text" data-i18n=' +
+ '"[placeholder]defaultNickname" placeholder="' +
+ APP.translation.translateString(
+ "defaultNickname", {name: "Jane Pink"}) +
+ '" autofocus>';
+
+ var buttonTxt
+ = APP.translation.generateTranslatonHTML("dialog.Ok");
+ var buttons = [];
+ buttons.push({title: buttonTxt, value: "ok"});
+
+ messageHandler.openDialog(null, message,
+ true,
+ buttons,
+ function (e, v, m, f) {
+ if (v == "ok") {
+ var displayName = f.displayName;
+ if (displayName) {
+ VideoLayout.inputDisplayNameHandler(displayName);
+ return true;
+ }
+ }
+ e.preventDefault();
+ },
+ function () {
+ var form = $.prompt.getPrompt();
+ var input = form.find("input[name='displayName']");
+ var button = form.find("button");
+ button.attr("disabled", "disabled");
+ input.keyup(function () {
+ if(!input.val())
+ button.attr("disabled", "disabled");
+ else
+ button.removeAttr("disabled");
+ });
+ }
+ );
+}
+
+
function notifyForInitialMute()
{
messageHandler.notify(null, "notify.mutedTitle", "connected",
@@ -1882,17 +1927,15 @@ UI.start = function (init) {
document.getElementById('largeVideo').volume = 0;
- if (!$('#settings').is(':visible')) {
- console.log('init');
- init();
- } else {
- loginInfo.onsubmit = function (e) {
- if (e.preventDefault) e.preventDefault();
- $('#settings').hide();
- init();
- };
+ if(config.requireDisplayName) {
+ var currentSettings = Settings.getSettings();
+ if (!currentSettings.displayName) {
+ promptDisplayName();
+ }
}
+ init();
+
toastr.options = {
"closeButton": true,
"debug": false,
diff --git a/modules/UI/UI.js b/modules/UI/UI.js
index 73dc28253c..7c71b0ce95 100644
--- a/modules/UI/UI.js
+++ b/modules/UI/UI.js
@@ -32,6 +32,51 @@ var eventEmitter = new EventEmitter();
var roomName = null;
+function promptDisplayName() {
+ var message = '<h2 data-i18n="dialog.displayNameRequired">';
+ message += APP.translation.translateString(
+ "dialog.displayNameRequired");
+ message += '</h2>' +
+ '<input name="displayName" type="text" data-i18n=' +
+ '"[placeholder]defaultNickname" placeholder="' +
+ APP.translation.translateString(
+ "defaultNickname", {name: "Jane Pink"}) +
+ '" autofocus>';
+
+ var buttonTxt
+ = APP.translation.generateTranslatonHTML("dialog.Ok");
+ var buttons = [];
+ buttons.push({title: buttonTxt, value: "ok"});
+
+ messageHandler.openDialog(null, message,
+ true,
+ buttons,
+ function (e, v, m, f) {
+ if (v == "ok") {
+ var displayName = f.displayName;
+ if (displayName) {
+ VideoLayout.inputDisplayNameHandler(displayName);
+ return true;
+ }
+ }
+ e.preventDefault();
+ },
+ function () {
+ var form = $.prompt.getPrompt();
+ var input = form.find("input[name='displayName']");
+ var button = form.find("button");
+ button.attr("disabled", "disabled");
+ input.keyup(function () {
+ if(!input.val())
+ button.attr("disabled", "disabled");
+ else
+ button.removeAttr("disabled");
+ });
+ }
+ );
+}
+
+
function notifyForInitialMute()
{
messageHandler.notify(null, "notify.mutedTitle", "connected",
@@ -362,17 +407,15 @@ UI.start = function (init) {
document.getElementById('largeVideo').volume = 0;
- if (!$('#settings').is(':visible')) {
- console.log('init');
- init();
- } else {
- loginInfo.onsubmit = function (e) {
- if (e.preventDefault) e.preventDefault();
- $('#settings').hide();
- init();
- };
+ if(config.requireDisplayName) {
+ var currentSettings = Settings.getSettings();
+ if (!currentSettings.displayName) {
+ promptDisplayName();
+ }
}
+ init();
+
toastr.options = {
"closeButton": true,
"debug": false,