Browse Source

[eslint] prefer-template

tags/v0.0.2
Lyubo Marinov 8 years ago
parent
commit
c991abf9ef
41 changed files with 414 additions and 421 deletions
  1. 1
    0
      .eslintrc.js
  2. 6
    6
      JitsiConference.js
  3. 10
    13
      JitsiConferenceEventManager.js
  4. 2
    2
      JitsiConnection.js
  5. 13
    10
      JitsiMeetJS.js
  6. 22
    22
      doc/example/example.js
  7. 9
    9
      modules/RTC/DataChannels.js
  8. 3
    3
      modules/RTC/JitsiLocalTrack.js
  9. 7
    7
      modules/RTC/JitsiRemoteTrack.js
  10. 1
    1
      modules/RTC/JitsiTrack.js
  11. 7
    7
      modules/RTC/RTCBrowserType.js
  12. 1
    1
      modules/RTC/RTCUIHelper.js
  13. 5
    5
      modules/RTC/RTCUtils.js
  14. 13
    11
      modules/RTC/ScreenObtainer.js
  15. 20
    18
      modules/RTC/TraceablePeerConnection.js
  16. 19
    21
      modules/connectivity/ParticipantConnectionStatus.js
  17. 1
    1
      modules/settings/Settings.js
  18. 3
    3
      modules/statistics/CallStats.js
  19. 6
    6
      modules/statistics/RTPStatsCollector.js
  20. 2
    2
      modules/statistics/statistics.js
  21. 7
    8
      modules/transcription/audioRecorder.js
  22. 17
    18
      modules/transcription/transcriber.js
  23. 12
    13
      modules/transcription/transcriptionServices/SphinxTranscriptionService.js
  24. 1
    1
      modules/util/UsernameGenerator.js
  25. 8
    7
      modules/version/ComponentsVersions.js
  26. 4
    4
      modules/xmpp/Caps.js
  27. 8
    8
      modules/xmpp/ChatRoom.js
  28. 94
    102
      modules/xmpp/JingleSessionPC.js
  29. 1
    1
      modules/xmpp/RtxModifier.js
  30. 34
    34
      modules/xmpp/SDP.js
  31. 11
    11
      modules/xmpp/SDPUtil.js
  32. 10
    9
      modules/xmpp/SdpConsistency.js
  33. 1
    1
      modules/xmpp/SdpTransformUtil.js
  34. 18
    21
      modules/xmpp/moderator.js
  35. 5
    4
      modules/xmpp/recording.js
  36. 9
    9
      modules/xmpp/strophe.jingle.js
  37. 4
    4
      modules/xmpp/strophe.ping.js
  38. 1
    1
      modules/xmpp/strophe.rayo.js
  39. 3
    3
      modules/xmpp/strophe.util.js
  40. 9
    8
      modules/xmpp/xmpp.js
  41. 6
    6
      webpack.config.js

+ 1
- 0
.eslintrc.js View File

