瀏覽代碼

Merge pull request #1740 from bgrozev/refactor-deployment-info

Refactor deployment info
j8
bbaldino 8 年之前
父節點
當前提交
5c199e2195
共有 3 個文件被更改,包括 17 次插入11 次删除
  1. 7
    0
      config.js
  2. 0
    0
      local.html
  3. 10
    11
      modules/analytics/analytics.js

+ 7
- 0
config.js 查看文件

@@ -107,5 +107,12 @@ var config = { // eslint-disable-line no-unused-vars
107 107
         // How long we're going to wait, before going back to P2P after
108 108
         // the 3rd participant has left the conference (to filter out page reload)
109 109
         //backToP2PDelay: 5
110
+    },
111
+    // Information about the jitsi-meet instance we are connecting to, including the
112
+    // user region as seen by the server.
113
+    deploymentInfo: {
114
+        //shard: "shard1",
115
+        //region: "europe",
116
+        //userRegion: "asia"
110 117
     }
111 118
 };

+ 0
- 0
local.html 查看文件


+ 10
- 11
modules/analytics/analytics.js 查看文件

@@ -4,7 +4,7 @@
4 4
  * Load the integration of a third-party analytics API such as Google
5 5
  * Analytics. Since we cannot guarantee the quality of the third-party service
6 6
  * (e.g. their server may take noticeably long time to respond), it is in our
7
- * best interest (in the sense that the intergration of the analytics API is
7
+ * best interest (in the sense that the integration of the analytics API is
8 8
  * important to us but not enough to allow it to prevent people from joining
9 9
  * a conference) to download the API asynchronously. Additionally, Google
10 10
  * Analytics will download its implementation asynchronously anyway so it makes
@@ -77,7 +77,7 @@ class Analytics {
77 77
             Promise.all(handlersPromises).then(values => {
78 78
                 values.forEach(el => {
79 79
                     if(el.type === "error") {
80
-                        console.log("Fialed to load " + el.url);
80
+                        console.log("Failed to load " + el.url);
81 81
                         console.error(el.error);
82 82
                     }
83 83
                 });
@@ -122,15 +122,14 @@ class Analytics {
122 122
                 if (group) {
123 123
                     permanentProperties.group = group;
124 124
                 }
125
-                /**
126
-                 * optionally include local deployment information,
127
-                 * window.jitsiDeploymentInfo defined outside of application
128
-                 * to use, override contents in local.html
129
-                **/
130
-                if (window.jitsiDeploymentInfo) {
131
-                    for (var key in window.jitsiDeploymentInfo) {
132
-                        permanentProperties[key] 
133
-                            = window.jitsiDeploymentInfo[key];
125
+                 // optionally include local deployment information based on
126
+                 // the contents of window.config.deploymentInfo
127
+                if (config.deploymentInfo) {
128
+                    for (let key in config.deploymentInfo) {
129
+                        if (config.deploymentInfo.hasOwnProperty(key)) {
130
+                            permanentProperties[key]
131
+                                = config.deploymentInfo[key];
132
+                        }
134 133
                     }
135 134
                 }
136 135
 

Loading…
取消
儲存