Browse Source

[eslint] object-shorthand

dev1
Lyubo Marinov 8 years ago
parent
commit
596767d57e

+ 5
- 0
.eslintrc.js View File

52
             { 'nestedBinaryExpressions': false }
52
             { 'nestedBinaryExpressions': false }
53
         ],
53
         ],
54
 
54
 
55
+        'object-shorthand': [
56
+            'error',
57
+            'always',
58
+            { 'avoidQuotes': true }
59
+        ],
55
         'prefer-const': 2,
60
         'prefer-const': 2,
56
         'prefer-reflect': 0,
61
         'prefer-reflect': 0,
57
         'prefer-spread': 2,
62
         'prefer-spread': 2,

+ 1
- 1
JitsiConference.js View File

1387
  * Sets a property for the local participant.
1387
  * Sets a property for the local participant.
1388
  */
1388
  */
1389
 JitsiConference.prototype.setLocalParticipantProperty = function(name, value) {
1389
 JitsiConference.prototype.setLocalParticipantProperty = function(name, value) {
1390
-    this.sendCommand("jitsi_participant_" + name, {value: value});
1390
+    this.sendCommand("jitsi_participant_" + name, {value});
1391
 };
1391
 };
1392
 
1392
 
1393
 /**
1393
 /**

+ 3
- 3
JitsiConferenceEventManager.js View File

75
             for (key in chatRoom.connectionTimes){
75
             for (key in chatRoom.connectionTimes){
76
                 value = chatRoom.connectionTimes[key];
76
                 value = chatRoom.connectionTimes[key];
77
                 Statistics.analytics.sendEvent('conference.' + key,
77
                 Statistics.analytics.sendEvent('conference.' + key,
78
-                    {value: value});
78
+                    {value});
79
             }
79
             }
80
             for (key in chatRoom.xmpp.connectionTimes){
80
             for (key in chatRoom.xmpp.connectionTimes){
81
                 value = chatRoom.xmpp.connectionTimes[key];
81
                 value = chatRoom.xmpp.connectionTimes[key];
82
                 Statistics.analytics.sendEvent('xmpp.' + key,
82
                 Statistics.analytics.sendEvent('xmpp.' + key,
83
-                    {value: value});
83
+                    {value});
84
             }
84
             }
85
     });
85
     });
86
 
86
 
233
                 function (status, error) {
233
                 function (status, error) {
234
                     var logObject = {
234
                     var logObject = {
235
                         id: "recorder_status",
235
                         id: "recorder_status",
236
-                        status: status
236
+                        status
237
                     };
237
                     };
238
                     if (error) {
238
                     if (error) {
239
                         logObject.error = error;
239
                         logObject.error = error;

+ 2
- 2
JitsiConnection.js View File

33
                 Statistics.analytics.sendEvent(
33
                 Statistics.analytics.sendEvent(
34
                     'connection.disconnected.' + msg);
34
                     'connection.disconnected.' + msg);
35
             Statistics.sendLog(
35
             Statistics.sendLog(
36
-                JSON.stringify({id: "connection.disconnected", msg: msg}));
36
+                JSON.stringify({id: "connection.disconnected", msg}));
37
         });
37
         });
38
 }
38
 }
39
 
39
 
90
  * @returns {JitsiConference} returns the new conference object.
90
  * @returns {JitsiConference} returns the new conference object.
91
  */
91
  */
92
 JitsiConnection.prototype.initJitsiConference = function (name, options) {
92
 JitsiConnection.prototype.initJitsiConference = function (name, options) {
93
-    return new JitsiConference({name: name, config: options, connection: this});
93
+    return new JitsiConference({name, config: options, connection: this});
94
 };
94
 };
95
 
95
 
96
 /**
96
 /**

+ 9
- 9
JitsiMediaDevices.js View File

41
      * Executes callback with list of media devices connected.
41
      * Executes callback with list of media devices connected.
42
      * @param {function} callback
42
      * @param {function} callback
43
      */
43
      */
44
-    enumerateDevices: function (callback) {
44
+    enumerateDevices (callback) {
45
         RTC.enumerateDevices(callback);
45
         RTC.enumerateDevices(callback);
46
     },
46
     },
47
     /**
47
     /**
50
      * the WebRTC stack is ready, either with true if the device listing is
50
      * the WebRTC stack is ready, either with true if the device listing is
51
      * available available or with false otherwise.
51
      * available available or with false otherwise.
52
      */
52
      */
53
-    isDeviceListAvailable: function () {
53
+    isDeviceListAvailable () {
54
         return RTC.isDeviceListAvailable();
54
         return RTC.isDeviceListAvailable();
55
     },
55
     },
56
     /**
56
     /**
60
      *      undefined or 'input', 'output' - for audio output device change.
60
      *      undefined or 'input', 'output' - for audio output device change.
61
      * @returns {boolean} true if available, false otherwise.
61
      * @returns {boolean} true if available, false otherwise.
62
      */
62
      */
63
-    isDeviceChangeAvailable: function (deviceType) {
63
+    isDeviceChangeAvailable (deviceType) {
64
         return RTC.isDeviceChangeAvailable(deviceType);
64
         return RTC.isDeviceChangeAvailable(deviceType);
65
     },
65
     },
66
     /**
66
     /**
69
      *      undefined stands for both 'audio' and 'video' together
69
      *      undefined stands for both 'audio' and 'video' together
70
      * @returns {boolean}
70
      * @returns {boolean}
71
      */
71
      */
