Browse Source

feat: enable config callstats configParams (#1672)

* enable config callstats configParams

* add comments

* wrap long comments

* fix format

* fix format

* fix format

* add jsDoc
tags/v0.0.2
pangrr 4 years ago
parent
commit
c23abfa2bc
No account linked to committer's email address
3 changed files with 10 additions and 8 deletions
  1. 2
    1
      JitsiConference.js
  2. 4
    6
      modules/statistics/CallStats.js
  3. 4
    1
      modules/statistics/statistics.js

+ 2
- 1
JitsiConference.js View File

@@ -421,7 +421,8 @@ JitsiConference.prototype._init = function(options = {}) {
421 421
             enableCallStats,
422 422
             roomName: this.options.name,
423 423
             applicationName: config.applicationName,
424
-            getWiFiStatsMethod: config.getWiFiStatsMethod
424
+            getWiFiStatsMethod: config.getWiFiStatsMethod,
425
+            configParams: config.callStatsConfigParams
425 426
         });
426 427
         Statistics.analytics.addPermanentProperties({
427 428
             'callstats_name': this._statsCurrentId

+ 4
- 6
modules/statistics/CallStats.js View File

@@ -343,6 +343,8 @@ export default class CallStats {
343 343
      * the <tt>userID</tt> aka endpoint ID, see CallStats docs for more info.
344 344
      * @param {string} options.userName the <tt>userName</tt> part of
345 345
      * the <tt>userID</tt> aka display name, see CallStats docs for more info.
346
+     * @param {String} options.configParams the set of parameters
347
+     * to enable/disable certain features in the library. See CallStats docs for more info.
346 348
      *
347 349
      */
348 350
     static initBackend(options) {
@@ -361,14 +363,10 @@ export default class CallStats {
361 363
             CallStats.callStatsID = options.callStatsID;
362 364
             CallStats.callStatsSecret = options.callStatsSecret;
363 365
 
364
-            let configParams;
366
+            const configParams = { ...options.configParams };
365 367
 
366 368
             if (options.applicationName) {
367
-                configParams = {
368
-                    applicationVersion:
369
-                        `${options.applicationName} (${
370
-                            browser.getName()})`
371
-                };
369
+                configParams.applicationVersion = `${options.applicationName} (${browser.getName()})`;
372 370
             }
373 371
 
374 372
             if (options.confID) {

+ 4
- 1
modules/statistics/statistics.js View File

@@ -72,7 +72,8 @@ function _initCallStatsBackend(options) {
72 72
         applicationName: options.applicationName,
73 73
         getWiFiStatsMethod: options.getWiFiStatsMethod,
74 74
         confID: options.confID,
75
-        siteID: options.siteID
75
+        siteID: options.siteID,
76
+        configParams: options.configParams
76 77
     })) {
77 78
         logger.error('CallStats Backend initialization failed bad');
78 79
     }
@@ -141,6 +142,8 @@ Statistics.init = function(options) {
141 142
  * @property {string} customScriptUrl - A custom lib url to use when downloading
142 143
  * callstats library.
143 144
  * @property {string} roomName - The room name we are currently in.
145
+ * @property {string} configParams - The set of parameters
146
+ * to enable/disable certain features in the library. See CallStats docs for more info.
144 147
  */
145 148
 /**
146 149
  *

Loading…
Cancel
Save