浏览代码

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

j8
yanas 9 年前
父节点
当前提交
bbb144f1bd
共有 2 个文件被更改,包括 28 次插入15 次删除
  1. 16
    14
      app.js
  2. 12
    1
      modules/UI/UI.js

+ 16
- 14
app.js 查看文件

76
 };
76
 };
77
 
77
 
78
 function init() {
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
     $(window).resize(onResize);
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
 UI.start = function () {
232
 UI.start = function () {
227
     document.title = interfaceConfig.APP_NAME;
233
     document.title = interfaceConfig.APP_NAME;
228
     var setupWelcomePage = null;
234
     var setupWelcomePage = null;
234
             setupWelcomePage = require("./welcome_page/WelcomePage");
240
             setupWelcomePage = require("./welcome_page/WelcomePage");
235
         setupWelcomePage();
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
     $("#welcome_page").hide();
248
     $("#welcome_page").hide();
318
         SettingsMenu.init(eventEmitter);
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
 

正在加载...
取消
保存