Преглед изворни кода

Coding style

Reduce the source code by replacing this.options.config with config.
dev1
Lyubo Marinov пре 8 година
родитељ
комит
a22cf0979f
1 измењених фајлова са 13 додато и 14 уклоњено
  1. 13
    14
      JitsiConference.js

+ 13
- 14
JitsiConference.js Прегледај датотеку

204
         this.eventManager.setupXMPPListeners();
204
         this.eventManager.setupXMPPListeners();
205
     }
205
     }
206
 
206
 
207
-    this.room = this.xmpp.createRoom(this.options.name, this.options.config);
207
+    const { config } = this.options;
208
+
209
+    this.room = this.xmpp.createRoom(this.options.name, config);
208
 
210
 
209
     // Connection interrupted/restored listeners
211
     // Connection interrupted/restored listeners
210
     this._onIceConnectionInterrupted
212
     this._onIceConnectionInterrupted
236
                 // as an entry point through config for tuning up purposes.
238
                 // as an entry point through config for tuning up purposes.
237
                 // Default values should be adjusted as soon as optimal values
239
                 // Default values should be adjusted as soon as optimal values
238
                 // are discovered.
240
                 // are discovered.
239
-                rtcMuteTimeout:
240
-                    this.options.config._peerConnStatusRtcMuteTimeout,
241
-                outOfLastNTimeout:
242
-                    this.options.config._peerConnStatusOutOfLastNTimeout
241
+                rtcMuteTimeout: config._peerConnStatusRtcMuteTimeout,
242
+                outOfLastNTimeout: config._peerConnStatusOutOfLastNTimeout
243
             });
243
             });
244
     this.participantConnectionStatus.init();
244
     this.participantConnectionStatus.init();
245
 
245
 
246
     if (!this.statistics) {
246
     if (!this.statistics) {
247
         this.statistics = new Statistics(this.xmpp, {
247
         this.statistics = new Statistics(this.xmpp, {
248
-            callStatsID: this.options.config.callStatsID,
249
-            callStatsSecret: this.options.config.callStatsSecret,
248
+            callStatsAliasName: this.myUserId(),
250
             callStatsConfIDNamespace:
249
             callStatsConfIDNamespace:
251
-                this.options.config.callStatsConfIDNamespace
250
+                config.callStatsConfIDNamespace
252
                     || window.location.hostname,
251
                     || window.location.hostname,
253
-            callStatsCustomScriptUrl:
254
-                this.options.config.callStatsCustomScriptUrl,
255
-            callStatsAliasName: this.myUserId(),
252
+            callStatsCustomScriptUrl: config.callStatsCustomScriptUrl,
253
+            callStatsID: config.callStatsID,
254
+            callStatsSecret: config.callStatsSecret,
256
             roomName: this.options.name
255
             roomName: this.options.name
257
         });
256
         });
258
     }
257
     }
263
     // listeners are removed from statistics module.
262
     // listeners are removed from statistics module.
264
     this.eventManager.setupStatisticsListeners();
263
     this.eventManager.setupStatisticsListeners();
265
 
264
 
266
-    if (this.options.config.enableTalkWhileMuted) {
265
+    if (config.enableTalkWhileMuted) {
267
         // eslint-disable-next-line no-new
266
         // eslint-disable-next-line no-new
268
         new TalkMutedDetection(
267
         new TalkMutedDetection(
269
             this,
268
             this,
271
                 this.eventEmitter.emit(JitsiConferenceEvents.TALK_WHILE_MUTED));
270
                 this.eventEmitter.emit(JitsiConferenceEvents.TALK_WHILE_MUTED));
272
     }
271
     }
273
 
272
 
274
-    if ('channelLastN' in options.config) {
275
-        this.setLastN(options.config.channelLastN);
273
+    if ('channelLastN' in config) {
274
+        this.setLastN(config.channelLastN);
276
     }
275
     }
277
 
276
 
278
     /**
277
     /**

Loading…
Откажи
Сачувај