@@ -211,6 +211,7 @@ module.exports = {
211 211
         'prefer-const': 2,
212 212
         'prefer-reflect': 0,
213 213
         'prefer-spread': 2,
214
+        'prefer-template': 2,
214 215
         'require-yield': 2,
215 216
         'rest-spread-spacing': 2,
216 217
         'sort-imports': 0,

+ 6
- 6
JitsiConference.js View File

@@ -591,7 +591,7 @@ JitsiConference.prototype._setupNewTrack = function(newTrack) {
591 591
         // Report active device to statistics
592 592
         const devices = RTC.getCurrentlyAvailableMediaDevices();
593 593
         const device = devices.find(function(d) {
594
-            return d.kind === newTrack.getTrack().kind + 'input'
594
+            return d.kind === `${newTrack.getTrack().kind}input`
595 595
                 && d.label === newTrack.getTrack().label;
596 596
         });
597 597
         if (device) {
@@ -776,7 +776,7 @@ JitsiConference.prototype.pinParticipant = function(participantId) {
776 776
  */
777 777
 JitsiConference.prototype.setLastN = function(lastN) {
778 778
     if (!Number.isInteger(lastN) && !Number.parseInt(lastN)) {
779
-        throw new Error('Invalid value for lastN: ' + lastN);
779
+        throw new Error(`Invalid value for lastN: ${lastN}`);
780 780
     }
781 781
     if (lastN < -1) {
782 782
         throw new RangeError('lastN cannot be smaller than -1');
@@ -1007,8 +1007,8 @@ JitsiConference.prototype.onIncomingCall
1007 1007
 = function(jingleSession, jingleOffer, now) {
1008 1008
     if (!this.room.isFocus(jingleSession.peerjid)) {
1009 1009
         // Error cause this should never happen unless something is wrong!
1010
-        const errmsg = 'Rejecting session-initiate from non-focus user: '
1011
-                + jingleSession.peerjid;
1010
+        const errmsg = `Rejecting session-initiate from non-focus user: ${
1011
+                 jingleSession.peerjid}`;
1012 1012
         GlobalOnErrorHandler.callErrorHandler(new Error(errmsg));
1013 1013
         logger.error(errmsg);
1014 1014
 
@@ -1134,7 +1134,7 @@ JitsiConference.prototype.onIncomingCall
1134 1134
  */
1135 1135
 JitsiConference.prototype.onCallEnded
1136 1136
 = function(JingleSession, reasonCondition, reasonText) {
1137
-    logger.info('Call ended: ' + reasonCondition + ' - ' + reasonText);
1137
+    logger.info(`Call ended: ${reasonCondition} - ${reasonText}`);
1138 1138
     this.wasStopped = true;
1139 1139
     // Send session.terminate event
1140 1140
     Statistics.sendEventToAll('session.terminate');
@@ -1414,7 +1414,7 @@ JitsiConference.prototype.getConnectionTimes = function() {
1414 1414
  * Sets a property for the local participant.
1415 1415
  */
1416 1416
 JitsiConference.prototype.setLocalParticipantProperty = function(name, value) {
1417
-    this.sendCommand('jitsi_participant_' + name, {value});
1417
+    this.sendCommand(`jitsi_participant_${name}`, {value});
1418 1418
 };
1419 1419
 
1420 1420
 /**

+ 10
- 13
JitsiConferenceEventManager.js View File

@@ -73,13 +73,11 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function() {
73 73
 
74 74
             Object.keys(chatRoom.connectionTimes).forEach(key => {
75 75
                 const value = chatRoom.connectionTimes[key];
76
-                Statistics.analytics.sendEvent('conference.' + key,
77
-                    {value});
76
+                Statistics.analytics.sendEvent(`conference.${key}`, {value});
78 77
             });
79 78
             Object.keys(chatRoom.xmpp.connectionTimes).forEach(key => {
80 79
                 const value = chatRoom.xmpp.connectionTimes[key];
81
-                Statistics.analytics.sendEvent('xmpp.' + key,
82
-                    {value});
80
+                Statistics.analytics.sendEvent(`xmpp.${key}`, {value});
83 81
             });
84 82
         });
85 83
 
@@ -109,10 +107,9 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function() {
109 107
     this.chatRoomForwarder.forward(XMPPEvents.BRIDGE_DOWN,
110 108
         JitsiConferenceEvents.CONFERENCE_FAILED,
111 109
         JitsiConferenceErrors.VIDEOBRIDGE_NOT_AVAILABLE);
112
-    chatRoom.addListener(XMPPEvents.BRIDGE_DOWN,
113
-        function() {
114
-            Statistics.analytics.sendEvent('conference.bridgeDown');
115
-        });
110
+    chatRoom.addListener(
111
+        XMPPEvents.BRIDGE_DOWN,
112
+        () => Statistics.analytics.sendEvent('conference.bridgeDown'));
116 113
 
117 114
     this.chatRoomForwarder.forward(XMPPEvents.RESERVATION_ERROR,
118 115
         JitsiConferenceEvents.CONFERENCE_FAILED,
@@ -156,9 +153,8 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function() {
156 153
                 JitsiConferenceErrors.FOCUS_LEFT);
157 154
         });
158 155
 
159
-    const eventLogHandler = function(reason) {
160
-        Statistics.sendEventToAll('conference.error.' + reason);
161
-    };
156
+    const eventLogHandler
157
+        = reason => Statistics.sendEventToAll(`conference.error.${reason}`);
162 158
     chatRoom.addListener(XMPPEvents.SESSION_ACCEPT_TIMEOUT,
163 159
         eventLogHandler.bind(null, 'sessionAcceptTimeout'));
164 160
 
@@ -451,8 +447,9 @@ JitsiConferenceEventManager.prototype.setupRTCListeners = function() {
451 447
                     participant, payload);
452 448
             } else {
453 449
                 logger.warn(
454
-                    'Ignored ENDPOINT_MESSAGE_RECEIVED '
455
-                    + 'for not existing participant: ' + from, payload);
450
+                    'Ignored ENDPOINT_MESSAGE_RECEIVED for not existing '
451
+                        + `participant: ${from}`,
452
+                    payload);
456 453
             }
457 454
         });
458 455
 

+ 2
- 2
JitsiConnection.js View File

@@ -20,7 +20,7 @@ function JitsiConnection(appID, token, options) {
20 20
     this.addEventListener(JitsiConnectionEvents.CONNECTION_FAILED,
21 21
         function(errType, msg) {
22 22
             // sends analytics and callstats event
23
-            Statistics.sendEventToAll('connection.failed.' + errType,
23
+            Statistics.sendEventToAll(`connection.failed.${errType}`,
24 24
                 {label: msg});
25 25
         });
26 26
 
@@ -31,7 +31,7 @@ function JitsiConnection(appID, token, options) {
31 31
             // when there is real error
32 32
             if(msg) {
33 33
                 Statistics.analytics.sendEvent(
34
-                    'connection.disconnected.' + msg);
34
+                    `connection.disconnected.${msg}`);
35 35
             }
36 36
             Statistics.sendLog(
37 37
                 JSON.stringify({id: 'connection.disconnected', msg}));

+ 13
- 10
JitsiMeetJS.js View File

@@ -64,7 +64,7 @@ function addDeviceTypeToAnalyticsEvent(name, options) {
64 64
     }
65 65
     if (options.devices.indexOf('video') !== -1) {
66 66
         // we have video add resolution
67
-        name += '.video.' + options.resolution;
67
+        name += `.video.${options.resolution}`;
68 68
     }
69 69
 
70 70
     return name;
@@ -281,7 +281,7 @@ const LibJitsiMeet = {
281 281
                             newResolution);
282 282
 
283 283
                         Statistics.analytics.sendEvent(
284
-                            'getUserMedia.fail.resolution.' + oldResolution);
284
+                            `getUserMedia.fail.resolution.${oldResolution}`);
285 285
 
286 286
                         return LibJitsiMeet.createLocalTracks(options);
287 287
                     }
@@ -307,14 +307,17 @@ const LibJitsiMeet = {
307 307
                     };
308 308
                     Statistics.sendLog(JSON.stringify(logObject));
309 309
                     Statistics.analytics.sendEvent(
310
-                        'getUserMedia.deviceNotFound.'
311
-                            + error.gum.devices.join('.'));
310
+                        `getUserMedia.deviceNotFound.${
311
+                             error.gum.devices.join('.')}`);
312 312
                 } else {
313 313
                     // Report gUM failed to the stats
314 314
                     Statistics.sendGetUserMediaFailed(error);
315
+                    const event
316
+                        = addDeviceTypeToAnalyticsEvent(
317
+                            'getUserMedia.failed',
318
+                            options);
315 319
                     Statistics.analytics.sendEvent(
316
-                        addDeviceTypeToAnalyticsEvent(
317
-                            'getUserMedia.failed', options) + '.' + error.name,
320
+                        `${event}.${error.name}`,
318 321
                         {value: options});
319 322
                 }
320 323
 
@@ -367,10 +370,10 @@ const LibJitsiMeet = {
367 370
      */
368 371
     getGlobalOnErrorHandler(message, source, lineno, colno, error) {
369 372
         logger.error(
370
-            'UnhandledError: ' + message,
371
-            'Script: ' + source,
372
-            'Line: ' + lineno,
373
-            'Column: ' + colno,
373
+            `UnhandledError: ${message}`,
374
+            `Script: ${source}`,
375
+            `Line: ${lineno}`,
376
+            `Column: ${colno}`,
374 377
             'StackTrace: ', error);
375 378
         Statistics.reportGlobalError(error);
376 379
     },

+ 22
- 22
doc/example/example.js View File

@@ -29,7 +29,7 @@ function onLocalTracks(tracks) {
29 29
     for(let i = 0; i < localTracks.length; i++) {
30 30
         localTracks[i].addEventListener(JitsiMeetJS.events.track.TRACK_AUDIO_LEVEL_CHANGED,
31 31
             function(audioLevel) {
32
-                console.log('Audio Level local: ' + audioLevel);
32
+                console.log(`Audio Level local: ${audioLevel}`);
33 33
             });
34 34
         localTracks[i].addEventListener(JitsiMeetJS.events.track.TRACK_MUTE_CHANGED,
35 35
             function() {
@@ -41,14 +41,14 @@ function onLocalTracks(tracks) {
41 41
             });
42 42
         localTracks[i].addEventListener(JitsiMeetJS.events.track.TRACK_AUDIO_OUTPUT_CHANGED,
43 43
             function(deviceId) {
44
-                console.log('track audio output device was changed to ' + deviceId);
44
+                console.log(`track audio output device was changed to ${deviceId}`);
45 45
             });
46 46
         if(localTracks[i].getType() == 'video') {
47
-            $('body').append('<video autoplay=\'1\' id=\'localVideo' + i + '\' />');
48
-            localTracks[i].attach($('#localVideo' + i)[0]);
47
+            $('body').append(`<video autoplay='1' id='localVideo${i}' />`);
48
+            localTracks[i].attach($(`#localVideo${i}`)[0]);
49 49
         } else {
50
-            $('body').append('<audio autoplay=\'1\' muted=\'true\' id=\'localAudio' + i + '\' />');
51
-            localTracks[i].attach($('#localAudio' + i)[0]);
50
+            $('body').append(`<audio autoplay='1' muted='true' id='localAudio${i}' />`);
51
+            localTracks[i].attach($(`#localAudio${i}`)[0]);
52 52
         }
53 53
         if(isJoined) {
54 54
             room.addTrack(localTracks[i]);
@@ -71,7 +71,7 @@ function onRemoteTrack(track) {
71 71
     const idx = remoteTracks[participant].push(track);
72 72
     track.addEventListener(JitsiMeetJS.events.track.TRACK_AUDIO_LEVEL_CHANGED,
73 73
         function(audioLevel) {
74
-            console.log('Audio Level remote: ' + audioLevel);
74
+            console.log(`Audio Level remote: ${audioLevel}`);
75 75
         });
76 76
     track.addEventListener(JitsiMeetJS.events.track.TRACK_MUTE_CHANGED,
77 77
         function() {
@@ -83,15 +83,15 @@ function onRemoteTrack(track) {
83 83
         });
84 84
     track.addEventListener(JitsiMeetJS.events.track.TRACK_AUDIO_OUTPUT_CHANGED,
85 85
         function(deviceId) {
86
-            console.log('track audio output device was changed to ' + deviceId);
86
+            console.log(`track audio output device was changed to ${deviceId}`);
87 87
         });
88 88
     const id = participant + track.getType() + idx;
89 89
     if(track.getType() == 'video') {
90
-        $('body').append('<video autoplay=\'1\' id=\'' + participant + 'video' + idx + '\' />');
90
+        $('body').append(`<video autoplay='1' id='${participant}video${idx}' />`);
91 91
     } else {
92
-        $('body').append('<audio autoplay=\'1\' id=\'' + participant + 'audio' + idx + '\' />');
92
+        $('body').append(`<audio autoplay='1' id='${participant}audio${idx}' />`);
93 93
     }
94
-    track.attach($('#' + id)[0]);
94
+    track.attach($(`#${id}`)[0]);
95 95
 }
96 96
 
97 97
 /**
@@ -112,7 +112,7 @@ function onUserLeft(id) {
112 112
     }
113 113
     const tracks = remoteTracks[id];
114 114
     for(let i = 0; i < tracks.length; i++) {
115
-        tracks[i].detach($('#' + id + tracks[i].getType()));
115
+        tracks[i].detach($(`#${id}${tracks[i].getType()}`));
116 116
     }
117 117
 }
118 118
 
@@ -123,7 +123,7 @@ function onConnectionSuccess() {
123 123
     room = connection.initJitsiConference('conference', confOptions);
124 124
     room.on(JitsiMeetJS.events.conference.TRACK_ADDED, onRemoteTrack);
125 125
     room.on(JitsiMeetJS.events.conference.TRACK_REMOVED, function(track) {
126
-        console.log('track removed!!!' + track);
126
+        console.log(`track removed!!!${track}`);
127 127
     });
128 128
     room.on(JitsiMeetJS.events.conference.CONFERENCE_JOINED, onConferenceJoined);
129 129
     room.on(JitsiMeetJS.events.conference.USER_JOINED, function(id) {
@@ -131,24 +131,24 @@ function onConnectionSuccess() {
131 131
     });
132 132
     room.on(JitsiMeetJS.events.conference.USER_LEFT, onUserLeft);
133 133
     room.on(JitsiMeetJS.events.conference.TRACK_MUTE_CHANGED, function(track) {
134
-        console.log(track.getType() + ' - ' + track.isMuted());
134
+        console.log(`${track.getType()} - ${track.isMuted()}`);
135 135
     });
136 136
     room.on(JitsiMeetJS.events.conference.DISPLAY_NAME_CHANGED, function(userID, displayName) {
137
-        console.log(userID + ' - ' + displayName);
137
+        console.log(`${userID} - ${displayName}`);
138 138
     });
139 139
     room.on(JitsiMeetJS.events.conference.TRACK_AUDIO_LEVEL_CHANGED,
140 140
       function(userID, audioLevel) {
141
-          console.log(userID + ' - ' + audioLevel);
141
+          console.log(`${userID} - ${audioLevel}`);
142 142
       });
143 143
     room.on(JitsiMeetJS.events.conference.RECORDER_STATE_CHANGED, function() {
144
-        console.log(room.isRecordingSupported() + ' - '
145
-            + room.getRecordingState() + ' - '
146
-            + room.getRecordingURL());
144
+        console.log(`${room.isRecordingSupported()} - ${
145
+             room.getRecordingState()} - ${
146
+             room.getRecordingURL()}`);
147 147
     });
148 148
     room.on(JitsiMeetJS.events.conference.PHONE_NUMBER_CHANGED, function() {
149 149
         console.log(
150
-            room.getPhoneNumber() + ' - '
151
-            + room.getPhonePin());
150
+            `${room.getPhoneNumber()} - ${
151
+             room.getPhonePin()}`);
152 152
     });
153 153
     room.join();
154 154
 }
@@ -271,7 +271,7 @@ if (JitsiMeetJS.mediaDevices.isDeviceChangeAvailable('output')) {
271 271
         if (audioOutputDevices.length > 1) {
272 272
             $('#audioOutputSelect').html(
273 273
                 audioOutputDevices.map(function(d) {
274
-                    return '<option value="' + d.deviceId + '">' + d.label + '</option>';
274
+                    return `<option value="${d.deviceId}">${d.label}</option>`;
275 275
                 }).join('\n')
276 276
             );
277 277
 

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

@@ -139,8 +139,9 @@ DataChannels.prototype.onDataChannel = function(event) {
139 139
             } else if ('EndpointConnectivityStatusChangeEvent' === colibriClass) {
140 140
                 const endpoint = obj.endpoint;
141 141
                 const isActive = obj.active === 'true';
142
-                logger.info('Endpoint connection status changed: ' + endpoint
143
-                           + ' active ? ' + isActive);
142
+                logger.info(
143
+                    `Endpoint connection status changed: ${endpoint} active ? ${
144
+                        isActive}`);
144 145
                 self.eventEmitter.emit(RTCEvents.ENDPOINT_CONN_STATUS_CHANGED,
145 146
                     endpoint, isActive);
146 147
             } else {
@@ -149,7 +150,7 @@ DataChannels.prototype.onDataChannel = function(event) {
149 150
                 // (i.e. is a JSON object which assigns a value to the mandatory
150 151
                 // property colibriClass) so don't just swallow it, expose it to
151 152
                 // public consumption.
152
-                self.eventEmitter.emit('rtc.datachannel.' + colibriClass, obj);
153
+                self.eventEmitter.emit(`rtc.datachannel.${colibriClass}`, obj);
153 154
             }
154 155
         }
155 156
     };
@@ -215,20 +216,19 @@ DataChannels.prototype._onXXXEndpointChanged = function(xxx, userResource) {
215 216
     const lower = head.toLowerCase() + tail;
216 217
     const upper = head.toUpperCase() + tail;
217 218
     logger.log(
218
-            'sending ' + lower
219
-                + ' endpoint changed notification to the bridge: ',
219
+            `sending ${lower} endpoint changed notification to the bridge: `,
220 220
             userResource);
221 221
 
222 222
     const jsonObject = {};
223 223
 
224
-    jsonObject.colibriClass = upper + 'EndpointChangedEvent';
225
-    jsonObject[lower + 'Endpoint']
224
+    jsonObject.colibriClass = `${upper}EndpointChangedEvent`;
225
+    jsonObject[`${lower}Endpoint`]
226 226
         = userResource ? userResource : null;
227 227
 
228 228
     this.send(jsonObject);
229 229
 
230 230
     // Notify Videobridge about the specified endpoint change.
231
-    logger.log(lower + ' endpoint changed: ', userResource);
231
+    logger.log(`${lower} endpoint changed: `, userResource);
232 232
 };
233 233
 
234 234
 DataChannels.prototype._some = function(callback, thisArg) {
@@ -291,7 +291,7 @@ DataChannels.prototype.sendSetLastNMessage = function(value) {
291 291
     };
292 292
 
293 293
     this.send(jsonObject);
294
-    logger.log('Channel lastN set to: ' + value);
294
+    logger.log(`Channel lastN set to: ${value}`);
295 295
 };
296 296
 
297 297
 module.exports = DataChannels;

+ 3
- 3
modules/RTC/JitsiLocalTrack.js View File

@@ -156,7 +156,7 @@ JitsiLocalTrack.prototype._initNoDataFromSourceHandlers = function() {
156 156
                 this._setHandler('track_unmute', () => {
157 157
                     this._clearNoDataFromSourceMuteResources();
158 158
                     Statistics.sendEventToAll(
159
-                        this.getType() + '.track_unmute',
159
+                        `${this.getType()}.track_unmute`,
160 160
                         {value: window.performance.now() - now});
161 161
                 });
162 162
             }
@@ -195,7 +195,7 @@ JitsiLocalTrack.prototype._onNoDataFromSourceError = function() {
195 195
  */
196 196
 JitsiLocalTrack.prototype._fireNoDataFromSourceEvent = function() {
197 197
     this.eventEmitter.emit(JitsiTrackEvents.NO_DATA_FROM_SOURCE);
198
-    const eventName = this.getType() + '.no_data_from_source';
198
+    const eventName = `${this.getType()}.no_data_from_source`;
199 199
     Statistics.analytics.sendEvent(eventName);
200 200
     const log = {name: eventName};
201 201
     if (this.isAudioTrack()) {
@@ -215,7 +215,7 @@ JitsiLocalTrack.prototype._setRealDeviceIdFromDeviceList = function(devices) {
215 215
     const track = this.getTrack();
216 216
     const device
217 217
         = devices.find(
218
-            d => d.kind === track.kind + 'input' && d.label === track.label);
218
+            d => d.kind === `${track.kind}input` && d.label === track.label);
219 219
 
220 220
     if (device) {
221 221
         this._realDeviceId = device.deviceId;

+ 7
- 7
modules/RTC/JitsiRemoteTrack.js View File

@@ -64,7 +64,7 @@ JitsiRemoteTrack.prototype._bindMuteHandlers = function() {
64 64
     this.track.addEventListener('mute', function() {
65 65
 
66 66
         logger.debug(
67
-            '"onmute" event(' + Date.now() + '): ',
67
+            `"onmute" event(${Date.now()}): `,
68 68
             this.getParticipantId(), this.getType(), this.getSSRC());
69 69
 
70 70
         this.rtc.eventEmitter.emit(RTCEvents.REMOTE_TRACK_MUTE, this);
@@ -74,7 +74,7 @@ JitsiRemoteTrack.prototype._bindMuteHandlers = function() {
74 74
     this.track.addEventListener('unmute', function() {
75 75
 
76 76
         logger.debug(
77
-            '"onunmute" event(' + Date.now() + '): ',
77
+            `"onunmute" event(${Date.now()}): `,
78 78
             this.getParticipantId(), this.getType(), this.getSSRC());
79 79
 
80 80
         this.rtc.eventEmitter.emit(RTCEvents.REMOTE_TRACK_UNMUTE, this);
@@ -152,17 +152,17 @@ JitsiRemoteTrack.prototype._playCallback = function() {
152 152
     const type = this.isVideoTrack() ? 'video' : 'audio';
153 153
 
154 154
     const now = window.performance.now();
155
-    console.log('(TIME) Render ' + type + ':\t', now);
156
-    this.conference.getConnectionTimes()[type + '.render'] = now;
155
+    console.log(`(TIME) Render ${type}:\t`, now);
156
+    this.conference.getConnectionTimes()[`${type}.render`] = now;
157 157
 
158 158
     const ttfm = now
159 159
         - (this.conference.getConnectionTimes()['session.initiate']
160 160
         - this.conference.getConnectionTimes()['muc.joined'])
161 161
         - (window.connectionTimes['obtainPermissions.end']
162 162
         - window.connectionTimes['obtainPermissions.start']);
163
-    this.conference.getConnectionTimes()[type + '.ttfm'] = ttfm;
164
-    console.log('(TIME) TTFM ' + type + ':\t', ttfm);
165
-    let eventName = type + '.ttfm';
163
+    this.conference.getConnectionTimes()[`${type}.ttfm`] = ttfm;
164
+    console.log(`(TIME) TTFM ${type}:\t`, ttfm);
165
+    let eventName = `${type}.ttfm`;
166 166
     if(this.hasBeenMuted) {
167 167
         eventName += '.muted';
168 168
     }

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

@@ -386,7 +386,7 @@ JitsiTrack.prototype.setAudioLevel = function(audioLevel) {
386 386
 JitsiTrack.prototype.getMSID = function() {
387 387
     const streamId = this.getStreamId();
388 388
     const trackId = this.getTrackId();
389
-    return streamId && trackId ? streamId + ' ' + trackId : null;
389
+    return streamId && trackId ? `${streamId} ${trackId}` : null;
390 390
 };
391 391
 
392 392
 /**

+ 7
- 7
modules/RTC/RTCBrowserType.js View File

@@ -199,7 +199,7 @@ function detectChrome() {
199 199
         // We can assume that user agent is chrome, because it's
200 200
         // enforced when 'ext' streaming method is set
201 201
         const ver = parseInt(userAgent.match(/chrome\/(\d+)\./)[1], 10);
202
-        logger.log('This appears to be Chrome, ver: ' + ver);
202
+        logger.log(`This appears to be Chrome, ver: ${ver}`);
203 203
         return ver;
204 204
     }
205 205
     return null;
@@ -210,7 +210,7 @@ function detectOpera() {
210 210
     if (userAgent.match(/Opera|OPR/)) {
211 211
         currentBrowser = RTCBrowserType.RTC_BROWSER_OPERA;
212 212
         const version = userAgent.match(/(Opera|OPR) ?\/?(\d+)\.?/)[2];
213
-        logger.info('This appears to be Opera, ver: ' + version);
213
+        logger.info(`This appears to be Opera, ver: ${version}`);
214 214
         return version;
215 215
     }
216 216
     return null;
@@ -221,7 +221,7 @@ function detectFirefox() {
221 221
         currentBrowser = RTCBrowserType.RTC_BROWSER_FIREFOX;
222 222
         const version = parseInt(
223 223
             navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1], 10);
224
-        logger.log('This appears to be Firefox, ver: ' + version);
224
+        logger.log(`This appears to be Firefox, ver: ${version}`);
225 225
         return version;
226 226
     }
227 227
     return null;
@@ -262,7 +262,7 @@ function detectIE() {
262 262
 
263 263
     if (version) {
264 264
         currentBrowser = RTCBrowserType.RTC_BROWSER_IEXPLORER;
265
-        logger.info('This appears to be IExplorer, ver: ' + version);
265
+        logger.info(`This appears to be IExplorer, ver: ${version}`);
266 266
     }
267 267
     return version;
268 268
 }
@@ -275,7 +275,7 @@ function detectElectron() {
275 275
     if (userAgent.match(/Electron/)) {
276 276
         currentBrowser = RTCBrowserType.RTC_BROWSER_ELECTRON;
277 277
         const version = userAgent.match(/Electron\/([\d.]+)/)[1];
278
-        logger.info('This appears to be Electron, ver: ' + version);
278
+        logger.info(`This appears to be Electron, ver: ${version}`);
279 279
         return version;
280 280
     }
281 281
     return null;
@@ -286,7 +286,7 @@ function detectNWJS() {
286 286
     if (userAgent.match(/JitsiMeetNW/)) {
287 287
         currentBrowser = RTCBrowserType.RTC_BROWSER_NWJS;
288 288
         const version = userAgent.match(/JitsiMeetNW\/([\d.]+)/)[1];
289
-        logger.info('This appears to be JitsiMeetNW, ver: ' + version);
289
+        logger.info(`This appears to be JitsiMeetNW, ver: ${version}`);
290 290
         return version;
291 291
     }
292 292
     return null;
@@ -308,7 +308,7 @@ function detectReactNative() {
308 308
         }
309 309
         name || (name = 'react-native');
310 310
         version || (version = 'unknown');
311
-        console.info('This appears to be ' + name + ', ver: ' + version);
311
+        console.info(`This appears to be ${name}, ver: ${version}`);
312 312
     } else {
313 313
         // We're not running in a React Native environment.
314 314
         version = null;

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

@@ -27,7 +27,7 @@ const RTCUIHelper = {
27 27
             return $(containerElement).find(videoElemName)[0];
28 28
         }
29 29
         const matching = $(containerElement).find(
30
-                ' ' + videoElemName + '>param[value="video"]');
30
+                ` ${videoElemName}>param[value="video"]`);
31 31
         if (matching.length) {
32 32
             if (matching.length > 1) {
33 33
                 logger.warn(

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

@@ -531,7 +531,7 @@ function convertMediaStreamTrackSource(source) {
531 531
         // not return 'audiooutput' devices but let's handle it in any
532 532
         // case
533 533
         kind: kind
534
-            ? kind === 'audiooutput' ? kind : kind + 'input'
534
+            ? kind === 'audiooutput' ? kind : `${kind}input`
535 535
             : null,
536 536
         deviceId: source.id,
537 537
         groupId: source.groupId || null
@@ -556,7 +556,7 @@ function obtainDevices(options) {
556 556
                 rtcUtils.stopMediaStream(options.streams[device]);
557 557
             });
558 558
             logger.error(
559
-                'failed to obtain ' + device + ' stream - stop', error);
559
+                `failed to obtain ${device} stream - stop`, error);
560 560
 
561 561
             options.errorCallback(error);
562 562
         });
@@ -733,11 +733,11 @@ class RTCUtils extends Listenable {
733 733
     init(options) {
734 734
         if (typeof options.disableAEC === 'boolean') {
735 735
             disableAEC = options.disableAEC;
736
-            logger.info('Disable AEC: ' + disableAEC);
736
+            logger.info(`Disable AEC: ${disableAEC}`);
737 737
         }
738 738
         if (typeof options.disableNS === 'boolean') {
739 739
             disableNS = options.disableNS;
740
-            logger.info('Disable NS: ' + disableNS);
740
+            logger.info(`Disable NS: ${disableNS}`);
741 741
         }
742 742
 
743 743
         return new Promise(function(resolve, reject) {
@@ -1262,7 +1262,7 @@ class RTCUtils extends Listenable {
1262 1262
                 audioOutputDeviceId = deviceId;
1263 1263
                 audioOutputChanged = true;
1264 1264
 
1265
-                logger.log('Audio output device set to ' + deviceId);
1265
+                logger.log(`Audio output device set to ${deviceId}`);
1266 1266
 
1267 1267
                 eventEmitter.emit(RTCEvents.AUDIO_OUTPUT_DEVICE_CHANGED,
1268 1268
                     deviceId);

+ 13
- 11
modules/RTC/ScreenObtainer.js View File

@@ -189,8 +189,9 @@ const ScreenObtainer = {
189 189
                 && RTCBrowserType.getFirefoxVersion()
190 190
                     <= desktopSharingFirefoxMaxVersionExtRequired)) {
191 191
             extensionRequired = true;
192
-            logger.log('Jidesha extension required on firefox version '
193
-                + RTCBrowserType.getFirefoxVersion());
192
+            logger.log(
193
+                `Jidesha extension required on firefox version ${
194
+                    RTCBrowserType.getFirefoxVersion()}`);
194 195
         }
195 196
 
196 197
         if (!extensionRequired || firefoxExtInstalled === true) {
@@ -290,7 +291,7 @@ const ScreenObtainer = {
290 291
         }
291 292
 
292 293
         const msg
293
-            = 'Failed to install the extension from ' + webStoreInstallUrl;
294
+            = `Failed to install the extension from ${webStoreInstallUrl}`;
294 295
 
295 296
         logger.log(msg, e);
296 297
         failCallback(new JitsiTrackError(
@@ -337,8 +338,9 @@ function obtainWebRTCScreen(options, streamCallback, failCallback) {
337 338
  * @returns {string}
338 339
  */
339 340
 function getWebStoreInstallUrl(options) {
340
-    return 'https://chrome.google.com/webstore/detail/'
341
-        + options.desktopSharingChromeExtId;
341
+    return (
342
+        `https://chrome.google.com/webstore/detail/${
343
+            options.desktopSharingChromeExtId}`);
342 344
 }
343 345
 
344 346
 /**
@@ -400,7 +402,7 @@ function checkChromeExtInstalled(callback, options) {
400 402
             }
401 403
             // Check installed extension version
402 404
             const extVersion = response.version;
403
-            logger.log('Extension version is: ' + extVersion);
405
+            logger.log(`Extension version is: ${extVersion}`);
404 406
             const updateRequired
405 407
                 = isUpdateRequired(
406 408
                     options.desktopSharingChromeMinExtVersion,
@@ -458,8 +460,8 @@ function initChromeExtension(options) {
458 460
         chromeExtInstalled = installed;
459 461
         chromeExtUpdateRequired = updateRequired;
460 462
         logger.info(
461
-            'Chrome extension installed: ' + chromeExtInstalled
462
-            + ' updateRequired: ' + chromeExtUpdateRequired);
463
+            `Chrome extension installed: ${chromeExtInstalled
464
+                } updateRequired: ${chromeExtUpdateRequired}`);
463 465
     }, options);
464 466
 }
465 467
 
@@ -558,9 +560,9 @@ function initFirefoxExtensionDetection(options) {
558 560
     // "chrome://EXT_ID/content/DOMAIN.png"
559 561
     // Where EXT_ID is the ID of the extension with "@" replaced by ".", and
560 562
     // DOMAIN is a domain whitelisted by the extension.
561
-    const src = 'chrome://'
562
-        + options.desktopSharingFirefoxExtId.replace('@', '.')
563
-        + '/content/' + document.location.hostname + '.png';
563
+    const src
564
+        = `chrome://${options.desktopSharingFirefoxExtId.replace('@', '.')
565
+            }/content/${document.location.hostname}.png`;
564 566
     img.setAttribute('src', src);
565 567
 }
566 568
 

+ 20
- 18
modules/RTC/TraceablePeerConnection.js View File

@@ -173,7 +173,7 @@ function TraceablePeerConnection(rtc, id, signalingLayer, ice_config,
173 173
                 const now = new Date();
174 174
                 for (let i = 0; i < results.length; ++i) {
175 175
                     results[i].names().forEach(function(name) {
176
-                        const id = results[i].id + '-' + name;
176
+                        const id = `${results[i].id}-${name}`;
177 177
                         if (!self.stats[id]) {
178 178
                             self.stats[id] = {
179 179
                                 startTime: now,
@@ -205,7 +205,7 @@ const dumpSDP = function(description) {
205 205
         return '';
206 206
     }
207 207
 
208
-    return 'type: ' + description.type + '\r\n' + description.sdp;
208
+    return `type: ${description.type}\r\n${description.sdp}`;
209 209
 };
210 210
 
211 211
 /**
@@ -266,15 +266,14 @@ TraceablePeerConnection.prototype._remoteTrackAdded = function(stream, track) {
266 266
     }
267 267
 
268 268
     const remoteSDP = new SDP(this.remoteDescription.sdp);
269
-    const mediaLines = remoteSDP.media.filter(
270
-        function(mediaLines) {
271
-            return mediaLines.startsWith('m=' + mediaType);
272
-        });
269
+    const mediaLines
270
+        = remoteSDP.media.filter(
271
+            mediaLines => mediaLines.startsWith(`m=${mediaType}`));
273 272
     if (!mediaLines.length) {
274 273
         GlobalOnErrorHandler.callErrorHandler(
275 274
             new Error(
276
-                'No media lines for type ' + mediaType
277
-                    + ' found in remote SDP for remote track: ' + streamId));
275
+                `No media lines for type ${mediaType
276
+                     } found in remote SDP for remote track: ${streamId}`));
278 277
         // Abort
279 278
         return;
280 279
     }
@@ -285,13 +284,13 @@ TraceablePeerConnection.prototype._remoteTrackAdded = function(stream, track) {
285 284
         function(line) {
286 285
             const msid
287 286
                 = RTCBrowserType.isTemasysPluginUsed() ? 'mslabel' : 'msid';
288
-            return line.indexOf(msid + ':' + streamId) !== -1;
287
+            return line.indexOf(`${msid}:${streamId}`) !== -1;
289 288
         });
290 289
     if (!ssrcLines.length) {
291 290
         GlobalOnErrorHandler.callErrorHandler(
292 291
             new Error(
293
-                'No SSRC lines for streamId ' + streamId
294
-                    + ' for remote track, media type: ' + mediaType));
292
+                `No SSRC lines for streamId ${streamId
293
+                     } for remote track, media type: ${mediaType}`));
295 294
         // Abort
296 295
         return;
297 296
     }
@@ -304,9 +303,9 @@ TraceablePeerConnection.prototype._remoteTrackAdded = function(stream, track) {
304 303
     if (!ownerEndpointId) {
305 304
         GlobalOnErrorHandler.callErrorHandler(
306 305
             new Error(
307
-                'No SSRC owner known for: ' + trackSsrc
308
-                    + ' for remote track, msid: ' + streamId
309
-                    + ' media type: ' + mediaType));
306
+                `No SSRC owner known for: ${trackSsrc
307
+                     } for remote track, msid: ${streamId
308
+                     } media type: ${mediaType}`));
310 309
         // Abort
311 310
         return;
312 311
     }
@@ -318,7 +317,7 @@ TraceablePeerConnection.prototype._remoteTrackAdded = function(stream, track) {
318 317
 
319 318
     if (!peerMediaInfo) {
320 319
         GlobalOnErrorHandler.callErrorHandler(
321
-            new Error('No peer media info available for: ' + ownerEndpointId));
320
+            new Error(`No peer media info available for: ${ownerEndpointId}`));
322 321
         // Abort
323 322
         return;
324 323
     }
@@ -728,7 +727,7 @@ TraceablePeerConnection.prototype.setRemoteDescription
728 727
 TraceablePeerConnection.prototype.generateRecvonlySsrc = function() {
729 728
     // FIXME replace with SDPUtil.generateSsrc (when it's added)
730 729
     const newSSRC = this.generateNewStreamSSRCInfo().ssrcs[0];
731
-    logger.info('Generated new recvonly SSRC: ' + newSSRC);
730
+    logger.info(`Generated new recvonly SSRC: ${newSSRC}`);
732 731
     this.sdpConsistency.setPrimarySsrc(newSSRC);
733 732
 };
734 733
 
@@ -838,8 +837,11 @@ TraceablePeerConnection.prototype.createAnswer
838 837
                  *  about unmapped ssrcs)
839 838
                  */
840 839
                 if (!RTCBrowserType.isFirefox()) {
841
-                    answer.sdp = this.sdpConsistency.makeVideoPrimarySsrcsConsistent(answer.sdp);
842
-                    this.trace('createAnswerOnSuccess::postTransform (make primary video ssrcs consistent)',
840
+                    answer.sdp
841
+                        = this.sdpConsistency.makeVideoPrimarySsrcsConsistent(
842
+                            answer.sdp);
843
+                    this.trace(
844
+                        'createAnswerOnSuccess::postTransform (make primary video ssrcs consistent)',
843 845
                         dumpSDP(answer));
844 846
                 }
845 847
 

+ 19
- 21
modules/connectivity/ParticipantConnectionStatus.js View File

@@ -81,7 +81,7 @@ export default class ParticipantConnectionStatus {
81 81
          * @type {Object.<string, number>}
82 82
          */
83 83
         this.rtcMutedTimestamp = { };
84
-        logger.info('RtcMuteTimeout set to: ' + this.rtcMuteTimeout);
84
+        logger.info(`RtcMuteTimeout set to: ${this.rtcMuteTimeout}`);
85 85
     }
86 86
 
87 87
     /**
@@ -174,8 +174,8 @@ export default class ParticipantConnectionStatus {
174 174
     onEndpointConnStatusChanged(endpointId, isActive) {
175 175
 
176 176
         logger.debug(
177
-            'Detector RTCEvents.ENDPOINT_CONN_STATUS_CHANGED('
178
-                + Date.now() + '): ' + endpointId + ': ' + isActive);
177
+            `Detector RTCEvents.ENDPOINT_CONN_STATUS_CHANGED(${Date.now()}): ${
178
+                endpointId}: ${isActive}`);
179 179
 
180 180
         // Filter out events for the local JID for now
181 181
         if (endpointId !== this.conference.myUserId()) {
@@ -193,8 +193,8 @@ export default class ParticipantConnectionStatus {
193 193
             participant._setIsConnectionActive(newStatus);
194 194
 
195 195
             logger.debug(
196
-                'Emit endpoint conn status(' + Date.now() + ') '
197
-                    + endpointId + ': ' + newStatus);
196
+                `Emit endpoint conn status(${Date.now()}) ${endpointId}: ${
197
+                    newStatus}`);
198 198
 
199 199
             // Log the event on CallStats
200 200
             Statistics.sendLog(
@@ -250,8 +250,8 @@ export default class ParticipantConnectionStatus {
250 250
                 && remoteTrack.getType() === MediaType.VIDEO) {
251 251
 
252 252
             logger.debug(
253
-                'Detector on remote track added for: '
254
-                    + remoteTrack.getParticipantId());
253
+                `Detector on remote track added for: ${
254
+                    remoteTrack.getParticipantId()}`);
255 255
 
256 256
             remoteTrack.on(
257 257
                 JitsiTrackEvents.TRACK_MUTE_CHANGED,
@@ -272,8 +272,7 @@ export default class ParticipantConnectionStatus {
272 272
 
273 273
             const endpointId = remoteTrack.getParticipantId();
274 274
 
275
-            logger.debug(
276
-                'Detector on remote track removed: ' + endpointId);
275
+            logger.debug(`Detector on remote track removed: ${endpointId}`);
277 276
 
278 277
             remoteTrack.off(
279 278
                 JitsiTrackEvents.TRACK_MUTE_CHANGED,
@@ -329,7 +328,7 @@ export default class ParticipantConnectionStatus {
329 328
             // fired),
330 329
             // so we don't care, but let's print the warning for
331 330
             // debugging purpose
332
-            logger.warn('figure out conn status - no participant for: ' + id);
331
+            logger.warn(`figure out conn status - no participant for: ${id}`);
333 332
             return;
334 333
         }
335 334
 
@@ -348,10 +347,10 @@ export default class ParticipantConnectionStatus {
348 347
             = isConnActiveByJvb && (isVideoMuted || !isVideoTrackFrozen);
349 348
 
350 349
         logger.debug(
351
-            'Figure out conn status, is video muted: ' + isVideoMuted
352
-                + ' is active(jvb): ' + isConnActiveByJvb
353
-                + ' video track frozen: ' + isVideoTrackFrozen
354
-                + ' => ' + isConnectionActive);
350
+            `Figure out conn status, is video muted: ${isVideoMuted
351
+                 } is active(jvb): ${isConnActiveByJvb
352
+                 } video track frozen: ${isVideoTrackFrozen
353
+                 } => ${isConnectionActive}`);
355 354
 
356 355
         this._changeConnectionStatus(participant, isConnectionActive);
357 356
     }
@@ -365,9 +364,9 @@ export default class ParticipantConnectionStatus {
365 364
     onTrackRtcMuted(track) {
366 365
         const participantId = track.getParticipantId();
367 366
         const participant = this.conference.getParticipantById(participantId);
368
-        logger.debug('Detector track RTC muted: ' + participantId);
367
+        logger.debug(`Detector track RTC muted: ${participantId}`);
369 368
         if (!participant) {
370
-            logger.error('No participant for id: ' + participantId);
369
+            logger.error(`No participant for id: ${participantId}`);
371 370
             return;
372 371
         }
373 372
         this.rtcMutedTimestamp[participantId] = Date.now();
@@ -377,7 +376,7 @@ export default class ParticipantConnectionStatus {
377 376
             // triggered.
378 377
             this.clearTimeout(participantId);
379 378
             this.trackTimers[participantId] = window.setTimeout(function() {
380
-                logger.debug('RTC mute timeout for: ' + participantId);
379
+                logger.debug(`RTC mute timeout for: ${participantId}`);
381 380
                 this.clearTimeout(participantId);
382 381
                 this.figureOutConnectionStatus(participantId);
383 382
             }.bind(this), this.rtcMuteTimeout);
@@ -393,7 +392,7 @@ export default class ParticipantConnectionStatus {
393 392
     onTrackRtcUnmuted(track) {
394 393
         const participantId = track.getParticipantId();
395 394
 
396
-        logger.debug('Detector track RTC unmuted: ' + participantId);
395
+        logger.debug(`Detector track RTC unmuted: ${participantId}`);
397 396
 
398 397
         this.clearTimeout(participantId);
399 398
         this.clearRtcMutedTimestamp(participantId);
@@ -411,10 +410,9 @@ export default class ParticipantConnectionStatus {
411 410
         const participantId = track.getParticipantId();
412 411
 
413 412
         logger.debug(
414
-            'Detector on track signalling mute changed: '
415
-                + participantId, track.isMuted());
413
+            `Detector on track signalling mute changed: ${participantId}`,
414
+            track.isMuted());
416 415
 
417 416
         this.figureOutConnectionStatus(participantId);
418 417
     }
419
-
420 418
 }

+ 1
- 1
modules/settings/Settings.js View File

@@ -15,7 +15,7 @@ function getLocalStorage() {
15 15
 }
16 16
 
17 17
 function _p8() {
18
-    return (Math.random().toString(16) + '000000000').substr(2, 8);
18
+    return `${Math.random().toString(16)}000000000`.substr(2, 8);
19 19
 }
20 20
 
21 21
 function generateUniqueId() {

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

@@ -55,7 +55,7 @@ let callStats = null;
55 55
 const DEFAULT_REMOTE_USER = 'jitsi';
56 56
 
57 57
 function initCallback(err, msg) {
58
-    logger.log('CallStats Status: err=' + err + ' msg=' + msg);
58
+    logger.log(`CallStats Status: err=${err} msg=${msg}`);
59 59
 
60 60
     CallStats.initializeInProgress = false;
61 61
 
@@ -153,7 +153,7 @@ const CallStats = _try_catch(function(jingleSession, options) {
153 153
         };
154 154
 
155 155
         // The confID is case sensitive!!!
156
-        this.confID = options.callStatsConfIDNamespace + '/' + options.roomName;
156
+        this.confID = `${options.callStatsConfIDNamespace}/${options.roomName}`;
157 157
 
158 158
         this.callStatsID = options.callStatsID;
159 159
         this.callStatsSecret = options.callStatsSecret;
@@ -237,7 +237,7 @@ const reportType = {
237 237
 
238 238
 CallStats.prototype.pcCallback = _try_catch(function(err, msg) {
239 239
     if (callStats && err !== 'success') {
240
-        logger.error('Monitoring status: ' + err + ' msg: ' + msg);
240
+        logger.error(`Monitoring status: ${err} msg: ${msg}`);
241 241
     }
242 242
 });
243 243
 

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

@@ -181,7 +181,7 @@ function StatsCollector(
181 181
     this._browserType = RTCBrowserType.getBrowserType();
182 182
     const keys = KEYS_BY_BROWSER_TYPE[this._browserType];
183 183
     if (!keys) {
184
-        throw 'The browser type \'' + this._browserType + '\' isn\'t supported!';
184
+        throw `The browser type '${this._browserType}' isn't supported!`;
185 185
     }
186 186
     /**
187 187
      * The function which is to be used to retrieve the value associated in a
@@ -287,7 +287,7 @@ StatsCollector.prototype.start = function(startAudioLevelStats) {
287 287
                             self.processStatsReport();
288 288
                         } catch (e) {
289 289
                             GlobalOnErrorHandler.callErrorHandler(e);
290
-                            logger.error('Unsupported key:' + e, e);
290
+                            logger.error(`Unsupported key:${e}`, e);
291 291
                         }
292 292
 
293 293
                         self.previousStatsReport = self.currentStatsReport;
@@ -317,7 +317,7 @@ StatsCollector.prototype._defineGetStatValueMethod = function(keys) {
317 317
         if (key) {
318 318
             return key;
319 319
         }
320
-        throw 'The property \'' + name + '\' isn\'t supported!';
320
+        throw `The property '${name}' isn't supported!`;
321 321
 
322 322
     };
323 323
 
@@ -436,9 +436,9 @@ StatsCollector.prototype.processStatsReport = function() {
436 436
             const local = this.currentStatsReport[now.localCandidateId];
437 437
             const remote = this.currentStatsReport[now.remoteCandidateId];
438 438
             this.conferenceStats.transport.push({
439
-                ip: remote.ipAddress + ':' + remote.portNumber,
439
+                ip: `${remote.ipAddress}:${remote.portNumber}`,
440 440
                 type: local.transport,
441
-                localip: local.ipAddress + ':' + local.portNumber
441
+                localip: `${local.ipAddress}:${local.portNumber}`
442 442
             });
443 443
         }
444 444
 
@@ -621,7 +621,7 @@ StatsCollector.prototype.processAudioLevelReport = function() {
621 621
         const before = this.baselineAudioLevelsReport[idx];
622 622
         const ssrc = getStatValue(now, 'ssrc');
623 623
         if (!before) {
624
-            logger.warn(ssrc + ' not enough data');
624
+            logger.warn(`${ssrc} not enough data`);
625 625
             continue;
626 626
         }
627 627
 

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

@@ -49,7 +49,7 @@ function formatJitsiTrackErrorForCallStats(error) {
49 49
 
50 50
     // Combine name from error's name plus (possibly) name of original GUM error
51 51
     err.name = (error.name || 'Unknown error') + (error.gum && error.gum.error
52
-        && error.gum.error.name ? ' - ' + error.gum.error.name : '');
52
+        && error.gum.error.name ? ` - ${error.gum.error.name}` : '');
53 53
 
54 54
     // Put all constraints into this field. For constraint failed errors we will
55 55
     // still know which exactly constraint failed as it will be a part of
@@ -118,7 +118,7 @@ Statistics.prototype.startRemoteStats = function(peerconnection) {
118 118
         this.rtpStats.start(Statistics.audioLevelsEnabled);
119 119
     } catch (e) {
120 120
         this.rtpStats = null;
121
-        logger.error('Failed to start collecting remote statistics: ' + e);
121
+        logger.error(`Failed to start collecting remote statistics: ${e}`);
122 122
     }
123 123
 };
124 124
 

+ 7
- 8
modules/transcription/audioRecorder.js View File

@@ -215,8 +215,9 @@ audioRecorder.prototype.start = function() {
215 215
         startRecorder(trackRecorder);
216 216
     });
217 217
     // log that recording has started
218
-    console.log('Started the recording of the audio. There are currently '
219
-        + this.recorders.length + ' recorders active.');
218
+    console.log(
219
+        `Started the recording of the audio. There are currently ${
220
+            this.recorders.length} recorders active.`);
220 221
 };
221 222
 
222 223
 /**
@@ -226,9 +227,7 @@ audioRecorder.prototype.stop = function() {
226 227
     // set the boolean flag to false
227 228
     this.isRecording = false;
228 229
     // stop all recorders
229
-    this.recorders.forEach(function(trackRecorder) {
230
-        stopRecorder(trackRecorder);
231
-    });
230
+    this.recorders.forEach(trackRecorder => stopRecorder(trackRecorder));
232 231
     console.log('stopped recording');
233 232
 };
234 233
 
@@ -244,7 +243,7 @@ audioRecorder.prototype.download = function() {
244 243
         document.body.appendChild(a);
245 244
         a.style = 'display: none';
246 245
         a.href = url;
247
-        a.download = 'test.' + t.fileType.split('/')[1];
246
+        a.download = `test.${t.fileType.split('/')[1]}`;
248 247
         a.click();
249 248
         window.URL.revokeObjectURL(url);
250 249
     });
@@ -257,8 +256,8 @@ audioRecorder.prototype.download = function() {
257 256
  */
258 257
 audioRecorder.prototype.getRecordingResults = function() {
259 258
     if(this.isRecording) {
260
-        throw new Error('cannot get blobs because the AudioRecorder is still'
261
-            + 'recording!');
259
+        throw new Error(
260
+            'cannot get blobs because the AudioRecorder is still recording!');
262 261
     }
263 262
     // make sure the names are up to date before sending them off
264 263
     this.updateNames();

+ 17
- 18
modules/transcription/transcriber.js View File

@@ -50,9 +50,9 @@ const transcriber = function() {
50 50
 transcriber.prototype.start = function start() {
51 51
     if(this.state !== BEFORE_STATE) {
52 52
         throw new Error(
53
-            'The transcription can only start when it\'s in the "'
54
-                + BEFORE_STATE + '" state. It\'s currently in the "'
55
-                + this.state + '" state');
53
+            `The transcription can only start when it's in the "${
54
+                 BEFORE_STATE}" state. It's currently in the "${
55
+                 this.state}" state`);
56 56
     }
57 57
     this.state = RECORDING_STATE;
58 58
     this.audioRecorder.start();
@@ -68,9 +68,9 @@ transcriber.prototype.start = function start() {
68 68
 transcriber.prototype.stop = function stop(callback) {
69 69
     if(this.state !== RECORDING_STATE) {
70 70
         throw new Error(
71
-            'The transcription can only stop when it\'s in the "'
72
-                + RECORDING_STATE + '" state. It\'s currently in the "'
73
-                + this.state + '" state');
71
+            `The transcription can only stop when it's in the "${
72
+                 RECORDING_STATE}" state. It's currently in the "${
73
+                 this.state}" state`);
74 74
     }
75 75
     // stop the recording
76 76
     console.log('stopping recording and sending audio files');
@@ -102,7 +102,7 @@ transcriber.prototype.stop = function stop(callback) {
102 102
 const blobCallBack = function(answer) {
103 103
     console.log(
104 104
         'retrieved an answer from the transcription service. The answer has an'
105
-            + ' array of length: ' + answer.wordArray.length);
105
+            + ` array of length: ${answer.wordArray.length}`);
106 106
     // first add the offset between the start of the transcription and
107 107
     // the start of the recording to all start and end times
108 108
     if(answer.wordArray.length > 0) {
@@ -117,7 +117,7 @@ const blobCallBack = function(answer) {
117 117
         answer.wordArray.forEach(function(wordObject) {
118 118
             wordObject.begin += offset;
119 119
             wordObject.end += offset;
120
-            array += wordObject.word + ',';
120
+            array += `${wordObject.word},`;
121 121
         });
122 122
         array += ']';
123 123
         console.log(array);
@@ -129,7 +129,7 @@ const blobCallBack = function(answer) {
129 129
     // then store the array and decrease the counter
130 130
     this.results.push(answer.wordArray);
131 131
     this.counter--;
132
-    console.log('current counter: ' + this.counter);
132
+    console.log(`current counter: ${this.counter}`);
133 133
     // and check if all results have been received.
134 134
     this.maybeMerge();
135 135
 };
@@ -152,8 +152,8 @@ transcriber.prototype.maybeMerge = function() {
152 152
  */
153 153
 transcriber.prototype.merge = function() {
154 154
     console.log(
155
-        'starting merge process!\n The length of the array: '
156
-            + this.results.length);
155
+        `starting merge process!\n The length of the array: ${
156
+             this.results.length}`);
157 157
     this.transcription = '';
158 158
     // the merging algorithm will look over all Word objects who are at pos 0 in
159 159
     // every array. It will then select the one closest in time to the
@@ -219,14 +219,14 @@ transcriber.prototype.merge = function() {
219 219
  */
220 220
 transcriber.prototype.updateTranscription = function(word, name) {
221 221
     if(name !== undefined && name !== null) {
222
-        this.transcription += '\n' + name + ':';
222
+        this.transcription += `\n${name}:`;
223 223
         this.lineLength = name.length + 1; // +1 for the semi-colon
224 224
     }
225 225
     if(this.lineLength + word.word.length > MAXIMUM_SENTENCE_LENGTH) {
226 226
         this.transcription += '\n    ';
227 227
         this.lineLength = 4; // because of the 4 spaces after the new line
228 228
     }
229
-    this.transcription += ' ' + word.word;
229
+    this.transcription += ` ${word.word}`;
230 230
     this.lineLength += word.word.length + 1; // +1 for the space
231 231
 };
232 232
 
@@ -239,8 +239,7 @@ transcriber.prototype.updateTranscription = function(word, name) {
239 239
  * @returns {boolean} true if any non-zero arrays inside, otherwise false
240 240
  */
241 241
 const hasPopulatedArrays = function(twoDimensionalArray) {
242
-    let i;
243
-    for(i = 0; i < twoDimensionalArray.length; i++) {
242
+    for(let i = 0; i < twoDimensionalArray.length; i++) {
244 243
         if(twoDimensionalArray[i].length === 0) {
245 244
             twoDimensionalArray.splice(i, 1);
246 245
         }
@@ -301,9 +300,9 @@ transcriber.prototype.removeTrack = function(track) {
301 300
 transcriber.prototype.getTranscription = function() {
302 301
     if(this.state !== FINISHED_STATE) {
303 302
         throw new Error(
304
-            'The transcription can only be retrieved when it\'s in the "'
305
-                + FINISHED_STATE + '" state. It\'s currently in the "'
306
-                + this.state + '" state');
303
+            `The transcription can only be retrieved when it's in the "${
304
+                 FINISHED_STATE}" state. It's currently in the "${
305
+                 this.state}" state`);
307 306
     }
308 307
     return this.transcription;
309 308
 };

+ 12
- 13
modules/transcription/transcriptionServices/SphinxTranscriptionService.js View File

@@ -30,16 +30,17 @@ SphinxService.constructor = SphinxService;
30 30
  * @param callback the callback function retrieving the server response
31 31
  */
32 32
 SphinxService.prototype.sendRequest = function(audioFileBlob, callback) {
33
-    console.log('sending an audio file  to ' + this.url);
34
-    console.log('the audio file being sent: ' + audioFileBlob);
33
+    console.log(`sending an audio file  to ${this.url}`);
34
+    console.log(`the audio file being sent: ${audioFileBlob}`);
35 35
     const request = new XMLHttpRequest();
36 36
     request.onreadystatechange = function() {
37 37
         if(request.readyState === XMLHttpRequest.DONE
38 38
             && request.status === 200) {
39 39
             callback(request.responseText);
40 40
         } else if (request.readyState === XMLHttpRequest.DONE) {
41
-            throw new Error('unable to accept response from sphinx server.'
42
-                + 'status: ' + request.status);
41
+            throw new Error(
42
+                `unable to accept response from sphinx server. status: ${
43
+                    request.status}`);
43 44
         }
44 45
         // if not ready no point to throw an error
45 46
     };
@@ -47,7 +48,7 @@ SphinxService.prototype.sendRequest = function(audioFileBlob, callback) {
47 48
     request.setRequestHeader('Content-Type',
48 49
         audioRecorder.determineCorrectFileType());
49 50
     request.send(audioFileBlob);
50
-    console.log('send ' + audioFileBlob);
51
+    console.log(`send ${audioFileBlob}`);
51 52
 };
52 53
 
53 54
 /**
@@ -62,11 +63,10 @@ SphinxService.prototype.formatResponse = function(response) {
62 63
     // the first value in the JSON array
63 64
     result.shift();
64 65
     const array = [];
65
-    result.forEach(function(word) {
66
-        if(!word.filler) {
67
-            array.push(new Word(word.word, word.start, word.end));
68
-        }
69
-    });
66
+    result.forEach(
67
+        word =>
68
+            word.filler
69
+                || array.push(new Word(word.word, word.start, word.end)));
70 70
     return array;
71 71
 };
72 72
 
@@ -76,7 +76,7 @@ SphinxService.prototype.formatResponse = function(response) {
76 76
  * @return {boolean} whether the response is valid
77 77
  */
78 78
 SphinxService.prototype.verify = function(response) {
79
-    console.log('response from server:' + response.toString());
79
+    console.log(`response from server:${response.toString()}`);
80 80
     // test if server responded with a string object
81 81
     if(typeof response !== 'string') {
82 82
         return false;
@@ -109,8 +109,7 @@ SphinxService.prototype.verify = function(response) {
109 109
  * @returns {string} the URL to the sphinx4 server
110 110
  */
111 111
 function getURL() {
112
-    const message = 'config does not contain an url to a '
113
-    + 'Sphinx4 https server';
112
+    const message = 'config does not contain an url to a Sphinx4 https server';
114 113
     if(config.sphinxURL === undefined) {
115 114
         console.log(message);
116 115
     } else {

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

@@ -433,7 +433,7 @@ function generateUsername() {
433 433
     const name = RandomUtil.randomElement(names);
434 434
     const suffix = RandomUtil.randomAlphanumStr(3);
435 435
 
436
-    return name + '-' + suffix;
436
+    return `${name}-${suffix}`;
437 437
 }
438 438
 
439 439
 module.exports = {

+ 8
- 7
modules/version/ComponentsVersions.js View File

@@ -36,7 +36,6 @@ function ComponentsVersions(conference) {
36 36
 
37 37
 ComponentsVersions.prototype.processPresence
38 38
     = function(node, mucResource, mucJid) {
39
-
40 39
         if (node.attributes.xmlns !== 'http://jitsi.org/jitmeet') {
41 40
             logger.warn('Ignored presence versions node - invalid xmlns', node);
42 41
             return;
@@ -44,7 +43,8 @@ ComponentsVersions.prototype.processPresence
44 43
 
45 44
         if (!this.conference._isFocus(mucJid)) {
46 45
             logger.warn(
47
-            'Received versions not from the focus user: ' + node, mucJid);
46
+                `Received versions not from the focus user: ${node}`,
47
+                mucJid);
48 48
             return;
49 49
         }
50 50
 
@@ -56,24 +56,25 @@ ComponentsVersions.prototype.processPresence
56 56
             && componentName !== ComponentsVersions.XMPP_SERVER_COMPONENT
57 57
             && componentName !== ComponentsVersions.VIDEOBRIDGE_COMPONENT) {
58 58
                 logger.warn(
59
-                'Received version for not supported component name: '
60
-                    + componentName);
59
+                    `Received version for not supported component name: ${
60
+                        componentName}`);
61 61
                 return;
62 62
             }
63 63
 
64 64
             const version = item.value;
65 65
             if (this.versions[componentName] !== version) {
66 66
                 this.versions[componentName] = version;
67
-                logger.info('Got ' + componentName + ' version: ' + version);
67
+                logger.info(`Got ${componentName} version: ${version}`);
68 68
 
69 69
                 log.push({
70 70
                     id: 'component_version',
71 71
                     component: componentName,
72
-                    version});
72
+                    version
73
+                });
73 74
             }
74 75
         }.bind(this));
75 76
 
76
-    // logs versions to stats
77
+        // logs versions to stats
77 78
         if (log.length > 0) {
78 79
             Statistics.sendLog(JSON.stringify(log));
79 80
         }

+ 4
- 4
modules/xmpp/Caps.js View File

@@ -105,7 +105,7 @@ export default class Caps extends Listenable {
105 105
         const user
106 106
             = jid in this.jidToVersion ? this.jidToVersion[jid] : null;
107 107
         if(!user || !(user.version in this.versionToCapabilities)) {
108
-            const node = user ? user.node + '#' + user.version : null;
108
+            const node = user ? `${user.node}#${user.version}` : null;
109 109
             return new Promise((resolve, reject) =>
110 110
                 this.disco.info(jid, node, response => {
111 111
                     const features = new Set();
@@ -178,15 +178,15 @@ export default class Caps extends Listenable {
178 178
         this.version = b64_sha1(
179 179
             identities.reduce(
180 180
                     (accumulatedValue, identity) =>
181
-                        IDENTITY_PROPERTIES.reduce(
181
+                        `${IDENTITY_PROPERTIES.reduce(
182 182
                                 (tmp, key, idx) =>
183 183
                                     tmp
184 184
                                         + (idx === 0 ? '' : '/')
185 185
                                         + identity[key],
186 186
                                 '')
187
-                            + '<',
187
+                             }<`,
188 188
                     '')
189
-                + features.reduce((tmp, feature) => tmp + feature + '<', ''));
189
+                + features.reduce((tmp, feature) => `${tmp + feature}<`, ''));
190 190
         this._notifyVersionChanged();
191 191
     }
192 192
 

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

@@ -73,7 +73,7 @@ export default class ChatRoom extends Listenable {
73 73
         this.roomjid = Strophe.getBareJidFromJid(jid);
74 74
         this.myroomjid = jid;
75 75
         this.password = password;
76
-        logger.info('Joined MUC as ' + this.myroomjid);
76
+        logger.info(`Joined MUC as ${this.myroomjid}`);
77 77
         this.members = {};
78 78
         this.presMap = {};
79 79
         this.presHandlers = {};
@@ -266,7 +266,7 @@ export default class ChatRoom extends Listenable {
266 266
         const jid = mucUserItem.attr('jid');
267 267
         member.jid = jid;
268 268
         member.isFocus
269
-            = jid && jid.indexOf(this.moderator.getFocusUserJid() + '/') === 0;
269
+            = jid && jid.indexOf(`${this.moderator.getFocusUserJid()}/`) === 0;
270 270
         member.isHiddenDomain
271 271
             = jid && jid.indexOf('@') > 0
272 272
                 && this.options.hiddenDomain
@@ -421,7 +421,7 @@ export default class ChatRoom extends Listenable {
421 421
                 this.recording.handleJibriPresence(this.lastJibri);
422 422
             }
423 423
         }
424
-        logger.info('Ignore focus: ' + from + ', real JID: ' + mucJid);
424
+        logger.info(`Ignore focus: ${from}, real JID: ${mucJid}`);
425 425
     }
426 426
 
427 427
     /**
@@ -446,7 +446,7 @@ export default class ChatRoom extends Listenable {
446 446
             }
447 447
         } catch (e) {
448 448
             GlobalOnErrorHandler.callErrorHandler(e);
449
-            logger.error('Error processing:' + node.tagName + ' node.', e);
449
+            logger.error(`Error processing:${node.tagName} node.`, e);
450 450
         }
451 451
     }
452 452
 
@@ -558,7 +558,7 @@ export default class ChatRoom extends Listenable {
558 558
             const subjectText = subject.text();
559 559
             if (subjectText || subjectText === '') {
560 560
                 this.eventEmitter.emit(XMPPEvents.SUBJECT_CHANGED, subjectText);
561
-                logger.log('Subject is changed to ' + subjectText);
561
+                logger.log(`Subject is changed to ${subjectText}`);
562 562
             }
563 563
         }
564 564
 
@@ -572,7 +572,7 @@ export default class ChatRoom extends Listenable {
572 572
             if (stamp) {
573 573
                 // the format is CCYYMMDDThh:mm:ss
574 574
                 const dateParts = stamp.match(/(\d{4})(\d{2})(\d{2}T\d{2}:\d{2}:\d{2})/);
575
-                stamp = dateParts[1] + '-' + dateParts[2] + '-' + dateParts[3] + 'Z';
575
+                stamp = `${dateParts[1]}-${dateParts[2]}-${dateParts[3]}Z`;
576 576
             }
577 577
         }
578 578
 
@@ -760,7 +760,7 @@ export default class ChatRoom extends Listenable {
760 760
      */
761 761
     getMediaPresenceInfo(endpointId, mediaType) {
762 762
         // Will figure out current muted status by looking up owner's presence
763
-        const pres = this.lastPresences[this.roomjid + '/' + endpointId];
763
+        const pres = this.lastPresences[`${this.roomjid}/${endpointId}`];
764 764
         if (!pres) {
765 765
             // No presence available
766 766
             return null;
@@ -781,7 +781,7 @@ export default class ChatRoom extends Listenable {
781 781
                 data.videoType = videoTypeNode[0].value;
782 782
             }
783 783
         } else {
784
-            logger.error('Unsupported media type: ' + mediaType);
784
+            logger.error(`Unsupported media type: ${mediaType}`);
785 785
             return null;
786 786
         }
787 787
 

+ 94
- 102
modules/xmpp/JingleSessionPC.js View File

@@ -173,12 +173,15 @@ export default class JingleSessionPC extends JingleSession {
173 173
                 return;
174 174
             }
175 175
             const now = window.performance.now();
176
-            this.room.connectionTimes['ice.state.'
177
-            + this.peerconnection.iceConnectionState] = now;
178
-            logger.log('(TIME) ICE ' + this.peerconnection.iceConnectionState
179
-                + ':\t', now);
176
+            this.room.connectionTimes[
177
+                    `ice.state.${this.peerconnection.iceConnectionState}`]
178
+                = now;
179
+            logger.log(
180
+                `(TIME) ICE ${this.peerconnection.iceConnectionState}:\t`,
181
+                now);
180 182
             Statistics.analytics.sendEvent(
181
-                'ice.' + this.peerconnection.iceConnectionState, {value: now});
183
+                `ice.${this.peerconnection.iceConnectionState}`,
184
+                {value: now});
182 185
             this.room.eventEmitter.emit(
183 186
                 XMPPEvents.ICE_CONNECTION_STATE_CHANGED,
184 187
                 this.peerconnection.iceConnectionState);
@@ -314,7 +317,7 @@ export default class JingleSessionPC extends JingleSession {
314 317
         this.connection.sendIQ(
315 318
             cand, null, this.newJingleErrorHandler(cand, function(error) {
316 319
                 GlobalOnErrorHandler.callErrorHandler(
317
-                    new Error('Jingle error: ' + JSON.stringify(error)));
320
+                    new Error(`Jingle error: ${JSON.stringify(error)}`));
318 321
             }), IQ_TIMEOUT);
319 322
     }
320 323
 
@@ -323,7 +326,7 @@ export default class JingleSessionPC extends JingleSession {
323 326
             const ssrcs
324 327
                 = $(content).find(
325 328
                     'description>'
326
-                    + 'source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]');
329
+                        + 'source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]');
327 330
             ssrcs.each((idx, ssrcElement) => {
328 331
                 const ssrc = ssrcElement.getAttribute('ssrc');
329 332
                 $(ssrcElement)
@@ -396,8 +399,8 @@ export default class JingleSessionPC extends JingleSession {
396 399
                     finishedCallback();
397 400
                 }, error => {
398 401
                     logger.error(
399
-                        'Error renegotiating after setting new remote offer: '
400
-                            + error);
402
+                        `Error renegotiating after setting new remote offer: ${
403
+                             error}`);
401 404
                     JingleSessionPC.onJingleFatalError(this, error);
402 405
                     finishedCallback(error);
403 406
                 });
@@ -405,13 +408,8 @@ export default class JingleSessionPC extends JingleSession {
405 408
         this.modificationQueue.push(
406 409
             workFunction,
407 410
             error => {
408
-                if (!error) {
409
-                    success();
410
-                } else {
411
-                    failure(error);
412
-                }
413
-            }
414
-        );
411
+                error ? failure(error) : success();
412
+            });
415 413
     }
416 414
 
417 415
     /**
@@ -537,7 +535,10 @@ export default class JingleSessionPC extends JingleSession {
537 535
             const mline = SDPUtil.parse_mline(medialines.split('\r\n')[0]);
538 536
             transportAccept.c('content',
539 537
                 {
540
-                    creator: this.initiator == this.localJid ? 'initiator' : 'responder',
538
+                    creator:
539
+                        this.initiator == this.localJid
540
+                            ? 'initiator'
541
+                            : 'responder',
541 542
                     name: mline.media
542 543
                 }
543 544
             );
@@ -651,8 +652,9 @@ export default class JingleSessionPC extends JingleSession {
651 652
                     }).get();
652 653
 
653 654
                     if (ssrcs.length) {
654
-                        lines += 'a=ssrc-group:' + semantics
655
-                            + ' ' + ssrcs.join(' ') + '\r\n';
655
+                        lines
656
+                            += `a=ssrc-group:${semantics} ${ssrcs.join(' ')
657
+                                }\r\n`;
656 658
                     }
657 659
                 });
658 660
             // handles both >source and >description>source
@@ -663,19 +665,19 @@ export default class JingleSessionPC extends JingleSession {
663 665
                 const ssrc = $(this).attr('ssrc');
664 666
                 if (currentRemoteSdp.containsSSRC(ssrc)) {
665 667
                     logger.warn(
666
-                        'Source-add request for existing SSRC: ' + ssrc);
668
+                        `Source-add request for existing SSRC: ${ssrc}`);
667 669
                     return;
668 670
                 }
669 671
                 $(this).find('>parameter').each(function() {
670
-                    lines += 'a=ssrc:' + ssrc + ' ' + $(this).attr('name');
672
+                    lines += `a=ssrc:${ssrc} ${$(this).attr('name')}`;
671 673
                     if ($(this).attr('value') && $(this).attr('value').length) {
672
-                        lines += ':' + $(this).attr('value');
674
+                        lines += `:${$(this).attr('value')}`;
673 675
                     }
674 676
                     lines += '\r\n';
675 677
                 });
676 678
             });
677 679
             currentRemoteSdp.media.forEach(function(media, idx) {
678
-                if (!SDPUtil.find_line(media, 'a=mid:' + name)) {
680
+                if (!SDPUtil.find_line(media, `a=mid:${name}`)) {
679 681
                     return;
680 682
                 }
681 683
                 if (!addSsrcInfo[idx]) {
@@ -720,8 +722,7 @@ export default class JingleSessionPC extends JingleSession {
720 722
                     finishedCallback();
721 723
                 }, error => {
722 724
                     logger.error(
723
-                        `Error renegotiating after processing remote source-add:
724
-                        ${error}`);
725
+                        `Error renegotiating after processing remote source-add: ${error}`);
725 726
                     finishedCallback(error);
726 727
                 });
727 728
         };
@@ -761,8 +762,7 @@ export default class JingleSessionPC extends JingleSession {
761 762
                     finishedCallback();
762 763
                 }, error => {
763 764
                     logger.error(
764
-                        'Error renegotiating after processing'
765
-                            + ' remote source-remove: ' + error);
765
+                        `Error renegotiating after processing remote source-remove: ${error}`);
766 766
                     finishedCallback(error);
767 767
                 });
768 768
         };
@@ -823,7 +823,7 @@ export default class JingleSessionPC extends JingleSession {
823 823
             lines.pop(); // remove empty last element;
824 824
             lines.forEach(function(line) {
825 825
                 remoteSdp.media[idx]
826
-                    = remoteSdp.media[idx].replace(line + '\r\n', '');
826
+                    = remoteSdp.media[idx].replace(`${line}\r\n`, '');
827 827
             });
828 828
         });
829 829
         remoteSdp.raw = remoteSdp.session + remoteSdp.media.join('');
@@ -893,13 +893,16 @@ export default class JingleSessionPC extends JingleSession {
893 893
                     logger.debug('Renegotiate: creating answer');
894 894
                     this.peerconnection.createAnswer(
895 895
                         answer => {
896
-                            const localUfrag = JingleSessionPC.getUfrag(answer.sdp);
896
+                            const localUfrag
897
+                                = JingleSessionPC.getUfrag(answer.sdp);
897 898
                             if (localUfrag != this.localUfrag) {
898 899
                                 this.localUfrag = localUfrag;
899 900
                                 this.room.eventEmitter.emit(
900
-                                        XMPPEvents.LOCAL_UFRAG_CHANGED, localUfrag);
901
+                                        XMPPEvents.LOCAL_UFRAG_CHANGED,
902
+                                        localUfrag);
901 903
                             }
902
-                            logger.debug('Renegotiate: setting local description');
904
+                            logger.debug(
905
+                                'Renegotiate: setting local description');
903 906
                             this.peerconnection.setLocalDescription(
904 907
                                 answer,
905 908
                                 () => {
@@ -907,18 +910,16 @@ export default class JingleSessionPC extends JingleSession {
907 910
                                 },
908 911
                                 error => {
909 912
                                     reject(
910
-                                        'setLocalDescription failed: ' + error);
913
+                                        `setLocalDescription failed: ${error}`);
911 914
                                 }
912 915
                             );
913 916
                         },
914
-                        error => {
915
-                            reject('createAnswer failed: ' + error);
916
-                        },
917
+                        error => reject(`createAnswer failed: ${error}`),
917 918
                         media_constraints
918 919
                     );
919 920
                 },
920 921
                 error => {
921
-                    reject('setRemoteDescription failed: ' + error);
922
+                    reject(`setRemoteDescription failed: ${error}`);
922 923
                 }
923 924
             );
924 925
         });
@@ -969,7 +970,7 @@ export default class JingleSessionPC extends JingleSession {
969 970
                         finishedCallback();
970 971
                     }, error => {
971 972
                         logger.error(
972
-                            'replaceTrack renegotiation failed: ' + error);
973
+                            `replaceTrack renegotiation failed: ${error}`);
973 974
                         finishedCallback(error);
974 975
                     });
975 976
             };
@@ -1026,8 +1027,9 @@ export default class JingleSessionPC extends JingleSession {
1026 1027
                     }).get();
1027 1028
 
1028 1029
                     if (ssrcs.length) {
1029
-                        lines += 'a=ssrc-group:' + semantics
1030
-                            + ' ' + ssrcs.join(' ') + '\r\n';
1030
+                        lines
1031
+                            += `a=ssrc-group:${semantics} ${ssrcs.join(' ')
1032
+                                }\r\n`;
1031 1033
                     }
1032 1034
                 });
1033 1035
             const ssrcs = [];
@@ -1040,7 +1042,7 @@ export default class JingleSessionPC extends JingleSession {
1040 1042
                 ssrcs.push(ssrc);
1041 1043
             });
1042 1044
             currentRemoteSdp.media.forEach(function(media, idx) {
1043
-                if (!SDPUtil.find_line(media, 'a=mid:' + name)) {
1045
+                if (!SDPUtil.find_line(media, `a=mid:${name}`)) {
1044 1046
                     return;
1045 1047
                 }
1046 1048
                 if (!removeSsrcInfo[idx]) {
@@ -1048,9 +1050,9 @@ export default class JingleSessionPC extends JingleSession {
1048 1050
                 }
1049 1051
                 ssrcs.forEach(function(ssrc) {
1050 1052
                     const ssrcLines
1051
-                        = SDPUtil.find_lines(media, 'a=ssrc:' + ssrc);
1053
+                        = SDPUtil.find_lines(media, `a=ssrc:${ssrc}`);
1052 1054
                     if (ssrcLines.length) {
1053
-                        removeSsrcInfo[idx] += ssrcLines.join('\r\n') + '\r\n';
1055
+                        removeSsrcInfo[idx] += `${ssrcLines.join('\r\n')}\r\n`;
1054 1056
                     }
1055 1057
                 });
1056 1058
                 removeSsrcInfo[idx] += lines;
@@ -1082,8 +1084,7 @@ export default class JingleSessionPC extends JingleSession {
1082 1084
         const workFunction = finishedCallback => {
1083 1085
             if (!this.peerconnection) {
1084 1086
                 finishedCallback(
1085
-                    'Error: '
1086
-                        + 'tried adding stream with no active peer connection');
1087
+                    'Error: tried adding stream with no active peer connection');
1087 1088
                 return;
1088 1089
             }
1089 1090
             this.addStreamToPeerConnection(stream, ssrcInfo);
@@ -1252,8 +1253,7 @@ export default class JingleSessionPC extends JingleSession {
1252 1253
     notifyMySSRCUpdate(old_sdp, new_sdp) {
1253 1254
 
1254 1255
         if (this.state !== JingleSessionState.ACTIVE) {
1255
-            logger.warn(
1256
-                'Skipping SSRC update in \'' + this.state + ' \' state.');
1256
+            logger.warn(`Skipping SSRC update in '${this.state} ' state.`);
1257 1257
             return;
1258 1258
         }
1259 1259
 
@@ -1276,7 +1276,7 @@ export default class JingleSessionPC extends JingleSession {
1276 1276
                 remove, null,
1277 1277
                 this.newJingleErrorHandler(remove, function(error) {
1278 1278
                     GlobalOnErrorHandler.callErrorHandler(
1279
-                        new Error('Jingle error: ' + JSON.stringify(error)));
1279
+                        new Error(`Jingle error: ${JSON.stringify(error)}`));
1280 1280
                 }), IQ_TIMEOUT);
1281 1281
         } else {
1282 1282
             logger.log('removal not necessary');
@@ -1301,7 +1301,7 @@ export default class JingleSessionPC extends JingleSession {
1301 1301
             this.connection.sendIQ(
1302 1302
                 add, null, this.newJingleErrorHandler(add, function(error) {
1303 1303
                     GlobalOnErrorHandler.callErrorHandler(
1304
-                        new Error('Jingle error: ' + JSON.stringify(error)));
1304
+                        new Error(`Jingle error: ${JSON.stringify(error)}`));
1305 1305
                 }), IQ_TIMEOUT);
1306 1306
         } else {
1307 1307
             logger.log('addition not necessary');
@@ -1448,20 +1448,20 @@ export default class JingleSessionPC extends JingleSession {
1448 1448
         this.modifiedSSRCs.unmute = [];
1449 1449
         if (ssrcs && ssrcs.length) {
1450 1450
             ssrcs.forEach(function(ssrcObj) {
1451
-                const desc = $(jingle.tree()).find('>jingle>content[name="'
1452
-                    + ssrcObj.mtype + '"]>description');
1451
+                const desc
1452
+                    = $(jingle.tree()).find(
1453
+                        `>jingle>content[name="${ssrcObj.mtype}"]>description`);
1453 1454
                 if (!desc || !desc.length) {
1454 1455
                     return;
1455 1456
                 }
1456 1457
                 ssrcObj.ssrcs.forEach(function(ssrc) {
1457
-                    const sourceNode = desc.find('>source[ssrc="'
1458
-                        + ssrc + '"]');
1458
+                    const sourceNode = desc.find(`>source[ssrc="${ssrc}"]`);
1459 1459
                     sourceNode.remove();
1460 1460
                 });
1461 1461
                 ssrcObj.groups.forEach(function(group) {
1462
-                    const groupNode = desc.find('>ssrc-group[semantics="'
1463
-                        + group.semantics + '"]:has(source[ssrc="'
1464
-                        + group.ssrcs[0] + '"])');
1462
+                    const groupNode = desc.find(`>ssrc-group[semantics="${
1463
+                         group.semantics}"]:has(source[ssrc="${
1464
+                         group.ssrcs[0]}"])`);
1465 1465
                     groupNode.remove();
1466 1466
                 });
1467 1467
             });
@@ -1477,31 +1477,29 @@ export default class JingleSessionPC extends JingleSession {
1477 1477
                 const cname = Math.random().toString(36).substring(2);
1478 1478
                 ssrcObj.ssrcs.forEach(function(ssrc) {
1479 1479
                     const sourceNode
1480
-                        = desc.find('>source[ssrc="' + ssrc + '"]');
1480
+                        = desc.find(`>source[ssrc="${ssrc}"]`);
1481 1481
                     sourceNode.remove();
1482
-                    const sourceXML = '<source '
1483
-                        + 'xmlns="urn:xmpp:jingle:apps:rtp:ssma:0" ssrc="'
1484
-                        + ssrc + '">'
1482
+                    const sourceXML
1483
+                        = '<source xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"'
1484
+                        + ` ssrc="${ssrc}">`
1485 1485
                         + '<parameter xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"'
1486
-                        + ' value="' + ssrcObj.msid + '" name="msid"/>'
1486
+                        + ` value="${ssrcObj.msid}" name="msid"/>`
1487 1487
                         + '<parameter xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"'
1488
-                        + ' value="' + cname + '" name="cname" />'
1488
+                        + ` value="${cname}" name="cname" />`
1489 1489
                         + '</source>';
1490 1490
                     desc.append(sourceXML);
1491 1491
                 });
1492 1492
                 ssrcObj.groups.forEach(function(group) {
1493 1493
                     const groupNode
1494
-                        = desc.find('>ssrc-group[semantics="'
1495
-                            + group.semantics + '"]:has(source[ssrc="'
1496
-                            + group.ssrcs[0] + '"])');
1494
+                        = desc.find(
1495
+                            `>ssrc-group[semantics="${group.semantics
1496
+                                }"]:has(source[ssrc="${group.ssrcs[0]}"])`);
1497 1497
                     groupNode.remove();
1498 1498
                     desc.append(
1499
-                        '<ssrc-group semantics="' + group.semantics
1500
-                        + '" xmlns="urn:xmpp:jingle:apps:rtp:ssma:0">'
1501
-                        + '<source ssrc="'
1502
-                            + group.ssrcs.join('"/>' + '<source ssrc="')
1503
-                            + '"/>'
1504
-                        + '</ssrc-group>');
1499
+                        `<ssrc-group semantics="${group.semantics
1500
+                            }" xmlns="urn:xmpp:jingle:apps:rtp:ssma:0">`
1501
+                        + `<source ssrc="${group.ssrcs.join('"/><source ssrc="')
1502
+                            }"/></ssrc-group>`);
1505 1503
                 });
1506 1504
             });
1507 1505
         }
@@ -1520,18 +1518,18 @@ export default class JingleSessionPC extends JingleSession {
1520 1518
             ssrcs.forEach(function(ssrcObj) {
1521 1519
                 ssrcObj.ssrcs.forEach(function(ssrc) {
1522 1520
                     const sourceNode
1523
-                        = $(jingle.tree()).find('>jingle>content[name="'
1524
-                            + ssrcObj.mtype + '"]>description>source[ssrc="'
1525
-                            + ssrc + '"]');
1521
+                        = $(jingle.tree()).find(
1522
+                            `>jingle>content[name="${ssrcObj.mtype
1523
+                                }"]>description>source[ssrc="${ssrc}"]`);
1526 1524
                     sourceNode.remove();
1527 1525
                 });
1528 1526
                 ssrcObj.groups.forEach(function(group) {
1529 1527
                     const groupNode
1530 1528
                         = $(jingle.tree()).find(
1531
-                            '>jingle>content[name="' + ssrcObj.mtype
1532
-                            + '"]>description>ssrc-group[semantics="'
1533
-                            + group.semantics + '"]:has(source[ssrc="'
1534
-                            + group.ssrcs[0] + '"])');
1529
+                            `>jingle>content[name="${ssrcObj.mtype
1530
+                                }"]>description>ssrc-group[semantics="${
1531
+                                group.semantics}"]:has(source[ssrc="${
1532
+                                group.ssrcs[0]}"])`);
1535 1533
                     groupNode.remove();
1536 1534
                 });
1537 1535
             });
@@ -1546,27 +1544,25 @@ export default class JingleSessionPC extends JingleSession {
1546 1544
                         jingle, ssrcObj.mtype);
1547 1545
                 ssrcObj.ssrcs.forEach(function(ssrc) {
1548 1546
                     const sourceNode
1549
-                        = desc.find('>source[ssrc="' + ssrc + '"]');
1547
+                        = desc.find(`>source[ssrc="${ssrc}"]`);
1550 1548
                     if (!sourceNode || !sourceNode.length) {
1551 1549
                         // Maybe we have to include cname, msid, etc here?
1552 1550
                         desc.append(
1553
-                            '<source '
1554
-                            + 'xmlns="urn:xmpp:jingle:apps:rtp:ssma:0" '
1555
-                            + 'ssrc="' + ssrc + '"></source>');
1551
+                            '<source xmlns="urn:xmpp:jingle:apps:rtp:ssma:0" '
1552
+                                + `ssrc="${ssrc}"></source>`);
1556 1553
                     }
1557 1554
                 });
1558 1555
                 ssrcObj.groups.forEach(function(group) {
1559 1556
                     const groupNode
1560
-                        = desc.find('>ssrc-group[semantics="'
1561
-                            + group.semantics + '"]:has(source[ssrc="'
1562
-                            + group.ssrcs[0] + '"])');
1557
+                        = desc.find(`>ssrc-group[semantics="${
1558
+                             group.semantics}"]:has(source[ssrc="${
1559
+                             group.ssrcs[0]}"])`);
1563 1560
                     if (!groupNode || !groupNode.length) {
1564
-                        desc.append('<ssrc-group semantics="'
1565
-                            + group.semantics
1566
-                            + '" xmlns="urn:xmpp:jingle:apps:rtp:ssma:0">'
1567
-                            + '<source ssrc="'
1568
-                                + group.ssrcs.join('"/><source ssrc="')
1569
-                                + '"/>'
1561
+                        desc.append(
1562
+                            `<ssrc-group semantics="${group.semantics
1563
+                                }" xmlns="urn:xmpp:jingle:apps:rtp:ssma:0">`
1564
+                            + `<source ssrc="${
1565
+                                group.ssrcs.join('"/><source ssrc="')}"/>`
1570 1566
                             + '</ssrc-group>');
1571 1567
                     }
1572 1568
                 });
@@ -1581,21 +1577,19 @@ export default class JingleSessionPC extends JingleSession {
1581 1577
      * @param mtype - the content type(audio, video, etc.)
1582 1578
      */
1583 1579
     static createDescriptionNode(jingle, mtype) {
1584
-        let content = $(jingle.tree()).find('>jingle>content[name="'
1585
-            + mtype + '"]');
1580
+        let content = $(jingle.tree()).find(`>jingle>content[name="${mtype}"]`);
1586 1581
 
1587 1582
         if (!content || !content.length) {
1588 1583
             $(jingle.tree()).find('>jingle').append(
1589
-                '<content name="' + mtype + '"></content>');
1590
-            content = $(jingle.tree()).find('>jingle>content[name="'
1591
-                + mtype + '"]');
1584
+                `<content name="${mtype}"></content>`);
1585
+            content = $(jingle.tree()).find(`>jingle>content[name="${mtype}"]`);
1592 1586
         }
1593 1587
 
1594 1588
         let desc = content.find('>description');
1595 1589
         if (!desc || !desc.length) {
1596
-            content.append('<description '
1597
-                + 'xmlns="urn:xmpp:jingle:apps:rtp:1" media="'
1598
-                + mtype + '"></description>');
1590
+            content.append(
1591
+                `<description xmlns="urn:xmpp:jingle:apps:rtp:1" media="${
1592
+                    mtype}"></description>`);
1599 1593
             desc = content.find('>description');
1600 1594
         }
1601 1595
         return desc;
@@ -1605,12 +1599,10 @@ export default class JingleSessionPC extends JingleSession {
1605 1599
      * Extracts the ice username fragment from an SDP string.
1606 1600
      */
1607 1601
     static getUfrag(sdp) {
1608
-        const ufragLines = sdp.split('\n').filter(function(line) {
1609
-            return line.startsWith('a=ice-ufrag:');
1610
-        });
1602
+        const ufragLines
1603
+            = sdp.split('\n').filter(line => line.startsWith('a=ice-ufrag:'));
1611 1604
         if (ufragLines.length > 0) {
1612 1605
             return ufragLines[0].substr('a=ice-ufrag:'.length);
1613 1606
         }
1614 1607
     }
1615
-
1616 1608
 }

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

@@ -58,7 +58,7 @@ function updateAssociatedRtxStream(mLine, primarySsrcInfo, rtxSsrc) {
58 58
     });
59 59
     mLine.addSSRCGroup({
60 60
         semantics: 'FID',
61
-        ssrcs: primarySsrc + ' ' + rtxSsrc
61
+        ssrcs: `${primarySsrc} ${rtxSsrc}`
62 62
     });
63 63
 }
64 64
 /**

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

@@ -6,13 +6,13 @@ const SDPUtil = require('./SDPUtil');
6 6
 function SDP(sdp) {
7 7
     const media = sdp.split('\r\nm=');
8 8
     for (let i = 1, length = media.length; i < length; i++) {
9
-        let media_i = 'm=' + media[i];
9
+        let media_i = `m=${media[i]}`;
10 10
         if (i != length - 1) {
11 11
             media_i += '\r\n';
12 12
         }
13 13
         media[i] = media_i;
14 14
     }
15
-    const session = media.shift() + '\r\n';
15
+    const session = `${media.shift()}\r\n`;
16 16
 
17 17
     this.media = media;
18 18
     this.raw = session + media.join('');
@@ -122,9 +122,9 @@ SDP.prototype.mangle = function() {
122 122
                 }
123 123
                 mline.fmt.push(rtpmap.id);
124 124
             }
125
-            newdesc += lines[j] + '\r\n';
125
+            newdesc += `${lines[j]}\r\n`;
126 126
         }
127
-        this.media[i] = SDPUtil.build_mline(mline) + '\r\n' + newdesc;
127
+        this.media[i] = `${SDPUtil.build_mline(mline)}\r\n${newdesc}`;
128 128
     }
129 129
     this.raw = this.session + this.media.join('');
130 130
 };
@@ -134,7 +134,7 @@ SDP.prototype.removeSessionLines = function(prefix) {
134 134
     const self = this;
135 135
     const lines = SDPUtil.find_lines(this.session, prefix);
136 136
     lines.forEach(function(line) {
137
-        self.session = self.session.replace(line + '\r\n', '');
137
+        self.session = self.session.replace(`${line}\r\n`, '');
138 138
     });
139 139
     this.raw = this.session + this.media.join('');
140 140
     return lines;
@@ -145,7 +145,7 @@ SDP.prototype.removeMediaLines = function(mediaindex, prefix) {
145 145
     const self = this;
146 146
     const lines = SDPUtil.find_lines(this.media[mediaindex], prefix);
147 147
     lines.forEach(function(line) {
148
-        self.media[mediaindex] = self.media[mediaindex].replace(line + '\r\n', '');
148
+        self.media[mediaindex] = self.media[mediaindex].replace(`${line}\r\n`, '');
149 149
     });
150 150
     this.raw = this.session + this.media.join('');
151 151
     return lines;
@@ -197,10 +197,10 @@ SDP.prototype.toJingle = function(elem, thecreator) {
197 197
                 elem.attrs({ssrc});
198 198
             }
199 199
             for (j = 0; j < mline.fmt.length; j++) {
200
-                rtpmap = SDPUtil.find_line(this.media[i], 'a=rtpmap:' + mline.fmt[j]);
200
+                rtpmap = SDPUtil.find_line(this.media[i], `a=rtpmap:${mline.fmt[j]}`);
201 201
                 elem.c('payload-type', SDPUtil.parse_rtpmap(rtpmap));
202 202
                 // put any 'a=fmtp:' + mline.fmt[j] lines into <param name=foo value=bar/>
203
-                const afmtpline = SDPUtil.find_line(this.media[i], 'a=fmtp:' + mline.fmt[j]);
203
+                const afmtpline = SDPUtil.find_line(this.media[i], `a=fmtp:${mline.fmt[j]}`);
204 204
                 if (afmtpline) {
205 205
                     tmp = SDPUtil.parse_fmtp(afmtpline);
206 206
                     for (k = 0; k < tmp.length; k++) {
@@ -419,7 +419,7 @@ SDP.prototype.transportToJingle = function(mediaindex, elem) {
419 419
 };
420 420
 
421 421
 SDP.prototype.rtcpFbToJingle = function(mediaindex, elem, payloadtype) { // XEP-0293
422
-    const lines = SDPUtil.find_lines(this.media[mediaindex], 'a=rtcp-fb:' + payloadtype);
422
+    const lines = SDPUtil.find_lines(this.media[mediaindex], `a=rtcp-fb:${payloadtype}`);
423 423
     lines.forEach(function(line) {
424 424
         const tmp = SDPUtil.parse_rtcpfb(line);
425 425
         if (tmp.type == 'trr-int') {
@@ -449,9 +449,9 @@ SDP.prototype.rtcpFbFromJingle = function(elem, payloadtype) { // XEP-0293
449 449
     }
450 450
     tmp = elem.find('>rtcp-fb[xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0"]');
451 451
     tmp.each(function() {
452
-        media += 'a=rtcp-fb:' + payloadtype + ' ' + $(this).attr('type');
452
+        media += `a=rtcp-fb:${payloadtype} ${$(this).attr('type')}`;
453 453
         if ($(this).attr('subtype')) {
454
-            media += ' ' + $(this).attr('subtype');
454
+            media += ` ${$(this).attr('subtype')}`;
455 455
         }
456 456
         media += '\r\n';
457 457
     });
@@ -472,7 +472,7 @@ SDP.prototype.fromJingle = function(jingle) {
472 472
                 return content.getAttribute('name');
473 473
             }).get();
474 474
             if (contents.length > 0) {
475
-                self.raw += 'a=group:' + (group.getAttribute('semantics') || group.getAttribute('type')) + ' ' + contents.join(' ') + '\r\n';
475
+                self.raw += `a=group:${group.getAttribute('semantics') || group.getAttribute('type')} ${contents.join(' ')}\r\n`;
476 476
             }
477 477
         });
478 478
     }
@@ -519,15 +519,15 @@ SDP.prototype.jingle2media = function(content) {
519 519
             function() {
520 520
                 return this.getAttribute('id');
521 521
             }).get();
522
-        media += SDPUtil.build_mline(tmp) + '\r\n';
522
+        media += `${SDPUtil.build_mline(tmp)}\r\n`;
523 523
     } else {
524
-        media += 'm=application 1 DTLS/SCTP ' + sctp.attr('number') + '\r\n';
525
-        media += 'a=sctpmap:' + sctp.attr('number')
526
-            + ' ' + sctp.attr('protocol');
524
+        media += `m=application 1 DTLS/SCTP ${sctp.attr('number')}\r\n`;
525
+        media += `a=sctpmap:${sctp.attr('number')
526
+             } ${sctp.attr('protocol')}`;
527 527
 
528 528
         const streamCount = sctp.attr('streams');
529 529
         if (streamCount) {
530
-            media += ' ' + streamCount + '\r\n';
530
+            media += ` ${streamCount}\r\n`;
531 531
         } else {
532 532
             media += '\r\n';
533 533
         }
@@ -540,18 +540,18 @@ SDP.prototype.jingle2media = function(content) {
540 540
     tmp = content.find('>transport[xmlns="urn:xmpp:jingle:transports:ice-udp:1"]');
541 541
     if (tmp.length) {
542 542
         if (tmp.attr('ufrag')) {
543
-            media += SDPUtil.build_iceufrag(tmp.attr('ufrag')) + '\r\n';
543
+            media += `${SDPUtil.build_iceufrag(tmp.attr('ufrag'))}\r\n`;
544 544
         }
545 545
         if (tmp.attr('pwd')) {
546
-            media += SDPUtil.build_icepwd(tmp.attr('pwd')) + '\r\n';
546
+            media += `${SDPUtil.build_icepwd(tmp.attr('pwd'))}\r\n`;
547 547
         }
548 548
         tmp.find('>fingerprint').each(function() {
549 549
             // FIXME: check namespace at some point
550
-            media += 'a=fingerprint:' + this.getAttribute('hash');
551
-            media += ' ' + $(this).text();
550
+            media += `a=fingerprint:${this.getAttribute('hash')}`;
551
+            media += ` ${$(this).text()}`;
552 552
             media += '\r\n';
553 553
             if (this.getAttribute('setup')) {
554
-                media += 'a=setup:' + this.getAttribute('setup') + '\r\n';
554
+                media += `a=setup:${this.getAttribute('setup')}\r\n`;
555 555
             }
556 556
         });
557 557
     }
@@ -569,7 +569,7 @@ SDP.prototype.jingle2media = function(content) {
569 569
         media += 'a=sendrecv\r\n';
570 570
         break;
571 571
     }
572
-    media += 'a=mid:' + content.attr('name') + '\r\n';
572
+    media += `a=mid:${content.attr('name')}\r\n`;
573 573
 
574 574
     // <description><rtcp-mux/></description>
575 575
     // see http://code.google.com/p/libjingle/issues/detail?id=309 -- no spec though
@@ -580,22 +580,22 @@ SDP.prototype.jingle2media = function(content) {
580 580
 
581 581
     if (desc.find('encryption').length) {
582 582
         desc.find('encryption>crypto').each(function() {
583
-            media += 'a=crypto:' + this.getAttribute('tag');
584
-            media += ' ' + this.getAttribute('crypto-suite');
585
-            media += ' ' + this.getAttribute('key-params');
583
+            media += `a=crypto:${this.getAttribute('tag')}`;
584
+            media += ` ${this.getAttribute('crypto-suite')}`;
585
+            media += ` ${this.getAttribute('key-params')}`;
586 586
             if (this.getAttribute('session-params')) {
587
-                media += ' ' + this.getAttribute('session-params');
587
+                media += ` ${this.getAttribute('session-params')}`;
588 588
             }
589 589
             media += '\r\n';
590 590
         });
591 591
     }
592 592
     desc.find('payload-type').each(function() {
593
-        media += SDPUtil.build_rtpmap(this) + '\r\n';
593
+        media += `${SDPUtil.build_rtpmap(this)}\r\n`;
594 594
         if ($(this).find('>parameter').length) {
595
-            media += 'a=fmtp:' + this.getAttribute('id') + ' ';
595
+            media += `a=fmtp:${this.getAttribute('id')} `;
596 596
             media += $(this).find('parameter').map(function() {
597 597
                 return (this.getAttribute('name')
598
-                        ? this.getAttribute('name') + '=' : '')
598
+                        ? `${this.getAttribute('name')}=` : '')
599 599
                     + this.getAttribute('value');
600 600
             }).get().join('; ');
601 601
             media += '\r\n';
@@ -610,7 +610,7 @@ SDP.prototype.jingle2media = function(content) {
610 610
     // xep-0294
611 611
     tmp = desc.find('>rtp-hdrext[xmlns="urn:xmpp:jingle:apps:rtp:rtp-hdrext:0"]');
612 612
     tmp.each(function() {
613
-        media += 'a=extmap:' + this.getAttribute('id') + ' ' + this.getAttribute('uri') + '\r\n';
613
+        media += `a=extmap:${this.getAttribute('id')} ${this.getAttribute('uri')}\r\n`;
614 614
     });
615 615
 
616 616
     content.find('>transport[xmlns="urn:xmpp:jingle:transports:ice-udp:1"]>candidate').each(function() {
@@ -636,7 +636,7 @@ SDP.prototype.jingle2media = function(content) {
636 636
         }).get();
637 637
 
638 638
         if (ssrcs.length) {
639
-            media += 'a=ssrc-group:' + semantics + ' ' + ssrcs.join(' ') + '\r\n';
639
+            media += `a=ssrc-group:${semantics} ${ssrcs.join(' ')}\r\n`;
640 640
         }
641 641
     });
642 642
 
@@ -647,9 +647,9 @@ SDP.prototype.jingle2media = function(content) {
647 647
             const name = this.getAttribute('name');
648 648
             let value = this.getAttribute('value');
649 649
             value = SDPUtil.filter_special_chars(value);
650
-            media += 'a=ssrc:' + ssrc + ' ' + name;
650
+            media += `a=ssrc:${ssrc} ${name}`;
651 651
             if (value && value.length) {
652
-                media += ':' + value;
652
+                media += `:${value}`;
653 653
             }
654 654
             media += '\r\n';
655 655
         });

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

@@ -25,13 +25,13 @@ const SDPUtil = {
25 25
         return line.substring(12);
26 26
     },
27 27
     build_iceufrag(frag) {
28
-        return 'a=ice-ufrag:' + frag;
28
+        return `a=ice-ufrag:${frag}`;
29 29
     },
30 30
     parse_icepwd(line) {
31 31
         return line.substring(10);
32 32
     },
33 33
     build_icepwd(pwd) {
34
-        return 'a=ice-pwd:' + pwd;
34
+        return `a=ice-pwd:${pwd}`;
35 35
     },
36 36
     parse_mid(line) {
37 37
         return line.substring(6);
@@ -50,7 +50,7 @@ const SDPUtil = {
50 50
         return data;
51 51
     },
52 52
     build_mline(mline) {
53
-        return 'm=' + mline.media + ' ' + mline.port + ' ' + mline.proto + ' ' + mline.fmt.join(' ');
53
+        return `m=${mline.media} ${mline.port} ${mline.proto} ${mline.fmt.join(' ')}`;
54 54
     },
55 55
     parse_rtpmap(line) {
56 56
         const data = {};
@@ -77,9 +77,9 @@ const SDPUtil = {
77 77
         return [sctpPort, protocol, streamCount];// SCTP port
78 78
     },
79 79
     build_rtpmap(el) {
80
-        let line = 'a=rtpmap:' + el.getAttribute('id') + ' ' + el.getAttribute('name') + '/' + el.getAttribute('clockrate');
80
+        let line = `a=rtpmap:${el.getAttribute('id')} ${el.getAttribute('name')}/${el.getAttribute('clockrate')}`;
81 81
         if (el.getAttribute('channels') && el.getAttribute('channels') != '1') {
82
-            line += '/' + el.getAttribute('channels');
82
+            line += `/${el.getAttribute('channels')}`;
83 83
         }
84 84
         return line;
85 85
     },
@@ -153,7 +153,7 @@ const SDPUtil = {
153 153
                 candidate.tcptype = elems[i + 1];
154 154
                 break;
155 155
             default: // TODO
156
-                logger.log('parse_icecandidate not translating "' + elems[i] + '" = "' + elems[i + 1] + '"');
156
+                logger.log(`parse_icecandidate not translating "${elems[i]}" = "${elems[i + 1]}"`);
157 157
             }
158 158
         }
159 159
         candidate.network = '1';
@@ -161,7 +161,7 @@ const SDPUtil = {
161 161
         return candidate;
162 162
     },
163 163
     build_icecandidate(cand) {
164
-        let line = ['a=candidate:' + cand.foundation, cand.component, cand.protocol, cand.priority, cand.ip, cand.port, 'typ', cand.type].join(' ');
164
+        let line = [`a=candidate:${cand.foundation}`, cand.component, cand.protocol, cand.priority, cand.ip, cand.port, 'typ', cand.type].join(' ');
165 165
         line += ' ';
166 166
         switch (cand.type) {
167 167
         case 'srflx':
@@ -271,7 +271,7 @@ const SDPUtil = {
271 271
         // a=candidate:2979166662 1 udp 2113937151 192.168.2.100 57698 typ host generation 0
272 272
         //      <candidate component=... foundation=... generation=... id=... ip=... network=... port=... priority=... protocol=... type=.../>
273 273
         if (line.indexOf('candidate:') === 0) {
274
-            line = 'a=' + line;
274
+            line = `a=${line}`;
275 275
         } else if (line.substring(0, 12) != 'a=candidate:') {
276 276
             logger.log('parseCandidate called with a line that is not a candidate line');
277 277
             logger.log(line);
@@ -313,7 +313,7 @@ const SDPUtil = {
313 313
                 candidate.tcptype = elems[i + 1];
314 314
                 break;
315 315
             default: // TODO
316
-                logger.log('not translating "' + elems[i] + '" = "' + elems[i + 1] + '"');
316
+                logger.log(`not translating "${elems[i]}" = "${elems[i + 1]}"`);
317 317
             }
318 318
         }
319 319
         candidate.network = '1';
@@ -342,7 +342,7 @@ const SDPUtil = {
342 342
         line += cand.getAttribute('port');
343 343
         line += ' ';
344 344
         line += 'typ';
345
-        line += ' ' + cand.getAttribute('type');
345
+        line += ` ${cand.getAttribute('type')}`;
346 346
         line += ' ';
347 347
         switch (cand.getAttribute('type')) {
348 348
         case 'srflx':
@@ -369,7 +369,7 @@ const SDPUtil = {
369 369
         line += 'generation';
370 370
         line += ' ';
371 371
         line += cand.getAttribute('generation') || '0';
372
-        return line + '\r\n';
372
+        return `${line}\r\n`;
373 373
     },
374 374
 
375 375
     /**

+ 10
- 9
modules/xmpp/SdpConsistency.js View File

@@ -1,9 +1,11 @@
1 1
 /* global __filename */
2 2
 
3 3
 import { getLogger } from 'jitsi-meet-logger';
4
-import { parsePrimarySSRC,
5
-         parseSecondarySSRC,
6
-         SdpTransformWrap } from './SdpTransformUtil';
4
+import {
5
+    parsePrimarySSRC,
6
+    parseSecondarySSRC,
7
+    SdpTransformWrap
8
+} from './SdpTransformUtil';
7 9
 
8 10
 const logger = getLogger(__filename);
9 11
 
@@ -89,12 +91,12 @@ export default class SdpConsistency {
89 91
             if (!this.cachedPrimarySsrc) {
90 92
                 this.cachedPrimarySsrc = newPrimarySsrc;
91 93
                 logger.info(
92
-                    'Sdp-consistency caching primary ssrc '
93
-                    + this.cachedPrimarySsrc);
94
+                    `Sdp-consistency caching primary ssrc ${
95
+                        this.cachedPrimarySsrc}`);
94 96
             } else {
95 97
                 logger.info(
96
-                    `Sdp-consistency replacing new ssrc ${newPrimarySsrc} with`
97
-                        + ` cached ${this.cachedPrimarySsrc}`);
98
+                    `Sdp-consistency replacing new ssrc ${newPrimarySsrc
99
+                        } with cached ${this.cachedPrimarySsrc}`);
98 100
                 videoMLine.replaceSSRC(
99 101
                     newPrimarySsrc, this.cachedPrimarySsrc);
100 102
                 for (const group of videoMLine.ssrcGroups) {
@@ -103,8 +105,7 @@ export default class SdpConsistency {
103 105
                         const rtxSsrc = parseSecondarySSRC(group);
104 106
                         if (primarySsrc === newPrimarySsrc) {
105 107
                             group.ssrcs
106
-                                = this.cachedPrimarySsrc + ' '
107
-                                    + rtxSsrc;
108
+                                = `${this.cachedPrimarySsrc} ${rtxSsrc}`;
108 109
                         }
109 110
                     }
110 111
                 }

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

@@ -354,7 +354,7 @@ class MLineWrap {
354 354
         }
355 355
 
356 356
         this.mLine.ssrcGroups = this.mLine.ssrcGroups
357
-            .filter(groupInfo => groupInfo.ssrcs.indexOf(ssrc + '') === -1);
357
+            .filter(groupInfo => groupInfo.ssrcs.indexOf(`${ssrc}`) === -1);
358 358
     }
359 359
 
360 360
     /**

+ 18
- 21
modules/xmpp/moderator.js View File

@@ -46,8 +46,9 @@ function Moderator(roomName, xmpp, emitter, options) {
46 46
     function listener(event) {
47 47
         if (event.data && event.data.sessionId) {
48 48
             if (event.origin !== window.location.origin) {
49
-                logger.warn('Ignoring sessionId from different origin: '
50
-                    + event.origin);
49
+                logger.warn(
50
+                    `Ignoring sessionId from different origin: ${
51
+                        event.origin}`);
51 52
                 return;
52 53
             }
53 54
             Settings.setSessionId(event.data.sessionId);
@@ -70,9 +71,8 @@ Moderator.prototype.isSipGatewayEnabled = function() {
70 71
     return this.sipGatewayEnabled;
71 72
 };
72 73
 
73
-
74 74
 Moderator.prototype.onMucMemberLeft = function(jid) {
75
-    logger.info('Someone left is it focus ? ' + jid);
75
+    logger.info(`Someone left is it focus ? ${jid}`);
76 76
     const resource = Strophe.getResourceFromJid(jid);
77 77
     if (resource === 'focus') {
78 78
         logger.info(
@@ -81,15 +81,13 @@ Moderator.prototype.onMucMemberLeft = function(jid) {
81 81
     }
82 82
 };
83 83
 
84
-
85 84
 Moderator.prototype.setFocusUserJid = function(focusJid) {
86 85
     if (!this.focusUserJid) {
87 86
         this.focusUserJid = focusJid;
88
-        logger.info('Focus jid set to:  ' + this.focusUserJid);
87
+        logger.info(`Focus jid set to:  ${this.focusUserJid}`);
89 88
     }
90 89
 };
91 90
 
92
-
93 91
 Moderator.prototype.getFocusUserJid = function() {
94 92
     return this.focusUserJid;
95 93
 };
@@ -99,7 +97,7 @@ Moderator.prototype.getFocusComponent = function() {
99 97
     let focusComponent = this.options.connection.hosts.focus;
100 98
     // If not specified use default:  'focus.domain'
101 99
     if (!focusComponent) {
102
-        focusComponent = 'focus.' + this.options.connection.hosts.domain;
100
+        focusComponent = `focus.${this.options.connection.hosts.domain}`;
103 101
     }
104 102
     return focusComponent;
105 103
 };
@@ -112,8 +110,7 @@ Moderator.prototype.createConferenceIq = function() {
112 110
     const sessionId = Settings.getSessionId();
113 111
     const machineUID = Settings.getMachineId();
114 112
 
115
-    logger.info(
116
-            'Session ID: ' + sessionId + ' machine UID: ' + machineUID);
113
+    logger.info(`Session ID: ${sessionId} machine UID: ${machineUID}`);
117 114
 
118 115
     elem.c('conference', {
119 116
         xmlns: 'http://jitsi.org/protocol/focus',
@@ -221,7 +218,7 @@ Moderator.prototype.createConferenceIq = function() {
221 218
 Moderator.prototype.parseSessionId = function(resultIq) {
222 219
     const sessionId = $(resultIq).find('conference').attr('session-id');
223 220
     if (sessionId) {
224
-        logger.info('Received sessionId:  ' + sessionId);
221
+        logger.info(`Received sessionId:  ${sessionId}`);
225 222
         Settings.setSessionId(sessionId);
226 223
     }
227 224
 };
@@ -236,14 +233,14 @@ Moderator.prototype.parseConfigOptions = function(resultIq) {
236 233
             '>conference>property'
237 234
             + '[name=\'authentication\'][value=\'true\']').length > 0;
238 235
 
239
-    logger.info('Authentication enabled: ' + authenticationEnabled);
236
+    logger.info(`Authentication enabled: ${authenticationEnabled}`);
240 237
 
241 238
     this.externalAuthEnabled = $(resultIq).find(
242 239
             '>conference>property'
243 240
             + '[name=\'externalAuth\'][value=\'true\']').length > 0;
244 241
 
245 242
     logger.info(
246
-        'External authentication enabled: ' + this.externalAuthEnabled);
243
+        `External authentication enabled: ${this.externalAuthEnabled}`);
247 244
 
248 245
     if (!this.externalAuthEnabled) {
249 246
         // We expect to receive sessionId in 'internal' authentication mode
@@ -263,7 +260,7 @@ Moderator.prototype.parseConfigOptions = function(resultIq) {
263 260
         this.sipGatewayEnabled = true;
264 261
     }
265 262
 
266
-    logger.info('Sip gateway enabled:  ' + this.sipGatewayEnabled);
263
+    logger.info(`Sip gateway enabled:  ${this.sipGatewayEnabled}`);
267 264
 };
268 265
 
269 266
 // FIXME We need to show the fact that we're waiting for the focus to the user
@@ -337,7 +334,7 @@ Moderator.prototype._allocateConferenceFocusError = function(error, callback) {
337 334
         return;
338 335
     }
339 336
     const waitMs = this.getNextErrorTimeout();
340
-    const errmsg = 'Focus error, retry after ' + waitMs;
337
+    const errmsg = `Focus error, retry after ${waitMs}`;
341 338
     GlobalOnErrorHandler.callErrorHandler(new Error(errmsg));
342 339
     logger.error(errmsg, error);
343 340
     // Show message
@@ -378,7 +375,7 @@ Moderator.prototype._allocateConferenceFocusSuccess = function(
378 375
         callback();
379 376
     } else {
380 377
         const waitMs = this.getNextTimeout();
381
-        logger.info('Waiting for the focus... ' + waitMs);
378
+        logger.info(`Waiting for the focus... ${waitMs}`);
382 379
         window.setTimeout(() => this.allocateConferenceFocus(callback),
383 380
             waitMs);
384 381
     }
@@ -420,7 +417,7 @@ Moderator.prototype._getLoginUrl = function(popup, urlCb, failureCb) {
420 417
     let str = 'auth url'; // for logger
421 418
     if (popup) {
422 419
         attrs.popup = true;
423
-        str = 'POPUP ' + str;
420
+        str = `POPUP ${str}`;
424 421
     }
425 422
     iq.c('login-url', attrs);
426 423
     /**
@@ -441,13 +438,13 @@ Moderator.prototype._getLoginUrl = function(popup, urlCb, failureCb) {
441 438
             let url = $(result).find('login-url').attr('url');
442 439
             url = decodeURIComponent(url);
443 440
             if (url) {
444
-                logger.info('Got ' + str + ': ' + url);
441
+                logger.info(`Got ${str}: ${url}`);
445 442
                 urlCb(url);
446 443
             } else {
447
-                reportError('Failed to get ' + str + ' from the focus', result);
444
+                reportError(`Failed to get ${str} from the focus`, result);
448 445
             }
449 446
         },
450
-        reportError.bind(undefined, 'Get ' + str + ' error')
447
+        reportError.bind(undefined, `Get ${str} error`)
451 448
     );
452 449
 };
453 450
 
@@ -473,7 +470,7 @@ Moderator.prototype.logout = function(callback) {
473 470
             if (logoutUrl) {
474 471
                 logoutUrl = decodeURIComponent(logoutUrl);
475 472
             }
476
-            logger.info('Log out OK, url: ' + logoutUrl, result);
473
+            logger.info(`Log out OK, url: ${logoutUrl}`, result);
477 474
             Settings.clearSessionId();
478 475
             callback(logoutUrl);
479 476
         },

+ 5
- 4
modules/xmpp/recording.js View File

@@ -102,7 +102,7 @@ Recording.prototype.setRecordingJibri
102 102
             'streamid': options.streamId,
103 103
         }).up();
104 104
 
105
-        logger.log('Set jibri recording: ' + state, iq.nodeTree);
105
+        logger.log(`Set jibri recording: ${state}`, iq.nodeTree);
106 106
         logger.log(iq.nodeTree);
107 107
         this.connection.sendIQ(
108 108
         iq,
@@ -142,9 +142,10 @@ Recording.prototype.setRecordingJirecon
142 142
             // TODO wait for an IQ with the real status, since this is
143 143
             // provisional?
144 144
             self.jireconRid = $(result).find('recording').attr('rid');
145
-            logger.log('Recording '
146
-                + (state === Recording.status.ON ? 'started' : 'stopped')
147
-                + '(jirecon)' + result);
145
+            logger.log(
146
+                `Recording ${
147
+                    state === Recording.status.ON ? 'started' : 'stopped'
148
+                    }(jirecon)${result}`);
148 149
             self.state = state;
149 150
             if (state === Recording.status.OFF) {
150 151
                 self.jireconRid = null;

+ 9
- 9
modules/xmpp/strophe.jingle.js View File

@@ -39,7 +39,7 @@ class JingleConnectionPlugin extends ConnectionPlugin {
39 39
             to: fromJid,
40 40
             id: iq.getAttribute('id')
41 41
         });
42
-        logger.log('on jingle ' + action + ' from ' + fromJid, iq);
42
+        logger.log(`on jingle ${action} from ${fromJid}`, iq);
43 43
         let sess = this.sessions[sid];
44 44
         if ('session-initiate' != action) {
45 45
             if (!sess) {
@@ -178,7 +178,7 @@ class JingleConnectionPlugin extends ConnectionPlugin {
178 178
         this.connection.sendIQ(
179 179
             $iq({type: 'get', to: this.connection.domain})
180 180
                 .c('services', {xmlns: 'urn:xmpp:extdisco:1'})
181
-                .c('service', {host: 'turn.' + this.connection.domain}),
181
+                .c('service', {host: `turn.${this.connection.domain}`}),
182 182
             res => {
183 183
                 const iceservers = [];
184 184
                 $(res).find('>services>service').each((idx, el) => {
@@ -187,15 +187,15 @@ class JingleConnectionPlugin extends ConnectionPlugin {
187 187
                     const type = el.attr('type');
188 188
                     switch (type) {
189 189
                     case 'stun':
190
-                        dict.url = 'stun:' + el.attr('host');
190
+                        dict.url = `stun:${el.attr('host')}`;
191 191
                         if (el.attr('port')) {
192
-                            dict.url += ':' + el.attr('port');
192
+                            dict.url += `:${el.attr('port')}`;
193 193
                         }
194 194
                         iceservers.push(dict);
195 195
                         break;
196 196
                     case 'turn':
197 197
                     case 'turns': {
198
-                        dict.url = type + ':';
198
+                        dict.url = `${type}:`;
199 199
                         const username = el.attr('username');
200 200
                             // https://code.google.com/p/webrtc/issues/detail?id=1508
201 201
                         if (username) {
@@ -205,7 +205,7 @@ class JingleConnectionPlugin extends ConnectionPlugin {
205 205
                                         navigator.userAgent.match(
206 206
                                             /Chrom(e|ium)\/([0-9]+)\./)[2],
207 207
                                             10) < 28) {
208
-                                dict.url += username + '@';
208
+                                dict.url += `${username}@`;
209 209
                             } else {
210 210
                                     // only works in M28
211 211
                                 dict.username = username;
@@ -214,11 +214,11 @@ class JingleConnectionPlugin extends ConnectionPlugin {
214 214
                         dict.url += el.attr('host');
215 215
                         const port = el.attr('port');
216 216
                         if (port && port != '3478') {
217
-                            dict.url += ':' + el.attr('port');
217
+                            dict.url += `:${el.attr('port')}`;
218 218
                         }
219 219
                         const transport = el.attr('transport');
220 220
                         if (transport && transport != 'udp') {
221
-                            dict.url += '?transport=' + transport;
221
+                            dict.url += `?transport=${transport}`;
222 222
                         }
223 223
 
224 224
                         dict.credential = el.attr('password')
@@ -246,7 +246,7 @@ class JingleConnectionPlugin extends ConnectionPlugin {
246 246
             const pc = session.peerconnection;
247 247
             if (pc && pc.updateLog) {
248 248
                 // FIXME: should probably be a .dump call
249
-                data['jingle_' + sid] = {
249
+                data[`jingle_${sid}`] = {
250 250
                     updateLog: pc.updateLog,
251 251
                     stats: pc.stats,
252 252
                     url: window.location.href

+ 4
- 4
modules/xmpp/strophe.ping.js View File

@@ -71,8 +71,8 @@ class PingConnectionPlugin extends ConnectionPlugin {
71 71
         this.xmpp.caps.getFeatures(jid).then(features =>
72 72
             callback(features.has('urn:xmpp:ping')), error => {
73 73
             const errmsg = 'Ping feature discovery error';
74
-            GlobalOnErrorHandler.callErrorHandler(new Error(
75
-                errmsg + ': ' + error));
74
+            GlobalOnErrorHandler.callErrorHandler(
75
+                new Error(`${errmsg}: ${error}`));
76 76
             logger.error(errmsg, error);
77 77
             callback(false);
78 78
         });
@@ -97,7 +97,7 @@ class PingConnectionPlugin extends ConnectionPlugin {
97 97
                 this.failedPings = 0;
98 98
             }, error => {
99 99
                 this.failedPings += 1;
100
-                const errmsg = 'Ping ' + (error ? 'error' : 'timeout');
100
+                const errmsg = `Ping ${error ? 'error' : 'timeout'}`;
101 101
                 if (this.failedPings >= PING_THRESHOLD) {
102 102
                     GlobalOnErrorHandler.callErrorHandler(new Error(errmsg));
103 103
                     logger.error(errmsg, error);
@@ -112,7 +112,7 @@ class PingConnectionPlugin extends ConnectionPlugin {
112 112
                 }
113 113
             }, PING_TIMEOUT);
114 114
         }, interval);
115
-        logger.info('XMPP pings will be sent every ' + interval + ' ms');
115
+        logger.info(`XMPP pings will be sent every ${interval} ms`);
116 116
     }
117 117
 
118 118
     /**

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

@@ -51,7 +51,7 @@ class RayoConnectionPlugin extends ConnectionPlugin {
51 51
                 const resource = $(result).find('ref').attr('uri');
52 52
                 this.call_resource
53 53
                     = resource.substr('xmpp:'.length);
54
-                logger.info('Received call resource: ' + this.call_resource);
54
+                logger.info(`Received call resource: ${this.call_resource}`);
55 55
                 resolve();
56 56
             }, error => {
57 57
                 logger.info('Dial error ', error);

+ 3
- 3
modules/xmpp/strophe.util.js View File

@@ -66,17 +66,17 @@ export default function() {
66 66
             }
67 67
             break;
68 68
         case Strophe.LogLevel.WARN:
69
-            logger.warn('Strophe: ' + msg);
69
+            logger.warn(`Strophe: ${msg}`);
70 70
             const errStatusCapture = lastErrorStatusRegExpr.exec(msg);
71 71
             if (errStatusCapture && errStatusCapture.length === 2) {
72 72
                 lastErrorStatus = parseInt(errStatusCapture[1]);
73 73
                 logger.debug(
74
-                        'lastErrorStatus set to: ' + lastErrorStatus);
74
+                        `lastErrorStatus set to: ${lastErrorStatus}`);
75 75
             }
76 76
             break;
77 77
         case Strophe.LogLevel.ERROR:
78 78
         case Strophe.LogLevel.FATAL:
79
-            msg = 'Strophe: ' + msg;
79
+            msg = `Strophe: ${msg}`;
80 80
             GlobalOnErrorHandler.callErrorHandler(new Error(msg));
81 81
             logger.error(msg);
82 82
             break;

+ 9
- 8
modules/xmpp/xmpp.js View File

@@ -18,7 +18,7 @@ import Caps from './Caps';
18 18
 function createConnection(token, bosh = '/http-bind') {
19 19
     // Append token as URL param
20 20
     if (token) {
21
-        bosh += (bosh.indexOf('?') == -1 ? '?' : '&') + 'token=' + token;
21
+        bosh += `${bosh.indexOf('?') == -1 ? '?' : '&'}token=${token}`;
22 22
     }
23 23
 
24 24
     return new Strophe.Connection(bosh);
@@ -106,15 +106,16 @@ export default class XMPP extends Listenable {
106 106
         const now = window.performance.now();
107 107
         const statusStr = Strophe.getStatusString(status).toLowerCase();
108 108
         this.connectionTimes[statusStr] = now;
109
-        logger.log('(TIME) Strophe ' + statusStr
110
-            + (msg ? '[' + msg + ']' : '') + ':\t', now);
109
+        logger.log(
110
+            `(TIME) Strophe ${statusStr}${msg ? `[${msg}]` : ''}:\t`,
111
+            now);
111 112
         if (status === Strophe.Status.CONNECTED
112 113
             || status === Strophe.Status.ATTACHED) {
113 114
             if (this.options.useStunTurn) {
114 115
                 this.connection.jingle.getStunAndTurnCredentials();
115 116
             }
116 117
 
117
-            logger.info('My Jabber ID: ' + this.connection.jid);
118
+            logger.info(`My Jabber ID: ${this.connection.jid}`);
118 119
 
119 120
             // Schedule ping ?
120 121
             const pingJid = this.connection.domain;
@@ -124,7 +125,7 @@ export default class XMPP extends Listenable {
124 125
                     if (hasPing) {
125 126
                         this.connection.ping.startInterval(pingJid);
126 127
                     } else {
127
-                        logger.warn('Ping NOT supported by ' + pingJid);
128
+                        logger.warn(`Ping NOT supported by ${pingJid}`);
128 129
                     }
129 130
                 }.bind(this));
130 131
 
@@ -238,7 +239,7 @@ export default class XMPP extends Listenable {
238 239
      */
239 240
     attach(options) {
240 241
         const now = this.connectionTimes.attaching = window.performance.now();
241
-        logger.log('(TIME) Strophe Attaching\t:' + now);
242
+        logger.log(`(TIME) Strophe Attaching\t:${now}`);
242 243
         this.connection.attach(options.jid, options.sid,
243 244
             parseInt(options.rid,10) + 1,
244 245
             this.connectionHandler.bind(this, options.password));
@@ -268,7 +269,7 @@ export default class XMPP extends Listenable {
268 269
     createRoom(roomName, options) {
269 270
         // By default MUC nickname is the resource part of the JID
270 271
         let mucNickname = Strophe.getNodeFromJid(this.connection.jid);
271
-        let roomjid = roomName + '@' + this.options.hosts.muc + '/';
272
+        let roomjid = `${roomName}@${this.options.hosts.muc}/`;
272 273
         const cfgNickname
273 274
             = options.useNicks && options.nick ? options.nick : null;
274 275
 
@@ -282,7 +283,7 @@ export default class XMPP extends Listenable {
282 283
         // Constant JIDs need some random part to be appended in order to be
283 284
         // able to join the MUC more than once.
284 285
         if (this.authenticatedUser || cfgNickname !== null) {
285
-            mucNickname += '-' + RandomUtil.randomHexString(6);
286
+            mucNickname += `-${RandomUtil.randomHexString(6)}`;
286 287
         }
287 288
 
288 289
         roomjid += mucNickname;

+ 6
- 6
webpack.config.js View File

@@ -42,7 +42,7 @@ module.exports = {
42 42
                 flags: 'g',
43 43
                 replace:
44 44
                     child_process.execSync( // eslint-disable-line camelcase
45
-                            __dirname + '/get-version.sh')
45
+                            `${__dirname}/get-version.sh`)
46 46
 
47 47
                         // The type of the return value of
48 48
                         // child_process.execSync is either Buffer or String.
@@ -53,13 +53,13 @@ module.exports = {
53 53
                             .trim(),
54 54
                 search: '{#COMMIT_HASH#}'
55 55
             },
56
-            test: __dirname + '/JitsiMeetJS.js'
56
+            test: `${__dirname}/JitsiMeetJS.js`
57 57
         }, {
58 58
             // Transpile ES2015 (aka ES6) to ES5.
59 59
 
60 60
             exclude: [
61
-                __dirname + '/modules/RTC/adapter.screenshare.js',
62
-                __dirname + '/node_modules/'
61
+                `${__dirname}/modules/RTC/adapter.screenshare.js`,
62
+                `${__dirname}/node_modules/`
63 63
             ],
64 64
             loader: 'babel-loader',
65 65
             query: {
@@ -77,10 +77,10 @@ module.exports = {
77 77
         __filename: true
78 78
     },
79 79
     output: {
80
-        filename: '[name]' + (minimize ? '.min' : '') + '.js',
80
+        filename: `[name]${minimize ? '.min' : ''}.js`,
81 81
         library: 'JitsiMeetJS',
82 82
         libraryTarget: 'umd',
83
-        sourceMapFilename: '[name].' + (minimize ? 'min' : 'js') + '.map'
83
+        sourceMapFilename: `[name].${minimize ? 'min' : 'js'}.map`
84 84
     },
85 85
     plugins
86 86
 };

Loading…
Cancel
Save