Quellcode durchsuchen

Fixes issue with the local audio levels

dev1
hristoterezov vor 9 Jahren
Ursprung
Commit
cdf7734b3e
3 geänderte Dateien mit 8 neuen und 7 gelöschten Zeilen
  1. 0
    1
      JitsiConference.js
  2. 4
    0
      JitsiMeetJS.js
  3. 4
    6
      modules/statistics/statistics.js

+ 0
- 1
JitsiConference.js Datei anzeigen

@@ -47,7 +47,6 @@ function JitsiConference(options) {
47 47
     this.room.updateDeviceAvailability(RTC.getDeviceAvailability());
48 48
     this.rtc = new RTC(this.room, options);
49 49
     this.statistics = new Statistics(this.xmpp, {
50
-        audioLevelsInterval: this.options.config.audioLevelsInterval,
51 50
         callStatsID: this.options.config.callStatsID,
52 51
         callStatsSecret: this.options.config.callStatsSecret,
53 52
         disableThirdPartyRequests:

+ 4
- 0
JitsiMeetJS.js Datei anzeigen

@@ -60,6 +60,10 @@ var LibJitsiMeet = {
60 60
     init: function (options) {
61 61
         Statistics.audioLevelsEnabled = !options.disableAudioLevels;
62 62
 
63
+        if(typeof options.audioLevelsInterval === 'number') {
64
+            Statistics.audioLevelsInterval = options.audioLevelsInterval;
65
+        }
66
+
63 67
         if (options.enableWindowOnErrorHandler) {
64 68
             GlobalOnErrorHandler.addHandler(
65 69
                 this.getGlobalOnErrorHandler.bind(this));

+ 4
- 6
modules/statistics/statistics.js Datei anzeigen

@@ -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
 };

Laden…
Abbrechen
Speichern