Selaa lähdekoodia

Adds a option to set custom callstats script.

master
damencho 9 vuotta sitten
vanhempi
commit
a9dd9ad1d2
2 muutettua tiedostoa jossa 6 lisäystä ja 4 poistoa
  1. 2
    1
      doc/API.md
  2. 4
    3
      modules/statistics/statistics.js

+ 2
- 1
doc/API.md Näytä tiedosto

51
     10. disableSimulcast - boolean property. Enables/disables simulcast.
51
     10. disableSimulcast - boolean property. Enables/disables simulcast.
52
     11. enableWindowOnErrorHandler - boolean property (default false). Enables/disables attaching global onerror handler (window.onerror).
52
     11. enableWindowOnErrorHandler - boolean property (default false). Enables/disables attaching global onerror handler (window.onerror).
53
     12. disableThirdPartyRequests - if true - callstats will be disabled and the callstats API won't be included.
53
     12. disableThirdPartyRequests - if true - callstats will be disabled and the callstats API won't be included.
54
-    13. analyticsScriptUrl - (optional) custom url to search for the analytics lib, if missing js file will be expected to be next to the library file (the location it is sourced from) 
54
+    13. analyticsScriptUrl - (optional) custom url to search for the analytics lib, if missing js file will be expected to be next to the library file (the location it is sourced from)
55
+    14. callStatsCustomScriptUrl - (optional) custom url to access callstats client script 
55
 
56
 
56
 * ```JitsiMeetJS.JitsiConnection``` - the ```JitsiConnection``` constructor. You can use that to create new server connection.
57
 * ```JitsiMeetJS.JitsiConnection``` - the ```JitsiConnection``` constructor. You can use that to create new server connection.
57
 
58
 

+ 4
- 3
modules/statistics/statistics.js Näytä tiedosto

21
 // allow it to prevent people from joining a conference) to (1) start
21
 // allow it to prevent people from joining a conference) to (1) start
22
 // downloading their API as soon as possible and (2) do the downloading
22
 // downloading their API as soon as possible and (2) do the downloading
23
 // asynchronously.
23
 // asynchronously.
24
-function loadCallStatsAPI() {
24
+function loadCallStatsAPI(customScriptUrl) {
25
     if(!isCallstatsLoaded) {
25
     if(!isCallstatsLoaded) {
26
         ScriptUtil.loadScript(
26
         ScriptUtil.loadScript(
27
-                'https://api.callstats.io/static/callstats.min.js',
27
+                customScriptUrl ? customScriptUrl :
28
+                    'https://api.callstats.io/static/callstats.min.js',
28
                 /* async */ true,
29
                 /* async */ true,
29
                 /* prepend */ true);
30
                 /* prepend */ true);
30
         isCallstatsLoaded = true;
31
         isCallstatsLoaded = true;
122
             // requests to any third parties.
123
             // requests to any third parties.
123
             && (Statistics.disableThirdPartyRequests !== true);
124
             && (Statistics.disableThirdPartyRequests !== true);
124
     if(this.callStatsIntegrationEnabled)
125
     if(this.callStatsIntegrationEnabled)
125
-        loadCallStatsAPI();
126
+        loadCallStatsAPI(this.options.callStatsCustomScriptUrl);
126
     this.callStats = null;
127
     this.callStats = null;
127
     // Flag indicates whether or not the CallStats have been started for this
128
     // Flag indicates whether or not the CallStats have been started for this
128
     // Statistics instance
129
     // Statistics instance

Loading…
Peruuta
Tallenna