72
-    isDevicePermissionGranted: function (type) {
72
+    isDevicePermissionGranted (type) {
73
         var permissions = RTC.getDeviceAvailability();
73
         var permissions = RTC.getDeviceAvailability();
74
 
74
 
75
         switch(type) {
75
         switch(type) {
86
      * for default device
86
      * for default device
87
      * @returns {string}
87
      * @returns {string}
88
      */
88
      */
89
-    getAudioOutputDevice: function () {
89
+    getAudioOutputDevice () {
90
         return RTC.getAudioOutputDevice();
90
         return RTC.getAudioOutputDevice();
91
     },
91
     },
92
     /**
92
     /**
97
      * @returns {Promise} - resolves when audio output is changed, is rejected
97
      * @returns {Promise} - resolves when audio output is changed, is rejected
98
      *      otherwise
98
      *      otherwise
99
      */
99
      */
100
-    setAudioOutputDevice: function (deviceId) {
100
+    setAudioOutputDevice (deviceId) {
101
 
101
 
102
         var availableDevices = RTC.getCurrentlyAvailableMediaDevices();
102
         var availableDevices = RTC.getCurrentlyAvailableMediaDevices();
103
         if (availableDevices && availableDevices.length > 0)
103
         if (availableDevices && availableDevices.length > 0)
115
      * @param {string} event - event name
115
      * @param {string} event - event name
116
      * @param {function} handler - event handler
116
      * @param {function} handler - event handler
117
      */
117
      */
118
-    addEventListener: function (event, handler) {
118
+    addEventListener (event, handler) {
119
         eventEmitter.addListener(event, handler);
119
         eventEmitter.addListener(event, handler);
120
     },
120
     },
121
     /**
121
     /**
123
      * @param {string} event - event name
123
      * @param {string} event - event name
124
      * @param {function} handler - event handler
124
      * @param {function} handler - event handler
125
      */
125
      */
126
-    removeEventListener: function (event, handler) {
126
+    removeEventListener (event, handler) {
127
         eventEmitter.removeListener(event, handler);
127
         eventEmitter.removeListener(event, handler);
128
     },
128
     },
129
     /**
129
     /**
130
      * Emits an event.
130
      * Emits an event.
131
      * @param {string} event - event name
131
      * @param {string} event - event name
132
      */
132
      */
133
-    emitEvent: function (event) { // eslint-disable-line no-unused-vars
133
+    emitEvent (event) { // eslint-disable-line no-unused-vars
134
         eventEmitter.emit(...arguments);
134
         eventEmitter.emit(...arguments);
135
     }
135
     }
136
 };
136
 };

+ 17
- 17
JitsiMeetJS.js View File

76
 
76
 
77
     version: '{#COMMIT_HASH#}',
77
     version: '{#COMMIT_HASH#}',
78
 
78
 
79
-    JitsiConnection: JitsiConnection,
79
+    JitsiConnection,
80
     events: {
80
     events: {
81
         conference: JitsiConferenceEvents,
81
         conference: JitsiConferenceEvents,
82
         connection: JitsiConnectionEvents,
82
         connection: JitsiConnectionEvents,
91
         track: JitsiTrackErrors
91
         track: JitsiTrackErrors
92
     },
92
     },
93
     errorTypes: {
93
     errorTypes: {
94
-        JitsiTrackError: JitsiTrackError
94
+        JitsiTrackError
95
     },
95
     },
96
     logLevels: Logger.levels,
96
     logLevels: Logger.levels,
97
     mediaDevices: JitsiMediaDevices,
97
     mediaDevices: JitsiMediaDevices,
98
     analytics: null,
98
     analytics: null,
99
-    init: function (options) {
99
+    init (options) {
100
         let logObject, attr;
100
         let logObject, attr;
101
         Statistics.init(options);
101
         Statistics.init(options);
102
 
102
 
139
      * Returns whether the desktop sharing is enabled or not.
139
      * Returns whether the desktop sharing is enabled or not.
140
      * @returns {boolean}
140
      * @returns {boolean}
141
      */
141
      */
142
-    isDesktopSharingEnabled: function () {
142
+    isDesktopSharingEnabled () {
143
         return RTC.isDesktopSharingEnabled();
143
         return RTC.isDesktopSharingEnabled();
144
     },
144
     },
145
-    setLogLevel: function (level) {
145
+    setLogLevel (level) {
146
         Logger.setLogLevel(level);
146
         Logger.setLogLevel(level);
147
     },
147
     },
148
     /**
148
     /**
152
      * Usually it's the name of the JavaScript source file including the path
152
      * Usually it's the name of the JavaScript source file including the path
153
      * ex. "modules/xmpp/ChatRoom.js"
153
      * ex. "modules/xmpp/ChatRoom.js"
154
      */
154
      */
155
-    setLogLevelById: function (level, id) {
155
+    setLogLevelById (level, id) {
156
         Logger.setLogLevelById(level, id);
156
         Logger.setLogLevelById(level, id);
157
     },
157
     },
158
     /**
158
     /**
160
      * @param globalTransport
160
      * @param globalTransport
161
      * @see Logger.addGlobalTransport
161
      * @see Logger.addGlobalTransport
162
      */
162
      */
163
-    addGlobalLogTransport: function (globalTransport) {
163
+    addGlobalLogTransport (globalTransport) {
164
         Logger.addGlobalTransport(globalTransport);
164
         Logger.addGlobalTransport(globalTransport);
165
     },
165
     },
166
     /**
166
     /**
168
      * @param globalTransport
168
      * @param globalTransport
169
      * @see Logger.removeGlobalTransport
169
      * @see Logger.removeGlobalTransport
170
      */
170
      */
171
-    removeGlobalLogTransport: function (globalTransport) {
171
+    removeGlobalLogTransport (globalTransport) {
172
         Logger.removeGlobalTransport(globalTransport);
172
         Logger.removeGlobalTransport(globalTransport);
173
     },
173
     },
174
     /**
174
     /**
210
      *     A promise that returns an array of created JitsiTracks if resolved,
210
      *     A promise that returns an array of created JitsiTracks if resolved,
211
      *     or a JitsiConferenceError if rejected.
211
      *     or a JitsiConferenceError if rejected.
212
      */
212
      */
213
-    createLocalTracks: function (options, firePermissionPromptIsShownEvent) {
213
+    createLocalTracks (options, firePermissionPromptIsShownEvent) {
214
         var promiseFulfilled = false;
214
         var promiseFulfilled = false;
215
 
215
 
216
         if (firePermissionPromptIsShownEvent === true) {
216
         if (firePermissionPromptIsShownEvent === true) {
329
      * available available or with false otherwise.
329
      * available available or with false otherwise.
330
      * @deprecated use JitsiMeetJS.mediaDevices.isDeviceListAvailable instead
330
      * @deprecated use JitsiMeetJS.mediaDevices.isDeviceListAvailable instead
331
      */
331
      */
332
-    isDeviceListAvailable: function () {
332
+    isDeviceListAvailable () {
333
         logger.warn('This method is deprecated, use ' +
333
         logger.warn('This method is deprecated, use ' +
334
             'JitsiMeetJS.mediaDevices.isDeviceListAvailable instead');
334
             'JitsiMeetJS.mediaDevices.isDeviceListAvailable instead');
335
         return this.mediaDevices.isDeviceListAvailable();
335
         return this.mediaDevices.isDeviceListAvailable();
342
      * @returns {boolean} true if available, false otherwise.
342
      * @returns {boolean} true if available, false otherwise.
343
      * @deprecated use JitsiMeetJS.mediaDevices.isDeviceChangeAvailable instead
343
      * @deprecated use JitsiMeetJS.mediaDevices.isDeviceChangeAvailable instead
344
      */
344
      */
345
-    isDeviceChangeAvailable: function (deviceType) {
345
+    isDeviceChangeAvailable (deviceType) {
346
         logger.warn('This method is deprecated, use ' +
346
         logger.warn('This method is deprecated, use ' +
347
             'JitsiMeetJS.mediaDevices.isDeviceChangeAvailable instead');
347
             'JitsiMeetJS.mediaDevices.isDeviceChangeAvailable instead');
348
         return this.mediaDevices.isDeviceChangeAvailable(deviceType);
348
         return this.mediaDevices.isDeviceChangeAvailable(deviceType);
352
      * @param {function} callback
352
      * @param {function} callback
353
      * @deprecated use JitsiMeetJS.mediaDevices.enumerateDevices instead
353
      * @deprecated use JitsiMeetJS.mediaDevices.enumerateDevices instead
354
      */
354
      */
355
-    enumerateDevices: function (callback) {
355
+    enumerateDevices (callback) {
356
         logger.warn('This method is deprecated, use ' +
356
         logger.warn('This method is deprecated, use ' +
357
             'JitsiMeetJS.mediaDevices.enumerateDevices instead');
357
             'JitsiMeetJS.mediaDevices.enumerateDevices instead');
358
         this.mediaDevices.enumerateDevices(callback);
358
         this.mediaDevices.enumerateDevices(callback);
363
      * the function used by the lib.
363
      * the function used by the lib.
364
      * (function(message, source, lineno, colno, error)).
364
      * (function(message, source, lineno, colno, error)).
365
      */
365
      */
366
-    getGlobalOnErrorHandler: function (message, source, lineno, colno, error) {
366
+    getGlobalOnErrorHandler (message, source, lineno, colno, error) {
367
         logger.error(
367
         logger.error(
368
             'UnhandledError: ' + message,
368
             'UnhandledError: ' + message,
369
             'Script: ' + source,
369
             'Script: ' + source,
377
      * Returns current machine id saved from the local storage.
377
      * Returns current machine id saved from the local storage.
378
      * @returns {string} the machine id
378
      * @returns {string} the machine id
379
      */
379
      */
380
-    getMachineId: function() {
380
+    getMachineId() {
381
         return Settings.getMachineId();
381
         return Settings.getMachineId();
382
     },
382
     },
383
 
383
 
386
      * interest to LibJitsiMeet clients.
386
      * interest to LibJitsiMeet clients.
387
      */
387
      */
388
     util: {
388
     util: {
389
-        ScriptUtil: ScriptUtil,
390
-        RTCUIHelper: RTCUIHelper,
391
-        AuthUtil: AuthUtil
389
+        ScriptUtil,
390
+        RTCUIHelper,
391
+        AuthUtil
392
     }
392
     }
393
 };
393
 };
394
 
394
 

+ 1
- 1
modules/RTC/DataChannels.js View File

278
 DataChannels.prototype.sendDataChannelMessage = function (to, payload) {
278
 DataChannels.prototype.sendDataChannelMessage = function (to, payload) {
279
     this.send({
279
     this.send({
280
         colibriClass: "EndpointMessage",
280
         colibriClass: "EndpointMessage",
281
-        to: to,
281
+        to,
282
         msgPayload: payload
282
         msgPayload: payload
283
     });
283
     });
284
 };
284
 };

+ 4
- 4
modules/RTC/RTCUIHelper.js View File

10
      * currently using.
10
      * currently using.
11
      * @returns {string} 'video' or 'object' string name of WebRTC video element
11
      * @returns {string} 'video' or 'object' string name of WebRTC video element
12
      */
12
      */
13
-    getVideoElementName: function () {
13
+    getVideoElementName () {
14
         return RTCBrowserType.isTemasysPluginUsed() ? 'object' : 'video';
14
         return RTCBrowserType.isTemasysPluginUsed() ? 'object' : 'video';
15
     },
15
     },
16
 
16
 
21
      * @returns {HTMLElement} video HTML element instance if found inside of the
21
      * @returns {HTMLElement} video HTML element instance if found inside of the
22
      *          container or undefined otherwise.
22
      *          container or undefined otherwise.
23
      */
23
      */
24
-    findVideoElement: function (containerElement) {
24
+    findVideoElement (containerElement) {
25
         var videoElemName = RTCUIHelper.getVideoElementName();
25
         var videoElemName = RTCUIHelper.getVideoElementName();
26
         if (!RTCBrowserType.isTemasysPluginUsed()) {
26
         if (!RTCBrowserType.isTemasysPluginUsed()) {
27
             return $(containerElement).find(videoElemName)[0];
27
             return $(containerElement).find(videoElemName)[0];
45
      * @param streamElement HTML element to which the RTC stream is attached to.
45
      * @param streamElement HTML element to which the RTC stream is attached to.
46
      * @param volume the volume value to be set.
46
      * @param volume the volume value to be set.
47
      */
47
      */
48
-    setVolume: function (streamElement, volume) {
48
+    setVolume (streamElement, volume) {
49
         if (!RTCBrowserType.isIExplorer()) {
49
         if (!RTCBrowserType.isIExplorer()) {
50
             streamElement.volume = volume;
50
             streamElement.volume = volume;
51
         }
51
         }
56
      * @param streamElement HTML element to which the RTC stream is attached to.
56
      * @param streamElement HTML element to which the RTC stream is attached to.
57
      * @param autoPlay 'true' or 'false'
57
      * @param autoPlay 'true' or 'false'
58
      */
58
      */
59
-    setAutoPlay: function (streamElement, autoPlay) {
59
+    setAutoPlay (streamElement, autoPlay) {
60
         if (!RTCBrowserType.isIExplorer()) {
60
         if (!RTCBrowserType.isIExplorer()) {
61
             streamElement.autoplay = autoPlay;
61
             streamElement.autoplay = autoPlay;
62
         }
62
         }

+ 5
- 5
modules/RTC/RTCUtils.js View File

177
                 constraints.video.facingMode = facingMode;
177
                 constraints.video.facingMode = facingMode;
178
             }
178
             }
179
             constraints.video.optional.push({
179
             constraints.video.optional.push({
180
-                facingMode: facingMode
180
+                facingMode
181
             });
181
             });
182
         }
182
         }
183
 
183
 
639
             track: videoStream.getVideoTracks()[0],
639
             track: videoStream.getVideoTracks()[0],
640
             mediaType: MediaType.VIDEO,
640
             mediaType: MediaType.VIDEO,
641
             videoType: VideoType.CAMERA,
641
             videoType: VideoType.CAMERA,
642
-            resolution: resolution
642
+            resolution
643
         });
643
         });
644
     }
644
     }
645
 
645
 
1034
                 obtainDevices({
1034
                 obtainDevices({
1035
                     devices: options.devices,
1035
                     devices: options.devices,
1036
                     streams: [],
1036
                     streams: [],
1037
-                    successCallback: successCallback,
1037
+                    successCallback,
1038
                     errorCallback: reject,
1038
                     errorCallback: reject,
1039
-                    deviceGUM: deviceGUM
1039
+                    deviceGUM
1040
                 });
1040
                 });
1041
             } else {
1041
             } else {
1042
                 var hasDesktop = options.devices.indexOf('desktop') > -1;
1042
                 var hasDesktop = options.devices.indexOf('desktop') > -1;
1109
                                     dsOptions,
1109
                                     dsOptions,
1110
                                     function (desktopStream) {
1110
                                     function (desktopStream) {
1111
                                         successCallback({audioVideo: stream,
1111
                                         successCallback({audioVideo: stream,
1112
-                                            desktopStream: desktopStream});
1112
+                                            desktopStream});
1113
                                     }, function (error) {
1113
                                     }, function (error) {
1114
                                         self.stopMediaStream(stream);
1114
                                         self.stopMediaStream(stream);
1115
 
1115
 

+ 4
- 4
modules/RTC/TraceablePeerConnection.js View File

563
 };
563
 };
564
 
564
 
565
 var getters = {
565
 var getters = {
566
-    signalingState: function () {
566
+    signalingState () {
567
         return this.peerconnection.signalingState;
567
         return this.peerconnection.signalingState;
568
     },
568
     },
569
-    iceConnectionState: function () {
569
+    iceConnectionState () {
570
         return this.peerconnection.iceConnectionState;
570
         return this.peerconnection.iceConnectionState;
571
     },
571
     },
572
-    localDescription:  function() {
572
+    localDescription() {
573
         var desc = this.peerconnection.localDescription;
573
         var desc = this.peerconnection.localDescription;
574
 
574
 
575
         this.trace('getLocalDescription::preTransform', dumpSDP(desc));
575
         this.trace('getLocalDescription::preTransform', dumpSDP(desc));
582
         }
582
         }
583
         return desc;
583
         return desc;
584
     },
584
     },
585
-    remoteDescription:  function() {
585
+    remoteDescription() {
586
         var desc = this.peerconnection.remoteDescription;
586
         var desc = this.peerconnection.remoteDescription;
587
         this.trace('getRemoteDescription::preTransform', dumpSDP(desc));
587
         this.trace('getRemoteDescription::preTransform', dumpSDP(desc));
588
 
588
 

+ 2
- 2
modules/statistics/AnalyticsAdapter.js View File

24
      */
24
      */
25
     sendEvent(action, data = {}) {
25
     sendEvent(action, data = {}) {
26
         this.eventCache.push({
26
         this.eventCache.push({
27
-            action: action,
28
-            data: data
27
+            action,
28
+            data
29
         });
29
         });
30
     }
30
     }
31
 
31
 

+ 2
- 2
modules/statistics/CallStats.js View File

357
     } else {
357
     } else {
358
         CallStats.reportsQueue.push({
358
         CallStats.reportsQueue.push({
359
                 type: reportType.EVENT,
359
                 type: reportType.EVENT,
360
-                data: {event: event, eventData: eventData}
360
+                data: {event, eventData}
361
             });
361
             });
362
         CallStats._checkInitialize();
362
         CallStats._checkInitialize();
363
     }
363
     }
422
     } else {
422
     } else {
423
         CallStats.reportsQueue.push({
423
         CallStats.reportsQueue.push({
424
             type: reportType.ERROR,
424
             type: reportType.ERROR,
425
-            data: { type: type, error: e, pc: pc}
425
+            data: { type, error: e, pc}
426
         });
426
         });
427
         CallStats._checkInitialize();
427
         CallStats._checkInitialize();
428
     }
428
     }

+ 2
- 2
modules/statistics/RTPStatsCollector.js View File

423
                         t.ip == ip && t.type == type && t.localip == localip
423
                         t.ip == ip && t.type == type && t.localip == localip
424
                     );})) {
424
                     );})) {
425
                 conferenceStatsTransport.push(
425
                 conferenceStatsTransport.push(
426
-                    {ip: ip, type: type, localip: localip});
426
+                    {ip, type, localip});
427
             }
427
             }
428
             continue;
428
             continue;
429
         }
429
         }
481
         ssrcStats.setLoss({
481
         ssrcStats.setLoss({
482
             packetsTotal: packetsDiff + packetsLostDiff,
482
             packetsTotal: packetsDiff + packetsLostDiff,
483
             packetsLost: packetsLostDiff,
483
             packetsLost: packetsLostDiff,
484
-            isDownloadStream: isDownloadStream
484
+            isDownloadStream
485
         });
485
         });
486
 
486
 
487
         var bytesReceivedNow = getNonNegativeStat(now, 'bytesReceived');
487
         var bytesReceivedNow = getNonNegativeStat(now, 'bytesReceived');

+ 1
- 1
modules/statistics/statistics.js View File

421
     if(this.callstats)
421
     if(this.callstats)
422
         this.callstats.sendFeedback(overall, detailed);
422
         this.callstats.sendFeedback(overall, detailed);
423
     Statistics.analytics.sendEvent("feedback.rating",
423
     Statistics.analytics.sendEvent("feedback.rating",
424
-        {value: overall, detailed: detailed});
424
+        {value: overall, detailed});
425
 };
425
 };
426
 
426
 
427
 Statistics.LOCAL_JID = require("../../service/statistics/constants").LOCAL_JID;
427
 Statistics.LOCAL_JID = require("../../service/statistics/constants").LOCAL_JID;

+ 1
- 1
modules/transcription/transcriberHolder.js View File

8
 var transcriberHolder = {
8
 var transcriberHolder = {
9
     transcribers : [],
9
     transcribers : [],
10
 
10
 
11
-    add : function(transcriber){
11
+    add(transcriber){
12
         transcriberHolder.transcribers.push(transcriber);
12
         transcriberHolder.transcribers.push(transcriber);
13
     }
13
     }
14
 };
14
 };

+ 1
- 1
modules/util/AuthUtil.js View File

20
      * <tt>null</tt> if 'urlPattern' is not a string and the URL can not be
20
      * <tt>null</tt> if 'urlPattern' is not a string and the URL can not be
21
      * constructed.
21
      * constructed.
22
      */
22
      */
23
-    getTokenAuthUrl: function (urlPattern, roomName, roleUpgrade) {
23
+    getTokenAuthUrl (urlPattern, roomName, roleUpgrade) {
24
         var url = urlPattern;
24
         var url = urlPattern;
25
         if (typeof url !== "string") {
25
         if (typeof url !== "string") {
26
             return null;
26
             return null;

+ 3
- 3
modules/util/GlobalOnErrorHandler.js View File

51
      * Adds new error handlers.
51
      * Adds new error handlers.
52
      * @param handler the new handler.
52
      * @param handler the new handler.
53
      */
53
      */
54
-    addHandler: function (handler) {
54
+    addHandler (handler) {
55
         handlers.push(handler);
55
         handlers.push(handler);
56
     },
56
     },
57
     /**
57
     /**
58
      * Calls the global error handler if there is one.
58
      * Calls the global error handler if there is one.
59
      * @param error the error to pass to the error handler
59
      * @param error the error to pass to the error handler
60
      */
60
      */
61
-    callErrorHandler: function (error) {
61
+    callErrorHandler (error) {
62
         var errHandler = window.onerror;
62
         var errHandler = window.onerror;
63
         if(!errHandler)
63
         if(!errHandler)
64
             return;
64
             return;
68
      * Calls the global rejection handler if there is one.
68
      * Calls the global rejection handler if there is one.
69
      * @param error the error to pass to the rejection handler.
69
      * @param error the error to pass to the rejection handler.
70
      */
70
      */
71
-    callUnhandledRejectionHandler: function (error) {
71
+    callUnhandledRejectionHandler (error) {
72
         var errHandler = window.onunhandledrejection;
72
         var errHandler = window.onunhandledrejection;
73
         if(!errHandler)
73
         if(!errHandler)
74
             return;
74
             return;

+ 5
- 5
modules/util/RandomUtil.js View File

52
      * Returns a random hex digit.
52
      * Returns a random hex digit.
53
      * @returns {*}
53
      * @returns {*}
54
      */
54
      */
55
-    randomHexDigit: function() {
55
+    randomHexDigit() {
56
         return randomElement(HEX_DIGITS);
56
         return randomElement(HEX_DIGITS);
57
     },
57
     },
58
     /**
58
     /**
59
      * Returns a random string of hex digits with length 'len'.
59
      * Returns a random string of hex digits with length 'len'.
60
      * @param len the length.
60
      * @param len the length.
61
      */
61
      */
62
-    randomHexString: function (len) {
62
+    randomHexString (len) {
63
         var ret = '';
63
         var ret = '';
64
         while (len--) {
64
         while (len--) {
65
             ret += this.randomHexDigit();
65
             ret += this.randomHexDigit();
66
         }
66
         }
67
         return ret;
67
         return ret;
68
     },
68
     },
69
-    randomElement: randomElement,
70
-    randomAlphanumStr: randomAlphanumStr,
71
-    randomInt: randomInt
69
+    randomElement,
70
+    randomAlphanumStr,
71
+    randomInt
72
 };
72
 };
73
 
73
 
74
 module.exports = RandomUtil;
74
 module.exports = RandomUtil;

+ 1
- 1
modules/util/ScriptUtil.js View File

21
      * @param loadCallback on load callback function
21
      * @param loadCallback on load callback function
22
      * @param errorCallback callback to be called on error loading the script
22
      * @param errorCallback callback to be called on error loading the script
23
      */
23
      */
24
-    loadScript: function (src, async, prepend, relativeURL,
24
+    loadScript (src, async, prepend, relativeURL,
25
                           loadCallback, errorCallback) {
25
                           loadCallback, errorCallback) {
26
         var d = document;
26
         var d = document;
27
         var tagName = 'script';
27
         var tagName = 'script';

+ 1
- 1
modules/util/UsernameGenerator.js View File

425
 }
425
 }
426
 
426
 
427
 module.exports = {
427
 module.exports = {
428
-  generateUsername: generateUsername
428
+  generateUsername
429
 };
429
 };

+ 1
- 1
modules/version/ComponentsVersions.js View File

69
             log.push({
69
             log.push({
70
                 id: "component_version",
70
                 id: "component_version",
71
                 component: componentName,
71
                 component: componentName,
72
-                version: version});
72
+                version});
73
         }
73
         }
74
     }.bind(this));
74
     }.bind(this));
75
 
75
 

+ 5
- 5
modules/xmpp/ChatRoom.js View File

10
 const logger = getLogger(__filename);
10
 const logger = getLogger(__filename);
11
 
11
 
12
 var parser = {
12
 var parser = {
13
-    packet2JSON: function (packet, nodes) {
13
+    packet2JSON (packet, nodes) {
14
         var self = this;
14
         var self = this;
15
         $(packet).children().each(function () {
15
         $(packet).children().each(function () {
16
             var tagName = $(this).prop("tagName");
16
             var tagName = $(this).prop("tagName");
17
             const node = {
17
             const node = {
18
-                tagName: tagName
18
+                tagName
19
             };
19
             };
20
             node.attributes = {};
20
             node.attributes = {};
21
             $($(this)[0].attributes).each(function( index, attr ) {
21
             $($(this)[0].attributes).each(function( index, attr ) {
30
             self.packet2JSON($(this), node.children);
30
             self.packet2JSON($(this), node.children);
31
         });
31
         });
32
     },
32
     },
33
-    json2packet: function (nodes, packet) {
33
+    json2packet (nodes, packet) {
34
         for(let i = 0; i < nodes.length; i++) {
34
         for(let i = 0; i < nodes.length; i++) {
35
             const node = nodes[i];
35
             const node = nodes[i];
36
             if(!node || node === null){
36
             if(!node || node === null){
135
             return;
135
             return;
136
         }
136
         }
137
 
137
 
138
-        var pres = $pres({to: to });
138
+        var pres = $pres({to });
139
 
139
 
140
         // xep-0045 defines: "including in the initial presence stanza an empty
140
         // xep-0045 defines: "including in the initial presence stanza an empty
141
         // <x/> element qualified by the 'http://jabber.org/protocol/muc' namespace"
141
         // <x/> element qualified by the 'http://jabber.org/protocol/muc' namespace"
864
             {to: this.focusMucJid, type: 'set'})
864
             {to: this.focusMucJid, type: 'set'})
865
             .c('mute', {
865
             .c('mute', {
866
                 xmlns: 'http://jitsi.org/jitmeet/audio',
866
                 xmlns: 'http://jitsi.org/jitmeet/audio',
867
-                jid: jid
867
+                jid
868
             })
868
             })
869
             .t(mute.toString())
869
             .t(mute.toString())
870
             .up();
870
             .up();

+ 2
- 2
modules/xmpp/RtxModifier.js View File

162
                 videoMLine,
162
                 videoMLine,
163
                 {
163
                 {
164
                     id: ssrc,
164
                     id: ssrc,
165
-                    cname: cname,
166
-                    msid: msid
165
+                    cname,
166
+                    msid
167
                 },
167
                 },
168
                 correspondingRtxSsrc);
168
                 correspondingRtxSsrc);
169
         }
169
         }

+ 11
- 11
modules/xmpp/SDP.js View File

50
         tmp = SDPUtil.find_lines(self.media[mediaindex], 'a=ssrc:');
50
         tmp = SDPUtil.find_lines(self.media[mediaindex], 'a=ssrc:');
51
         var mid = SDPUtil.parse_mid(SDPUtil.find_line(self.media[mediaindex], 'a=mid:'));
51
         var mid = SDPUtil.parse_mid(SDPUtil.find_line(self.media[mediaindex], 'a=mid:'));
52
         var media = {
52
         var media = {
53
-            mediaindex: mediaindex,
54
-            mid: mid,
53
+            mediaindex,
54
+            mid,
55
             ssrcs: {},
55
             ssrcs: {},
56
             ssrcGroups: []
56
             ssrcGroups: []
57
         };
57
         };
74
             var ssrcs = line.substr(14 + semantics.length).split(' ');
74
             var ssrcs = line.substr(14 + semantics.length).split(' ');
75
             if (ssrcs.length) {
75
             if (ssrcs.length) {
76
                 media.ssrcGroups.push({
76
                 media.ssrcGroups.push({
77
-                    semantics: semantics,
78
-                    ssrcs: ssrcs
77
+                    semantics,
78
+                    ssrcs
79
                 });
79
                 });
80
             }
80
             }
81
         });
81
         });
157
         for (i = 0; i < lines.length; i++) {
157
         for (i = 0; i < lines.length; i++) {
158
             tmp = lines[i].split(' ');
158
             tmp = lines[i].split(' ');
159
             var semantics = tmp.shift().substr(8);
159
             var semantics = tmp.shift().substr(8);
160
-            elem.c('group', {xmlns: 'urn:xmpp:jingle:apps:grouping:0', semantics:semantics});
160
+            elem.c('group', {xmlns: 'urn:xmpp:jingle:apps:grouping:0', semantics});
161
             for (j = 0; j < tmp.length; j++) {
161
             for (j = 0; j < tmp.length; j++) {
162
                 elem.c('content', {name: tmp[j]}).up();
162
                 elem.c('content', {name: tmp[j]}).up();
163
             }
163
             }
191
                 {xmlns: 'urn:xmpp:jingle:apps:rtp:1',
191
                 {xmlns: 'urn:xmpp:jingle:apps:rtp:1',
192
                     media: mline.media });
192
                     media: mline.media });
193
             if (ssrc) {
193
             if (ssrc) {
194
-                elem.attrs({ssrc: ssrc});
194
+                elem.attrs({ssrc});
195
             }
195
             }
196
             for (j = 0; j < mline.fmt.length; j++) {
196
             for (j = 0; j < mline.fmt.length; j++) {
197
                 rtpmap = SDPUtil.find_line(this.media[i], 'a=rtpmap:' + mline.fmt[j]);
197
                 rtpmap = SDPUtil.find_line(this.media[i], 'a=rtpmap:' + mline.fmt[j]);
219
 
219
 
220
             if (ssrc) {
220
             if (ssrc) {
221
                 // new style mapping
221
                 // new style mapping
222
-                elem.c('source', { ssrc: ssrc, xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
222
+                elem.c('source', { ssrc, xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
223
                 // FIXME: group by ssrc and support multiple different ssrcs
223
                 // FIXME: group by ssrc and support multiple different ssrcs
224
                 var ssrclines = SDPUtil.find_lines(this.media[i], 'a=ssrc:');
224
                 var ssrclines = SDPUtil.find_lines(this.media[i], 'a=ssrc:');
225
                 if(ssrclines.length > 0) {
225
                 if(ssrclines.length > 0) {
229
                         if (linessrc != ssrc) {
229
                         if (linessrc != ssrc) {
230
                             elem.up();
230
                             elem.up();
231
                             ssrc = linessrc;
231
                             ssrc = linessrc;
232
-                            elem.c('source', { ssrc: ssrc, xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
232
+                            elem.c('source', { ssrc, xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
233
                         }
233
                         }
234
                         var kv = line.substr(idx + 1);
234
                         var kv = line.substr(idx + 1);
235
                         elem.c('parameter');
235
                         elem.c('parameter');
247
                     });
247
                     });
248
                 } else {
248
                 } else {
249
                     elem.up();
249
                     elem.up();
250
-                    elem.c('source', { ssrc: ssrc, xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
250
+                    elem.c('source', { ssrc, xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
251
                     elem.c('parameter');
251
                     elem.c('parameter');
252
                     elem.attrs({name: "cname", value:Math.random().toString(36).substring(7)});
252
                     elem.attrs({name: "cname", value:Math.random().toString(36).substring(7)});
253
                     elem.up();
253
                     elem.up();
282
                     var semantics = line.substr(0, idx).substr(13);
282
                     var semantics = line.substr(0, idx).substr(13);
283
                     var ssrcs = line.substr(14 + semantics.length).split(' ');
283
                     var ssrcs = line.substr(14 + semantics.length).split(' ');
284
                     if (ssrcs.length) {
284
                     if (ssrcs.length) {
285
-                        elem.c('ssrc-group', { semantics: semantics, xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
285
+                        elem.c('ssrc-group', { semantics, xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
286
                         ssrcs.forEach(function(ssrc) {
286
                         ssrcs.forEach(function(ssrc) {
287
-                            elem.c('source', { ssrc: ssrc })
287
+                            elem.c('source', { ssrc })
288
                                 .up();
288
                                 .up();
289
                         });
289
                         });
290
                         elem.up();
290
                         elem.up();

+ 3
- 3
modules/xmpp/SDPDiffer.js View File

133
                     var nv = kv.split(':', 2);
133
                     var nv = kv.split(':', 2);
134
                     var name = nv[0];
134
                     var name = nv[0];
135
                     var value = SDPUtil.filter_special_chars(nv[1]);
135
                     var value = SDPUtil.filter_special_chars(nv[1]);
136
-                    modify.attrs({ name: name });
137
-                    modify.attrs({ value: value });
136
+                    modify.attrs({ name });
137
+                    modify.attrs({ value });
138
                 }
138
                 }
139
                 modify.up(); // end of parameter
139
                 modify.up(); // end of parameter
140
             });
140
             });
151
                 });
151
                 });
152
 
152
 
153
                 ssrcGroup.ssrcs.forEach(function (ssrc) {
153
                 ssrcGroup.ssrcs.forEach(function (ssrc) {
154
-                    modify.c('source', { ssrc: ssrc })
154
+                    modify.c('source', { ssrc })
155
                         .up(); // end of source
155
                         .up(); // end of source
156
                 });
156
                 });
157
                 modify.up(); // end of ssrc-group
157
                 modify.up(); // end of ssrc-group

+ 31
- 31
modules/xmpp/SDPUtil.js View File

4
 var RTCBrowserType = require("../RTC/RTCBrowserType");
4
 var RTCBrowserType = require("../RTC/RTCBrowserType");
5
 
5
 
6
 var SDPUtil = {
6
 var SDPUtil = {
7
-    filter_special_chars: function (text) {
7
+    filter_special_chars (text) {
8
         // XXX Neither one of the falsy values (e.g. null, undefined, false,
8
         // XXX Neither one of the falsy values (e.g. null, undefined, false,
9
         // "", etc.) "contain" special chars.
9
         // "", etc.) "contain" special chars.
10
         return text ? text.replace(/[\\\/\{,\}\+]/g, "") : text;
10
         return text ? text.replace(/[\\\/\{,\}\+]/g, "") : text;
11
     },
11
     },
12
-    iceparams: function (mediadesc, sessiondesc) {
12
+    iceparams (mediadesc, sessiondesc) {
13
         var data = null;
13
         var data = null;
14
         var ufrag, pwd;
14
         var ufrag, pwd;
15
         if ((ufrag = SDPUtil.find_line(mediadesc, 'a=ice-ufrag:', sessiondesc))
15
         if ((ufrag = SDPUtil.find_line(mediadesc, 'a=ice-ufrag:', sessiondesc))
21
         }
21
         }
22
         return data;
22
         return data;
23
     },
23
     },
24
-    parse_iceufrag: function (line) {
24
+    parse_iceufrag (line) {
25
         return line.substring(12);
25
         return line.substring(12);
26
     },
26
     },
27
-    build_iceufrag: function (frag) {
27
+    build_iceufrag (frag) {
28
         return 'a=ice-ufrag:' + frag;
28
         return 'a=ice-ufrag:' + frag;
29
     },
29
     },
30
-    parse_icepwd: function (line) {
30
+    parse_icepwd (line) {
31
         return line.substring(10);
31
         return line.substring(10);
32
     },
32
     },
33
-    build_icepwd: function (pwd) {
33
+    build_icepwd (pwd) {
34
         return 'a=ice-pwd:' + pwd;
34
         return 'a=ice-pwd:' + pwd;
35
     },
35
     },
36
-    parse_mid: function (line) {
36
+    parse_mid (line) {
37
         return line.substring(6);
37
         return line.substring(6);
38
     },
38
     },
39
-    parse_mline: function (line) {
39
+    parse_mline (line) {
40
         var parts = line.substring(2).split(' '),
40
         var parts = line.substring(2).split(' '),
41
             data = {};
41
             data = {};
42
         data.media = parts.shift();
42
         data.media = parts.shift();
48
         data.fmt = parts;
48
         data.fmt = parts;
49
         return data;
49
         return data;
50
     },
50
     },
51
-    build_mline: function (mline) {
51
+    build_mline (mline) {
52
         return 'm=' + mline.media + ' ' + mline.port + ' ' + mline.proto + ' ' + mline.fmt.join(' ');
52
         return 'm=' + mline.media + ' ' + mline.port + ' ' + mline.proto + ' ' + mline.fmt.join(' ');
53
     },
53
     },
54
-    parse_rtpmap: function (line) {
54
+    parse_rtpmap (line) {
55
         var parts = line.substring(9).split(' '),
55
         var parts = line.substring(9).split(' '),
56
             data = {};
56
             data = {};
57
         data.id = parts.shift();
57
         data.id = parts.shift();
66
      * @param line eg. "a=sctpmap:5000 webrtc-datachannel"
66
      * @param line eg. "a=sctpmap:5000 webrtc-datachannel"
67
      * @returns [SCTP port number, protocol, streams]
67
      * @returns [SCTP port number, protocol, streams]
68
      */
68
      */
69
-    parse_sctpmap: function (line)
69
+    parse_sctpmap (line)
70
     {
70
     {
71
         var parts = line.substring(10).split(' ');
71
         var parts = line.substring(10).split(' ');
72
         var sctpPort = parts[0];
72
         var sctpPort = parts[0];
75
         var streamCount = parts.length > 2 ? parts[2] : null;
75
         var streamCount = parts.length > 2 ? parts[2] : null;
76
         return [sctpPort, protocol, streamCount];// SCTP port
76
         return [sctpPort, protocol, streamCount];// SCTP port
77
     },
77
     },
78
-    build_rtpmap: function (el) {
78
+    build_rtpmap (el) {
79
         var line = 'a=rtpmap:' + el.getAttribute('id') + ' ' + el.getAttribute('name') + '/' + el.getAttribute('clockrate');
79
         var line = 'a=rtpmap:' + el.getAttribute('id') + ' ' + el.getAttribute('name') + '/' + el.getAttribute('clockrate');
80
         if (el.getAttribute('channels') && el.getAttribute('channels') != '1') {
80
         if (el.getAttribute('channels') && el.getAttribute('channels') != '1') {
81
             line += '/' + el.getAttribute('channels');
81
             line += '/' + el.getAttribute('channels');
82
         }
82
         }
83
         return line;
83
         return line;
84
     },
84
     },
85
-    parse_crypto: function (line) {
85
+    parse_crypto (line) {
86
         var parts = line.substring(9).split(' '),
86
         var parts = line.substring(9).split(' '),
87
             data = {};
87
             data = {};
88
         data.tag = parts.shift();
88
         data.tag = parts.shift();
93
         }
93
         }
94
         return data;
94
         return data;
95
     },
95
     },
96
-    parse_fingerprint: function (line) { // RFC 4572
96
+    parse_fingerprint (line) { // RFC 4572
97
         var parts = line.substring(14).split(' '),
97
         var parts = line.substring(14).split(' '),
98
             data = {};
98
             data = {};
99
         data.hash = parts.shift();
99
         data.hash = parts.shift();
101
         // TODO assert that fingerprint satisfies 2UHEX *(":" 2UHEX) ?
101
         // TODO assert that fingerprint satisfies 2UHEX *(":" 2UHEX) ?
102
         return data;
102
         return data;
103
     },
103
     },
104
-    parse_fmtp: function (line) {
104
+    parse_fmtp (line) {
105
         var parts = line.split(' '),
105
         var parts = line.split(' '),
106
             i, key, value,
106
             i, key, value,
107
             data = [];
107
             data = [];
114
             }
114
             }
115
             value = parts[i].split('=')[1];
115
             value = parts[i].split('=')[1];
116
             if (key && value) {
116
             if (key && value) {
117
-                data.push({name: key, value: value});
117
+                data.push({name: key, value});
118
             } else if (key) {
118
             } else if (key) {
119
                 // rfc 4733 (DTMF) style stuff
119
                 // rfc 4733 (DTMF) style stuff
120
                 data.push({name: '', value: key});
120
                 data.push({name: '', value: key});
122
         }
122
         }
123
         return data;
123
         return data;
124
     },
124
     },
125
-    parse_icecandidate: function (line) {
125
+    parse_icecandidate (line) {
126
         var candidate = {},
126
         var candidate = {},
127
             elems = line.split(' ');
127
             elems = line.split(' ');
128
         candidate.foundation = elems[0].substring(12);
128
         candidate.foundation = elems[0].substring(12);
156
         candidate.id = Math.random().toString(36).substr(2, 10); // not applicable to SDP -- FIXME: should be unique, not just random
156
         candidate.id = Math.random().toString(36).substr(2, 10); // not applicable to SDP -- FIXME: should be unique, not just random
157
         return candidate;
157
         return candidate;
158
     },
158
     },
159
-    build_icecandidate: function (cand) {
159
+    build_icecandidate (cand) {
160
         var line = ['a=candidate:' + cand.foundation, cand.component, cand.protocol, cand.priority, cand.ip, cand.port, 'typ', cand.type].join(' ');
160
         var line = ['a=candidate:' + cand.foundation, cand.component, cand.protocol, cand.priority, cand.ip, cand.port, 'typ', cand.type].join(' ');
161
         line += ' ';
161
         line += ' ';
162
         switch (cand.type) {
162
         switch (cand.type) {
186
         line += cand.hasOwnAttribute('generation') ? cand.generation : '0';
186
         line += cand.hasOwnAttribute('generation') ? cand.generation : '0';
187
         return line;
187
         return line;
188
     },
188
     },
189
-    parse_ssrc: function (desc) {
189
+    parse_ssrc (desc) {
190
         // proprietary mapping of a=ssrc lines
190
         // proprietary mapping of a=ssrc lines
191
         // TODO: see "Jingle RTP Source Description" by Juberti and P. Thatcher on google docs
191
         // TODO: see "Jingle RTP Source Description" by Juberti and P. Thatcher on google docs
192
         // and parse according to that
192
         // and parse according to that
200
         }
200
         }
201
         return data;
201
         return data;
202
     },
202
     },
203
-    parse_rtcpfb: function (line) {
203
+    parse_rtcpfb (line) {
204
         var parts = line.substr(10).split(' ');
204
         var parts = line.substr(10).split(' ');
205
         var data = {};
205
         var data = {};
206
         data.pt = parts.shift();
206
         data.pt = parts.shift();
208
         data.params = parts;
208
         data.params = parts;
209
         return data;
209
         return data;
210
     },
210
     },
211
-    parse_extmap: function (line) {
211
+    parse_extmap (line) {
212
         var parts = line.substr(9).split(' ');
212
         var parts = line.substr(9).split(' ');
213
         var data = {};
213
         var data = {};
214
         data.value = parts.shift();
214
         data.value = parts.shift();
222
         data.params = parts;
222
         data.params = parts;
223
         return data;
223
         return data;
224
     },
224
     },
225
-    find_line: function (haystack, needle, sessionpart) {
225
+    find_line (haystack, needle, sessionpart) {
226
         var lines = haystack.split('\r\n');
226
         var lines = haystack.split('\r\n');
227
         for (var i = 0; i < lines.length; i++) {
227
         for (var i = 0; i < lines.length; i++) {
228
             if (lines[i].substring(0, needle.length) == needle) {
228
             if (lines[i].substring(0, needle.length) == needle) {
241
         }
241
         }
242
         return false;
242
         return false;
243
     },
243
     },
244
-    find_lines: function (haystack, needle, sessionpart) {
244
+    find_lines (haystack, needle, sessionpart) {
245
         var lines = haystack.split('\r\n'),
245
         var lines = haystack.split('\r\n'),
246
             needles = [];
246
             needles = [];
247
         for (var i = 0; i < lines.length; i++) {
247
         for (var i = 0; i < lines.length; i++) {
260
         }
260
         }
261
         return needles;
261
         return needles;
262
     },
262
     },
263
-    candidateToJingle: function (line) {
263
+    candidateToJingle (line) {
264
         // a=candidate:2979166662 1 udp 2113937151 192.168.2.100 57698 typ host generation 0
264
         // a=candidate:2979166662 1 udp 2113937151 192.168.2.100 57698 typ host generation 0
265
         //      <candidate component=... foundation=... generation=... id=... ip=... network=... port=... priority=... protocol=... type=.../>
265
         //      <candidate component=... foundation=... generation=... id=... ip=... network=... port=... priority=... protocol=... type=.../>
266
         if (line.indexOf('candidate:') === 0) {
266
         if (line.indexOf('candidate:') === 0) {
312
         candidate.id = Math.random().toString(36).substr(2, 10); // not applicable to SDP -- FIXME: should be unique, not just random
312
         candidate.id = Math.random().toString(36).substr(2, 10); // not applicable to SDP -- FIXME: should be unique, not just random
313
         return candidate;
313
         return candidate;
314
     },
314
     },
315
-    candidateFromJingle: function (cand) {
315
+    candidateFromJingle (cand) {
316
         var line = 'a=candidate:';
316
         var line = 'a=candidate:';
317
         line += cand.getAttribute('foundation');
317
         line += cand.getAttribute('foundation');
318
         line += ' ';
318
         line += ' ';
369
      * @param {object} mLine object as parsed from transform.parse
369
      * @param {object} mLine object as parsed from transform.parse
370
      * @return {number} the primary video ssrc from the given m line
370
      * @return {number} the primary video ssrc from the given m line
371
      */
371
      */
372
-    parsePrimaryVideoSsrc: function(videoMLine) {
372
+    parsePrimaryVideoSsrc(videoMLine) {
373
         const numSsrcs = videoMLine.ssrcs
373
         const numSsrcs = videoMLine.ssrcs
374
             .map(ssrcInfo => ssrcInfo.id)
374
             .map(ssrcInfo => ssrcInfo.id)
375
             .filter((ssrc, index, array) => array.indexOf(ssrc) === index)
375
             .filter((ssrc, index, array) => array.indexOf(ssrc) === index)
406
      * Generate an ssrc
406
      * Generate an ssrc
407
      * @returns {number} an ssrc
407
      * @returns {number} an ssrc
408
      */
408
      */
409
-    generateSsrc: function() {
409
+    generateSsrc() {
410
         return RandomUtil.randomInt(1, 0xffffffff);
410
         return RandomUtil.randomInt(1, 0xffffffff);
411
     },
411
     },
412
 
412
 
419
      * @returns {string} the value corresponding to the given ssrc
419
      * @returns {string} the value corresponding to the given ssrc
420
      *  and attributeName
420
      *  and attributeName
421
      */
421
      */
422
-    getSsrcAttribute: function (mLine, ssrc, attributeName) {
422
+    getSsrcAttribute (mLine, ssrc, attributeName) {
423
         for (let i = 0; i < mLine.ssrcs.length; ++i) {
423
         for (let i = 0; i < mLine.ssrcs.length; ++i) {
424
             const ssrcLine = mLine.ssrcs[i];
424
             const ssrcLine = mLine.ssrcs[i];
425
             if (ssrcLine.id === ssrc &&
425
             if (ssrcLine.id === ssrc &&
437
      * @returns {list<number>} a list of the ssrcs in the group
437
      * @returns {list<number>} a list of the ssrcs in the group
438
      *  parsed as numbers
438
      *  parsed as numbers
439
      */
439
      */
440
-    parseGroupSsrcs: function (ssrcGroup) {
440
+    parseGroupSsrcs (ssrcGroup) {
441
         return ssrcGroup
441
         return ssrcGroup
442
             .ssrcs
442
             .ssrcs
443
             .split(" ")
443
             .split(" ")
450
      * @param {string} type the type of the desired mline (e.g. "video")
450
      * @param {string} type the type of the desired mline (e.g. "video")
451
      * @returns {object} a media object
451
      * @returns {object} a media object
452
      */
452
      */
453
-    getMedia: function (sdp, type) {
453
+    getMedia (sdp, type) {
454
         return sdp.media.find(m => m.type === type);
454
         return sdp.media.find(m => m.type === type);
455
     },
455
     },
456
     /**
456
     /**
464
      *  an sdp as parsed by transform.parse
464
      *  an sdp as parsed by transform.parse
465
      * @param {string} the name of the preferred codec
465
      * @param {string} the name of the preferred codec
466
      */
466
      */
467
-    preferVideoCodec: function(videoMLine, codecName) {
467
+    preferVideoCodec(videoMLine, codecName) {
468
         let payloadType = null;
468
         let payloadType = null;
469
         for (let i = 0; i < videoMLine.rtp.length; ++i) {
469
         for (let i = 0; i < videoMLine.rtp.length; ++i) {
470
           const rtp = videoMLine.rtp[i];
470
           const rtp = videoMLine.rtp[i];

+ 1
- 1
modules/xmpp/recording.js View File

165
     elem.c('conference', {
165
     elem.c('conference', {
166
         xmlns: 'http://jitsi.org/protocol/colibri'
166
         xmlns: 'http://jitsi.org/protocol/colibri'
167
     });
167
     });
168
-    elem.c('recording', {state: state, token: options.token});
168
+    elem.c('recording', {state, token: options.token});
169
 
169
 
170
     var self = this;
170
     var self = this;
171
     this.connection.sendIQ(elem,
171
     this.connection.sendIQ(elem,

+ 2
- 2
modules/xmpp/strophe.rayo.js View File

30
             });
30
             });
31
             req.c('dial', {
31
             req.c('dial', {
32
                 xmlns: RAYO_XMLNS,
32
                 xmlns: RAYO_XMLNS,
33
-                to: to,
34
-                from: from
33
+                to,
34
+                from
35
             });
35
             });
36
             req.c('header', {
36
             req.c('header', {
37
                 name: 'JvbRoomName',
37
                 name: 'JvbRoomName',

+ 2
- 2
modules/xmpp/xmpp.js View File

242
 
242
 
243
     connect (jid, password) {
243
     connect (jid, password) {
244
         this.connectParams = {
244
         this.connectParams = {
245
-            jid: jid,
246
-            password: password
245
+            jid,
246
+            password
247
         };
247
         };
248
         if (!jid) {
248
         if (!jid) {
249
             let configDomain
249
             let configDomain

+ 1
- 1
webpack.config.js View File

82
         libraryTarget: 'umd',
82
         libraryTarget: 'umd',
83
         sourceMapFilename: '[name].' + (minimize ? 'min' : 'js') + '.map'
83
         sourceMapFilename: '[name].' + (minimize ? 'min' : 'js') + '.map'
84
     },
84
     },
85
-    plugins: plugins
85
+    plugins
86
 };
86
 };

Loading…
Cancel
Save