浏览代码

Adds a option to set custom callstats script.

dev1
damencho 9 年前
父节点
当前提交
a9dd9ad1d2
共有 2 个文件被更改,包括 6 次插入4 次删除
  1. 2
    1
      doc/API.md
  2. 4
    3
      modules/statistics/statistics.js

+ 2
- 1
doc/API.md 查看文件

@@ -51,7 +51,8 @@ The ```options``` parameter is JS object with the following properties:
51 51
     10. disableSimulcast - boolean property. Enables/disables simulcast.
52 52
     11. enableWindowOnErrorHandler - boolean property (default false). Enables/disables attaching global onerror handler (window.onerror).
53 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 57
 * ```JitsiMeetJS.JitsiConnection``` - the ```JitsiConnection``` constructor. You can use that to create new server connection.
57 58
 

+ 4
- 3
modules/statistics/statistics.js 查看文件

@@ -21,10 +21,11 @@ var JitsiTrackError = require("../../JitsiTrackError");
21 21
 // allow it to prevent people from joining a conference) to (1) start
22 22
 // downloading their API as soon as possible and (2) do the downloading
23 23
 // asynchronously.
24
-function loadCallStatsAPI() {
24
+function loadCallStatsAPI(customScriptUrl) {
25 25
     if(!isCallstatsLoaded) {
26 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 29
                 /* async */ true,
29 30
                 /* prepend */ true);
30 31
         isCallstatsLoaded = true;
@@ -122,7 +123,7 @@ function Statistics(xmpp, options) {
122 123
             // requests to any third parties.
123 124
             && (Statistics.disableThirdPartyRequests !== true);
124 125
     if(this.callStatsIntegrationEnabled)
125
-        loadCallStatsAPI();
126
+        loadCallStatsAPI(this.options.callStatsCustomScriptUrl);
126 127
     this.callStats = null;
127 128
     // Flag indicates whether or not the CallStats have been started for this
128 129
     // Statistics instance

正在加载...
取消
保存