|
|
@@ -73,16 +73,13 @@ function Statistics(xmpp, options) {
|
|
73
|
73
|
loadCallStatsAPI();
|
|
74
|
74
|
this.callStats = null;
|
|
75
|
75
|
|
|
76
|
|
- // audioLevelsInterval = 200 unless overridden in the config
|
|
77
|
|
- this.audioLevelsInterval
|
|
78
|
|
- = typeof this.options.audioLevelsInterval !== 'undefined'
|
|
79
|
|
- ? this.options.audioLevelsInterval : 200;
|
|
80
|
76
|
/**
|
|
81
|
77
|
* Send the stats already saved in rtpStats to be logged via the focus.
|
|
82
|
78
|
*/
|
|
83
|
79
|
this.logStatsIntervalId = null;
|
|
84
|
80
|
}
|
|
85
|
81
|
Statistics.audioLevelsEnabled = false;
|
|
|
82
|
+Statistics.audioLevelsInterval = 200;
|
|
86
|
83
|
|
|
87
|
84
|
/**
|
|
88
|
85
|
* Array of callstats instances. Used to call Statistics static methods and
|
|
|
@@ -99,7 +96,7 @@ Statistics.prototype.startRemoteStats = function (peerconnection) {
|
|
99
|
96
|
try {
|
|
100
|
97
|
this.rtpStats
|
|
101
|
98
|
= new RTPStats(peerconnection,
|
|
102
|
|
- this.audioLevelsInterval, 2000, this.eventEmitter);
|
|
|
99
|
+ Statistics.audioLevelsInterval, 2000, this.eventEmitter);
|
|
103
|
100
|
this.rtpStats.start();
|
|
104
|
101
|
} catch (e) {
|
|
105
|
102
|
this.rtpStats = null;
|
|
|
@@ -120,7 +117,8 @@ Statistics.localStats = [];
|
|
120
|
117
|
Statistics.startLocalStats = function (stream, callback) {
|
|
121
|
118
|
if(!Statistics.audioLevelsEnabled)
|
|
122
|
119
|
return;
|
|
123
|
|
- var localStats = new LocalStats(stream, this.audioLevelsInterval, callback);
|
|
|
120
|
+ var localStats = new LocalStats(stream, Statistics.audioLevelsInterval,
|
|
|
121
|
+ callback);
|
|
124
|
122
|
this.localStats.push(localStats);
|
|
125
|
123
|
localStats.start();
|
|
126
|
124
|
};
|