Przeglądaj źródła

Supports setting interfaceConfig options via URL params. Renames config.filmStripOnly to interfaceConfig.filmStripOnly.

master
Boris Grozev 9 lat temu
rodzic
commit
fd404b8465

+ 1
- 1
external_api.js Wyświetl plik

@@ -53,7 +53,7 @@ var JitsiMeetExternalAPI = (function()
53 53
             this.url += room_name;
54 54
         this.url += "#external=true";
55 55
         if(filmStripOnly)
56
-            this.url += "&config.filmStripOnly=true";
56
+            this.url += "&interfaceConfig.filmStripOnly=true";
57 57
 
58 58
         JitsiMeetExternalAPI.id++;
59 59
 

+ 5
- 1
interface_config.js Wyświetl plik

@@ -15,5 +15,9 @@ var interfaceConfig = {
15 15
     GENERATE_ROOMNAMES_ON_WELCOME_PAGE: true,
16 16
     APP_NAME: "Jitsi Meet",
17 17
     INVITATION_POWERED_BY: true,
18
-    ACTIVE_SPEAKER_AVATAR_SIZE: 100
18
+    ACTIVE_SPEAKER_AVATAR_SIZE: 100,
19
+    /**
20
+     * Whether to only show the filmstrip (and hide the toolbar).
21
+     */
22
+    filmStripOnly: false
19 23
 };

+ 3
- 3
modules/UI/UI.js Wyświetl plik

@@ -331,7 +331,7 @@ function registerListeners() {
331 331
         AudioLevels.init();
332 332
     });
333 333
 
334
-    if (!config.filmStripOnly) {
334
+    if (!interfaceConfig.filmStripOnly) {
335 335
         APP.xmpp.addListener(XMPPEvents.MESSAGE_RECEIVED, updateChatConversation);
336 336
         APP.xmpp.addListener(XMPPEvents.CHAT_ERROR_RECEIVED, chatAddError);
337 337
         // Listens for video interruption events.
@@ -399,7 +399,7 @@ UI.start = function (init) {
399 399
 
400 400
     bindEvents();
401 401
     setupPrezi();
402
-    if(!config.filmStripOnly) {
402
+    if (!interfaceConfig.filmStripOnly) {
403 403
         $("#videospace").mousemove(function () {
404 404
             return ToolbarToggler.showToolbar();
405 405
         });
@@ -442,7 +442,7 @@ UI.start = function (init) {
442 442
 
443 443
     init();
444 444
 
445
-    if(!config.filmStripOnly) {
445
+    if (!interfaceConfig.filmStripOnly) {
446 446
         toastr.options = {
447 447
             "closeButton": true,
448 448
             "debug": false,

+ 2
- 2
modules/UI/toolbars/ToolbarToggler.js Wyświetl plik

@@ -53,7 +53,7 @@ var ToolbarToggler = {
53 53
      * Shows the main toolbar.
54 54
      */
55 55
     showToolbar: function () {
56
-        if(config.filmStripOnly)
56
+        if (interfaceConfig.filmStripOnly)
57 57
             return;
58 58
         var header = $("#header"),
59 59
             bottomToolbar = $("#bottomToolbar");
@@ -90,7 +90,7 @@ var ToolbarToggler = {
90 90
      * @param isDock indicates what operation to perform
91 91
      */
92 92
     dockToolbar: function (isDock) {
93
-        if(config.filmStripOnly)
93
+        if (interfaceConfig.filmStripOnly)
94 94
             return;
95 95
 
96 96
         if (isDock) {

+ 1
- 1
modules/UI/videolayout/RemoteVideo.js Wyświetl plik

@@ -43,7 +43,7 @@ RemoteVideo.prototype.addRemoteVideoContainer = function() {
43 43
  * @param parentElement the parent element where this menu will be added
44 44
  */
45 45
 
46
-if(!config.filmStripOnly) {
46
+if (!interfaceConfig.filmStripOnly) {
47 47
     RemoteVideo.prototype.addRemoteVideoMenu = function () {
48 48
         var spanElement = document.createElement('span');
49 49
         spanElement.className = 'remotevideomenu';

+ 3
- 3
modules/UI/videolayout/VideoLayout.js Wyświetl plik

@@ -36,7 +36,7 @@ var VideoLayout = (function (my) {
36 36
     my.init = function (emitter) {
37 37
         eventEmitter = emitter;
38 38
         localVideoThumbnail = new LocalVideo(VideoLayout);
39
-        if(config.filmStripOnly)
39
+        if (interfaceConfig.filmStripOnly)
40 40
         {
41 41
             showLargeVideo = false;
42 42
             LargeVideo.disable();
@@ -202,7 +202,7 @@ var VideoLayout = (function (my) {
202 202
                                           resourceJid) {
203 203
         if(focusedVideoResourceJid) {
204 204
             var oldSmallVideo = VideoLayout.getSmallVideo(focusedVideoResourceJid);
205
-            if(oldSmallVideo && !config.filmStripOnly)
205
+            if (oldSmallVideo && !interfaceConfig.filmStripOnly)
206 206
                 oldSmallVideo.focus(false);
207 207
         }
208 208
 
@@ -229,7 +229,7 @@ var VideoLayout = (function (my) {
229 229
 
230 230
         // Update focused/pinned interface.
231 231
         if (resourceJid) {
232
-            if(smallVideo && !config.filmStripOnly)
232
+            if (smallVideo && !interfaceConfig.filmStripOnly)
233 233
                 smallVideo.focus(true);
234 234
 
235 235
             if (!noPinnedEndpointChangedEvent) {

+ 19
- 10
modules/URLProcessor/URLProcessor.js Wyświetl plik

@@ -1,4 +1,4 @@
1
-/* global $, $iq, config */
1
+/* global $, $iq, config, interfaceConfig */
2 2
 var params = {};
3 3
 function getConfigParamsFromUrl() {
4 4
     if(!location.hash)
@@ -17,22 +17,31 @@ params = getConfigParamsFromUrl();
17 17
 
18 18
 var URLProcessor = {
19 19
     setConfigParametersFromUrl: function () {
20
-        for(var k in params)
21
-        {
22
-            if(typeof k !== "string" || k.indexOf("config.") === -1)
20
+        for(var key in params) {
21
+            if(typeof key !== "string")
23 22
                 continue;
24 23
 
25
-            var v = params[k];
26
-            var confKey = k.substr(7);
27
-            if(config[confKey] && typeof config[confKey] !== typeof v)
24
+            var confObj = null, confKey;
25
+            if (key.indexOf("config.") === 0) {
26
+                confObj = config;
27
+                confKey = key.substr("config.".length);
28
+            } else if (key.indexOf("interfaceConfig.") === 0) {
29
+                confObj = interfaceConfig;
30
+                confKey = key.substr("interfaceConfig.".length);
31
+            }
32
+
33
+            if (!confObj)
34
+                continue;
35
+
36
+            var value = params[key];
37
+            if (confObj[confKey] && typeof confObj[confKey] !== typeof value)
28 38
             {
29
-                console.warn("The type of " + k +
39
+                console.warn("The type of " + key +
30 40
                     " is wrong. That parameter won't be updated in config.js.");
31 41
                 continue;
32 42
             }
33 43
 
34
-            config[confKey] = v;
35
-
44
+            confObj[confKey] = value;
36 45
         }
37 46
 
38 47
     }

Ładowanie…
Anuluj
Zapisz