瀏覽代碼

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,7 +204,9 @@ JitsiConference.prototype._init = function(options = {}) {
204 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 211
     // Connection interrupted/restored listeners
210 212
     this._onIceConnectionInterrupted
@@ -236,23 +238,20 @@ JitsiConference.prototype._init = function(options = {}) {
236 238
                 // as an entry point through config for tuning up purposes.
237 239
                 // Default values should be adjusted as soon as optimal values
238 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 244
     this.participantConnectionStatus.init();
245 245
 
246 246
     if (!this.statistics) {
247 247
         this.statistics = new Statistics(this.xmpp, {
248
-            callStatsID: this.options.config.callStatsID,
249
-            callStatsSecret: this.options.config.callStatsSecret,
248
+            callStatsAliasName: this.myUserId(),
250 249
             callStatsConfIDNamespace:
251
-                this.options.config.callStatsConfIDNamespace
250
+                config.callStatsConfIDNamespace
252 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 255
             roomName: this.options.name
257 256
         });
258 257
     }
@@ -263,7 +262,7 @@ JitsiConference.prototype._init = function(options = {}) {
263 262
     // listeners are removed from statistics module.
264 263
     this.eventManager.setupStatisticsListeners();
265 264
 
266
-    if (this.options.config.enableTalkWhileMuted) {
265
+    if (config.enableTalkWhileMuted) {
267 266
         // eslint-disable-next-line no-new
268 267
         new TalkMutedDetection(
269 268
             this,
@@ -271,8 +270,8 @@ JitsiConference.prototype._init = function(options = {}) {
271 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…
取消
儲存