瀏覽代碼

Fixes issue with conference starting before the UI is ready + enableWelcomePage config support.

master
yanas 9 年之前
父節點
當前提交
bbb144f1bd
共有 2 個檔案被更改,包括 28 行新增15 行删除
  1. 16
    14
      app.js
  2. 12
    1
      modules/UI/UI.js

+ 16
- 14
app.js 查看文件

@@ -76,22 +76,24 @@ const APP = {
76 76
 };
77 77
 
78 78
 function init() {
79
-    APP.UI.start();
80
-    APP.conference.init({roomName: buildRoomName()}).then(function () {
81
-        APP.UI.initConference();
79
+    var isUIReady = APP.UI.start();
80
+    if (isUIReady) {
81
+        APP.conference.init({roomName: buildRoomName()}).then(function () {
82
+            APP.UI.initConference();
83
+
84
+            APP.UI.addListener(UIEvents.LANG_CHANGED, function (language) {
85
+                APP.translation.setLanguage(language);
86
+                APP.settings.setLanguage(language);
87
+            });
82 88
 
83
-        APP.UI.addListener(UIEvents.LANG_CHANGED, function (language) {
84
-            APP.translation.setLanguage(language);
85
-            APP.settings.setLanguage(language);
89
+            APP.desktopsharing.init(JitsiMeetJS.isDesktopSharingEnabled());
90
+            APP.statistics.start();
91
+            APP.connectionquality.init();
92
+            APP.keyboardshortcut.init();
93
+        }).catch(function (err) {
94
+            console.error(err);
86 95
         });
87
-
88
-        APP.desktopsharing.init(JitsiMeetJS.isDesktopSharingEnabled());
89
-        APP.statistics.start();
90
-        APP.connectionquality.init();
91
-        APP.keyboardshortcut.init();
92
-    }).catch(function (err) {
93
-        console.error(err);
94
-    });
96
+    }
95 97
 }
96 98
 
97 99
 /**

+ 12
- 1
modules/UI/UI.js 查看文件

@@ -223,6 +223,12 @@ function bindEvents() {
223 223
     $(window).resize(onResize);
224 224
 }
225 225
 
226
+/**
227
+ * Starts the UI module and initializes all related components.
228
+ *
229
+ * @returns {boolean} true if the UI is ready and the conference should be
230
+ * esablished, false - otherwise (for example in the case of welcome page)
231
+ */
226 232
 UI.start = function () {
227 233
     document.title = interfaceConfig.APP_NAME;
228 234
     var setupWelcomePage = null;
@@ -234,7 +240,9 @@ UI.start = function () {
234 240
             setupWelcomePage = require("./welcome_page/WelcomePage");
235 241
         setupWelcomePage();
236 242
 
237
-        return;
243
+        // Return false to indicate that the UI hasn't been fully started and
244
+        // conference ready. We're still waiting for input from the user.
245
+        return false;
238 246
     }
239 247
 
240 248
     $("#welcome_page").hide();
@@ -318,6 +326,9 @@ UI.start = function () {
318 326
         SettingsMenu.init(eventEmitter);
319 327
     }
320 328
 
329
+    // Return true to indicate that the UI has been fully started and
330
+    // conference ready.
331
+    return true;
321 332
 };
322 333
 
323 334
 

Loading…
取消
儲存