Pārlūkot izejas kodu

[eslint] space-before-function-paren

release-8443
Lyubo Marinov 8 gadus atpakaļ
vecāks
revīzija
78217478d1
54 mainītis faili ar 787 papildinājumiem un 786 dzēšanām
  1. 1
    0
      .eslintrc.js
  2. 89
    89
      JitsiConference.js
  3. 40
    40
      JitsiConferenceEventManager.js
  4. 11
    11
      JitsiConnection.js
  5. 13
    13
      JitsiMediaDevices.js
  6. 13
    13
      JitsiMeetJS.js
  7. 1
    1
      JitsiParticipant.js
  8. 21
    21
      doc/example/example.js
  9. 2
    2
      modules/DTMF/JitsiDTMFManager.js
  10. 15
    15
      modules/RTC/DataChannels.js
  11. 28
    28
      modules/RTC/JitsiLocalTrack.js
  12. 10
    10
      modules/RTC/JitsiRemoteTrack.js
  13. 27
    27
      modules/RTC/JitsiTrack.js
  14. 50
    50
      modules/RTC/RTC.js
  15. 4
    4
      modules/RTC/RTCUIHelper.js
  16. 58
    58
      modules/RTC/RTCUtils.js
  17. 39
    39
      modules/RTC/TraceablePeerConnection.js
  18. 4
    4
      modules/connectivity/ParticipantConnectionStatus.js
  19. 6
    6
      modules/settings/Settings.js
  20. 2
    2
      modules/statistics/AnalyticsAdapter.js
  21. 23
    23
      modules/statistics/CallStats.js
  22. 3
    3
      modules/statistics/LocalStatsCollector.js
  23. 22
    22
      modules/statistics/RTPStatsCollector.js
  24. 33
    33
      modules/statistics/statistics.js
  25. 8
    8
      modules/transcription/audioRecorder.js
  26. 1
    1
      modules/transcription/transcriber.js
  27. 3
    3
      modules/transcription/word.js
  28. 1
    1
      modules/util/AuthUtil.js
  29. 2
    2
      modules/util/EventEmitterForwarder.js
  30. 5
    5
      modules/util/GlobalOnErrorHandler.js
  31. 2
    2
      modules/util/Listenable.js
  32. 1
    1
      modules/util/RandomUtil.js
  33. 1
    1
      modules/util/ScriptUtil.js
  34. 1
    1
      modules/util/UsernameGenerator.js
  35. 58
    58
      modules/xmpp/ChatRoom.js
  36. 1
    1
      modules/xmpp/ConnectionPlugin.js
  37. 26
    26
      modules/xmpp/JingleSessionPC.js
  38. 6
    6
      modules/xmpp/RtxModifier.js
  39. 4
    4
      modules/xmpp/RtxModifier.spec.js
  40. 26
    26
      modules/xmpp/SDP.js
  41. 2
    2
      modules/xmpp/SDPDiffer.js
  42. 27
    27
      modules/xmpp/SDPUtil.js
  43. 4
    4
      modules/xmpp/SdpConsistency.js
  44. 8
    8
      modules/xmpp/SdpTransformUtil.js
  45. 21
    21
      modules/xmpp/moderator.js
  46. 17
    17
      modules/xmpp/recording.js
  47. 7
    7
      modules/xmpp/strophe.emuc.js
  48. 5
    5
      modules/xmpp/strophe.jingle.js
  49. 4
    4
      modules/xmpp/strophe.logger.js
  50. 6
    6
      modules/xmpp/strophe.ping.js
  51. 4
    4
      modules/xmpp/strophe.rayo.js
  52. 4
    4
      modules/xmpp/strophe.util.js
  53. 15
    15
      modules/xmpp/xmpp.js
  54. 2
    2
      service/RTC/SignalingLayer.js

+ 1
- 0
.eslintrc.js Parādīt failu

@@ -157,6 +157,7 @@ module.exports = {
157 157
         'padded-blocks': 0,
158 158
         'quote-props': 0,
159 159
         'semi': [ 'error', 'always' ],
160
+        'space-before-function-paren': [ 'error', 'never' ],
160 161
         'space-in-parens': [ 'error', 'never' ],
161 162
         'space-infix-ops': 2,
162 163
         'space-unary-ops': 2,

+ 89
- 89
JitsiConference.js Parādīt failu

@@ -93,7 +93,7 @@ function JitsiConference(options) {
93 93
  * @param options {object}
94 94
  * @param connection {JitsiConnection} overrides this.connection
95 95
  */
96
-JitsiConference.prototype._init = function (options) {
96
+JitsiConference.prototype._init = function(options) {
97 97
     if (!options) {
98 98
         options = {};
99 99
     }
@@ -151,7 +151,7 @@ JitsiConference.prototype._init = function (options) {
151 151
  * Joins the conference.
152 152
  * @param password {string} the password
153 153
  */
154
-JitsiConference.prototype.join = function (password) {
154
+JitsiConference.prototype.join = function(password) {
155 155
     if (this.room) {
156 156
         this.room.join(password);
157 157
     }
@@ -160,7 +160,7 @@ JitsiConference.prototype.join = function (password) {
160 160
 /**
161 161
  * Check if joined to the conference.
162 162
  */
163
-JitsiConference.prototype.isJoined = function () {
163
+JitsiConference.prototype.isJoined = function() {
164 164
     return this.room && this.room.joined;
165 165
 };
166 166
 
@@ -168,7 +168,7 @@ JitsiConference.prototype.isJoined = function () {
168 168
  * Leaves the conference.
169 169
  * @returns {Promise}
170 170
  */
171
-JitsiConference.prototype.leave = function () {
171
+JitsiConference.prototype.leave = function() {
172 172
     if (this.participantConnectionStatus) {
173 173
         this.participantConnectionStatus.dispose();
174 174
         this.participantConnectionStatus = null;
@@ -207,35 +207,35 @@ JitsiConference.prototype.leave = function () {
207 207
 /**
208 208
  * Returns name of this conference.
209 209
  */
210
-JitsiConference.prototype.getName = function () {
210
+JitsiConference.prototype.getName = function() {
211 211
     return this.options.name;
212 212
 };
213 213
 
214 214
 /**
215 215
  * Check if authentication is enabled for this conference.
216 216
  */
217
-JitsiConference.prototype.isAuthEnabled = function () {
217
+JitsiConference.prototype.isAuthEnabled = function() {
218 218
     return this.authEnabled;
219 219
 };
220 220
 
221 221
 /**
222 222
  * Check if user is logged in.
223 223
  */
224
-JitsiConference.prototype.isLoggedIn = function () {
224
+JitsiConference.prototype.isLoggedIn = function() {
225 225
     return !!this.authIdentity;
226 226
 };
227 227
 
228 228
 /**
229 229
  * Get authorized login.
230 230
  */
231
-JitsiConference.prototype.getAuthLogin = function () {
231
+JitsiConference.prototype.getAuthLogin = function() {
232 232
     return this.authIdentity;
233 233
 };
234 234
 
235 235
 /**
236 236
  * Check if external authentication is enabled for this conference.
237 237
  */
238
-JitsiConference.prototype.isExternalAuthEnabled = function () {
238
+JitsiConference.prototype.isExternalAuthEnabled = function() {
239 239
     return this.room && this.room.moderator.isExternalAuthEnabled();
240 240
 };
241 241
 
@@ -245,8 +245,8 @@ JitsiConference.prototype.isExternalAuthEnabled = function () {
245 245
  *                                else url of login page.
246 246
  * @returns {Promise}
247 247
  */
248
-JitsiConference.prototype.getExternalAuthUrl = function (urlForPopup) {
249
-    return new Promise(function (resolve, reject) {
248
+JitsiConference.prototype.getExternalAuthUrl = function(urlForPopup) {
249
+    return new Promise(function(resolve, reject) {
250 250
         if (!this.isExternalAuthEnabled()) {
251 251
             reject();
252 252
             return;
@@ -264,7 +264,7 @@ JitsiConference.prototype.getExternalAuthUrl = function (urlForPopup) {
264 264
  * specific type is given.
265 265
  * @param {MediaType} [mediaType] Optional media type (audio or video).
266 266
  */
267
-JitsiConference.prototype.getLocalTracks = function (mediaType) {
267
+JitsiConference.prototype.getLocalTracks = function(mediaType) {
268 268
     let tracks = [];
269 269
     if (this.rtc) {
270 270
         tracks = this.rtc.getLocalTracks(mediaType);
@@ -276,7 +276,7 @@ JitsiConference.prototype.getLocalTracks = function (mediaType) {
276 276
  * Obtains local audio track.
277 277
  * @return {JitsiLocalTrack|null}
278 278
  */
279
-JitsiConference.prototype.getLocalAudioTrack = function () {
279
+JitsiConference.prototype.getLocalAudioTrack = function() {
280 280
     return this.rtc ? this.rtc.getLocalAudioTrack() : null;
281 281
 };
282 282
 
@@ -284,7 +284,7 @@ JitsiConference.prototype.getLocalAudioTrack = function () {
284 284
  * Obtains local video track.
285 285
  * @return {JitsiLocalTrack|null}
286 286
  */
287
-JitsiConference.prototype.getLocalVideoTrack = function () {
287
+JitsiConference.prototype.getLocalVideoTrack = function() {
288 288
     return this.rtc ? this.rtc.getLocalVideoTrack() : null;
289 289
 };
290 290
 
@@ -296,7 +296,7 @@ JitsiConference.prototype.getLocalVideoTrack = function () {
296 296
  *
297 297
  * Note: consider adding eventing functionality by extending an EventEmitter impl, instead of rolling ourselves
298 298
  */
299
-JitsiConference.prototype.on = function (eventId, handler) {
299
+JitsiConference.prototype.on = function(eventId, handler) {
300 300
     if (this.eventEmitter) {
301 301
         this.eventEmitter.on(eventId, handler);
302 302
     }
@@ -309,7 +309,7 @@ JitsiConference.prototype.on = function (eventId, handler) {
309 309
  *
310 310
  * Note: consider adding eventing functionality by extending an EventEmitter impl, instead of rolling ourselves
311 311
  */
312
-JitsiConference.prototype.off = function (eventId, handler) {
312
+JitsiConference.prototype.off = function(eventId, handler) {
313 313
     if (this.eventEmitter) {
314 314
         this.eventEmitter.removeListener(eventId, handler);
315 315
     }
@@ -325,7 +325,7 @@ JitsiConference.prototype.removeEventListener = JitsiConference.prototype.off;
325 325
  * @param command {String} the name of the command
326 326
  * @param handler {Function} handler for the command
327 327
  */
328
-JitsiConference.prototype.addCommandListener = function (command, handler) {
328
+JitsiConference.prototype.addCommandListener = function(command, handler) {
329 329
     if (this.room) {
330 330
         this.room.addPresenceListener(command, handler);
331 331
     }
@@ -335,7 +335,7 @@ JitsiConference.prototype.addCommandListener = function (command, handler) {
335 335
   * Removes command  listener
336 336
   * @param command {String} the name of the command
337 337
   */
338
-JitsiConference.prototype.removeCommandListener = function (command) {
338
+JitsiConference.prototype.removeCommandListener = function(command) {
339 339
     if (this.room) {
340 340
         this.room.removePresenceListener(command);
341 341
     }
@@ -345,7 +345,7 @@ JitsiConference.prototype.removeCommandListener = function (command) {
345 345
  * Sends text message to the other participants in the conference
346 346
  * @param message the text message.
347 347
  */
348
-JitsiConference.prototype.sendTextMessage = function (message) {
348
+JitsiConference.prototype.sendTextMessage = function(message) {
349 349
     if (this.room) {
350 350
         this.room.sendMessage(message);
351 351
     }
@@ -356,7 +356,7 @@ JitsiConference.prototype.sendTextMessage = function (message) {
356 356
  * @param name {String} the name of the command.
357 357
  * @param values {Object} with keys and values that will be sent.
358 358
  **/
359
-JitsiConference.prototype.sendCommand = function (name, values) {
359
+JitsiConference.prototype.sendCommand = function(name, values) {
360 360
     if (this.room) {
361 361
         this.room.addToPresence(name, values);
362 362
         this.room.sendPresence();
@@ -368,7 +368,7 @@ JitsiConference.prototype.sendCommand = function (name, values) {
368 368
  * @param name {String} the name of the command.
369 369
  * @param values {Object} with keys and values that will be sent.
370 370
  **/
371
-JitsiConference.prototype.sendCommandOnce = function (name, values) {
371
+JitsiConference.prototype.sendCommandOnce = function(name, values) {
372 372
     this.sendCommand(name, values);
373 373
     this.removeCommand(name);
374 374
 };
@@ -377,7 +377,7 @@ JitsiConference.prototype.sendCommandOnce = function (name, values) {
377 377
  * Removes presence command.
378 378
  * @param name {String} the name of the command.
379 379
  **/
380
-JitsiConference.prototype.removeCommand = function (name) {
380
+JitsiConference.prototype.removeCommand = function(name) {
381 381
     if (this.room) {
382 382
         this.room.removeFromPresence(name);
383 383
     }
@@ -401,7 +401,7 @@ JitsiConference.prototype.setDisplayName = function(name) {
401 401
  * Set new subject for this conference. (available only for moderator)
402 402
  * @param {string} subject new subject
403 403
  */
404
-JitsiConference.prototype.setSubject = function (subject) {
404
+JitsiConference.prototype.setSubject = function(subject) {
405 405
     if (this.room && this.isModerator()) {
406 406
         this.room.setSubject(subject);
407 407
     }
@@ -435,7 +435,7 @@ JitsiConference.prototype.getTranscriber = function(){
435 435
  * @throws {Error} if the specified track is a video track and there is already
436 436
  * another video track in the conference.
437 437
  */
438
-JitsiConference.prototype.addTrack = function (track) {
438
+JitsiConference.prototype.addTrack = function(track) {
439 439
     if (track.isVideoTrack()) {
440 440
         // Ensure there's exactly 1 local video track in the conference.
441 441
         var localVideoTrack = this.rtc.getLocalVideoTrack();
@@ -458,7 +458,7 @@ JitsiConference.prototype.addTrack = function (track) {
458 458
  * Fires TRACK_AUDIO_LEVEL_CHANGED change conference event.
459 459
  * @param audioLevel the audio level
460 460
  */
461
-JitsiConference.prototype._fireAudioLevelChangeEvent = function (audioLevel) {
461
+JitsiConference.prototype._fireAudioLevelChangeEvent = function(audioLevel) {
462 462
     this.eventEmitter.emit(
463 463
         JitsiConferenceEvents.TRACK_AUDIO_LEVEL_CHANGED,
464 464
         this.myUserId(), audioLevel);
@@ -468,7 +468,7 @@ JitsiConference.prototype._fireAudioLevelChangeEvent = function (audioLevel) {
468 468
  * Fires TRACK_MUTE_CHANGED change conference event.
469 469
  * @param track the JitsiTrack object related to the event.
470 470
  */
471
-JitsiConference.prototype._fireMuteChangeEvent = function (track) {
471
+JitsiConference.prototype._fireMuteChangeEvent = function(track) {
472 472
     // check if track was muted by focus and now is unmuted by user
473 473
     if (this.isMutedByFocus && track.isAudioTrack() && !track.isMuted()) {
474 474
         this.isMutedByFocus = false;
@@ -482,7 +482,7 @@ JitsiConference.prototype._fireMuteChangeEvent = function (track) {
482 482
  * Clear JitsiLocalTrack properties and listeners.
483 483
  * @param track the JitsiLocalTrack object.
484 484
  */
485
-JitsiConference.prototype.onLocalTrackRemoved = function (track) {
485
+JitsiConference.prototype.onLocalTrackRemoved = function(track) {
486 486
     track._setSSRC(null);
487 487
     track._setConference(null);
488 488
     this.rtc.removeLocalTrack(track);
@@ -509,7 +509,7 @@ JitsiConference.prototype.onLocalTrackRemoved = function (track) {
509 509
  * @param {JitsiLocalTrack} track
510 510
  * @returns {Promise}
511 511
  */
512
-JitsiConference.prototype.removeTrack = function (track) {
512
+JitsiConference.prototype.removeTrack = function(track) {
513 513
     return this.replaceTrack (track, null);
514 514
 };
515 515
 
@@ -522,7 +522,7 @@ JitsiConference.prototype.removeTrack = function (track) {
522 522
  * @param {JitsiLocalTrack} newTrack the new stream to use
523 523
  * @returns {Promise} resolves when the replacement is finished
524 524
  */
525
-JitsiConference.prototype.replaceTrack = function (oldTrack, newTrack) {
525
+JitsiConference.prototype.replaceTrack = function(oldTrack, newTrack) {
526 526
     // First do the removal of the oldTrack at the JitsiConference level
527 527
     if (oldTrack) {
528 528
         if (oldTrack.disposed) {
@@ -536,7 +536,7 @@ JitsiConference.prototype.replaceTrack = function (oldTrack, newTrack) {
536 536
                 new JitsiTrackError(JitsiTrackErrors.TRACK_IS_DISPOSED));
537 537
         }
538 538
         // Set up the ssrcHandler for the new track before we add it at the lower levels
539
-        newTrack.ssrcHandler = function (conference, ssrcMap) {
539
+        newTrack.ssrcHandler = function(conference, ssrcMap) {
540 540
             const trackSSRCInfo = ssrcMap.get(this.getMSID());
541 541
             if (trackSSRCInfo) {
542 542
                 this._setSSRC(trackSSRCInfo);
@@ -573,7 +573,7 @@ JitsiConference.prototype.replaceTrack = function (oldTrack, newTrack) {
573 573
  * @return {Promise}
574 574
  * @private
575 575
  */
576
-JitsiConference.prototype._doReplaceTrack = function (oldTrack, newTrack) {
576
+JitsiConference.prototype._doReplaceTrack = function(oldTrack, newTrack) {
577 577
     if (this.jingleSession) {
578 578
         return this.jingleSession.replaceTrack(oldTrack, newTrack);
579 579
     } else {
@@ -585,12 +585,12 @@ JitsiConference.prototype._doReplaceTrack = function (oldTrack, newTrack) {
585 585
  * Operations related to creating a new track
586 586
  * @param {JitsiLocalTrack} newTrack the new track being created
587 587
  */
588
-JitsiConference.prototype._setupNewTrack = function (newTrack) {
588
+JitsiConference.prototype._setupNewTrack = function(newTrack) {
589 589
     if (newTrack.isAudioTrack() || (newTrack.isVideoTrack() &&
590 590
             newTrack.videoType !== VideoType.DESKTOP)) {
591 591
         // Report active device to statistics
592 592
         var devices = RTC.getCurrentlyAvailableMediaDevices();
593
-        var device = devices.find(function (d) {
593
+        var device = devices.find(function(d) {
594 594
             return d.kind === newTrack.getTrack().kind + 'input'
595 595
                 && d.label === newTrack.getTrack().label;
596 596
         });
@@ -652,7 +652,7 @@ JitsiConference.prototype._setupNewTrack = function (newTrack) {
652 652
  * started. That is before the 'session-accept' is sent.
653 653
  */
654 654
 JitsiConference.prototype._addLocalStream
655
-    = function (stream, callback, errorCallback, ssrcInfo, dontModifySources) {
655
+    = function(stream, callback, errorCallback, ssrcInfo, dontModifySources) {
656 656
         if (this.jingleSession) {
657 657
             this.jingleSession.addStream(
658 658
             stream, callback, errorCallback, ssrcInfo, dontModifySources);
@@ -672,7 +672,7 @@ JitsiConference.prototype._addLocalStream
672 672
  * with the stream.
673 673
  */
674 674
 JitsiConference.prototype.removeLocalStream
675
-    = function (stream, callback, errorCallback, ssrcInfo) {
675
+    = function(stream, callback, errorCallback, ssrcInfo) {
676 676
         if (this.jingleSession) {
677 677
             this.jingleSession.removeStream(
678 678
             stream, callback, errorCallback, ssrcInfo);
@@ -688,7 +688,7 @@ JitsiConference.prototype.removeLocalStream
688 688
  * - ssrcs - Array of the ssrcs associated with the stream.
689 689
  * - groups - Array of the groups associated with the stream.
690 690
  */
691
-JitsiConference.prototype._generateNewStreamSSRCInfo = function () {
691
+JitsiConference.prototype._generateNewStreamSSRCInfo = function() {
692 692
     if (!this.jingleSession) {
693 693
         logger.warn("The call haven't been started. " +
694 694
             "Cannot generate ssrc info at the moment!");
@@ -701,7 +701,7 @@ JitsiConference.prototype._generateNewStreamSSRCInfo = function () {
701 701
  * Get role of the local user.
702 702
  * @returns {string} user role: 'moderator' or 'none'
703 703
  */
704
-JitsiConference.prototype.getRole = function () {
704
+JitsiConference.prototype.getRole = function() {
705 705
     return this.room.role;
706 706
 };
707 707
 
@@ -710,7 +710,7 @@ JitsiConference.prototype.getRole = function () {
710 710
  * @returns {boolean|null} true if local user is moderator, false otherwise. If
711 711
  * we're no longer in the conference room then <tt>null</tt> is returned.
712 712
  */
713
-JitsiConference.prototype.isModerator = function () {
713
+JitsiConference.prototype.isModerator = function() {
714 714
     return this.room ? this.room.isModerator() : null;
715 715
 };
716 716
 
@@ -719,18 +719,18 @@ JitsiConference.prototype.isModerator = function () {
719 719
  * @param {string} password new password for the room.
720 720
  * @returns {Promise}
721 721
  */
722
-JitsiConference.prototype.lock = function (password) {
722
+JitsiConference.prototype.lock = function(password) {
723 723
     if (!this.isModerator()) {
724 724
         return Promise.reject();
725 725
     }
726 726
 
727 727
     var conference = this;
728
-    return new Promise(function (resolve, reject) {
729
-        conference.room.lockRoom(password || "", function () {
728
+    return new Promise(function(resolve, reject) {
729
+        conference.room.lockRoom(password || "", function() {
730 730
             resolve();
731
-        }, function (err) {
731
+        }, function(err) {
732 732
             reject(err);
733
-        }, function () {
733
+        }, function() {
734 734
             reject(JitsiConferenceErrors.PASSWORD_NOT_SUPPORTED);
735 735
         });
736 736
     });
@@ -740,7 +740,7 @@ JitsiConference.prototype.lock = function (password) {
740 740
  * Remove password from the room.
741 741
  * @returns {Promise}
742 742
  */
743
-JitsiConference.prototype.unlock = function () {
743
+JitsiConference.prototype.unlock = function() {
744 744
     return this.lock();
745 745
 };
746 746
 
@@ -789,7 +789,7 @@ JitsiConference.prototype.setLastN = function(lastN) {
789 789
  * conference.
790 790
  */
791 791
 JitsiConference.prototype.getParticipants = function() {
792
-    return Object.keys(this.participants).map(function (key) {
792
+    return Object.keys(this.participants).map(function(key) {
793 793
         return this.participants[key];
794 794
     }, this);
795 795
 };
@@ -824,7 +824,7 @@ JitsiConference.prototype.getParticipantById = function(id) {
824 824
  * Kick participant from this conference.
825 825
  * @param {string} id id of the participant to kick
826 826
  */
827
-JitsiConference.prototype.kickParticipant = function (id) {
827
+JitsiConference.prototype.kickParticipant = function(id) {
828 828
     var participant = this.getParticipantById(id);
829 829
     if (!participant) {
830 830
         return;
@@ -836,7 +836,7 @@ JitsiConference.prototype.kickParticipant = function (id) {
836 836
  * Mutes a participant.
837 837
  * @param {string} id The id of the participant to mute.
838 838
  */
839
-JitsiConference.prototype.muteParticipant = function (id) {
839
+JitsiConference.prototype.muteParticipant = function(id) {
840 840
     var participant = this.getParticipantById(id);
841 841
     if (!participant) {
842 842
         return;
@@ -856,7 +856,7 @@ JitsiConference.prototype.muteParticipant = function (id) {
856 856
  * participant for example a recorder).
857 857
  */
858 858
 JitsiConference.prototype.onMemberJoined
859
-    = function (jid, nick, role, isHidden) {
859
+    = function(jid, nick, role, isHidden) {
860 860
         var id = Strophe.getResourceFromJid(jid);
861 861
         if (id === 'focus' || this.myUserId() === id) {
862 862
             return;
@@ -871,7 +871,7 @@ JitsiConference.prototype.onMemberJoined
871 871
         }, error => logger.error(error));
872 872
     };
873 873
 
874
-JitsiConference.prototype.onMemberLeft = function (jid) {
874
+JitsiConference.prototype.onMemberLeft = function(jid) {
875 875
     var id = Strophe.getResourceFromJid(jid);
876 876
     if (id === 'focus' || this.myUserId() === id) {
877 877
         return;
@@ -881,7 +881,7 @@ JitsiConference.prototype.onMemberLeft = function (jid) {
881 881
 
882 882
     var removedTracks = this.rtc.removeRemoteTracks(id);
883 883
 
884
-    removedTracks.forEach(function (track) {
884
+    removedTracks.forEach(function(track) {
885 885
         this.eventEmitter.emit(JitsiConferenceEvents.TRACK_REMOVED, track);
886 886
     }.bind(this));
887 887
 
@@ -892,7 +892,7 @@ JitsiConference.prototype.onMemberLeft = function (jid) {
892 892
     }
893 893
 };
894 894
 
895
-JitsiConference.prototype.onUserRoleChanged = function (jid, role) {
895
+JitsiConference.prototype.onUserRoleChanged = function(jid, role) {
896 896
     var id = Strophe.getResourceFromJid(jid);
897 897
     var participant = this.getParticipantById(id);
898 898
     if (!participant) {
@@ -902,7 +902,7 @@ JitsiConference.prototype.onUserRoleChanged = function (jid, role) {
902 902
     this.eventEmitter.emit(JitsiConferenceEvents.USER_ROLE_CHANGED, id, role);
903 903
 };
904 904
 
905
-JitsiConference.prototype.onDisplayNameChanged = function (jid, displayName) {
905
+JitsiConference.prototype.onDisplayNameChanged = function(jid, displayName) {
906 906
     var id = Strophe.getResourceFromJid(jid);
907 907
     var participant = this.getParticipantById(id);
908 908
     if (!participant) {
@@ -924,7 +924,7 @@ JitsiConference.prototype.onDisplayNameChanged = function (jid, displayName) {
924 924
  * @param {JitsiRemoteTrack} track the JitsiRemoteTrack which was added to this
925 925
  * JitsiConference
926 926
  */
927
-JitsiConference.prototype.onRemoteTrackAdded = function (track) {
927
+JitsiConference.prototype.onRemoteTrackAdded = function(track) {
928 928
     const id = track.getParticipantId();
929 929
     const participant = this.getParticipantById(id);
930 930
     if (!participant) {
@@ -942,13 +942,13 @@ JitsiConference.prototype.onRemoteTrackAdded = function (track) {
942 942
     const emitter = this.eventEmitter;
943 943
     track.addEventListener(
944 944
         JitsiTrackEvents.TRACK_MUTE_CHANGED,
945
-        function () {
945
+        function() {
946 946
             emitter.emit(JitsiConferenceEvents.TRACK_MUTE_CHANGED, track);
947 947
         }
948 948
     );
949 949
     track.addEventListener(
950 950
         JitsiTrackEvents.TRACK_AUDIO_LEVEL_CHANGED,
951
-        function (audioLevel) {
951
+        function(audioLevel) {
952 952
             emitter.emit(
953 953
                 JitsiConferenceEvents.TRACK_AUDIO_LEVEL_CHANGED,
954 954
                 id,
@@ -965,7 +965,7 @@ JitsiConference.prototype.onRemoteTrackAdded = function (track) {
965 965
  *
966 966
  * @param {JitsiRemoteTrack} removedTrack
967 967
  */
968
-JitsiConference.prototype.onRemoteTrackRemoved = function (removedTrack) {
968
+JitsiConference.prototype.onRemoteTrackRemoved = function(removedTrack) {
969 969
     let consumed = false;
970 970
 
971 971
     this.getParticipants().forEach(function(participant) {
@@ -1004,7 +1004,7 @@ JitsiConference.prototype.onRemoteTrackRemoved = function (removedTrack) {
1004 1004
  * Handles incoming call event.
1005 1005
  */
1006 1006
 JitsiConference.prototype.onIncomingCall =
1007
-function (jingleSession, jingleOffer, now) {
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 1010
         var errmsg = "Rejecting session-initiate from non-focus user: "
@@ -1016,7 +1016,7 @@ function (jingleSession, jingleOffer, now) {
1016 1016
         jingleSession.terminate(
1017 1017
             'security-error', 'Only focus can start new sessions',
1018 1018
             null /* success callback => we don't care */,
1019
-            function (error) {
1019
+            function(error) {
1020 1020
                 logger.warn(
1021 1021
                     "An error occurred while trying to terminate"
1022 1022
                         + " invalid Jingle session", error);
@@ -1089,7 +1089,7 @@ function (jingleSession, jingleOffer, now) {
1089 1089
         }
1090 1090
         try {
1091 1091
             this._addLocalStream(
1092
-                localTrack.getOriginalStream(), function () {}, function () {},
1092
+                localTrack.getOriginalStream(), function() {}, function() {},
1093 1093
                 ssrcInfo, true /* don't modify SSRCs */);
1094 1094
         } catch(e) {
1095 1095
             GlobalOnErrorHandler.callErrorHandler(e);
@@ -1102,7 +1102,7 @@ function (jingleSession, jingleOffer, now) {
1102 1102
     }
1103 1103
 
1104 1104
     jingleSession.acceptOffer(jingleOffer, null,
1105
-        function (error) {
1105
+        function(error) {
1106 1106
             GlobalOnErrorHandler.callErrorHandler(error);
1107 1107
             logger.error(
1108 1108
                 "Failed to accept incoming Jingle session", error);
@@ -1126,7 +1126,7 @@ function (jingleSession, jingleOffer, now) {
1126 1126
  * more details about why the call has been terminated.
1127 1127
  */
1128 1128
 JitsiConference.prototype.onCallEnded
1129
-= function (JingleSession, reasonCondition, reasonText) {
1129
+= function(JingleSession, reasonCondition, reasonText) {
1130 1130
     logger.info("Call ended: " + reasonCondition + " - " + reasonText);
1131 1131
     this.wasStopped = true;
1132 1132
     // Send session.terminate event
@@ -1160,12 +1160,12 @@ JitsiConference.prototype.onCallEnded
1160 1160
 /**
1161 1161
  * Handles the suspend detected event. Leaves the room and fires suspended.
1162 1162
  */
1163
-JitsiConference.prototype.onSuspendDetected = function () {
1163
+JitsiConference.prototype.onSuspendDetected = function() {
1164 1164
     this.leave();
1165 1165
     this.eventEmitter.emit(JitsiConferenceEvents.SUSPEND_DETECTED);
1166 1166
 };
1167 1167
 
1168
-JitsiConference.prototype.updateDTMFSupport = function () {
1168
+JitsiConference.prototype.updateDTMFSupport = function() {
1169 1169
     var somebodySupportsDTMF = false;
1170 1170
     var participants = this.getParticipants();
1171 1171
 
@@ -1187,7 +1187,7 @@ JitsiConference.prototype.updateDTMFSupport = function () {
1187 1187
  * that supports DTMF.
1188 1188
  * @returns {boolean} true if somebody supports DTMF, false otherwise
1189 1189
  */
1190
-JitsiConference.prototype.isDTMFSupported = function () {
1190
+JitsiConference.prototype.isDTMFSupported = function() {
1191 1191
     return this.somebodySupportsDTMF;
1192 1192
 };
1193 1193
 
@@ -1195,11 +1195,11 @@ JitsiConference.prototype.isDTMFSupported = function () {
1195 1195
  * Returns the local user's ID
1196 1196
  * @return {string} local user's ID
1197 1197
  */
1198
-JitsiConference.prototype.myUserId = function () {
1198
+JitsiConference.prototype.myUserId = function() {
1199 1199
     return this.room && this.room.myroomjid ? Strophe.getResourceFromJid(this.room.myroomjid) : null;
1200 1200
 };
1201 1201
 
1202
-JitsiConference.prototype.sendTones = function (tones, duration, pause) {
1202
+JitsiConference.prototype.sendTones = function(tones, duration, pause) {
1203 1203
     // FIXME P2P 'dtmfManager' must be cleared, after switching jingleSessions
1204 1204
     if (!this.dtmfManager) {
1205 1205
         if (!this.jingleSession) {
@@ -1227,7 +1227,7 @@ JitsiConference.prototype.sendTones = function (tones, duration, pause) {
1227 1227
 /**
1228 1228
  * Returns true if recording is supported and false if not.
1229 1229
  */
1230
-JitsiConference.prototype.isRecordingSupported = function () {
1230
+JitsiConference.prototype.isRecordingSupported = function() {
1231 1231
     if (this.room) {
1232 1232
         return this.room.isRecordingSupported();
1233 1233
     }
@@ -1238,23 +1238,23 @@ JitsiConference.prototype.isRecordingSupported = function () {
1238 1238
  * Returns null if the recording is not supported, "on" if the recording started
1239 1239
  * and "off" if the recording is not started.
1240 1240
  */
1241
-JitsiConference.prototype.getRecordingState = function () {
1241
+JitsiConference.prototype.getRecordingState = function() {
1242 1242
     return this.room ? this.room.getRecordingState() : undefined;
1243 1243
 };
1244 1244
 
1245 1245
 /**
1246 1246
  * Returns the url of the recorded video.
1247 1247
  */
1248
-JitsiConference.prototype.getRecordingURL = function () {
1248
+JitsiConference.prototype.getRecordingURL = function() {
1249 1249
     return this.room ? this.room.getRecordingURL() : null;
1250 1250
 };
1251 1251
 
1252 1252
 /**
1253 1253
  * Starts/stops the recording
1254 1254
  */
1255
-JitsiConference.prototype.toggleRecording = function (options) {
1255
+JitsiConference.prototype.toggleRecording = function(options) {
1256 1256
     if (this.room) {
1257
-        return this.room.toggleRecording(options, function (status, error) {
1257
+        return this.room.toggleRecording(options, function(status, error) {
1258 1258
             this.eventEmitter.emit(
1259 1259
                 JitsiConferenceEvents.RECORDER_STATE_CHANGED, status, error);
1260 1260
         }.bind(this));
@@ -1267,7 +1267,7 @@ JitsiConference.prototype.toggleRecording = function (options) {
1267 1267
 /**
1268 1268
  * Returns true if the SIP calls are supported and false otherwise
1269 1269
  */
1270
-JitsiConference.prototype.isSIPCallingSupported = function () {
1270
+JitsiConference.prototype.isSIPCallingSupported = function() {
1271 1271
     if (this.room) {
1272 1272
         return this.room.isSIPCallingSupported();
1273 1273
     }
@@ -1278,7 +1278,7 @@ JitsiConference.prototype.isSIPCallingSupported = function () {
1278 1278
  * Dials a number.
1279 1279
  * @param number the number
1280 1280
  */
1281
-JitsiConference.prototype.dial = function (number) {
1281
+JitsiConference.prototype.dial = function(number) {
1282 1282
     if (this.room) {
1283 1283
         return this.room.dial(number);
1284 1284
     }
@@ -1290,7 +1290,7 @@ JitsiConference.prototype.dial = function (number) {
1290 1290
 /**
1291 1291
  * Hangup an existing call
1292 1292
  */
1293
-JitsiConference.prototype.hangup = function () {
1293
+JitsiConference.prototype.hangup = function() {
1294 1294
     if (this.room) {
1295 1295
         return this.room.hangup();
1296 1296
     }
@@ -1302,7 +1302,7 @@ JitsiConference.prototype.hangup = function () {
1302 1302
 /**
1303 1303
  * Returns the phone number for joining the conference.
1304 1304
  */
1305
-JitsiConference.prototype.getPhoneNumber = function () {
1305
+JitsiConference.prototype.getPhoneNumber = function() {
1306 1306
     if (this.room) {
1307 1307
         return this.room.getPhoneNumber();
1308 1308
     }
@@ -1312,7 +1312,7 @@ JitsiConference.prototype.getPhoneNumber = function () {
1312 1312
 /**
1313 1313
  * Returns the pin for joining the conference with phone.
1314 1314
  */
1315
-JitsiConference.prototype.getPhonePin = function () {
1315
+JitsiConference.prototype.getPhonePin = function() {
1316 1316
     if (this.room) {
1317 1317
         return this.room.getPhonePin();
1318 1318
     }
@@ -1323,7 +1323,7 @@ JitsiConference.prototype.getPhonePin = function () {
1323 1323
  * Returns the connection state for the current room. Its ice connection state
1324 1324
  * for its session.
1325 1325
  */
1326
-JitsiConference.prototype.getConnectionState = function () {
1326
+JitsiConference.prototype.getConnectionState = function() {
1327 1327
     if (this.jingleSession) {
1328 1328
         return this.jingleSession.getIceConnectionState();
1329 1329
     } else {
@@ -1337,7 +1337,7 @@ JitsiConference.prototype.getConnectionState = function () {
1337 1337
  * @param {boolean} audio if audio should be muted.
1338 1338
  * @param {boolean} video if video should be muted.
1339 1339
  */
1340
-JitsiConference.prototype.setStartMutedPolicy = function (policy) {
1340
+JitsiConference.prototype.setStartMutedPolicy = function(policy) {
1341 1341
     if (!this.isModerator()) {
1342 1342
         return;
1343 1343
     }
@@ -1357,28 +1357,28 @@ JitsiConference.prototype.setStartMutedPolicy = function (policy) {
1357 1357
  * Returns current start muted policy
1358 1358
  * @returns {Object} with 2 properties - audio and video.
1359 1359
  */
1360
-JitsiConference.prototype.getStartMutedPolicy = function () {
1360
+JitsiConference.prototype.getStartMutedPolicy = function() {
1361 1361
     return this.startMutedPolicy;
1362 1362
 };
1363 1363
 
1364 1364
 /**
1365 1365
  * Check if audio is muted on join.
1366 1366
  */
1367
-JitsiConference.prototype.isStartAudioMuted = function () {
1367
+JitsiConference.prototype.isStartAudioMuted = function() {
1368 1368
     return this.startAudioMuted;
1369 1369
 };
1370 1370
 
1371 1371
 /**
1372 1372
  * Check if video is muted on join.
1373 1373
  */
1374
-JitsiConference.prototype.isStartVideoMuted = function () {
1374
+JitsiConference.prototype.isStartVideoMuted = function() {
1375 1375
     return this.startVideoMuted;
1376 1376
 };
1377 1377
 
1378 1378
 /**
1379 1379
  * Get object with internal logs.
1380 1380
  */
1381
-JitsiConference.prototype.getLogs = function () {
1381
+JitsiConference.prototype.getLogs = function() {
1382 1382
     var data = this.xmpp.getJingleLog();
1383 1383
 
1384 1384
     var metadata = {};
@@ -1399,7 +1399,7 @@ JitsiConference.prototype.getLogs = function () {
1399 1399
 /**
1400 1400
  * Returns measured connectionTimes.
1401 1401
  */
1402
-JitsiConference.prototype.getConnectionTimes = function () {
1402
+JitsiConference.prototype.getConnectionTimes = function() {
1403 1403
     return this.room.connectionTimes;
1404 1404
 };
1405 1405
 
@@ -1429,7 +1429,7 @@ function(overallFeedback, detailedFeedback){
1429 1429
  * @returns true if the callstats integration is enabled, otherwise returns
1430 1430
  * false.
1431 1431
  */
1432
-JitsiConference.prototype.isCallstatsEnabled = function () {
1432
+JitsiConference.prototype.isCallstatsEnabled = function() {
1433 1433
     return this.statistics.isCallstatsEnabled();
1434 1434
 };
1435 1435
 
@@ -1468,14 +1468,14 @@ JitsiConference.prototype.sendApplicationLog = function(message) {
1468 1468
  * <tt>false</tt> when is not. <tt>null</tt> if we're not in the MUC anymore and
1469 1469
  * are unable to figure out the status or if given <tt>mucJid</tt> is invalid.
1470 1470
  */
1471
-JitsiConference.prototype._isFocus = function (mucJid) {
1471
+JitsiConference.prototype._isFocus = function(mucJid) {
1472 1472
     return this.room ? this.room.isFocus(mucJid) : null;
1473 1473
 };
1474 1474
 
1475 1475
 /**
1476 1476
  * Fires CONFERENCE_FAILED event with INCOMPATIBLE_SERVER_VERSIONS parameter
1477 1477
  */
1478
-JitsiConference.prototype._fireIncompatibleVersionsEvent = function () {
1478
+JitsiConference.prototype._fireIncompatibleVersionsEvent = function() {
1479 1479
     this.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_FAILED,
1480 1480
         JitsiConferenceErrors.INCOMPATIBLE_SERVER_VERSIONS);
1481 1481
 };
@@ -1487,7 +1487,7 @@ JitsiConference.prototype._fireIncompatibleVersionsEvent = function () {
1487 1487
  * @param payload {object} the payload of the message.
1488 1488
  * @throws NetworkError or InvalidStateError or Error if the operation fails.
1489 1489
  */
1490
-JitsiConference.prototype.sendEndpointMessage = function (to, payload) {
1490
+JitsiConference.prototype.sendEndpointMessage = function(to, payload) {
1491 1491
     this.rtc.sendDataChannelMessage(to, payload);
1492 1492
 };
1493 1493
 
@@ -1496,11 +1496,11 @@ JitsiConference.prototype.sendEndpointMessage = function (to, payload) {
1496 1496
  * @param payload {object} the payload of the message.
1497 1497
  * @throws NetworkError or InvalidStateError or Error if the operation fails.
1498 1498
  */
1499
-JitsiConference.prototype.broadcastEndpointMessage = function (payload) {
1499
+JitsiConference.prototype.broadcastEndpointMessage = function(payload) {
1500 1500
     this.sendEndpointMessage("", payload);
1501 1501
 };
1502 1502
 
1503
-JitsiConference.prototype.isConnectionInterrupted = function () {
1503
+JitsiConference.prototype.isConnectionInterrupted = function() {
1504 1504
     return this.connectionIsInterrupted;
1505 1505
 };
1506 1506
 

+ 40
- 40
JitsiConferenceEventManager.js Parādīt failu

@@ -22,7 +22,7 @@ function JitsiConferenceEventManager(conference) {
22 22
 
23 23
     // Listeners related to the conference only
24 24
     conference.on(JitsiConferenceEvents.TRACK_MUTE_CHANGED,
25
-        function (track) {
25
+        function(track) {
26 26
             if(!track.isLocal() || !conference.statistics) {
27 27
                 return;
28 28
             }
@@ -34,13 +34,13 @@ function JitsiConferenceEventManager(conference) {
34 34
 /**
35 35
  * Setups event listeners related to conference.chatRoom
36 36
  */
37
-JitsiConferenceEventManager.prototype.setupChatRoomListeners = function () {
37
+JitsiConferenceEventManager.prototype.setupChatRoomListeners = function() {
38 38
     var conference = this.conference;
39 39
     var chatRoom = conference.room;
40 40
     this.chatRoomForwarder = new EventEmitterForwarder(chatRoom,
41 41
         this.conference.eventEmitter);
42 42
 
43
-    chatRoom.addListener(XMPPEvents.ICE_RESTARTING, function () {
43
+    chatRoom.addListener(XMPPEvents.ICE_RESTARTING, function() {
44 44
         // All data channels have to be closed, before ICE restart
45 45
         // otherwise Chrome will not trigger "opened" event for the channel
46 46
         // established with the new bridge
@@ -48,7 +48,7 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function () {
48 48
     });
49 49
 
50 50
     chatRoom.addListener(XMPPEvents.AUDIO_MUTED_BY_FOCUS,
51
-        function (value) {
51
+        function(value) {
52 52
             // set isMutedByFocus when setAudioMute Promise ends
53 53
             conference.rtc.setAudioMute(value).then(
54 54
                 function() {
@@ -112,7 +112,7 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function () {
112 112
         JitsiConferenceEvents.CONFERENCE_FAILED,
113 113
         JitsiConferenceErrors.VIDEOBRIDGE_NOT_AVAILABLE);
114 114
     chatRoom.addListener(XMPPEvents.BRIDGE_DOWN,
115
-        function (){
115
+        function(){
116 116
             Statistics.analytics.sendEvent('conference.bridgeDown');
117 117
         });
118 118
 
@@ -125,14 +125,14 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function () {
125 125
         JitsiConferenceErrors.GRACEFUL_SHUTDOWN);
126 126
 
127 127
     chatRoom.addListener(XMPPEvents.JINGLE_FATAL_ERROR,
128
-        function (session, error) {
128
+        function(session, error) {
129 129
             conference.eventEmitter.emit(
130 130
                 JitsiConferenceEvents.CONFERENCE_FAILED,
131 131
                 JitsiConferenceErrors.JINGLE_FATAL_ERROR, error);
132 132
         });
133 133
 
134 134
     chatRoom.addListener(XMPPEvents.CONNECTION_ICE_FAILED,
135
-        function () {
135
+        function() {
136 136
             chatRoom.eventEmitter.emit(
137 137
                 XMPPEvents.CONFERENCE_SETUP_FAILED,
138 138
                 new Error("ICE fail"));
@@ -151,14 +151,14 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function () {
151 151
         JitsiConferenceErrors.FOCUS_DISCONNECTED);
152 152
 
153 153
     chatRoom.addListener(XMPPEvents.FOCUS_LEFT,
154
-        function () {
154
+        function() {
155 155
             Statistics.analytics.sendEvent('conference.focusLeft');
156 156
             conference.eventEmitter.emit(
157 157
                 JitsiConferenceEvents.CONFERENCE_FAILED,
158 158
                 JitsiConferenceErrors.FOCUS_LEFT);
159 159
         });
160 160
 
161
-    var eventLogHandler = function (reason) {
161
+    var eventLogHandler = function(reason) {
162 162
         Statistics.sendEventToAll("conference.error." + reason);
163 163
     };
164 164
     chatRoom.addListener(XMPPEvents.SESSION_ACCEPT_TIMEOUT,
@@ -190,7 +190,7 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function () {
190 190
         JitsiConferenceEvents.CONFERENCE_FAILED,
191 191
         JitsiConferenceErrors.SETUP_FAILED);
192 192
 
193
-    chatRoom.setParticipantPropertyListener(function (node, from) {
193
+    chatRoom.setParticipantPropertyListener(function(node, from) {
194 194
         var participant = conference.getParticipantById(from);
195 195
         if (!participant) {
196 196
             return;
@@ -204,7 +204,7 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function () {
204 204
     this.chatRoomForwarder.forward(XMPPEvents.KICKED,
205 205
         JitsiConferenceEvents.KICKED);
206 206
     chatRoom.addListener(XMPPEvents.KICKED,
207
-        function () {
207
+        function() {
208 208
             conference.room = null;
209 209
             conference.leave();
210 210
         });
@@ -224,14 +224,14 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function () {
224 224
     chatRoom.addListener(XMPPEvents.DISPLAY_NAME_CHANGED,
225 225
         conference.onDisplayNameChanged.bind(conference));
226 226
 
227
-    chatRoom.addListener(XMPPEvents.LOCAL_ROLE_CHANGED, function (role) {
227
+    chatRoom.addListener(XMPPEvents.LOCAL_ROLE_CHANGED, function(role) {
228 228
         conference.eventEmitter.emit(JitsiConferenceEvents.USER_ROLE_CHANGED,
229 229
             conference.myUserId(), role);
230 230
 
231 231
         // log all events for the recorder operated by the moderator
232 232
         if (conference.statistics && conference.isModerator()) {
233 233
             conference.on(JitsiConferenceEvents.RECORDER_STATE_CHANGED,
234
-                function (status, error) {
234
+                function(status, error) {
235 235
                     var logObject = {
236 236
                         id: "recorder_status",
237 237
                         status
@@ -248,7 +248,7 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function () {
248 248
         conference.onUserRoleChanged.bind(conference));
249 249
 
250 250
     chatRoom.addListener(AuthenticationEvents.IDENTITY_UPDATED,
251
-        function (authEnabled, authIdentity) {
251
+        function(authEnabled, authIdentity) {
252 252
             conference.authEnabled = authEnabled;
253 253
             conference.authIdentity = authIdentity;
254 254
             conference.eventEmitter.emit(
@@ -257,14 +257,14 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function () {
257 257
         });
258 258
 
259 259
     chatRoom.addListener(XMPPEvents.MESSAGE_RECEIVED,
260
-        function (jid, displayName, txt, myJid, ts) {
260
+        function(jid, displayName, txt, myJid, ts) {
261 261
             var id = Strophe.getResourceFromJid(jid);
262 262
             conference.eventEmitter.emit(JitsiConferenceEvents.MESSAGE_RECEIVED,
263 263
                 id, txt, ts);
264 264
         });
265 265
 
266 266
     chatRoom.addListener(XMPPEvents.PRESENCE_STATUS,
267
-        function (jid, status) {
267
+        function(jid, status) {
268 268
             var id = Strophe.getResourceFromJid(jid);
269 269
             var participant = conference.getParticipantById(id);
270 270
             if (!participant || participant._status === status) {
@@ -276,17 +276,17 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function () {
276 276
         });
277 277
 
278 278
     conference.room.addListener(XMPPEvents.LOCAL_UFRAG_CHANGED,
279
-        function (ufrag) {
279
+        function(ufrag) {
280 280
             Statistics.sendLog(
281 281
                 JSON.stringify({id: "local_ufrag", value: ufrag}));
282 282
         });
283 283
     conference.room.addListener(XMPPEvents.REMOTE_UFRAG_CHANGED,
284
-        function (ufrag) {
284
+        function(ufrag) {
285 285
             Statistics.sendLog(
286 286
                 JSON.stringify({id: "remote_ufrag", value: ufrag}));
287 287
         });
288 288
 
289
-    chatRoom.addPresenceListener("startmuted", function (data, from) {
289
+    chatRoom.addPresenceListener("startmuted", function(data, from) {
290 290
         var isModerator = false;
291 291
         if (conference.myUserId() === from && conference.isModerator()) {
292 292
             isModerator = true;
@@ -324,12 +324,12 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function () {
324 324
         }
325 325
     });
326 326
 
327
-    chatRoom.addPresenceListener("videomuted", function (values, from) {
327
+    chatRoom.addPresenceListener("videomuted", function(values, from) {
328 328
         conference.rtc.handleRemoteTrackMute(MediaType.VIDEO,
329 329
             values.value == "true", from);
330 330
     });
331 331
 
332
-    chatRoom.addPresenceListener("audiomuted", function (values, from) {
332
+    chatRoom.addPresenceListener("audiomuted", function(values, from) {
333 333
         conference.rtc.handleRemoteTrackMute(MediaType.AUDIO,
334 334
             values.value == "true", from);
335 335
     });
@@ -338,10 +338,10 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function () {
338 338
         conference.rtc.handleRemoteTrackVideoTypeChanged(data.value, from);
339 339
     });
340 340
 
341
-    chatRoom.addPresenceListener("devices", function (data, from) {
341
+    chatRoom.addPresenceListener("devices", function(data, from) {
342 342
         var isAudioAvailable = false;
343 343
         var isVideoAvailable = false;
344
-        data.children.forEach(function (config) {
344
+        data.children.forEach(function(config) {
345 345
             if (config.tagName === 'audio') {
346 346
                 isAudioAvailable = config.value === 'true';
347 347
             }
@@ -384,11 +384,11 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function () {
384 384
     if(conference.statistics) {
385 385
         // FIXME ICE related events should end up in RTCEvents eventually
386 386
         chatRoom.addListener(XMPPEvents.CONNECTION_ICE_FAILED,
387
-            function (pc) {
387
+            function(pc) {
388 388
                 conference.statistics.sendIceConnectionFailedEvent(pc);
389 389
             });
390 390
         chatRoom.addListener(XMPPEvents.ADD_ICE_CANDIDATE_FAILED,
391
-            function (e, pc) {
391
+            function(e, pc) {
392 392
                 conference.statistics.sendAddIceCandidateFailed(e, pc);
393 393
             });
394 394
     }
@@ -397,7 +397,7 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function () {
397 397
 /**
398 398
  * Setups event listeners related to conference.rtc
399 399
  */
400
-JitsiConferenceEventManager.prototype.setupRTCListeners = function () {
400
+JitsiConferenceEventManager.prototype.setupRTCListeners = function() {
401 401
     const conference = this.conference;
402 402
     const rtc = conference.rtc;
403 403
 
@@ -413,7 +413,7 @@ JitsiConferenceEventManager.prototype.setupRTCListeners = function () {
413 413
         conference.onRemoteTrackRemoved.bind(conference));
414 414
 
415 415
     rtc.addListener(RTCEvents.DOMINANT_SPEAKER_CHANGED,
416
-        function (id) {
416
+        function(id) {
417 417
             if(conference.lastDominantSpeaker !== id && conference.room) {
418 418
                 conference.lastDominantSpeaker = id;
419 419
                 conference.eventEmitter.emit(
@@ -425,7 +425,7 @@ JitsiConferenceEventManager.prototype.setupRTCListeners = function () {
425 425
             }
426 426
         });
427 427
 
428
-    rtc.addListener(RTCEvents.DATA_CHANNEL_OPEN, function () {
428
+    rtc.addListener(RTCEvents.DATA_CHANNEL_OPEN, function() {
429 429
         var now = window.performance.now();
430 430
         logger.log("(TIME) data channel opened ", now);
431 431
         conference.room.connectionTimes["data.channel.opened"] = now;
@@ -440,12 +440,12 @@ JitsiConferenceEventManager.prototype.setupRTCListeners = function () {
440 440
         JitsiConferenceEvents.LAST_N_ENDPOINTS_CHANGED);
441 441
 
442 442
     rtc.addListener(RTCEvents.AVAILABLE_DEVICES_CHANGED,
443
-        function (devices) {
443
+        function(devices) {
444 444
             conference.room.updateDeviceAvailability(devices);
445 445
         });
446 446
 
447 447
     rtc.addListener(RTCEvents.ENDPOINT_MESSAGE_RECEIVED,
448
-        function (from, payload) {
448
+        function(from, payload) {
449 449
             const participant = conference.getParticipantById(from);
450 450
             if (participant) {
451 451
                 conference.eventEmitter.emit(
@@ -484,7 +484,7 @@ JitsiConferenceEventManager.prototype.setupRTCListeners = function () {
484 484
 /**
485 485
  * Setups event listeners related to conference.xmpp
486 486
  */
487
-JitsiConferenceEventManager.prototype.setupXMPPListeners = function () {
487
+JitsiConferenceEventManager.prototype.setupXMPPListeners = function() {
488 488
     var conference = this.conference;
489 489
     conference.xmpp.caps.addListener(XMPPEvents.PARTCIPANT_FEATURES_CHANGED,
490 490
         from => {
@@ -502,13 +502,13 @@ JitsiConferenceEventManager.prototype.setupXMPPListeners = function () {
502 502
         XMPPEvents.CALL_ENDED, conference.onCallEnded.bind(conference));
503 503
 
504 504
     conference.xmpp.addListener(XMPPEvents.START_MUTED_FROM_FOCUS,
505
-        function (audioMuted, videoMuted) {
505
+        function(audioMuted, videoMuted) {
506 506
             conference.startAudioMuted = audioMuted;
507 507
             conference.startVideoMuted = videoMuted;
508 508
 
509 509
             // mute existing local tracks because this is initial mute from
510 510
             // Jicofo
511
-            conference.getLocalTracks().forEach(function (track) {
511
+            conference.getLocalTracks().forEach(function(track) {
512 512
                 switch (track.getType()) {
513 513
                 case MediaType.AUDIO:
514 514
                     conference.startAudioMuted && track.mute();
@@ -526,13 +526,13 @@ JitsiConferenceEventManager.prototype.setupXMPPListeners = function () {
526 526
 /**
527 527
  * Setups event listeners related to conference.statistics
528 528
  */
529
-JitsiConferenceEventManager.prototype.setupStatisticsListeners = function () {
529
+JitsiConferenceEventManager.prototype.setupStatisticsListeners = function() {
530 530
     var conference = this.conference;
531 531
     if(!conference.statistics) {
532 532
         return;
533 533
     }
534 534
 
535
-    conference.statistics.addAudioLevelListener(function (ssrc, level) {
535
+    conference.statistics.addAudioLevelListener(function(ssrc, level) {
536 536
         var resource = conference.rtc.getResourceBySSRC(ssrc);
537 537
         if (!resource) {
538 538
             return;
@@ -541,18 +541,18 @@ JitsiConferenceEventManager.prototype.setupStatisticsListeners = function () {
541 541
         conference.rtc.setAudioLevel(resource, level);
542 542
     });
543 543
     // Forward the "before stats disposed" event
544
-    conference.statistics.addBeforeDisposedListener(function () {
544
+    conference.statistics.addBeforeDisposedListener(function() {
545 545
         conference.eventEmitter.emit(
546 546
             JitsiConferenceEvents.BEFORE_STATISTICS_DISPOSED);
547 547
     });
548
-    conference.statistics.addConnectionStatsListener(function (stats) {
548
+    conference.statistics.addConnectionStatsListener(function(stats) {
549 549
         var ssrc2resolution = stats.resolution;
550 550
 
551 551
         var id2resolution = {};
552 552
 
553 553
         // preprocess resolutions: group by user id, skip incorrect
554 554
         // resolutions etc.
555
-        Object.keys(ssrc2resolution).forEach(function (ssrc) {
555
+        Object.keys(ssrc2resolution).forEach(function(ssrc) {
556 556
             var resolution = ssrc2resolution[ssrc];
557 557
 
558 558
             if (!resolution.width || !resolution.height ||
@@ -578,8 +578,8 @@ JitsiConferenceEventManager.prototype.setupStatisticsListeners = function () {
578 578
             JitsiConferenceEvents.CONNECTION_STATS, stats);
579 579
     });
580 580
 
581
-    conference.statistics.addByteSentStatsListener(function (stats) {
582
-        conference.getLocalTracks(MediaType.AUDIO).forEach(function (track) {
581
+    conference.statistics.addByteSentStatsListener(function(stats) {
582
+        conference.getLocalTracks(MediaType.AUDIO).forEach(function(track) {
583 583
             const ssrc = track.getSSRC();
584 584
             if (!ssrc || !stats.hasOwnProperty(ssrc)) {
585 585
                 return;

+ 11
- 11
JitsiConnection.js Parādīt failu

@@ -18,14 +18,14 @@ function JitsiConnection(appID, token, options) {
18 18
     this.xmpp = new XMPP(options, token);
19 19
 
20 20
     this.addEventListener(JitsiConnectionEvents.CONNECTION_FAILED,
21
-        function (errType, msg) {
21
+        function(errType, msg) {
22 22
             // sends analytics and callstats event
23 23
             Statistics.sendEventToAll('connection.failed.' + errType,
24 24
                 {label: msg});
25 25
         }.bind(this));
26 26
 
27 27
     this.addEventListener(JitsiConnectionEvents.CONNECTION_DISCONNECTED,
28
-        function (msg) {
28
+        function(msg) {
29 29
             // we can see disconnects from normal tab closing of the browser
30 30
             // and then there are no msgs, but we want to log only disconnects
31 31
             // when there is real error
@@ -43,7 +43,7 @@ function JitsiConnection(appID, token, options) {
43 43
  * @param options {object} connecting options
44 44
  * (for example authentications parameters).
45 45
  */
46
-JitsiConnection.prototype.connect = function (options) {
46
+JitsiConnection.prototype.connect = function(options) {
47 47
     if(!options) {
48 48
         options = {};
49 49
     }
@@ -58,14 +58,14 @@ JitsiConnection.prototype.connect = function (options) {
58 58
  *
59 59
  * @param options {object} connecting options - rid, sid and jid.
60 60
  */
61
-JitsiConnection.prototype.attach = function (options) {
61
+JitsiConnection.prototype.attach = function(options) {
62 62
     this.xmpp.attach(options);
63 63
 };
64 64
 
65 65
 /**
66 66
  * Disconnect the client from the server.
67 67
  */
68
-JitsiConnection.prototype.disconnect = function () {
68
+JitsiConnection.prototype.disconnect = function() {
69 69
     // XXX Forward any arguments passed to JitsiConnection.disconnect to
70 70
     // XMPP.disconnect. For example, the caller of JitsiConnection.disconnect
71 71
     // may optionally pass the event which triggered the disconnect in order to
@@ -79,7 +79,7 @@ JitsiConnection.prototype.disconnect = function () {
79 79
  * This method allows renewal of the tokens if they are expiring.
80 80
  * @param token the new token.
81 81
  */
82
-JitsiConnection.prototype.setToken = function (token) {
82
+JitsiConnection.prototype.setToken = function(token) {
83 83
     this.token = token;
84 84
 };
85 85
 
@@ -91,7 +91,7 @@ JitsiConnection.prototype.setToken = function (token) {
91 91
  * that will be created.
92 92
  * @returns {JitsiConference} returns the new conference object.
93 93
  */
94
-JitsiConnection.prototype.initJitsiConference = function (name, options) {
94
+JitsiConnection.prototype.initJitsiConference = function(name, options) {
95 95
     return new JitsiConference({name, config: options, connection: this});
96 96
 };
97 97
 
@@ -100,7 +100,7 @@ JitsiConnection.prototype.initJitsiConference = function (name, options) {
100 100
  * @param event {JitsiConnectionEvents} the connection event.
101 101
  * @param listener {Function} the function that will receive the event
102 102
  */
103
-JitsiConnection.prototype.addEventListener = function (event, listener) {
103
+JitsiConnection.prototype.addEventListener = function(event, listener) {
104 104
     this.xmpp.addListener(event, listener);
105 105
 };
106 106
 
@@ -109,14 +109,14 @@ JitsiConnection.prototype.addEventListener = function (event, listener) {
109 109
  * @param event {JitsiConnectionEvents} the connection event.
110 110
  * @param listener {Function} the function that will receive the event
111 111
  */
112
-JitsiConnection.prototype.removeEventListener = function (event, listener) {
112
+JitsiConnection.prototype.removeEventListener = function(event, listener) {
113 113
     this.xmpp.removeListener(event, listener);
114 114
 };
115 115
 
116 116
 /**
117 117
  * Returns measured connectionTimes.
118 118
  */
119
-JitsiConnection.prototype.getConnectionTimes = function () {
119
+JitsiConnection.prototype.getConnectionTimes = function() {
120 120
     return this.xmpp.connectionTimes;
121 121
 };
122 122
 
@@ -138,7 +138,7 @@ JitsiConnection.prototype.addFeature = function(feature, submit = false) {
138 138
  * @param {boolean} submit if true - the new list of features will be
139 139
  * immediately submitted to the others.
140 140
  */
141
-JitsiConnection.prototype.removeFeature = function (feature, submit = false) {
141
+JitsiConnection.prototype.removeFeature = function(feature, submit = false) {
142 142
     return this.xmpp.caps.removeFeature(feature, submit);
143 143
 };
144 144
 

+ 13
- 13
JitsiMediaDevices.js Parādīt failu

@@ -8,12 +8,12 @@ import Statistics from "./modules/statistics/statistics";
8 8
 const eventEmitter = new EventEmitter();
9 9
 
10 10
 RTC.addListener(RTCEvents.DEVICE_LIST_CHANGED,
11
-    function (devices) {
11
+    function(devices) {
12 12
         eventEmitter.emit(JitsiMediaDevicesEvents.DEVICE_LIST_CHANGED, devices);
13 13
     });
14 14
 
15 15
 RTC.addListener(RTCEvents.DEVICE_LIST_AVAILABLE,
16
-    function (devices) {
16
+    function(devices) {
17 17
         // log output device
18 18
         logOutputDevice(
19 19
             JitsiMediaDevices.getAudioOutputDevice(),
@@ -25,8 +25,8 @@ RTC.addListener(RTCEvents.DEVICE_LIST_AVAILABLE,
25 25
  * @param deviceID the device id to log
26 26
  * @param devices list of devices
27 27
  */
28
-function logOutputDevice (deviceID, devices) {
29
-    var device = devices.find(function (d) {
28
+function logOutputDevice(deviceID, devices) {
29
+    var device = devices.find(function(d) {
30 30
         return d.kind === 'audiooutput' && d.deviceId === deviceID;
31 31
     });
32 32
 
@@ -41,7 +41,7 @@ var JitsiMediaDevices = {
41 41
      * Executes callback with list of media devices connected.
42 42
      * @param {function} callback
43 43
      */
44
-    enumerateDevices (callback) {
44
+    enumerateDevices(callback) {
45 45
         RTC.enumerateDevices(callback);
46 46
     },
47 47
     /**
@@ -50,7 +50,7 @@ var JitsiMediaDevices = {
50 50
      * the WebRTC stack is ready, either with true if the device listing is
51 51
      * available available or with false otherwise.
52 52
      */
53
-    isDeviceListAvailable () {
53
+    isDeviceListAvailable() {
54 54
         return RTC.isDeviceListAvailable();
55 55
     },
56 56
     /**
@@ -60,7 +60,7 @@ var JitsiMediaDevices = {
60 60
      *      undefined or 'input', 'output' - for audio output device change.
61 61
      * @returns {boolean} true if available, false otherwise.
62 62
      */
63
-    isDeviceChangeAvailable (deviceType) {
63
+    isDeviceChangeAvailable(deviceType) {
64 64
         return RTC.isDeviceChangeAvailable(deviceType);
65 65
     },
66 66
     /**
@@ -69,7 +69,7 @@ var JitsiMediaDevices = {
69 69
      *      undefined stands for both 'audio' and 'video' together
70 70
      * @returns {boolean}
71 71
      */
72
-    isDevicePermissionGranted (type) {
72
+    isDevicePermissionGranted(type) {
73 73
         var permissions = RTC.getDeviceAvailability();
74 74
 
75 75
         switch(type) {
@@ -86,7 +86,7 @@ var JitsiMediaDevices = {
86 86
      * for default device
87 87
      * @returns {string}
88 88
      */
89
-    getAudioOutputDevice () {
89
+    getAudioOutputDevice() {
90 90
         return RTC.getAudioOutputDevice();
91 91
     },
92 92
     /**
@@ -97,7 +97,7 @@ var JitsiMediaDevices = {
97 97
      * @returns {Promise} - resolves when audio output is changed, is rejected
98 98
      *      otherwise
99 99
      */
100
-    setAudioOutputDevice (deviceId) {
100
+    setAudioOutputDevice(deviceId) {
101 101
 
102 102
         var availableDevices = RTC.getCurrentlyAvailableMediaDevices();
103 103
         if (availableDevices && availableDevices.length > 0) {
@@ -114,7 +114,7 @@ var JitsiMediaDevices = {
114 114
      * @param {string} event - event name
115 115
      * @param {function} handler - event handler
116 116
      */
117
-    addEventListener (event, handler) {
117
+    addEventListener(event, handler) {
118 118
         eventEmitter.addListener(event, handler);
119 119
     },
120 120
     /**
@@ -122,14 +122,14 @@ var JitsiMediaDevices = {
122 122
      * @param {string} event - event name
123 123
      * @param {function} handler - event handler
124 124
      */
125
-    removeEventListener (event, handler) {
125
+    removeEventListener(event, handler) {
126 126
         eventEmitter.removeListener(event, handler);
127 127
     },
128 128
     /**
129 129
      * Emits an event.
130 130
      * @param {string} event - event name
131 131
      */
132
-    emitEvent (event) { // eslint-disable-line no-unused-vars
132
+    emitEvent(event) { // eslint-disable-line no-unused-vars
133 133
         eventEmitter.emit(...arguments);
134 134
     }
135 135
 };

+ 13
- 13
JitsiMeetJS.js Parādīt failu

@@ -97,7 +97,7 @@ var LibJitsiMeet = {
97 97
     logLevels: Logger.levels,
98 98
     mediaDevices: JitsiMediaDevices,
99 99
     analytics: null,
100
-    init (options) {
100
+    init(options) {
101 101
         let logObject, attr;
102 102
         Statistics.init(options);
103 103
 
@@ -140,10 +140,10 @@ var LibJitsiMeet = {
140 140
      * Returns whether the desktop sharing is enabled or not.
141 141
      * @returns {boolean}
142 142
      */
143
-    isDesktopSharingEnabled () {
143
+    isDesktopSharingEnabled() {
144 144
         return RTC.isDesktopSharingEnabled();
145 145
     },
146
-    setLogLevel (level) {
146
+    setLogLevel(level) {
147 147
         Logger.setLogLevel(level);
148 148
     },
149 149
     /**
@@ -153,7 +153,7 @@ var LibJitsiMeet = {
153 153
      * Usually it's the name of the JavaScript source file including the path
154 154
      * ex. "modules/xmpp/ChatRoom.js"
155 155
      */
156
-    setLogLevelById (level, id) {
156
+    setLogLevelById(level, id) {
157 157
         Logger.setLogLevelById(level, id);
158 158
     },
159 159
     /**
@@ -161,7 +161,7 @@ var LibJitsiMeet = {
161 161
      * @param globalTransport
162 162
      * @see Logger.addGlobalTransport
163 163
      */
164
-    addGlobalLogTransport (globalTransport) {
164
+    addGlobalLogTransport(globalTransport) {
165 165
         Logger.addGlobalTransport(globalTransport);
166 166
     },
167 167
     /**
@@ -169,7 +169,7 @@ var LibJitsiMeet = {
169 169
      * @param globalTransport
170 170
      * @see Logger.removeGlobalTransport
171 171
      */
172
-    removeGlobalLogTransport (globalTransport) {
172
+    removeGlobalLogTransport(globalTransport) {
173 173
         Logger.removeGlobalTransport(globalTransport);
174 174
     },
175 175
     /**
@@ -211,11 +211,11 @@ var LibJitsiMeet = {
211 211
      *     A promise that returns an array of created JitsiTracks if resolved,
212 212
      *     or a JitsiConferenceError if rejected.
213 213
      */
214
-    createLocalTracks (options, firePermissionPromptIsShownEvent) {
214
+    createLocalTracks(options, firePermissionPromptIsShownEvent) {
215 215
         var promiseFulfilled = false;
216 216
 
217 217
         if (firePermissionPromptIsShownEvent === true) {
218
-            window.setTimeout(function () {
218
+            window.setTimeout(function() {
219 219
                 if (!promiseFulfilled) {
220 220
                     JitsiMediaDevices.emitEvent(
221 221
                         JitsiMediaDevicesEvents.PERMISSION_PROMPT_IS_SHOWN,
@@ -268,7 +268,7 @@ var LibJitsiMeet = {
268 268
                 }
269 269
 
270 270
                 return tracks;
271
-            }).catch(function (error) {
271
+            }).catch(function(error) {
272 272
                 promiseFulfilled = true;
273 273
 
274 274
                 if(error.name === JitsiTrackErrors.UNSUPPORTED_RESOLUTION) {
@@ -332,7 +332,7 @@ var LibJitsiMeet = {
332 332
      * available available or with false otherwise.
333 333
      * @deprecated use JitsiMeetJS.mediaDevices.isDeviceListAvailable instead
334 334
      */
335
-    isDeviceListAvailable () {
335
+    isDeviceListAvailable() {
336 336
         logger.warn('This method is deprecated, use ' +
337 337
             'JitsiMeetJS.mediaDevices.isDeviceListAvailable instead');
338 338
         return this.mediaDevices.isDeviceListAvailable();
@@ -345,7 +345,7 @@ var LibJitsiMeet = {
345 345
      * @returns {boolean} true if available, false otherwise.
346 346
      * @deprecated use JitsiMeetJS.mediaDevices.isDeviceChangeAvailable instead
347 347
      */
348
-    isDeviceChangeAvailable (deviceType) {
348
+    isDeviceChangeAvailable(deviceType) {
349 349
         logger.warn('This method is deprecated, use ' +
350 350
             'JitsiMeetJS.mediaDevices.isDeviceChangeAvailable instead');
351 351
         return this.mediaDevices.isDeviceChangeAvailable(deviceType);
@@ -355,7 +355,7 @@ var LibJitsiMeet = {
355 355
      * @param {function} callback
356 356
      * @deprecated use JitsiMeetJS.mediaDevices.enumerateDevices instead
357 357
      */
358
-    enumerateDevices (callback) {
358
+    enumerateDevices(callback) {
359 359
         logger.warn('This method is deprecated, use ' +
360 360
             'JitsiMeetJS.mediaDevices.enumerateDevices instead');
361 361
         this.mediaDevices.enumerateDevices(callback);
@@ -366,7 +366,7 @@ var LibJitsiMeet = {
366 366
      * the function used by the lib.
367 367
      * (function(message, source, lineno, colno, error)).
368 368
      */
369
-    getGlobalOnErrorHandler (message, source, lineno, colno, error) {
369
+    getGlobalOnErrorHandler(message, source, lineno, colno, error) {
370 370
         logger.error(
371 371
             'UnhandledError: ' + message,
372 372
             'Script: ' + source,

+ 1
- 1
JitsiParticipant.js Parādīt failu

@@ -136,7 +136,7 @@ export default class JitsiParticipant {
136 136
     /**
137 137
      * @returns {String} The status of the participant.
138 138
      */
139
-    getStatus () {
139
+    getStatus() {
140 140
         return this._status;
141 141
     }
142 142
 

+ 21
- 21
doc/example/example.js Parādīt failu

@@ -23,19 +23,19 @@ function onLocalTracks(tracks){
23 23
     localTracks = tracks;
24 24
     for(var i = 0; i < localTracks.length; i++) {
25 25
         localTracks[i].addEventListener(JitsiMeetJS.events.track.TRACK_AUDIO_LEVEL_CHANGED,
26
-            function (audioLevel) {
26
+            function(audioLevel) {
27 27
                 console.log("Audio Level local: " + audioLevel);
28 28
             });
29 29
         localTracks[i].addEventListener(JitsiMeetJS.events.track.TRACK_MUTE_CHANGED,
30
-            function () {
30
+            function() {
31 31
                 console.log("local track muted");
32 32
             });
33 33
         localTracks[i].addEventListener(JitsiMeetJS.events.track.LOCAL_TRACK_STOPPED,
34
-            function () {
34
+            function() {
35 35
                 console.log("local track stoped");
36 36
             });
37 37
         localTracks[i].addEventListener(JitsiMeetJS.events.track.TRACK_AUDIO_OUTPUT_CHANGED,
38
-            function (deviceId) {
38
+            function(deviceId) {
39 39
                 console.log("track audio output device was changed to " + deviceId);
40 40
             });
41 41
         if(localTracks[i].getType() == "video") {
@@ -65,19 +65,19 @@ function onRemoteTrack(track) {
65 65
     }
66 66
     var idx = remoteTracks[participant].push(track);
67 67
     track.addEventListener(JitsiMeetJS.events.track.TRACK_AUDIO_LEVEL_CHANGED,
68
-        function (audioLevel) {
68
+        function(audioLevel) {
69 69
             console.log("Audio Level remote: " + audioLevel);
70 70
         });
71 71
     track.addEventListener(JitsiMeetJS.events.track.TRACK_MUTE_CHANGED,
72
-        function () {
72
+        function() {
73 73
             console.log("remote track muted");
74 74
         });
75 75
     track.addEventListener(JitsiMeetJS.events.track.LOCAL_TRACK_STOPPED,
76
-        function () {
76
+        function() {
77 77
             console.log("remote track stoped");
78 78
         });
79 79
     track.addEventListener(JitsiMeetJS.events.track.TRACK_AUDIO_OUTPUT_CHANGED,
80
-        function (deviceId) {
80
+        function(deviceId) {
81 81
             console.log("track audio output device was changed to " + deviceId);
82 82
         });
83 83
     var id = participant + track.getType() + idx;
@@ -92,7 +92,7 @@ function onRemoteTrack(track) {
92 92
 /**
93 93
  * That function is executed when the conference is joined
94 94
  */
95
-function onConferenceJoined () {
95
+function onConferenceJoined() {
96 96
     console.log("conference joined!");
97 97
     isJoined = true;
98 98
     for(var i = 0; i < localTracks.length; i++) {
@@ -117,7 +117,7 @@ function onUserLeft(id) {
117 117
 function onConnectionSuccess(){
118 118
     room = connection.initJitsiConference("conference", confOptions);
119 119
     room.on(JitsiMeetJS.events.conference.TRACK_ADDED, onRemoteTrack);
120
-    room.on(JitsiMeetJS.events.conference.TRACK_REMOVED, function (track) {
120
+    room.on(JitsiMeetJS.events.conference.TRACK_REMOVED, function(track) {
121 121
         console.log("track removed!!!" + track);
122 122
     });
123 123
     room.on(JitsiMeetJS.events.conference.CONFERENCE_JOINED, onConferenceJoined);
@@ -125,22 +125,22 @@ function onConnectionSuccess(){
125 125
         console.log("user join");remoteTracks[id] = [];
126 126
     });
127 127
     room.on(JitsiMeetJS.events.conference.USER_LEFT, onUserLeft);
128
-    room.on(JitsiMeetJS.events.conference.TRACK_MUTE_CHANGED, function (track) {
128
+    room.on(JitsiMeetJS.events.conference.TRACK_MUTE_CHANGED, function(track) {
129 129
         console.log(track.getType() + " - " + track.isMuted());
130 130
     });
131
-    room.on(JitsiMeetJS.events.conference.DISPLAY_NAME_CHANGED, function (userID, displayName) {
131
+    room.on(JitsiMeetJS.events.conference.DISPLAY_NAME_CHANGED, function(userID, displayName) {
132 132
         console.log(userID + " - " + displayName);
133 133
     });
134 134
     room.on(JitsiMeetJS.events.conference.TRACK_AUDIO_LEVEL_CHANGED,
135 135
       function(userID, audioLevel){
136 136
           console.log(userID + " - " + audioLevel);
137 137
       });
138
-    room.on(JitsiMeetJS.events.conference.RECORDER_STATE_CHANGED, function () {
138
+    room.on(JitsiMeetJS.events.conference.RECORDER_STATE_CHANGED, function() {
139 139
         console.log(room.isRecordingSupported() + " - " +
140 140
             room.getRecordingState() + " - " +
141 141
             room.getRecordingURL());
142 142
     });
143
-    room.on(JitsiMeetJS.events.conference.PHONE_NUMBER_CHANGED, function () {
143
+    room.on(JitsiMeetJS.events.conference.PHONE_NUMBER_CHANGED, function() {
144 144
         console.log(
145 145
             room.getPhoneNumber() + " - " +
146 146
             room.getPhonePin());
@@ -188,19 +188,19 @@ function switchVideo() { // eslint-disable-line no-unused-vars
188 188
         localTracks.pop();
189 189
     }
190 190
     JitsiMeetJS.createLocalTracks({devices: isVideo ? ["video"] : ["desktop"]}).
191
-        then(function (tracks) {
191
+        then(function(tracks) {
192 192
             localTracks.push(tracks[0]);
193 193
             localTracks[1].addEventListener(JitsiMeetJS.events.track.TRACK_MUTE_CHANGED,
194
-                function () {
194
+                function() {
195 195
                     console.log("local track muted");
196 196
                 });
197 197
             localTracks[1].addEventListener(JitsiMeetJS.events.track.LOCAL_TRACK_STOPPED,
198
-                function () {
198
+                function() {
199 199
                     console.log("local track stoped");
200 200
                 });
201 201
             localTracks[1].attach($("#localVideo1")[0]);
202 202
             room.addTrack(localTracks[1]);
203
-        }).catch(function (error) {
203
+        }).catch(function(error) {
204 204
             console.log(error);
205 205
         });
206 206
 }
@@ -250,10 +250,10 @@ JitsiMeetJS.init(initOptions).then(function(){
250 250
 
251 251
     connection.connect();
252 252
     JitsiMeetJS.createLocalTracks({devices: ["audio", "video"]}).
253
-        then(onLocalTracks).catch(function (error) {
253
+        then(onLocalTracks).catch(function(error) {
254 254
             throw error;
255 255
         });
256
-}).catch(function (error) {
256
+}).catch(function(error) {
257 257
     console.log(error);
258 258
 });
259 259
 
@@ -265,7 +265,7 @@ if (JitsiMeetJS.mediaDevices.isDeviceChangeAvailable('output')) {
265 265
 
266 266
         if (audioOutputDevices.length > 1) {
267 267
             $('#audioOutputSelect').html(
268
-                audioOutputDevices.map(function (d) {
268
+                audioOutputDevices.map(function(d) {
269 269
                     return '<option value="' + d.deviceId + '">' + d.label + '</option>';
270 270
                 }).join('\n')
271 271
             );

+ 2
- 2
modules/DTMF/JitsiDTMFManager.js Parādīt failu

@@ -1,6 +1,6 @@
1 1
 var logger = require("jitsi-meet-logger").getLogger(__filename);
2 2
 
3
-function JitsiDTMFManager (localAudio, peerConnection) {
3
+function JitsiDTMFManager(localAudio, peerConnection) {
4 4
     var audioTrack = localAudio.getTrack();
5 5
     if (!audioTrack) {
6 6
         throw new Error("Failed to initialize DTMFSender: no audio track.");
@@ -11,6 +11,6 @@ function JitsiDTMFManager (localAudio, peerConnection) {
11 11
 }
12 12
 
13 13
 
14
-JitsiDTMFManager.prototype.sendTones = function (tones, duration, pause) {
14
+JitsiDTMFManager.prototype.sendTones = function(tones, duration, pause) {
15 15
     this.dtmfSender.insertDTMF(tones, duration || 200, pause || 200);
16 16
 };

+ 15
- 15
modules/RTC/DataChannels.js Parādīt failu

@@ -44,11 +44,11 @@ function DataChannels(peerConnection, emitter) {
44 44
  * on the bridge.
45 45
  * @param event the event info object.
46 46
  */
47
-DataChannels.prototype.onDataChannel = function (event) {
47
+DataChannels.prototype.onDataChannel = function(event) {
48 48
     var dataChannel = event.channel;
49 49
     var self = this;
50 50
 
51
-    dataChannel.onopen = function () {
51
+    dataChannel.onopen = function() {
52 52
         logger.info("Data channel opened by the Videobridge!", dataChannel);
53 53
 
54 54
         // Code sample for sending string and/or binary data
@@ -60,7 +60,7 @@ DataChannels.prototype.onDataChannel = function (event) {
60 60
         self.eventEmitter.emit(RTCEvents.DATA_CHANNEL_OPEN);
61 61
     };
62 62
 
63
-    dataChannel.onerror = function (error) {
63
+    dataChannel.onerror = function(error) {
64 64
         // FIXME: this one seems to be generated a bit too often right now
65 65
         // so we are temporarily commenting it before we have more clarity
66 66
         // on which of the errors we absolutely need to report
@@ -69,7 +69,7 @@ DataChannels.prototype.onDataChannel = function (event) {
69 69
         logger.error("Data Channel Error:", error, dataChannel);
70 70
     };
71 71
 
72
-    dataChannel.onmessage = function (event) {
72
+    dataChannel.onmessage = function(event) {
73 73
         var data = event.data;
74 74
         // JSON
75 75
         var obj;
@@ -154,7 +154,7 @@ DataChannels.prototype.onDataChannel = function (event) {
154 154
         }
155 155
     };
156 156
 
157
-    dataChannel.onclose = function () {
157
+    dataChannel.onclose = function() {
158 158
         logger.info("The Data Channel closed", dataChannel);
159 159
         var idx = self._dataChannels.indexOf(dataChannel);
160 160
         if (idx > -1) {
@@ -167,8 +167,8 @@ DataChannels.prototype.onDataChannel = function (event) {
167 167
 /**
168 168
  * Closes all currently opened data channels.
169 169
  */
170
-DataChannels.prototype.closeAllChannels = function () {
171
-    this._dataChannels.forEach(function (dc){
170
+DataChannels.prototype.closeAllChannels = function() {
171
+    this._dataChannels.forEach(function(dc){
172 172
         // the DC will be removed from the array on 'onclose' event
173 173
         dc.close();
174 174
     });
@@ -181,7 +181,7 @@ DataChannels.prototype.closeAllChannels = function () {
181 181
  * {@link https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send})
182 182
  * or Error with "No opened data channels found!" message.
183 183
  */
184
-DataChannels.prototype.sendSelectedEndpointMessage = function (endpointId) {
184
+DataChannels.prototype.sendSelectedEndpointMessage = function(endpointId) {
185 185
     this._onXXXEndpointChanged("selected", endpointId);
186 186
 };
187 187
 
@@ -192,7 +192,7 @@ DataChannels.prototype.sendSelectedEndpointMessage = function (endpointId) {
192 192
  * {@link https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send})
193 193
  * or Error with "No opened data channels found!" message.
194 194
  */
195
-DataChannels.prototype.sendPinnedEndpointMessage = function (endpointId) {
195
+DataChannels.prototype.sendPinnedEndpointMessage = function(endpointId) {
196 196
     this._onXXXEndpointChanged("pinned", endpointId);
197 197
 };
198 198
 
@@ -207,7 +207,7 @@ DataChannels.prototype.sendPinnedEndpointMessage = function (endpointId) {
207 207
  * {@link https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send})
208 208
  * or Error with "No opened data channels found!" message.
209 209
  */
210
-DataChannels.prototype._onXXXEndpointChanged = function (xxx, userResource) {
210
+DataChannels.prototype._onXXXEndpointChanged = function(xxx, userResource) {
211 211
     // Derive the correct words from xxx such as selected and Selected, pinned
212 212
     // and Pinned.
213 213
     var head = xxx.charAt(0);
@@ -231,7 +231,7 @@ DataChannels.prototype._onXXXEndpointChanged = function (xxx, userResource) {
231 231
     logger.log(lower + ' endpoint changed: ', userResource);
232 232
 };
233 233
 
234
-DataChannels.prototype._some = function (callback, thisArg) {
234
+DataChannels.prototype._some = function(callback, thisArg) {
235 235
     var dataChannels = this._dataChannels;
236 236
 
237 237
     if (dataChannels && dataChannels.length !== 0) {
@@ -252,8 +252,8 @@ DataChannels.prototype._some = function (callback, thisArg) {
252 252
  * {@link https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send})
253 253
  * or Error with "No opened data channels found!" message.
254 254
  */
255
-DataChannels.prototype.send = function (jsonObject) {
256
-    if(!this._some(function (dataChannel) {
255
+DataChannels.prototype.send = function(jsonObject) {
256
+    if(!this._some(function(dataChannel) {
257 257
         if (dataChannel.readyState == 'open') {
258 258
             dataChannel.send(JSON.stringify(jsonObject));
259 259
             return true;
@@ -272,7 +272,7 @@ DataChannels.prototype.send = function (jsonObject) {
272 272
  * {@link https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send})
273 273
  * or Error with "No opened data channels found!" message.
274 274
  */
275
-DataChannels.prototype.sendDataChannelMessage = function (to, payload) {
275
+DataChannels.prototype.sendDataChannelMessage = function(to, payload) {
276 276
     this.send({
277 277
         colibriClass: "EndpointMessage",
278 278
         to,
@@ -284,7 +284,7 @@ DataChannels.prototype.sendDataChannelMessage = function (to, payload) {
284 284
  * Sends a "lastN value changed" message via the data channel.
285 285
  * @param value {int} The new value for lastN. -1 means unlimited.
286 286
  */
287
-DataChannels.prototype.sendSetLastNMessage = function (value) {
287
+DataChannels.prototype.sendSetLastNMessage = function(value) {
288 288
     const jsonObject = {
289 289
         colibriClass : 'LastNChangedEvent',
290 290
         lastN : value

+ 28
- 28
modules/RTC/JitsiLocalTrack.js Parādīt failu

@@ -33,7 +33,7 @@ function JitsiLocalTrack(stream, track, mediaType, videoType, resolution,
33 33
 
34 34
     JitsiTrack.call(this,
35 35
         null /* RTC */, stream, track,
36
-        function () {
36
+        function() {
37 37
             if(!this.dontFireRemoveEvent) {
38 38
                 this.eventEmitter.emit(
39 39
                     JitsiTrackEvents.LOCAL_TRACK_STOPPED);
@@ -98,7 +98,7 @@ function JitsiLocalTrack(stream, track, mediaType, videoType, resolution,
98 98
      */
99 99
     this._noDataFromSourceTimeout = null;
100 100
 
101
-    this._onDeviceListChanged = function (devices) {
101
+    this._onDeviceListChanged = function(devices) {
102 102
         self._setRealDeviceIdFromDeviceList(devices);
103 103
 
104 104
         // Mark track as ended for those browsers that do not support
@@ -106,7 +106,7 @@ function JitsiLocalTrack(stream, track, mediaType, videoType, resolution,
106 106
         // device ID "".
107 107
         if (typeof self.getTrack().readyState === 'undefined'
108 108
             && typeof self._realDeviceId !== 'undefined'
109
-            && !devices.find(function (d) {
109
+            && !devices.find(function(d) {
110 110
                 return d.deviceId === self._realDeviceId;
111 111
             })) {
112 112
             self._trackEnded = true;
@@ -137,14 +137,14 @@ JitsiLocalTrack.prototype.constructor = JitsiLocalTrack;
137 137
  * Returns if associated MediaStreamTrack is in the 'ended' state
138 138
  * @returns {boolean}
139 139
  */
140
-JitsiLocalTrack.prototype.isEnded = function () {
140
+JitsiLocalTrack.prototype.isEnded = function() {
141 141
     return this.getTrack().readyState === 'ended' || this._trackEnded;
142 142
 };
143 143
 
144 144
 /**
145 145
  * Sets handlers to the MediaStreamTrack object that will detect camera issues.
146 146
  */
147
-JitsiLocalTrack.prototype._initNoDataFromSourceHandlers = function () {
147
+JitsiLocalTrack.prototype._initNoDataFromSourceHandlers = function() {
148 148
     if(this.isVideoTrack() && this.videoType === VideoType.CAMERA) {
149 149
         const _onNoDataFromSourceError
150 150
             = this._onNoDataFromSourceError.bind(this);
@@ -169,7 +169,7 @@ JitsiLocalTrack.prototype._initNoDataFromSourceHandlers = function () {
169 169
  * Clears all timeouts and handlers set on MediaStreamTrack mute event.
170 170
  * FIXME: Change the name of the method with better one.
171 171
  */
172
-JitsiLocalTrack.prototype._clearNoDataFromSourceMuteResources = function () {
172
+JitsiLocalTrack.prototype._clearNoDataFromSourceMuteResources = function() {
173 173
     if(this._noDataFromSourceTimeout) {
174 174
         clearTimeout(this._noDataFromSourceTimeout);
175 175
         this._noDataFromSourceTimeout = null;
@@ -182,7 +182,7 @@ JitsiLocalTrack.prototype._clearNoDataFromSourceMuteResources = function () {
182 182
  * timeouts set on MediaStreamTrack muted event. Verifies that the camera
183 183
  * issue persists and fires NO_DATA_FROM_SOURCE event.
184 184
  */
185
-JitsiLocalTrack.prototype._onNoDataFromSourceError = function () {
185
+JitsiLocalTrack.prototype._onNoDataFromSourceError = function() {
186 186
     this._clearNoDataFromSourceMuteResources();
187 187
     if(this._checkForCameraIssues()) {
188 188
         this._fireNoDataFromSourceEvent();
@@ -193,7 +193,7 @@ JitsiLocalTrack.prototype._onNoDataFromSourceError = function () {
193 193
  * Fires JitsiTrackEvents.NO_DATA_FROM_SOURCE and logs it to analytics and
194 194
  * callstats.
195 195
  */
196
-JitsiLocalTrack.prototype._fireNoDataFromSourceEvent = function () {
196
+JitsiLocalTrack.prototype._fireNoDataFromSourceEvent = function() {
197 197
     this.eventEmitter.emit(JitsiTrackEvents.NO_DATA_FROM_SOURCE);
198 198
     const eventName = this.getType() + ".no_data_from_source";
199 199
     Statistics.analytics.sendEvent(eventName);
@@ -211,9 +211,9 @@ JitsiLocalTrack.prototype._fireNoDataFromSourceEvent = function () {
211 211
  * @param {MediaDeviceInfo[]} devices - list of devices obtained from
212 212
  *  enumerateDevices() call
213 213
  */
214
-JitsiLocalTrack.prototype._setRealDeviceIdFromDeviceList = function (devices) {
214
+JitsiLocalTrack.prototype._setRealDeviceIdFromDeviceList = function(devices) {
215 215
     var track = this.getTrack(),
216
-        device = devices.find(function (d) {
216
+        device = devices.find(function(d) {
217 217
             return d.kind === track.kind + 'input' && d.label === track.label;
218 218
         });
219 219
 
@@ -227,7 +227,7 @@ JitsiLocalTrack.prototype._setRealDeviceIdFromDeviceList = function (devices) {
227 227
  * in progress.
228 228
  * @returns {Promise}
229 229
  */
230
-JitsiLocalTrack.prototype.mute = function () {
230
+JitsiLocalTrack.prototype.mute = function() {
231 231
     return createMuteUnmutePromise(this, true);
232 232
 };
233 233
 
@@ -236,7 +236,7 @@ JitsiLocalTrack.prototype.mute = function () {
236 236
  * in progress.
237 237
  * @returns {Promise}
238 238
  */
239
-JitsiLocalTrack.prototype.unmute = function () {
239
+JitsiLocalTrack.prototype.unmute = function() {
240 240
     return createMuteUnmutePromise(this, false);
241 241
 };
242 242
 
@@ -274,7 +274,7 @@ function createMuteUnmutePromise(track, mute) {
274 274
  * @private
275 275
  * @returns {Promise}
276 276
  */
277
-JitsiLocalTrack.prototype._setMute = function (mute) {
277
+JitsiLocalTrack.prototype._setMute = function(mute) {
278 278
     if (this.isMuted() === mute) {
279 279
         return Promise.resolve();
280 280
     }
@@ -324,7 +324,7 @@ JitsiLocalTrack.prototype._setMute = function (mute) {
324 324
             }
325 325
 
326 326
             promise = RTCUtils.obtainAudioAndVideoPermissions(streamOptions)
327
-                .then(function (streamsInfo) {
327
+                .then(function(streamsInfo) {
328 328
                     var mediaType = self.getType();
329 329
                     var streamInfo = streamsInfo.find(function(info) {
330 330
                         return info.mediaType === mediaType;
@@ -370,7 +370,7 @@ JitsiLocalTrack.prototype._setMute = function (mute) {
370 370
  * @private
371 371
  * @returns {Promise}
372 372
  */
373
-JitsiLocalTrack.prototype._addStreamToConferenceAsUnmute = function () {
373
+JitsiLocalTrack.prototype._addStreamToConferenceAsUnmute = function() {
374 374
     if (!this.conference) {
375 375
         return Promise.resolve();
376 376
     }
@@ -397,7 +397,7 @@ JitsiLocalTrack.prototype._addStreamToConferenceAsUnmute = function () {
397 397
  * @private
398 398
  */
399 399
 JitsiLocalTrack.prototype._removeStreamFromConferenceAsMute =
400
-function (successCallback, errorCallback) {
400
+function(successCallback, errorCallback) {
401 401
     if (!this.conference) {
402 402
         successCallback();
403 403
         return;
@@ -444,7 +444,7 @@ JitsiLocalTrack.prototype._sendMuteStatus = function(mute) {
444 444
  * @extends JitsiTrack#dispose
445 445
  * @returns {Promise}
446 446
  */
447
-JitsiLocalTrack.prototype.dispose = function () {
447
+JitsiLocalTrack.prototype.dispose = function() {
448 448
     var self = this;
449 449
     var promise = Promise.resolve();
450 450
 
@@ -477,7 +477,7 @@ JitsiLocalTrack.prototype.dispose = function () {
477 477
  * @returns {boolean} <tt>true</tt> - if the stream is muted
478 478
  * and <tt>false</tt> otherwise.
479 479
  */
480
-JitsiLocalTrack.prototype.isMuted = function () {
480
+JitsiLocalTrack.prototype.isMuted = function() {
481 481
     // this.stream will be null when we mute local video on Chrome
482 482
     if (!this.stream) {
483 483
         return true;
@@ -493,7 +493,7 @@ JitsiLocalTrack.prototype.isMuted = function () {
493 493
  * Updates the SSRC associated with the MediaStream in JitsiLocalTrack object.
494 494
  * @ssrc the new ssrc
495 495
  */
496
-JitsiLocalTrack.prototype._setSSRC = function (ssrc) {
496
+JitsiLocalTrack.prototype._setSSRC = function(ssrc) {
497 497
     this.ssrc = ssrc;
498 498
 };
499 499
 
@@ -522,7 +522,7 @@ JitsiLocalTrack.prototype._setConference = function(conference) {
522 522
  * In case of video and simulcast returns the the primarySSRC.
523 523
  * @returns {string} or {null}
524 524
  */
525
-JitsiLocalTrack.prototype.getSSRC = function () {
525
+JitsiLocalTrack.prototype.getSSRC = function() {
526 526
     if(this.ssrc && this.ssrc.groups && this.ssrc.groups.length) {
527 527
         return this.ssrc.groups[0].ssrcs[0];
528 528
     } else if(this.ssrc && this.ssrc.ssrcs && this.ssrc.ssrcs.length) {
@@ -536,7 +536,7 @@ JitsiLocalTrack.prototype.getSSRC = function () {
536 536
  * Returns <tt>true</tt>.
537 537
  * @returns {boolean} <tt>true</tt>
538 538
  */
539
-JitsiLocalTrack.prototype.isLocal = function () {
539
+JitsiLocalTrack.prototype.isLocal = function() {
540 540
     return true;
541 541
 };
542 542
 
@@ -544,7 +544,7 @@ JitsiLocalTrack.prototype.isLocal = function () {
544 544
  * Returns device id associated with track.
545 545
  * @returns {string}
546 546
  */
547
-JitsiLocalTrack.prototype.getDeviceId = function () {
547
+JitsiLocalTrack.prototype.getDeviceId = function() {
548 548
     return this._realDeviceId || this.deviceId;
549 549
 };
550 550
 
@@ -553,7 +553,7 @@ JitsiLocalTrack.prototype.getDeviceId = function () {
553 553
  * @param bytesSent {integer} the new value (FIXME: what is an integer in js?)
554 554
  * NOTE: used only for audio tracks to detect audio issues.
555 555
  */
556
-JitsiLocalTrack.prototype._setByteSent = function (bytesSent) {
556
+JitsiLocalTrack.prototype._setByteSent = function(bytesSent) {
557 557
     this._bytesSent = bytesSent;
558 558
     // FIXME it's a shame that PeerConnection and ICE status does not belong
559 559
     // to the RTC module and it has to be accessed through
@@ -561,7 +561,7 @@ JitsiLocalTrack.prototype._setByteSent = function (bytesSent) {
561 561
     const iceConnectionState
562 562
         = this.conference ? this.conference.getConnectionState() : null;
563 563
     if(this._testByteSent && "connected" === iceConnectionState) {
564
-        setTimeout(function () {
564
+        setTimeout(function() {
565 565
             if(this._bytesSent <= 0){
566 566
                 // we are not receiving anything from the microphone
567 567
                 this._fireNoDataFromSourceEvent();
@@ -577,7 +577,7 @@ JitsiLocalTrack.prototype._setByteSent = function (bytesSent) {
577 577
  *
578 578
  * @returns {CameraFacingMode|undefined}
579 579
  */
580
-JitsiLocalTrack.prototype.getCameraFacingMode = function () {
580
+JitsiLocalTrack.prototype.getCameraFacingMode = function() {
581 581
     if (this.isVideoTrack() && this.videoType === VideoType.CAMERA) {
582 582
         // MediaStreamTrack#getSettings() is not implemented in many browsers,
583 583
         // so we need feature checking here. Progress on the respective
@@ -615,7 +615,7 @@ JitsiLocalTrack.prototype.getCameraFacingMode = function () {
615 615
 /**
616 616
  * Stops the associated MediaStream.
617 617
  */
618
-JitsiLocalTrack.prototype._stopMediaStream = function () {
618
+JitsiLocalTrack.prototype._stopMediaStream = function() {
619 619
     this.stopStreamInProgress = true;
620 620
     RTCUtils.stopMediaStream(this.stream);
621 621
     this.stopStreamInProgress = false;
@@ -625,7 +625,7 @@ JitsiLocalTrack.prototype._stopMediaStream = function () {
625 625
  * Detects camera issues on ended and mute events from MediaStreamTrack.
626 626
  * @returns {boolean} true if an issue is detected and false otherwise
627 627
  */
628
-JitsiLocalTrack.prototype._checkForCameraIssues = function () {
628
+JitsiLocalTrack.prototype._checkForCameraIssues = function() {
629 629
     if(!this.isVideoTrack() || this.stopStreamInProgress ||
630 630
         this.videoType === VideoType.DESKTOP) {
631 631
         return false;
@@ -643,7 +643,7 @@ JitsiLocalTrack.prototype._checkForCameraIssues = function () {
643 643
  * user has disposed the track.
644 644
  * @returns {boolean} true if the stream is receiving data and false otherwise.
645 645
  */
646
-JitsiLocalTrack.prototype._isReceivingData = function () {
646
+JitsiLocalTrack.prototype._isReceivingData = function() {
647 647
     if(!this.stream) {
648 648
         return false;
649 649
     }

+ 10
- 10
modules/RTC/JitsiRemoteTrack.js Parādīt failu

@@ -28,7 +28,7 @@ var ttfmTrackerVideoAttached = false;
28 28
 function JitsiRemoteTrack(rtc, conference, ownerEndpointId, stream, track,
29 29
                           mediaType, videoType, ssrc, muted) {
30 30
     JitsiTrack.call(
31
-        this, conference, stream, track, function () {}, mediaType, videoType, ssrc);
31
+        this, conference, stream, track, function() {}, mediaType, videoType, ssrc);
32 32
     this.rtc = rtc;
33 33
     this.ownerEndpointId = ownerEndpointId;
34 34
     this.muted = muted;
@@ -52,7 +52,7 @@ JitsiRemoteTrack.prototype._bindMuteHandlers = function() {
52 52
     // 2. It does mix MediaStream('inactive') with MediaStreamTrack events
53 53
     // 3. Allowing to bind more than one event handler requires too much
54 54
     //    refactoring around camera issues detection.
55
-    this.track.addEventListener('mute', function () {
55
+    this.track.addEventListener('mute', function() {
56 56
 
57 57
         logger.debug(
58 58
             '"onmute" event(' + Date.now() + '): ',
@@ -62,7 +62,7 @@ JitsiRemoteTrack.prototype._bindMuteHandlers = function() {
62 62
     }.bind(this));
63 63
 
64 64
     // Bind 'onunmute'
65
-    this.track.addEventListener('unmute', function () {
65
+    this.track.addEventListener('unmute', function() {
66 66
 
67 67
         logger.debug(
68 68
             '"onunmute" event(' + Date.now() + '): ',
@@ -76,7 +76,7 @@ JitsiRemoteTrack.prototype._bindMuteHandlers = function() {
76 76
  * Sets current muted status and fires an events for the change.
77 77
  * @param value the muted status.
78 78
  */
79
-JitsiRemoteTrack.prototype.setMute = function (value) {
79
+JitsiRemoteTrack.prototype.setMute = function(value) {
80 80
     if(this.muted === value) {
81 81
         return;
82 82
     }
@@ -99,7 +99,7 @@ JitsiRemoteTrack.prototype.setMute = function (value) {
99 99
  * @returns {boolean|*|JitsiRemoteTrack.muted} <tt>true</tt> if the track is
100 100
  * muted and <tt>false</tt> otherwise.
101 101
  */
102
-JitsiRemoteTrack.prototype.isMuted = function () {
102
+JitsiRemoteTrack.prototype.isMuted = function() {
103 103
     return this.muted;
104 104
 };
105 105
 
@@ -115,7 +115,7 @@ JitsiRemoteTrack.prototype.getParticipantId = function() {
115 115
 /**
116 116
  * Return false;
117 117
  */
118
-JitsiRemoteTrack.prototype.isLocal = function () {
118
+JitsiRemoteTrack.prototype.isLocal = function() {
119 119
     return false;
120 120
 };
121 121
 
@@ -123,7 +123,7 @@ JitsiRemoteTrack.prototype.isLocal = function () {
123 123
  * Returns the synchronization source identifier (SSRC) of this remote track.
124 124
  * @returns {string} the SSRC of this remote track
125 125
  */
126
-JitsiRemoteTrack.prototype.getSSRC = function () {
126
+JitsiRemoteTrack.prototype.getSSRC = function() {
127 127
     return this.ssrc;
128 128
 };
129 129
 
@@ -131,7 +131,7 @@ JitsiRemoteTrack.prototype.getSSRC = function () {
131 131
  * Changes the video type of the track
132 132
  * @param type the new video type("camera", "desktop")
133 133
  */
134
-JitsiRemoteTrack.prototype._setVideoType = function (type) {
134
+JitsiRemoteTrack.prototype._setVideoType = function(type) {
135 135
     if(this.videoType === type) {
136 136
         return;
137 137
     }
@@ -139,7 +139,7 @@ JitsiRemoteTrack.prototype._setVideoType = function (type) {
139 139
     this.eventEmitter.emit(JitsiTrackEvents.TRACK_VIDEOTYPE_CHANGED, type);
140 140
 };
141 141
 
142
-JitsiRemoteTrack.prototype._playCallback = function () {
142
+JitsiRemoteTrack.prototype._playCallback = function() {
143 143
     var type = this.isVideoTrack() ? 'video' : 'audio';
144 144
 
145 145
     var now = window.performance.now();
@@ -168,7 +168,7 @@ JitsiRemoteTrack.prototype._playCallback = function () {
168 168
  *        method has been called previously on video or audio HTML element.
169 169
  * @private
170 170
  */
171
-JitsiRemoteTrack.prototype._attachTTFMTracker = function (container) {
171
+JitsiRemoteTrack.prototype._attachTTFMTracker = function(container) {
172 172
     if((ttfmTrackerAudioAttached && this.isAudioTrack())
173 173
         || (ttfmTrackerVideoAttached && this.isVideoTrack())) {
174 174
         return;

+ 27
- 27
modules/RTC/JitsiTrack.js Parādīt failu

@@ -31,7 +31,7 @@ function implementOnEndedHandling(jitsiTrack) {
31 31
     }
32 32
 
33 33
     var originalStop = stream.stop;
34
-    stream.stop = function () {
34
+    stream.stop = function() {
35 35
         originalStop.apply(stream);
36 36
         if (jitsiTrack.isActive()) {
37 37
             stream.onended();
@@ -100,7 +100,7 @@ function JitsiTrack(conference, stream, track, streamInactiveHandler, trackMedia
100 100
  * @param {string} type the type of the handler that is going to be set
101 101
  * @param {Function} handler the handler.
102 102
  */
103
-JitsiTrack.prototype._setHandler = function (type, handler) {
103
+JitsiTrack.prototype._setHandler = function(type, handler) {
104 104
     this.handlers[type] = handler;
105 105
     if(!this.stream) {
106 106
         return;
@@ -112,7 +112,7 @@ JitsiTrack.prototype._setHandler = function (type, handler) {
112 112
         }
113 113
         addMediaStreamInactiveHandler(this.stream, handler);
114 114
     } else if(trackHandler2Prop.hasOwnProperty(type)) {
115
-        this.stream.getVideoTracks().forEach(function (track) {
115
+        this.stream.getVideoTracks().forEach(function(track) {
116 116
             track[trackHandler2Prop[type]] = handler;
117 117
         }, this);
118 118
     }
@@ -123,9 +123,9 @@ JitsiTrack.prototype._setHandler = function (type, handler) {
123 123
  * to it.
124 124
  * @param {MediaStream} stream the new stream.
125 125
  */
126
-JitsiTrack.prototype._setStream = function (stream) {
126
+JitsiTrack.prototype._setStream = function(stream) {
127 127
     this.stream = stream;
128
-    Object.keys(this.handlers).forEach(function (type) {
128
+    Object.keys(this.handlers).forEach(function(type) {
129 129
         typeof this.handlers[type] === "function" &&
130 130
             this._setHandler(type, this.handlers[type]);
131 131
     }, this);
@@ -141,7 +141,7 @@ JitsiTrack.prototype.getType = function() {
141 141
 /**
142 142
  * Check if this is an audio track.
143 143
  */
144
-JitsiTrack.prototype.isAudioTrack = function () {
144
+JitsiTrack.prototype.isAudioTrack = function() {
145 145
     return this.getType() === MediaType.AUDIO;
146 146
 };
147 147
 
@@ -151,14 +151,14 @@ JitsiTrack.prototype.isAudioTrack = function () {
151 151
  * @return {boolean} <tt>true</tt> if the underlying <tt>MediaStreamTrack</tt>
152 152
  * is muted or <tt>false</tt> otherwise.
153 153
  */
154
-JitsiTrack.prototype.isWebRTCTrackMuted = function () {
154
+JitsiTrack.prototype.isWebRTCTrackMuted = function() {
155 155
     return this.track && this.track.muted;
156 156
 };
157 157
 
158 158
 /**
159 159
  * Check if this is a video track.
160 160
  */
161
-JitsiTrack.prototype.isVideoTrack = function () {
161
+JitsiTrack.prototype.isVideoTrack = function() {
162 162
     return this.getType() === MediaType.VIDEO;
163 163
 };
164 164
 
@@ -167,7 +167,7 @@ JitsiTrack.prototype.isVideoTrack = function () {
167 167
  * @abstract
168 168
  * @return {boolean} 'true' if it's a local track or 'false' otherwise.
169 169
  */
170
-JitsiTrack.prototype.isLocal = function () {
170
+JitsiTrack.prototype.isLocal = function() {
171 171
     throw new Error("Not implemented by subclass");
172 172
 };
173 173
 
@@ -182,7 +182,7 @@ JitsiTrack.prototype.getOriginalStream = function() {
182 182
  * Returns the ID of the underlying WebRTC Media Stream(if any)
183 183
  * @returns {String|null}
184 184
  */
185
-JitsiTrack.prototype.getStreamId = function () {
185
+JitsiTrack.prototype.getStreamId = function() {
186 186
     return this.stream ? this.stream.id : null;
187 187
 };
188 188
 
@@ -190,7 +190,7 @@ JitsiTrack.prototype.getStreamId = function () {
190 190
  * Return the underlying WebRTC MediaStreamTrack
191 191
  * @returns {MediaStreamTrack}
192 192
  */
193
-JitsiTrack.prototype.getTrack = function () {
193
+JitsiTrack.prototype.getTrack = function() {
194 194
     return this.track;
195 195
 };
196 196
 
@@ -198,7 +198,7 @@ JitsiTrack.prototype.getTrack = function () {
198 198
  * Returns the ID of the underlying WebRTC MediaStreamTrack(if any)
199 199
  * @returns {String|null}
200 200
  */
201
-JitsiTrack.prototype.getTrackId = function () {
201
+JitsiTrack.prototype.getTrackId = function() {
202 202
     return this.track ? this.track.id : null;
203 203
 };
204 204
 
@@ -207,7 +207,7 @@ JitsiTrack.prototype.getTrackId = function () {
207 207
  * eventual video type.
208 208
  * @returns {string}
209 209
  */
210
-JitsiTrack.prototype.getUsageLabel = function () {
210
+JitsiTrack.prototype.getUsageLabel = function() {
211 211
     if (this.isAudioTrack()) {
212 212
         return "mic";
213 213
     } else {
@@ -221,7 +221,7 @@ JitsiTrack.prototype.getUsageLabel = function () {
221 221
  *        and for which event will be fired.
222 222
  * @private
223 223
  */
224
-JitsiTrack.prototype._maybeFireTrackAttached = function (container) {
224
+JitsiTrack.prototype._maybeFireTrackAttached = function(container) {
225 225
     if (this.conference && container) {
226 226
         this.conference._onTrackAttach(this, container);
227 227
     }
@@ -243,7 +243,7 @@ JitsiTrack.prototype._maybeFireTrackAttached = function (container) {
243 243
  * @returns potentially new instance of container if it was replaced by the
244 244
  *          library. That's the case when Temasys plugin is in use.
245 245
  */
246
-JitsiTrack.prototype.attach = function (container) {
246
+JitsiTrack.prototype.attach = function(container) {
247 247
     if(this.stream) {
248 248
         container = RTCUtils.attachMediaStream(container, this.stream);
249 249
     }
@@ -264,7 +264,7 @@ JitsiTrack.prototype.attach = function (container) {
264 264
  * can be a 'video', 'audio' or 'object' HTML element instance to which this
265 265
  * JitsiTrack is currently attached.
266 266
  */
267
-JitsiTrack.prototype.detach = function (container) {
267
+JitsiTrack.prototype.detach = function(container) {
268 268
     for (var cs = this.containers, i = cs.length - 1; i >= 0; --i) {
269 269
         var c = cs[i];
270 270
         if (!container) {
@@ -289,7 +289,7 @@ JitsiTrack.prototype.detach = function (container) {
289 289
  * @private
290 290
  */
291 291
 // eslint-disable-next-line no-unused-vars
292
-JitsiTrack.prototype._attachTTFMTracker = function (container) {
292
+JitsiTrack.prototype._attachTTFMTracker = function(container) {
293 293
 };
294 294
 
295 295
 /**
@@ -297,7 +297,7 @@ JitsiTrack.prototype._attachTTFMTracker = function (container) {
297 297
  *
298 298
  * @returns {Promise}
299 299
  */
300
-JitsiTrack.prototype.dispose = function () {
300
+JitsiTrack.prototype.dispose = function() {
301 301
     this.eventEmitter.removeAllListeners();
302 302
 
303 303
     this.disposed = true;
@@ -316,7 +316,7 @@ JitsiTrack.prototype.isScreenSharing = function() {
316 316
  * Returns id of the track.
317 317
  * @returns {string|null} id of the track or null if this is fake track.
318 318
  */
319
-JitsiTrack.prototype.getId = function () {
319
+JitsiTrack.prototype.getId = function() {
320 320
     if(this.stream) {
321 321
         return RTCUtils.getStreamID(this.stream);
322 322
     } else {
@@ -330,7 +330,7 @@ JitsiTrack.prototype.getId = function () {
330 330
  * will return that stream is active (in case of FF).
331 331
  * @returns {boolean} whether MediaStream is active.
332 332
  */
333
-JitsiTrack.prototype.isActive = function () {
333
+JitsiTrack.prototype.isActive = function() {
334 334
     if(typeof this.stream.active !== "undefined") {
335 335
         return this.stream.active;
336 336
     } else {
@@ -344,7 +344,7 @@ JitsiTrack.prototype.isActive = function () {
344 344
  * @param eventId the event ID.
345 345
  * @param handler handler for the event.
346 346
  */
347
-JitsiTrack.prototype.on = function (eventId, handler) {
347
+JitsiTrack.prototype.on = function(eventId, handler) {
348 348
     if(this.eventEmitter) {
349 349
         this.eventEmitter.on(eventId, handler);
350 350
     }
@@ -355,7 +355,7 @@ JitsiTrack.prototype.on = function (eventId, handler) {
355 355
  * @param eventId the event ID.
356 356
  * @param [handler] optional, the specific handler to unbind
357 357
  */
358
-JitsiTrack.prototype.off = function (eventId, handler) {
358
+JitsiTrack.prototype.off = function(eventId, handler) {
359 359
     if(this.eventEmitter) {
360 360
         this.eventEmitter.removeListener(eventId, handler);
361 361
     }
@@ -369,7 +369,7 @@ JitsiTrack.prototype.removeEventListener = JitsiTrack.prototype.off;
369 369
  * Sets the audio level for the stream
370 370
  * @param audioLevel the new audio level
371 371
  */
372
-JitsiTrack.prototype.setAudioLevel = function (audioLevel) {
372
+JitsiTrack.prototype.setAudioLevel = function(audioLevel) {
373 373
     if(this.audioLevel !== audioLevel) {
374 374
         this.eventEmitter.emit(JitsiTrackEvents.TRACK_AUDIO_LEVEL_CHANGED,
375 375
             audioLevel);
@@ -381,7 +381,7 @@ JitsiTrack.prototype.setAudioLevel = function (audioLevel) {
381 381
  * Returns the msid of the stream attached to the JitsiTrack object or null if
382 382
  * no stream is attached.
383 383
  */
384
-JitsiTrack.prototype.getMSID = function () {
384
+JitsiTrack.prototype.getMSID = function() {
385 385
     var streamId = this.getStreamId();
386 386
     var trackId = this.getTrackId();
387 387
     return streamId && trackId ? streamId + " " + trackId : null;
@@ -395,7 +395,7 @@ JitsiTrack.prototype.getMSID = function () {
395 395
  * @emits JitsiTrackEvents.TRACK_AUDIO_OUTPUT_CHANGED
396 396
  * @returns {Promise}
397 397
  */
398
-JitsiTrack.prototype.setAudioOutput = function (audioOutputDeviceId) {
398
+JitsiTrack.prototype.setAudioOutput = function(audioOutputDeviceId) {
399 399
     var self = this;
400 400
 
401 401
     if (!RTCUtils.isDeviceChangeAvailable('output')) {
@@ -411,7 +411,7 @@ JitsiTrack.prototype.setAudioOutput = function (audioOutputDeviceId) {
411 411
 
412 412
     return Promise.all(this.containers.map(function(element) {
413 413
         return element.setSinkId(audioOutputDeviceId)
414
-            .catch(function (error) {
414
+            .catch(function(error) {
415 415
                 logger.warn(
416 416
                     'Failed to change audio output device on element. Default' +
417 417
                     ' or previously set audio output device will be used.',
@@ -419,7 +419,7 @@ JitsiTrack.prototype.setAudioOutput = function (audioOutputDeviceId) {
419 419
                 throw error;
420 420
             });
421 421
     }))
422
-    .then(function () {
422
+    .then(function() {
423 423
         self.eventEmitter.emit(JitsiTrackEvents.TRACK_AUDIO_OUTPUT_CHANGED,
424 424
             audioOutputDeviceId);
425 425
     });

+ 50
- 50
modules/RTC/RTC.js Parādīt failu

@@ -91,9 +91,9 @@ export default class RTC extends Listenable {
91 91
      * @param {string} options.micDeviceId
92 92
      * @returns {*} Promise object that will receive the new JitsiTracks
93 93
      */
94
-    static obtainAudioAndVideoPermissions (options) {
94
+    static obtainAudioAndVideoPermissions(options) {
95 95
         return RTCUtils.obtainAudioAndVideoPermissions(options).then(
96
-            function (tracksInfo) {
96
+            function(tracksInfo) {
97 97
                 var tracks = createLocalTracks(tracksInfo, options);
98 98
                 return !tracks.some(track =>
99 99
                     !track._isReceivingData()) ? tracks
@@ -106,7 +106,7 @@ export default class RTC extends Listenable {
106 106
      * Initializes the data channels of this instance.
107 107
      * @param peerconnection the associated PeerConnection.
108 108
      */
109
-    initializeDataChannels (peerconnection) {
109
+    initializeDataChannels(peerconnection) {
110 110
         if(this.options.config.openSctp) {
111 111
             this.dataChannels = new DataChannels(peerconnection,
112 112
                 this.eventEmitter);
@@ -140,7 +140,7 @@ export default class RTC extends Listenable {
140 140
      * Should be called when current media session ends and after the
141 141
      * PeerConnection has been closed using PeerConnection.close() method.
142 142
      */
143
-    onCallEnded () {
143
+    onCallEnded() {
144 144
         if (this.dataChannels) {
145 145
             // DataChannels are not explicitly closed as the PeerConnection
146 146
             // is closed on call ended which triggers data channel onclose
@@ -161,7 +161,7 @@ export default class RTC extends Listenable {
161 161
      * @throws NetworkError or InvalidStateError or Error if the operation
162 162
      * fails.
163 163
      */
164
-    selectEndpoint (id) {
164
+    selectEndpoint(id) {
165 165
         // cache the value if channel is missing, till we open it
166 166
         this.selectedEndpoint = id;
167 167
         if(this.dataChannels && this.dataChannelsOpen) {
@@ -176,7 +176,7 @@ export default class RTC extends Listenable {
176 176
      * @param id {string} the user id
177 177
      * @throws NetworkError or InvalidStateError or Error if the operation fails.
178 178
      */
179
-    pinEndpoint (id) {
179
+    pinEndpoint(id) {
180 180
         if(this.dataChannels) {
181 181
             this.dataChannels.sendPinnedEndpointMessage(id);
182 182
         } else {
@@ -186,24 +186,24 @@ export default class RTC extends Listenable {
186 186
         }
187 187
     }
188 188
 
189
-    static addListener (eventType, listener) {
189
+    static addListener(eventType, listener) {
190 190
         RTCUtils.addListener(eventType, listener);
191 191
     }
192 192
 
193
-    static removeListener (eventType, listener) {
193
+    static removeListener(eventType, listener) {
194 194
         RTCUtils.removeListener(eventType, listener);
195 195
     }
196 196
 
197
-    static isRTCReady () {
197
+    static isRTCReady() {
198 198
         return RTCUtils.isRTCReady();
199 199
     }
200 200
 
201
-    static init (options = {}) {
201
+    static init(options = {}) {
202 202
         this.options = options;
203 203
         return RTCUtils.init(this.options);
204 204
     }
205 205
 
206
-    static getDeviceAvailability () {
206
+    static getDeviceAvailability() {
207 207
         return RTCUtils.getDeviceAvailability();
208 208
     }
209 209
 
@@ -222,7 +222,7 @@ export default class RTC extends Listenable {
222 222
      * preferred over other video codecs.
223 223
      * @return {TraceablePeerConnection}
224 224
      */
225
-    createPeerConnection (signaling, iceConfig, options) {
225
+    createPeerConnection(signaling, iceConfig, options) {
226 226
         const newConnection
227 227
             = new TraceablePeerConnection(
228 228
                 this,
@@ -241,7 +241,7 @@ export default class RTC extends Listenable {
241 241
      * successfully or <tt>false</tt> if there was no peer connection mapped in
242 242
      * this RTC instance.
243 243
      */
244
-    _removePeerConnection (traceablePeerConnection) {
244
+    _removePeerConnection(traceablePeerConnection) {
245 245
         const id = traceablePeerConnection.id;
246 246
         if (this.peerConnections.has(id)) {
247 247
             // NOTE Remote tracks are not removed here.
@@ -252,7 +252,7 @@ export default class RTC extends Listenable {
252 252
         }
253 253
     }
254 254
 
255
-    addLocalTrack (track) {
255
+    addLocalTrack(track) {
256 256
         if (!track) {
257 257
             throw new Error('track must not be null nor undefined');
258 258
         }
@@ -266,7 +266,7 @@ export default class RTC extends Listenable {
266 266
      * Get local video track.
267 267
      * @returns {JitsiLocalTrack|undefined}
268 268
      */
269
-    getLocalVideoTrack () {
269
+    getLocalVideoTrack() {
270 270
         const localVideo = this.getLocalTracks(MediaType.VIDEO);
271 271
         return localVideo.length ? localVideo[0] : undefined;
272 272
     }
@@ -275,7 +275,7 @@ export default class RTC extends Listenable {
275 275
      * Get local audio track.
276 276
      * @returns {JitsiLocalTrack|undefined}
277 277
      */
278
-    getLocalAudioTrack () {
278
+    getLocalAudioTrack() {
279 279
         const localAudio = this.getLocalTracks(MediaType.AUDIO);
280 280
         return localAudio.length ? localAudio[0] : undefined;
281 281
     }
@@ -286,7 +286,7 @@ export default class RTC extends Listenable {
286 286
      * @param {MediaType} [mediaType] optional media type filter
287 287
      * (audio or video).
288 288
      */
289
-    getLocalTracks (mediaType) {
289
+    getLocalTracks(mediaType) {
290 290
         let tracks = this.localTracks.slice();
291 291
         if (mediaType !== undefined) {
292 292
             tracks = tracks.filter(
@@ -301,7 +301,7 @@ export default class RTC extends Listenable {
301 301
      * by their media type if this argument is specified.
302 302
      * @return {Array<JitsiRemoteTrack>}
303 303
      */
304
-    getRemoteTracks (mediaType) {
304
+    getRemoteTracks(mediaType) {
305 305
         const remoteTracks = [];
306 306
         const remoteEndpoints = Object.keys(this.remoteTracks);
307 307
 
@@ -331,7 +331,7 @@ export default class RTC extends Listenable {
331 331
      * @param resource the resource part of the MUC JID
332 332
      * @returns {JitsiRemoteTrack|null}
333 333
      */
334
-    getRemoteTrackByType (type, resource) {
334
+    getRemoteTrackByType(type, resource) {
335 335
         if (this.remoteTracks[resource]) {
336 336
             return this.remoteTracks[resource][type];
337 337
         } else {
@@ -345,7 +345,7 @@ export default class RTC extends Listenable {
345 345
      * @param resource the resource part of the MUC JID
346 346
      * @returns {JitsiRemoteTrack|null}
347 347
      */
348
-    getRemoteAudioTrack (resource) {
348
+    getRemoteAudioTrack(resource) {
349 349
         return this.getRemoteTrackByType(MediaType.AUDIO, resource);
350 350
     }
351 351
 
@@ -355,7 +355,7 @@ export default class RTC extends Listenable {
355 355
      * @param resource the resource part of the MUC JID
356 356
      * @returns {JitsiRemoteTrack|null}
357 357
      */
358
-    getRemoteVideoTrack (resource) {
358
+    getRemoteVideoTrack(resource) {
359 359
         return this.getRemoteTrackByType(MediaType.VIDEO, resource);
360 360
     }
361 361
 
@@ -364,7 +364,7 @@ export default class RTC extends Listenable {
364 364
      * @param value the mute value
365 365
      * @returns {Promise}
366 366
      */
367
-    setAudioMute (value) {
367
+    setAudioMute(value) {
368 368
         const mutePromises = [];
369 369
         this.getLocalTracks(MediaType.AUDIO).forEach(function(audioTrack){
370 370
             // this is a Promise
@@ -374,7 +374,7 @@ export default class RTC extends Listenable {
374 374
         return Promise.all(mutePromises);
375 375
     }
376 376
 
377
-    removeLocalTrack (track) {
377
+    removeLocalTrack(track) {
378 378
         const pos = this.localTracks.indexOf(track);
379 379
         if (pos === -1) {
380 380
             return;
@@ -395,7 +395,7 @@ export default class RTC extends Listenable {
395 395
      * @param {string} ssrc
396 396
      * @param {boolean} muted
397 397
      */
398
-    _createRemoteTrack (ownerEndpointId,
398
+    _createRemoteTrack(ownerEndpointId,
399 399
                         stream, track, mediaType, videoType, ssrc, muted) {
400 400
         const remoteTrack
401 401
             = new JitsiRemoteTrack(
@@ -421,7 +421,7 @@ export default class RTC extends Listenable {
421 421
      * @param {string} owner - The resource part of the MUC JID.
422 422
      * @returns {JitsiRemoteTrack[]}
423 423
      */
424
-    removeRemoteTracks (owner) {
424
+    removeRemoteTracks(owner) {
425 425
         const removedTracks = [];
426 426
 
427 427
         if (this.remoteTracks[owner]) {
@@ -445,7 +445,7 @@ export default class RTC extends Listenable {
445 445
      * @return {JitsiRemoteTrack|undefined}
446 446
      * @private
447 447
      */
448
-    _getRemoteTrackById (streamId, trackId) {
448
+    _getRemoteTrackById(streamId, trackId) {
449 449
         let result = undefined;
450 450
 
451 451
         // .find will break the loop once the first match is found
@@ -480,7 +480,7 @@ export default class RTC extends Listenable {
480 480
      * <tt>undefined</tt> if no track matching given stream and track ids was
481 481
      * found.
482 482
      */
483
-    _removeRemoteTrack (streamId, trackId) {
483
+    _removeRemoteTrack(streamId, trackId) {
484 484
         const toBeRemoved = this._getRemoteTrackById(streamId, trackId);
485 485
 
486 486
         if (toBeRemoved) {
@@ -496,15 +496,15 @@ export default class RTC extends Listenable {
496 496
         return toBeRemoved;
497 497
     }
498 498
 
499
-    static getPCConstraints () {
499
+    static getPCConstraints() {
500 500
         return RTCUtils.pc_constraints;
501 501
     }
502 502
 
503
-    static attachMediaStream (elSelector, stream) {
503
+    static attachMediaStream(elSelector, stream) {
504 504
         return RTCUtils.attachMediaStream(elSelector, stream);
505 505
     }
506 506
 
507
-    static getStreamID (stream) {
507
+    static getStreamID(stream) {
508 508
         return RTCUtils.getStreamID(stream);
509 509
     }
510 510
 
@@ -512,7 +512,7 @@ export default class RTC extends Listenable {
512 512
      * Returns true if retrieving the the list of input devices is supported
513 513
      * and false if not.
514 514
      */
515
-    static isDeviceListAvailable () {
515
+    static isDeviceListAvailable() {
516 516
         return RTCUtils.isDeviceListAvailable();
517 517
     }
518 518
 
@@ -523,7 +523,7 @@ export default class RTC extends Listenable {
523 523
      *      undefined or 'input', 'output' - for audio output device change.
524 524
      * @returns {boolean} true if available, false otherwise.
525 525
      */
526
-    static isDeviceChangeAvailable (deviceType) {
526
+    static isDeviceChangeAvailable(deviceType) {
527 527
         return RTCUtils.isDeviceChangeAvailable(deviceType);
528 528
     }
529 529
 
@@ -532,7 +532,7 @@ export default class RTC extends Listenable {
532 532
      * device
533 533
      * @returns {string}
534 534
      */
535
-    static getAudioOutputDevice () {
535
+    static getAudioOutputDevice() {
536 536
         return RTCUtils.getAudioOutputDevice();
537 537
     }
538 538
 
@@ -541,7 +541,7 @@ export default class RTC extends Listenable {
541 541
      * empty array is returned/
542 542
      * @returns {Array} list of available media devices.
543 543
      */
544
-    static getCurrentlyAvailableMediaDevices () {
544
+    static getCurrentlyAvailableMediaDevices() {
545 545
         return RTCUtils.getCurrentlyAvailableMediaDevices();
546 546
     }
547 547
 
@@ -549,7 +549,7 @@ export default class RTC extends Listenable {
549 549
      * Returns event data for device to be reported to stats.
550 550
      * @returns {MediaDeviceInfo} device.
551 551
      */
552
-    static getEventDataForActiveDevice (device) {
552
+    static getEventDataForActiveDevice(device) {
553 553
         return RTCUtils.getEventDataForActiveDevice(device);
554 554
     }
555 555
 
@@ -560,7 +560,7 @@ export default class RTC extends Listenable {
560 560
      * @returns {Promise} - resolves when audio output is changed, is rejected
561 561
      *      otherwise
562 562
      */
563
-    static setAudioOutputDevice (deviceId) {
563
+    static setAudioOutputDevice(deviceId) {
564 564
         return RTCUtils.setAudioOutputDevice(deviceId);
565 565
     }
566 566
 
@@ -576,7 +576,7 @@ export default class RTC extends Listenable {
576 576
      * @param {MediaStream} stream the WebRTC MediaStream instance
577 577
      * @returns {boolean}
578 578
      */
579
-    static isUserStream (stream) {
579
+    static isUserStream(stream) {
580 580
         return RTC.isUserStreamById(RTCUtils.getStreamID(stream));
581 581
     }
582 582
 
@@ -592,7 +592,7 @@ export default class RTC extends Listenable {
592 592
      * @param {string} streamId the id of WebRTC MediaStream
593 593
      * @returns {boolean}
594 594
      */
595
-    static isUserStreamById (streamId) {
595
+    static isUserStreamById(streamId) {
596 596
         return streamId && streamId !== "mixedmslabel"
597 597
             && streamId !== "default";
598 598
     }
@@ -601,7 +601,7 @@ export default class RTC extends Listenable {
601 601
      * Allows to receive list of available cameras/microphones.
602 602
      * @param {function} callback would receive array of devices as an argument
603 603
      */
604
-    static enumerateDevices (callback) {
604
+    static enumerateDevices(callback) {
605 605
         RTCUtils.enumerateDevices(callback);
606 606
     }
607 607
 
@@ -610,7 +610,7 @@ export default class RTC extends Listenable {
610 610
      * One point to handle the differences in various implementations.
611 611
      * @param mediaStream MediaStream object to stop.
612 612
      */
613
-    static stopMediaStream (mediaStream) {
613
+    static stopMediaStream(mediaStream) {
614 614
         RTCUtils.stopMediaStream(mediaStream);
615 615
     }
616 616
 
@@ -625,16 +625,16 @@ export default class RTC extends Listenable {
625 625
     /**
626 626
      * Closes all currently opened data channels.
627 627
      */
628
-    closeAllDataChannels () {
628
+    closeAllDataChannels() {
629 629
         if(this.dataChannels) {
630 630
             this.dataChannels.closeAllChannels();
631 631
             this.dataChannelsOpen = false;
632 632
         }
633 633
     }
634 634
 
635
-    dispose () { }
635
+    dispose() { }
636 636
 
637
-    setAudioLevel (resource, audioLevel) {
637
+    setAudioLevel(resource, audioLevel) {
638 638
         if(!resource) {
639 639
             return;
640 640
         }
@@ -649,7 +649,7 @@ export default class RTC extends Listenable {
649 649
      * remoteTracks for the ssrc and returns the corresponding resource.
650 650
      * @param ssrc the ssrc to check.
651 651
      */
652
-    getResourceBySSRC (ssrc) {
652
+    getResourceBySSRC(ssrc) {
653 653
         if (this.getLocalTracks().find(
654 654
                 localTrack => localTrack.getSSRC() == ssrc)) {
655 655
             return this.conference.myUserId();
@@ -666,8 +666,8 @@ export default class RTC extends Listenable {
666 666
      * @return {JitsiRemoteTrack|undefined} return the first remote track that
667 667
      * matches given SSRC or <tt>undefined</tt> if no such track was found.
668 668
      */
669
-    getRemoteTrackBySSRC (ssrc) {
670
-        return this.getRemoteTracks().find(function (remoteTrack) {
669
+    getRemoteTrackBySSRC(ssrc) {
670
+        return this.getRemoteTracks().find(function(remoteTrack) {
671 671
             return ssrc == remoteTrack.getSSRC();
672 672
         });
673 673
     }
@@ -678,7 +678,7 @@ export default class RTC extends Listenable {
678 678
      * @param isMuted {boolean} the new mute state
679 679
      * @param from {string} user id
680 680
      */
681
-    handleRemoteTrackMute (type, isMuted, from) {
681
+    handleRemoteTrackMute(type, isMuted, from) {
682 682
         var track = this.getRemoteTrackByType(type, from);
683 683
         if (track) {
684 684
             track.setMute(isMuted);
@@ -690,7 +690,7 @@ export default class RTC extends Listenable {
690 690
      * @param value {string} the new video type
691 691
      * @param from {string} user id
692 692
      */
693
-    handleRemoteTrackVideoTypeChanged (value, from) {
693
+    handleRemoteTrackVideoTypeChanged(value, from) {
694 694
         var videoTrack = this.getRemoteVideoTrack(from);
695 695
         if (videoTrack) {
696 696
             videoTrack._setVideoType(value);
@@ -705,7 +705,7 @@ export default class RTC extends Listenable {
705 705
      * @throws NetworkError or InvalidStateError or Error if the operation
706 706
      * fails or there is no data channel created
707 707
      */
708
-    sendDataChannelMessage (to, payload) {
708
+    sendDataChannelMessage(to, payload) {
709 709
         if(this.dataChannels) {
710 710
             this.dataChannels.sendDataChannelMessage(to, payload);
711 711
         } else {
@@ -720,7 +720,7 @@ export default class RTC extends Listenable {
720 720
      * @param value {int} the new value for lastN.
721 721
      * @trows Error if there is no data channel created.
722 722
      */
723
-    setLastN (value) {
723
+    setLastN(value) {
724 724
         if (this.dataChannels) {
725 725
             this.dataChannels.sendSetLastNMessage(value);
726 726
         } else {

+ 4
- 4
modules/RTC/RTCUIHelper.js Parādīt failu

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

+ 58
- 58
modules/RTC/RTCUtils.js Parādīt failu

@@ -71,7 +71,7 @@ function initRawEnumerateDevicesWithCallback() {
71 71
         && navigator.mediaDevices.enumerateDevices
72 72
         ? function(callback) {
73 73
             navigator.mediaDevices.enumerateDevices().then(
74
-                callback, function () {
74
+                callback, function() {
75 75
                     callback([]);
76 76
                 });
77 77
         }
@@ -80,8 +80,8 @@ function initRawEnumerateDevicesWithCallback() {
80 80
         // when Temasys plugin is not installed yet, have to delay this call
81 81
         // until WebRTC is ready.
82 82
         : MediaStreamTrack && MediaStreamTrack.getSources
83
-        ? function (callback) {
84
-            MediaStreamTrack.getSources(function (sources) {
83
+        ? function(callback) {
84
+            MediaStreamTrack.getSources(function(sources) {
85 85
                 callback(sources.map(convertMediaStreamTrackSource));
86 86
             });
87 87
         }
@@ -359,7 +359,7 @@ function pollForAvailableMediaDevices() {
359 359
     // do not matter. This fixes situation when we have no devices initially,
360 360
     // and then plug in a new one.
361 361
     if (rawEnumerateDevicesWithCallback) {
362
-        rawEnumerateDevicesWithCallback(function (devices) {
362
+        rawEnumerateDevicesWithCallback(function(devices) {
363 363
             // We don't fire RTCEvents.DEVICE_LIST_CHANGED for the first time
364 364
             // we call enumerateDevices(). This is the initial step.
365 365
             if (typeof currentlyAvailableMediaDevices === 'undefined') {
@@ -383,18 +383,18 @@ function onMediaDevicesListChanged(devicesReceived) {
383 383
     currentlyAvailableMediaDevices = devicesReceived.slice(0);
384 384
     logger.info('list of media devices has changed:', currentlyAvailableMediaDevices);
385 385
 
386
-    var videoInputDevices = currentlyAvailableMediaDevices.filter(function (d) {
386
+    var videoInputDevices = currentlyAvailableMediaDevices.filter(function(d) {
387 387
             return d.kind === 'videoinput';
388 388
         }),
389
-        audioInputDevices = currentlyAvailableMediaDevices.filter(function (d) {
389
+        audioInputDevices = currentlyAvailableMediaDevices.filter(function(d) {
390 390
             return d.kind === 'audioinput';
391 391
         }),
392 392
         videoInputDevicesWithEmptyLabels = videoInputDevices.filter(
393
-            function (d) {
393
+            function(d) {
394 394
                 return d.label === '';
395 395
             }),
396 396
         audioInputDevicesWithEmptyLabels = audioInputDevices.filter(
397
-            function (d) {
397
+            function(d) {
398 398
                 return d.label === '';
399 399
             });
400 400
 
@@ -414,7 +414,7 @@ function onMediaDevicesListChanged(devicesReceived) {
414 414
 // In case of IE we continue from 'onReady' callback
415 415
 // passed to RTCUtils constructor. It will be invoked by Temasys plugin
416 416
 // once it is initialized.
417
-function onReady (options, GUM) {
417
+function onReady(options, GUM) {
418 418
     rtcReady = true;
419 419
     eventEmitter.emit(RTCEvents.RTC_READY, true);
420 420
     screenObtainer.init(options, GUM);
@@ -423,7 +423,7 @@ function onReady (options, GUM) {
423 423
     initRawEnumerateDevicesWithCallback();
424 424
 
425 425
     if (rtcUtils.isDeviceListAvailable() && rawEnumerateDevicesWithCallback) {
426
-        rawEnumerateDevicesWithCallback(function (devices) {
426
+        rawEnumerateDevicesWithCallback(function(devices) {
427 427
             currentlyAvailableMediaDevices = devices.splice(0);
428 428
 
429 429
             eventEmitter.emit(RTCEvents.DEVICE_LIST_AVAILABLE,
@@ -432,7 +432,7 @@ function onReady (options, GUM) {
432 432
             if (isDeviceChangeEventSupported) {
433 433
                 navigator.mediaDevices.addEventListener(
434 434
                     'devicechange',
435
-                    function () {
435
+                    function() {
436 436
                         rtcUtils.enumerateDevices(
437 437
                             onMediaDevicesListChanged);
438 438
                     });
@@ -465,17 +465,17 @@ var getUserMediaStatus = {
465 465
  * @returns {Function} wrapped function
466 466
  */
467 467
 function wrapGetUserMedia(getUserMedia) {
468
-    return function (constraints, successCallback, errorCallback) {
469
-        getUserMedia(constraints, function (stream) {
468
+    return function(constraints, successCallback, errorCallback) {
469
+        getUserMedia(constraints, function(stream) {
470 470
             maybeApply(successCallback, [stream]);
471 471
             if (!getUserMediaStatus.initialized) {
472 472
                 getUserMediaStatus.initialized = true;
473
-                getUserMediaStatus.callbacks.forEach(function (callback) {
473
+                getUserMediaStatus.callbacks.forEach(function(callback) {
474 474
                     callback();
475 475
                 });
476 476
                 getUserMediaStatus.callbacks.length = 0;
477 477
             }
478
-        }, function (error) {
478
+        }, function(error) {
479 479
             maybeApply(errorCallback, [error]);
480 480
         });
481 481
     };
@@ -500,10 +500,10 @@ function afterUserMediaInitialized(callback) {
500 500
  * @returns {Funtion} wrapped function
501 501
  */
502 502
 function wrapEnumerateDevices(enumerateDevices) {
503
-    return function (callback) {
503
+    return function(callback) {
504 504
         // enumerate devices only after initial getUserMedia
505
-        afterUserMediaInitialized(function () {
506
-            enumerateDevices().then(callback, function (err) {
505
+        afterUserMediaInitialized(function() {
506
+            enumerateDevices().then(callback, function(err) {
507 507
                 logger.error('cannot enumerate devices: ', err);
508 508
                 callback([]);
509 509
             });
@@ -516,8 +516,8 @@ function wrapEnumerateDevices(enumerateDevices) {
516 516
  * convert it to enumerateDevices format.
517 517
  * @param {Function} callback function to call when received devices list.
518 518
  */
519
-function enumerateDevicesThroughMediaStreamTrack (callback) {
520
-    MediaStreamTrack.getSources(function (sources) {
519
+function enumerateDevicesThroughMediaStreamTrack(callback) {
520
+    MediaStreamTrack.getSources(function(sources) {
521 521
         callback(sources.map(convertMediaStreamTrackSource));
522 522
     });
523 523
 }
@@ -551,12 +551,12 @@ function obtainDevices(options) {
551 551
     var device = options.devices.splice(0, 1);
552 552
     var devices = [];
553 553
     devices.push(device);
554
-    options.deviceGUM[device](function (stream) {
554
+    options.deviceGUM[device](function(stream) {
555 555
         options.streams = options.streams || {};
556 556
         options.streams[device] = stream;
557 557
         obtainDevices(options);
558 558
     },
559
-        function (error) {
559
+        function(error) {
560 560
             Object.keys(options.streams).forEach(function(device) {
561 561
                 rtcUtils.stopMediaStream(options.streams[device]);
562 562
             });
@@ -663,7 +663,7 @@ function wrapAttachMediaStream(origAttachMediaStream) {
663 663
                 // we skip setting audio output if there was no explicit change
664 664
                 && audioOutputChanged) {
665 665
             element.setSinkId(rtcUtils.getAudioOutputDevice())
666
-                .catch(function (ex) {
666
+                .catch(function(ex) {
667 667
                     var err = new JitsiTrackError(ex, null, ['audiooutput']);
668 668
 
669 669
                     GlobalOnErrorHandler.callUnhandledRejectionHandler(
@@ -761,7 +761,7 @@ class RTCUtils extends Listenable {
761 761
                     navigator.mediaDevices.enumerateDevices.bind(navigator.mediaDevices)
762 762
                 );
763 763
                 this.pc_constraints = {};
764
-                this.attachMediaStream = wrapAttachMediaStream(function (element, stream) {
764
+                this.attachMediaStream = wrapAttachMediaStream(function(element, stream) {
765 765
                     //  srcObject is being standardized and FF will eventually
766 766
                     //  support that unprefixed. FF also supports the
767 767
                     //  "element.src = URL.createObjectURL(...)" combo, but that
@@ -777,7 +777,7 @@ class RTCUtils extends Listenable {
777 777
                     }
778 778
                     return element;
779 779
                 });
780
-                this.getStreamID = function (stream) {
780
+                this.getStreamID = function(stream) {
781 781
                     var id = stream.id;
782 782
                     if (!id) {
783 783
                         var tracks = stream.getVideoTracks();
@@ -807,11 +807,11 @@ class RTCUtils extends Listenable {
807 807
                     this.getUserMedia = getUserMedia;
808 808
                     this.enumerateDevices = enumerateDevicesThroughMediaStreamTrack;
809 809
                 }
810
-                this.attachMediaStream = wrapAttachMediaStream(function (element, stream) {
810
+                this.attachMediaStream = wrapAttachMediaStream(function(element, stream) {
811 811
                     defaultSetVideoSrc(element, stream);
812 812
                     return element;
813 813
                 });
814
-                this.getStreamID = function (stream) {
814
+                this.getStreamID = function(stream) {
815 815
                     // A. MediaStreams from FF endpoints have the characters '{'
816 816
                     // and '}' that make jQuery choke.
817 817
                     // B. The react-native-webrtc implementation that we use on
@@ -843,12 +843,12 @@ class RTCUtils extends Listenable {
843 843
                 }
844 844
 
845 845
                 if (!webkitMediaStream.prototype.getVideoTracks) {
846
-                    webkitMediaStream.prototype.getVideoTracks = function () {
846
+                    webkitMediaStream.prototype.getVideoTracks = function() {
847 847
                         return this.videoTracks;
848 848
                     };
849 849
                 }
850 850
                 if (!webkitMediaStream.prototype.getAudioTracks) {
851
-                    webkitMediaStream.prototype.getAudioTracks = function () {
851
+                    webkitMediaStream.prototype.getAudioTracks = function() {
852 852
                         return this.audioTracks;
853 853
                     };
854 854
                 }
@@ -949,12 +949,12 @@ class RTCUtils extends Listenable {
949 949
 
950 950
         try {
951 951
             this.getUserMedia(constraints,
952
-                function (stream) {
952
+                function(stream) {
953 953
                     logger.log('onUserMediaSuccess');
954 954
                     setAvailableDevices(um, stream);
955 955
                     success_callback(stream);
956 956
                 },
957
-                function (error) {
957
+                function(error) {
958 958
                     setAvailableDevices(um, undefined);
959 959
                     logger.warn('Failed to get access to local media. Error ',
960 960
                         error, constraints);
@@ -985,13 +985,13 @@ class RTCUtils extends Listenable {
985 985
      * @param {string} options.micDeviceId
986 986
      * @returns {*} Promise object that will receive the new JitsiTracks
987 987
      */
988
-    obtainAudioAndVideoPermissions (options) {
988
+    obtainAudioAndVideoPermissions(options) {
989 989
         var self = this;
990 990
 
991 991
         options = options || {};
992 992
         var dsOptions = options.desktopSharingExtensionExternalInstallation;
993
-        return new Promise(function (resolve, reject) {
994
-            var successCallback = function (stream) {
993
+        return new Promise(function(resolve, reject) {
994
+            var successCallback = function(stream) {
995 995
                 resolve(handleLocalStream(stream, options.resolution));
996 996
             };
997 997
 
@@ -1009,7 +1009,7 @@ class RTCUtils extends Listenable {
1009 1009
                     // NSNumber as) a MediaStream ID.
1010 1010
                     || RTCBrowserType.isReactNative()
1011 1011
                     || RTCBrowserType.isTemasysPluginUsed()) {
1012
-                var GUM = function (device, s, e) {
1012
+                var GUM = function(device, s, e) {
1013 1013
                     this.getUserMediaWithConstraints(device, s, e, options);
1014 1014
                 };
1015 1015
 
@@ -1047,7 +1047,7 @@ class RTCUtils extends Listenable {
1047 1047
                 if(options.devices.length) {
1048 1048
                     this.getUserMediaWithConstraints(
1049 1049
                         options.devices,
1050
-                        function (stream) {
1050
+                        function(stream) {
1051 1051
                             var audioDeviceRequested = options.devices.indexOf("audio") !== -1;
1052 1052
                             var videoDeviceRequested = options.devices.indexOf("video") !== -1;
1053 1053
                             var audioTracksReceived = !!stream.getAudioTracks().length;
@@ -1082,7 +1082,7 @@ class RTCUtils extends Listenable {
1082 1082
                                 // set to not ask for permissions)
1083 1083
                                 self.getUserMediaWithConstraints(
1084 1084
                                     devices,
1085
-                                    function () {
1085
+                                    function() {
1086 1086
                                         // we already failed to obtain this
1087 1087
                                         // media, so we are not supposed in any
1088 1088
                                         // way to receive success for this call
@@ -1095,7 +1095,7 @@ class RTCUtils extends Listenable {
1095 1095
                                             devices)
1096 1096
                                         );
1097 1097
                                     },
1098
-                                    function (error) {
1098
+                                    function(error) {
1099 1099
                                         // rejects with real error for not
1100 1100
                                         // obtaining the media
1101 1101
                                         reject(error);
@@ -1106,10 +1106,10 @@ class RTCUtils extends Listenable {
1106 1106
                             if(hasDesktop) {
1107 1107
                                 screenObtainer.obtainStream(
1108 1108
                                     dsOptions,
1109
-                                    function (desktopStream) {
1109
+                                    function(desktopStream) {
1110 1110
                                         successCallback({audioVideo: stream,
1111 1111
                                             desktopStream});
1112
-                                    }, function (error) {
1112
+                                    }, function(error) {
1113 1113
                                         self.stopMediaStream(stream);
1114 1114
 
1115 1115
                                         reject(error);
@@ -1118,16 +1118,16 @@ class RTCUtils extends Listenable {
1118 1118
                                 successCallback({audioVideo: stream});
1119 1119
                             }
1120 1120
                         },
1121
-                        function (error) {
1121
+                        function(error) {
1122 1122
                             reject(error);
1123 1123
                         },
1124 1124
                         options);
1125 1125
                 } else if (hasDesktop) {
1126 1126
                     screenObtainer.obtainStream(
1127 1127
                         dsOptions,
1128
-                        function (stream) {
1128
+                        function(stream) {
1129 1129
                             successCallback({desktopStream: stream});
1130
-                        }, function (error) {
1130
+                        }, function(error) {
1131 1131
                             reject(error);
1132 1132
                         });
1133 1133
                 }
@@ -1135,15 +1135,15 @@ class RTCUtils extends Listenable {
1135 1135
         }.bind(this));
1136 1136
     }
1137 1137
 
1138
-    getDeviceAvailability () {
1138
+    getDeviceAvailability() {
1139 1139
         return devices;
1140 1140
     }
1141 1141
 
1142
-    isRTCReady () {
1142
+    isRTCReady() {
1143 1143
         return rtcReady;
1144 1144
     }
1145 1145
 
1146
-    _isDeviceListAvailable () {
1146
+    _isDeviceListAvailable() {
1147 1147
         if (!rtcReady) {
1148 1148
             throw new Error("WebRTC not ready yet");
1149 1149
         }
@@ -1164,12 +1164,12 @@ class RTCUtils extends Listenable {
1164 1164
      * Note that currently we do not detect stack initialization failure and
1165 1165
      * the promise is never rejected(unless unexpected error occurs).
1166 1166
      */
1167
-    onRTCReady () {
1167
+    onRTCReady() {
1168 1168
         if (rtcReady) {
1169 1169
             return Promise.resolve();
1170 1170
         } else {
1171
-            return new Promise(function (resolve) {
1172
-                var listener = function () {
1171
+            return new Promise(function(resolve) {
1172
+                var listener = function() {
1173 1173
                     eventEmitter.removeListener(RTCEvents.RTC_READY, listener);
1174 1174
                     resolve();
1175 1175
                 };
@@ -1187,7 +1187,7 @@ class RTCUtils extends Listenable {
1187 1187
      * the WebRTC stack is ready, either with true if the device listing is
1188 1188
      * available available or with false otherwise.
1189 1189
      */
1190
-    isDeviceListAvailable () {
1190
+    isDeviceListAvailable() {
1191 1191
         return this.onRTCReady().then(function() {
1192 1192
             return this._isDeviceListAvailable();
1193 1193
         }.bind(this));
@@ -1200,7 +1200,7 @@ class RTCUtils extends Listenable {
1200 1200
      *      undefined or 'input', 'output' - for audio output device change.
1201 1201
      * @returns {boolean} true if available, false otherwise.
1202 1202
      */
1203
-    isDeviceChangeAvailable (deviceType) {
1203
+    isDeviceChangeAvailable(deviceType) {
1204 1204
         return deviceType === 'output' || deviceType === 'audiooutput'
1205 1205
             ? isAudioOutputDeviceChangeAvailable
1206 1206
             : RTCBrowserType.isChrome() ||
@@ -1215,8 +1215,8 @@ class RTCUtils extends Listenable {
1215 1215
      * One point to handle the differences in various implementations.
1216 1216
      * @param mediaStream MediaStream object to stop.
1217 1217
      */
1218
-    stopMediaStream (mediaStream) {
1219
-        mediaStream.getTracks().forEach(function (track) {
1218
+    stopMediaStream(mediaStream) {
1219
+        mediaStream.getTracks().forEach(function(track) {
1220 1220
             // stop() not supported with IE
1221 1221
             if (!RTCBrowserType.isTemasysPluginUsed() && track.stop) {
1222 1222
                 track.stop();
@@ -1247,7 +1247,7 @@ class RTCUtils extends Listenable {
1247 1247
      * Returns whether the desktop sharing is enabled or not.
1248 1248
      * @returns {boolean}
1249 1249
      */
1250
-    isDesktopSharingEnabled () {
1250
+    isDesktopSharingEnabled() {
1251 1251
         return screenObtainer.isSupported();
1252 1252
     }
1253 1253
 
@@ -1259,7 +1259,7 @@ class RTCUtils extends Listenable {
1259 1259
      * @returns {Promise} - resolves when audio output is changed, is rejected
1260 1260
      *      otherwise
1261 1261
      */
1262
-    setAudioOutputDevice (deviceId) {
1262
+    setAudioOutputDevice(deviceId) {
1263 1263
         if (!this.isDeviceChangeAvailable('output')) {
1264 1264
             Promise.reject(
1265 1265
                 new Error('Audio output device change is not supported'));
@@ -1282,7 +1282,7 @@ class RTCUtils extends Listenable {
1282 1282
      * device
1283 1283
      * @returns {string}
1284 1284
      */
1285
-    getAudioOutputDevice () {
1285
+    getAudioOutputDevice() {
1286 1286
         return audioOutputDeviceId;
1287 1287
     }
1288 1288
 
@@ -1291,7 +1291,7 @@ class RTCUtils extends Listenable {
1291 1291
      * empty array is returned/
1292 1292
      * @returns {Array} list of available media devices.
1293 1293
      */
1294
-    getCurrentlyAvailableMediaDevices () {
1294
+    getCurrentlyAvailableMediaDevices() {
1295 1295
         return currentlyAvailableMediaDevices;
1296 1296
     }
1297 1297
 
@@ -1299,7 +1299,7 @@ class RTCUtils extends Listenable {
1299 1299
      * Returns event data for device to be reported to stats.
1300 1300
      * @returns {MediaDeviceInfo} device.
1301 1301
      */
1302
-    getEventDataForActiveDevice (device) {
1302
+    getEventDataForActiveDevice(device) {
1303 1303
         var devices = [];
1304 1304
         var deviceData = {
1305 1305
             "deviceId": device.deviceId,

+ 39
- 39
modules/RTC/TraceablePeerConnection.js Parādīt failu

@@ -88,7 +88,7 @@ function TraceablePeerConnection(rtc, id, signalingLayer, ice_config,
88 88
     this.rtxModifier = new RtxModifier();
89 89
 
90 90
     // override as desired
91
-    this.trace = function (what, info) {
91
+    this.trace = function(what, info) {
92 92
         /* logger.warn('WTRACE', what, info);
93 93
         if (info && RTCBrowserType.isIExplorer()) {
94 94
             if (info.length > 1024) {
@@ -105,7 +105,7 @@ function TraceablePeerConnection(rtc, id, signalingLayer, ice_config,
105 105
         });
106 106
     };
107 107
     this.onicecandidate = null;
108
-    this.peerconnection.onicecandidate = function (event) {
108
+    this.peerconnection.onicecandidate = function(event) {
109 109
         // FIXME: this causes stack overflow with Temasys Plugin
110 110
         if (!RTCBrowserType.isTemasysPluginUsed()) {
111 111
             self.trace(
@@ -118,48 +118,48 @@ function TraceablePeerConnection(rtc, id, signalingLayer, ice_config,
118 118
         }
119 119
     };
120 120
     this.onaddstream = null;
121
-    this.peerconnection.onaddstream = function (event) {
121
+    this.peerconnection.onaddstream = function(event) {
122 122
         self.trace('onaddstream', event.stream.id);
123 123
         if (self.onaddstream !== null) {
124 124
             self.onaddstream(event);
125 125
         }
126 126
     };
127 127
     this.onremovestream = null;
128
-    this.peerconnection.onremovestream = function (event) {
128
+    this.peerconnection.onremovestream = function(event) {
129 129
         self.trace('onremovestream', event.stream.id);
130 130
         if (self.onremovestream !== null) {
131 131
             self.onremovestream(event);
132 132
         }
133 133
     };
134
-    this.peerconnection.onaddstream = function (event) {
134
+    this.peerconnection.onaddstream = function(event) {
135 135
         self._remoteStreamAdded(event.stream);
136 136
     };
137
-    this.peerconnection.onremovestream = function (event) {
137
+    this.peerconnection.onremovestream = function(event) {
138 138
         self._remoteStreamRemoved(event.stream);
139 139
     };
140 140
     this.onsignalingstatechange = null;
141
-    this.peerconnection.onsignalingstatechange = function (event) {
141
+    this.peerconnection.onsignalingstatechange = function(event) {
142 142
         self.trace('onsignalingstatechange', self.signalingState);
143 143
         if (self.onsignalingstatechange !== null) {
144 144
             self.onsignalingstatechange(event);
145 145
         }
146 146
     };
147 147
     this.oniceconnectionstatechange = null;
148
-    this.peerconnection.oniceconnectionstatechange = function (event) {
148
+    this.peerconnection.oniceconnectionstatechange = function(event) {
149 149
         self.trace('oniceconnectionstatechange', self.iceConnectionState);
150 150
         if (self.oniceconnectionstatechange !== null) {
151 151
             self.oniceconnectionstatechange(event);
152 152
         }
153 153
     };
154 154
     this.onnegotiationneeded = null;
155
-    this.peerconnection.onnegotiationneeded = function (event) {
155
+    this.peerconnection.onnegotiationneeded = function(event) {
156 156
         self.trace('onnegotiationneeded');
157 157
         if (self.onnegotiationneeded !== null) {
158 158
             self.onnegotiationneeded(event);
159 159
         }
160 160
     };
161 161
     self.ondatachannel = null;
162
-    this.peerconnection.ondatachannel = function (event) {
162
+    this.peerconnection.ondatachannel = function(event) {
163 163
         self.trace('ondatachannel', event);
164 164
         if (self.ondatachannel !== null) {
165 165
             self.ondatachannel(event);
@@ -172,7 +172,7 @@ function TraceablePeerConnection(rtc, id, signalingLayer, ice_config,
172 172
                 var results = stats.result();
173 173
                 var now = new Date();
174 174
                 for (var i = 0; i < results.length; ++i) {
175
-                    results[i].names().forEach(function (name) {
175
+                    results[i].names().forEach(function(name) {
176 176
                         var id = results[i].id + '-' + name;
177 177
                         if (!self.stats[id]) {
178 178
                             self.stats[id] = {
@@ -212,7 +212,7 @@ var dumpSDP = function(description) {
212 212
  * Called when new remote MediaStream is added to the PeerConnection.
213 213
  * @param {MediaStream} stream the WebRTC MediaStream for remote participant
214 214
  */
215
-TraceablePeerConnection.prototype._remoteStreamAdded = function (stream) {
215
+TraceablePeerConnection.prototype._remoteStreamAdded = function(stream) {
216 216
     if (!RTC.isUserStream(stream)) {
217 217
         logger.info(
218 218
             "Ignored remote 'stream added' event for non-user stream", stream);
@@ -249,7 +249,7 @@ TraceablePeerConnection.prototype._remoteStreamAdded = function (stream) {
249 249
  * @param {MediaStreamTrack} track the WebRTC MediaStreamTrack added for remote
250 250
  * participant
251 251
  */
252
-TraceablePeerConnection.prototype._remoteTrackAdded = function (stream, track) {
252
+TraceablePeerConnection.prototype._remoteTrackAdded = function(stream, track) {
253 253
     const streamId = RTC.getStreamID(stream);
254 254
     const mediaType = track.kind;
255 255
 
@@ -267,7 +267,7 @@ TraceablePeerConnection.prototype._remoteTrackAdded = function (stream, track) {
267 267
 
268 268
     const remoteSDP = new SDP(this.remoteDescription.sdp);
269 269
     const mediaLines = remoteSDP.media.filter(
270
-        function (mediaLines){
270
+        function(mediaLines){
271 271
             return mediaLines.startsWith("m=" + mediaType);
272 272
         });
273 273
     if (!mediaLines.length) {
@@ -282,7 +282,7 @@ TraceablePeerConnection.prototype._remoteTrackAdded = function (stream, track) {
282 282
     let ssrcLines = SDPUtil.find_lines(mediaLines[0], 'a=ssrc:');
283 283
 
284 284
     ssrcLines = ssrcLines.filter(
285
-        function (line) {
285
+        function(line) {
286 286
             const msid
287 287
                 = RTCBrowserType.isTemasysPluginUsed() ? 'mslabel' : 'msid';
288 288
             return line.indexOf(msid + ':' + streamId) !== -1;
@@ -335,7 +335,7 @@ TraceablePeerConnection.prototype._remoteTrackAdded = function (stream, track) {
335 335
  * @param stream the WebRTC MediaStream object which is being removed from the
336 336
  * PeerConnection
337 337
  */
338
-TraceablePeerConnection.prototype._remoteStreamRemoved = function (stream) {
338
+TraceablePeerConnection.prototype._remoteStreamRemoved = function(stream) {
339 339
     if (!RTC.isUserStream(stream)) {
340 340
         const id = RTC.getStreamID(stream);
341 341
         logger.info(
@@ -361,7 +361,7 @@ TraceablePeerConnection.prototype._remoteStreamRemoved = function (stream) {
361 361
  * removed from the PeerConnection.
362 362
  */
363 363
 TraceablePeerConnection.prototype._remoteTrackRemoved
364
-= function (stream, track) {
364
+= function(stream, track) {
365 365
     const streamId = RTC.getStreamID(stream);
366 366
     const trackId = track && track.id;
367 367
 
@@ -509,7 +509,7 @@ var normalizePlanB = function(desc) {
509 509
 
510 510
     if (typeof session !== 'undefined' &&
511 511
         typeof session.media !== 'undefined' && Array.isArray(session.media)) {
512
-        session.media.forEach(function (mLine) {
512
+        session.media.forEach(function(mLine) {
513 513
 
514 514
             // Chrome appears to be picky about the order in which a=ssrc lines
515 515
             // are listed in an m-line when rtx is enabled (and thus there are
@@ -523,7 +523,7 @@ var normalizePlanB = function(desc) {
523 523
 
524 524
             if (typeof mLine.ssrcGroups !== 'undefined' &&
525 525
                 Array.isArray(mLine.ssrcGroups)) {
526
-                mLine.ssrcGroups.forEach(function (group) {
526
+                mLine.ssrcGroups.forEach(function(group) {
527 527
                     if (typeof group.semantics !== 'undefined' &&
528 528
                         group.semantics === 'FID') {
529 529
                         if (typeof group.ssrcs !== 'undefined') {
@@ -563,10 +563,10 @@ var normalizePlanB = function(desc) {
563 563
 };
564 564
 
565 565
 var getters = {
566
-    signalingState () {
566
+    signalingState() {
567 567
         return this.peerconnection.signalingState;
568 568
     },
569
-    iceConnectionState () {
569
+    iceConnectionState() {
570 570
         return this.peerconnection.iceConnectionState;
571 571
     },
572 572
     localDescription() {
@@ -595,7 +595,7 @@ var getters = {
595 595
         return desc;
596 596
     }
597 597
 };
598
-Object.keys(getters).forEach(function (prop) {
598
+Object.keys(getters).forEach(function(prop) {
599 599
     Object.defineProperty(
600 600
         TraceablePeerConnection.prototype,
601 601
         prop, {
@@ -604,7 +604,7 @@ Object.keys(getters).forEach(function (prop) {
604 604
     );
605 605
 });
606 606
 
607
-TraceablePeerConnection.prototype.addStream = function (stream, ssrcInfo) {
607
+TraceablePeerConnection.prototype.addStream = function(stream, ssrcInfo) {
608 608
     this.trace('addStream', stream ? stream.id : "null");
609 609
     if (stream) {
610 610
         this.peerconnection.addStream(stream);
@@ -631,7 +631,7 @@ TraceablePeerConnection.prototype.addStream = function (stream, ssrcInfo) {
631 631
     }
632 632
 };
633 633
 
634
-TraceablePeerConnection.prototype.removeStream = function (stream) {
634
+TraceablePeerConnection.prototype.removeStream = function(stream) {
635 635
     this.trace('removeStream', stream.id);
636 636
     // FF doesn't support this yet.
637 637
     if (this.peerconnection.removeStream) {
@@ -639,13 +639,13 @@ TraceablePeerConnection.prototype.removeStream = function (stream) {
639 639
     }
640 640
 };
641 641
 
642
-TraceablePeerConnection.prototype.createDataChannel = function (label, opts) {
642
+TraceablePeerConnection.prototype.createDataChannel = function(label, opts) {
643 643
     this.trace('createDataChannel', label, opts);
644 644
     return this.peerconnection.createDataChannel(label, opts);
645 645
 };
646 646
 
647 647
 TraceablePeerConnection.prototype.setLocalDescription
648
-        = function (description, successCallback, failureCallback) {
648
+        = function(description, successCallback, failureCallback) {
649 649
             this.trace('setLocalDescription::preTransform', dumpSDP(description));
650 650
     // if we're running on FF, transform to Plan A first.
651 651
             if (RTCBrowserType.usesUnifiedPlan()) {
@@ -656,11 +656,11 @@ TraceablePeerConnection.prototype.setLocalDescription
656 656
 
657 657
             var self = this;
658 658
             this.peerconnection.setLocalDescription(description,
659
-        function () {
659
+        function() {
660 660
             self.trace('setLocalDescriptionOnSuccess');
661 661
             successCallback();
662 662
         },
663
-        function (err) {
663
+        function(err) {
664 664
             self.trace('setLocalDescriptionOnFailure', err);
665 665
             self.eventEmitter.emit(
666 666
                 RTCEvents.SET_LOCAL_DESCRIPTION_FAILED,
@@ -671,7 +671,7 @@ TraceablePeerConnection.prototype.setLocalDescription
671 671
         };
672 672
 
673 673
 TraceablePeerConnection.prototype.setRemoteDescription
674
-        = function (description, successCallback, failureCallback) {
674
+        = function(description, successCallback, failureCallback) {
675 675
             this.trace('setRemoteDescription::preTransform', dumpSDP(description));
676 676
     // TODO the focus should squeze or explode the remote simulcast
677 677
             description = this.simulcast.mungeRemoteDescription(description);
@@ -702,11 +702,11 @@ TraceablePeerConnection.prototype.setRemoteDescription
702 702
 
703 703
             var self = this;
704 704
             this.peerconnection.setRemoteDescription(description,
705
-        function () {
705
+        function() {
706 706
             self.trace('setRemoteDescriptionOnSuccess');
707 707
             successCallback();
708 708
         },
709
-        function (err) {
709
+        function(err) {
710 710
             self.trace('setRemoteDescriptionOnFailure', err);
711 711
             self.eventEmitter.emit(RTCEvents.SET_REMOTE_DESCRIPTION_FAILED,
712 712
                 err, self.peerconnection);
@@ -737,12 +737,12 @@ TraceablePeerConnection.prototype.generateRecvonlySsrc = function() {
737 737
  * SSRC.
738 738
  * @deprecated
739 739
  */
740
-TraceablePeerConnection.prototype.clearRecvonlySsrc = function () {
740
+TraceablePeerConnection.prototype.clearRecvonlySsrc = function() {
741 741
     logger.info("Clearing primary video SSRC!");
742 742
     this.sdpConsistency.clearSsrcCache();
743 743
 };
744 744
 
745
-TraceablePeerConnection.prototype.close = function () {
745
+TraceablePeerConnection.prototype.close = function() {
746 746
     this.trace('stop');
747 747
     if (!this.rtc._removePeerConnection(this)) {
748 748
         logger.error("RTC._removePeerConnection returned false");
@@ -765,7 +765,7 @@ TraceablePeerConnection.prototype.close = function () {
765 765
  * @param {SDP} answer - the SDP to modify
766 766
  * @private
767 767
  */
768
-var _fixAnswerRFC4145Setup = function (offer, answer) {
768
+var _fixAnswerRFC4145Setup = function(offer, answer) {
769 769
     if (!RTCBrowserType.isChrome()) {
770 770
         // It looks like Firefox doesn't agree with the fix (at least in its
771 771
         // current implementation) because it effectively remains active even
@@ -800,7 +800,7 @@ var _fixAnswerRFC4145Setup = function (offer, answer) {
800 800
     if (offer && answer
801 801
             && offer.media && answer.media
802 802
             && offer.media.length == answer.media.length) {
803
-        answer.media.forEach(function (a, i) {
803
+        answer.media.forEach(function(a, i) {
804 804
             if (SDPUtil.find_line(
805 805
                     offer.media[i],
806 806
                     'a=setup:actpass',
@@ -814,7 +814,7 @@ var _fixAnswerRFC4145Setup = function (offer, answer) {
814 814
 };
815 815
 
816 816
 TraceablePeerConnection.prototype.createAnswer
817
-        = function (successCallback, failureCallback, constraints) {
817
+        = function(successCallback, failureCallback, constraints) {
818 818
             this.trace('createAnswer', JSON.stringify(constraints, null, ' '));
819 819
             this.peerconnection.createAnswer(
820 820
         answer => {
@@ -889,7 +889,7 @@ TraceablePeerConnection.prototype.createAnswer
889 889
 
890 890
 TraceablePeerConnection.prototype.addIceCandidate
891 891
         // eslint-disable-next-line no-unused-vars
892
-        = function (candidate, successCallback, failureCallback) {
892
+        = function(candidate, successCallback, failureCallback) {
893 893
     // var self = this;
894 894
             this.trace('addIceCandidate', JSON.stringify(candidate, null, ' '));
895 895
             this.peerconnection.addIceCandidate(candidate);
@@ -914,7 +914,7 @@ TraceablePeerConnection.prototype.getStats = function(callback, errback) {
914 914
             || RTCBrowserType.isReactNative()) {
915 915
         // ignore for now...
916 916
         if(!errback) {
917
-            errback = function () {};
917
+            errback = function() {};
918 918
         }
919 919
         this.peerconnection.getStats(null, callback, errback);
920 920
     } else {
@@ -927,7 +927,7 @@ TraceablePeerConnection.prototype.getStats = function(callback, errback) {
927 927
  * - ssrcs - Array of the ssrcs associated with the stream.
928 928
  * - groups - Array of the groups associated with the stream.
929 929
  */
930
-TraceablePeerConnection.prototype.generateNewStreamSSRCInfo = function () {
930
+TraceablePeerConnection.prototype.generateNewStreamSSRCInfo = function() {
931 931
     let ssrcInfo = {ssrcs: [], groups: []};
932 932
     if (!this.options.disableSimulcast
933 933
         && this.simulcast.isSupported()) {

+ 4
- 4
modules/connectivity/ParticipantConnectionStatus.js Parādīt failu

@@ -155,7 +155,7 @@ export default class ParticipantConnectionStatus {
155 155
                 this._onRemoteTrackRemoved);
156 156
         }
157 157
 
158
-        Object.keys(this.trackTimers).forEach(function (participantId) {
158
+        Object.keys(this.trackTimers).forEach(function(participantId) {
159 159
             this.clearTimeout(participantId);
160 160
             this.clearRtcMutedTimestamp(participantId);
161 161
         }.bind(this));
@@ -299,7 +299,7 @@ export default class ParticipantConnectionStatus {
299 299
      *       local and remote tracks.
300 300
      *
301 301
      */
302
-    isVideoTrackFrozen (participant) {
302
+    isVideoTrackFrozen(participant) {
303 303
         if (!RTCBrowserType.isVideoMuteOnConnInterruptedSupported()) {
304 304
             return false;
305 305
         }
@@ -376,7 +376,7 @@ export default class ParticipantConnectionStatus {
376 376
             // it some time, before the connection interrupted event is
377 377
             // triggered.
378 378
             this.clearTimeout(participantId);
379
-            this.trackTimers[participantId] = window.setTimeout(function () {
379
+            this.trackTimers[participantId] = window.setTimeout(function() {
380 380
                 logger.debug('RTC mute timeout for: ' + participantId);
381 381
                 this.clearTimeout(participantId);
382 382
                 this.figureOutConnectionStatus(participantId);
@@ -407,7 +407,7 @@ export default class ParticipantConnectionStatus {
407 407
      * @param {JitsiRemoteTrack} track the remote video track for which
408 408
      * the signalling mute/unmute event will be processed.
409 409
      */
410
-    onSignallingMuteChanged (track) {
410
+    onSignallingMuteChanged(track) {
411 411
         const participantId = track.getParticipantId();
412 412
 
413 413
         logger.debug(

+ 6
- 6
modules/settings/Settings.js Parādīt failu

@@ -68,7 +68,7 @@ class Settings {
68 68
     /**
69 69
      * Save settings to localStorage if browser supports that.
70 70
      */
71
-    save () {
71
+    save() {
72 72
         var localStorage = getLocalStorage();
73 73
         if (localStorage) {
74 74
             localStorage.setItem('jitsiMeetId', this.userId);
@@ -80,7 +80,7 @@ class Settings {
80 80
      * Returns current machine id.
81 81
      * @returns {string} machine id
82 82
      */
83
-    getMachineId () {
83
+    getMachineId() {
84 84
         return this.userId;
85 85
     }
86 86
 
@@ -88,7 +88,7 @@ class Settings {
88 88
      * Returns fake username for callstats
89 89
      * @returns {string} fake username for callstats
90 90
      */
91
-    getCallStatsUserName () {
91
+    getCallStatsUserName() {
92 92
         return this.callStatsUserName;
93 93
     }
94 94
 
@@ -96,7 +96,7 @@ class Settings {
96 96
      * Save current session id.
97 97
      * @param {string} sessionId session id
98 98
      */
99
-    setSessionId (sessionId) {
99
+    setSessionId(sessionId) {
100 100
         const localStorage = getLocalStorage();
101 101
         if (localStorage) {
102 102
             if (sessionId) {
@@ -110,7 +110,7 @@ class Settings {
110 110
     /**
111 111
      * Clear current session id.
112 112
      */
113
-    clearSessionId () {
113
+    clearSessionId() {
114 114
         this.setSessionId(undefined);
115 115
     }
116 116
 
@@ -118,7 +118,7 @@ class Settings {
118 118
      * Returns current session id.
119 119
      * @returns {string} current session id
120 120
      */
121
-    getSessionId () {
121
+    getSessionId() {
122 122
         // We may update sessionId in localStorage from another JitsiConference
123 123
         // instance and that's why we should always re-read it.
124 124
         const localStorage = getLocalStorage();

+ 2
- 2
modules/statistics/AnalyticsAdapter.js Parādīt failu

@@ -91,7 +91,7 @@ class AnalyticsAdapter {
91 91
      * the cached events.
92 92
      * @param {Array} handlers the handlers
93 93
      */
94
-    setAnalyticsHandlers (handlers) {
94
+    setAnalyticsHandlers(handlers) {
95 95
         this.analyticsHandlers = new Set(handlers);
96 96
         cacheAnalytics.drainCachedEvents().forEach(
97 97
             ev => this.sendEvent(ev.action, ev.data));
@@ -101,7 +101,7 @@ class AnalyticsAdapter {
101 101
      * Adds map of properties that will be added to every event.
102 102
      * @param {Object} properties the map of properties
103 103
      */
104
-    addPermanentProperties (properties) {
104
+    addPermanentProperties(properties) {
105 105
         this.permanentProperties
106 106
             = Object.assign(this.permanentProperties, properties);
107 107
     }

+ 23
- 23
modules/statistics/CallStats.js Parādīt failu

@@ -54,7 +54,7 @@ var callStats = null;
54 54
  */
55 55
 const DEFAULT_REMOTE_USER = "jitsi";
56 56
 
57
-function initCallback (err, msg) {
57
+function initCallback(err, msg) {
58 58
     logger.log("CallStats Status: err=" + err + " msg=" + msg);
59 59
 
60 60
     CallStats.initializeInProgress = false;
@@ -85,7 +85,7 @@ function initCallback (err, msg) {
85 85
 
86 86
     // notify callstats about failures if there were any
87 87
     if (CallStats.reportsQueue.length) {
88
-        CallStats.reportsQueue.forEach(function (report) {
88
+        CallStats.reportsQueue.forEach(function(report) {
89 89
             if (report.type === reportType.ERROR) {
90 90
                 var error = report.data;
91 91
                 CallStats._reportError.call(this, error.type, error.error,
@@ -124,8 +124,8 @@ function initCallback (err, msg) {
124 124
  * @return a function which invokes f in a try/catch block, logs any exception
125 125
  * to the console, and then swallows it
126 126
  */
127
-function _try_catch (f) {
128
-    return function () {
127
+function _try_catch(f) {
128
+    return function() {
129 129
         try {
130 130
             f.apply(this, arguments);
131 131
         } catch (e) {
@@ -209,7 +209,7 @@ CallStats.feedbackEnabled = false;
209 209
  * Checks whether we need to re-initialize callstats and starts the process.
210 210
  * @private
211 211
  */
212
-CallStats._checkInitialize = function () {
212
+CallStats._checkInitialize = function() {
213 213
     if (CallStats.initialized || !CallStats.initializeFailed
214 214
         || !callStats || CallStats.initializeInProgress) {
215 215
         return;
@@ -235,7 +235,7 @@ var reportType = {
235 235
     MST_WITH_USERID: "mstWithUserID"
236 236
 };
237 237
 
238
-CallStats.prototype.pcCallback = _try_catch(function (err, msg) {
238
+CallStats.prototype.pcCallback = _try_catch(function(err, msg) {
239 239
     if (callStats && err !== 'success') {
240 240
         logger.error("Monitoring status: " + err + " msg: " + msg);
241 241
     }
@@ -254,7 +254,7 @@ CallStats.prototype.pcCallback = _try_catch(function (err, msg) {
254 254
  *        renders the stream.
255 255
  */
256 256
 CallStats.prototype.associateStreamWithVideoTag =
257
-function (ssrc, isLocal, usageLabel, containerId) {
257
+function(ssrc, isLocal, usageLabel, containerId) {
258 258
     if(!callStats) {
259 259
         return;
260 260
     }
@@ -300,7 +300,7 @@ function (ssrc, isLocal, usageLabel, containerId) {
300 300
  * @param type {String} "audio"/"video"
301 301
  * @param {CallStats} cs callstats instance related to the event
302 302
  */
303
-CallStats.sendMuteEvent = _try_catch(function (mute, type, cs) {
303
+CallStats.sendMuteEvent = _try_catch(function(mute, type, cs) {
304 304
     let event;
305 305
 
306 306
     if (type === "video") {
@@ -318,7 +318,7 @@ CallStats.sendMuteEvent = _try_catch(function (mute, type, cs) {
318 318
  * false for not stopping
319 319
  * @param {CallStats} cs callstats instance related to the event
320 320
  */
321
-CallStats.sendScreenSharingEvent = _try_catch(function (start, cs) {
321
+CallStats.sendScreenSharingEvent = _try_catch(function(start, cs) {
322 322
     CallStats._reportEvent.call(
323 323
         cs,
324 324
         start ? fabricEvent.screenShareStart : fabricEvent.screenShareStop);
@@ -328,7 +328,7 @@ CallStats.sendScreenSharingEvent = _try_catch(function (start, cs) {
328 328
  * Notifies CallStats that we are the new dominant speaker in the conference.
329 329
  * @param {CallStats} cs callstats instance related to the event
330 330
  */
331
-CallStats.sendDominantSpeakerEvent = _try_catch(function (cs) {
331
+CallStats.sendDominantSpeakerEvent = _try_catch(function(cs) {
332 332
     CallStats._reportEvent.call(cs, fabricEvent.dominantSpeaker);
333 333
 });
334 334
 
@@ -337,7 +337,7 @@ CallStats.sendDominantSpeakerEvent = _try_catch(function (cs) {
337 337
  * @param {{deviceList: {String:String}}} list of devices with their data
338 338
  * @param {CallStats} cs callstats instance related to the event
339 339
  */
340
-CallStats.sendActiveDeviceListEvent = _try_catch(function (devicesData, cs) {
340
+CallStats.sendActiveDeviceListEvent = _try_catch(function(devicesData, cs) {
341 341
     CallStats._reportEvent.call(cs, fabricEvent.activeDeviceList, devicesData);
342 342
 });
343 343
 
@@ -350,7 +350,7 @@ CallStats.sendActiveDeviceListEvent = _try_catch(function (devicesData, cs) {
350 350
  * @param eventData additional data to pass to event
351 351
  * @private
352 352
  */
353
-CallStats._reportEvent = function (event, eventData) {
353
+CallStats._reportEvent = function(event, eventData) {
354 354
     if (CallStats.initialized) {
355 355
         callStats.sendFabricEvent(
356 356
             this.peerconnection, event, this.confID, eventData);
@@ -366,7 +366,7 @@ CallStats._reportEvent = function (event, eventData) {
366 366
 /**
367 367
  * Notifies CallStats for connection setup errors
368 368
  */
369
-CallStats.prototype.sendTerminateEvent = _try_catch(function () {
369
+CallStats.prototype.sendTerminateEvent = _try_catch(function() {
370 370
     if(!CallStats.initialized) {
371 371
         return;
372 372
     }
@@ -379,7 +379,7 @@ CallStats.prototype.sendTerminateEvent = _try_catch(function () {
379 379
  * @param {RTCPeerConnection} pc connection on which failure occured.
380 380
  * @param {CallStats} cs callstats instance related to the error (optional)
381 381
  */
382
-CallStats.prototype.sendIceConnectionFailedEvent = _try_catch(function (pc, cs){
382
+CallStats.prototype.sendIceConnectionFailedEvent = _try_catch(function(pc, cs){
383 383
     CallStats._reportError.call(
384 384
         cs, wrtcFuncNames.iceConnectionFailure, null, pc);
385 385
 });
@@ -412,7 +412,7 @@ function(overallFeedback, detailedFeedback) {
412 412
  * @param pc the peerconnection
413 413
  * @private
414 414
  */
415
-CallStats._reportError = function (type, e, pc) {
415
+CallStats._reportError = function(type, e, pc) {
416 416
     if(!e) {
417 417
         logger.warn("No error is passed!");
418 418
         e = new Error("Unknown error");
@@ -435,7 +435,7 @@ CallStats._reportError = function (type, e, pc) {
435 435
  * @param {Error} e error to send
436 436
  * @param {CallStats} cs callstats instance related to the error (optional)
437 437
  */
438
-CallStats.sendGetUserMediaFailed = _try_catch(function (e, cs) {
438
+CallStats.sendGetUserMediaFailed = _try_catch(function(e, cs) {
439 439
     CallStats._reportError.call(cs, wrtcFuncNames.getUserMedia, e, null);
440 440
 });
441 441
 
@@ -446,7 +446,7 @@ CallStats.sendGetUserMediaFailed = _try_catch(function (e, cs) {
446 446
  * @param {RTCPeerConnection} pc connection on which failure occured.
447 447
  * @param {CallStats} cs callstats instance related to the error (optional)
448 448
  */
449
-CallStats.sendCreateOfferFailed = _try_catch(function (e, pc, cs) {
449
+CallStats.sendCreateOfferFailed = _try_catch(function(e, pc, cs) {
450 450
     CallStats._reportError.call(cs, wrtcFuncNames.createOffer, e, pc);
451 451
 });
452 452
 
@@ -457,7 +457,7 @@ CallStats.sendCreateOfferFailed = _try_catch(function (e, pc, cs) {
457 457
  * @param {RTCPeerConnection} pc connection on which failure occured.
458 458
  * @param {CallStats} cs callstats instance related to the error (optional)
459 459
  */
460
-CallStats.sendCreateAnswerFailed = _try_catch(function (e, pc, cs) {
460
+CallStats.sendCreateAnswerFailed = _try_catch(function(e, pc, cs) {
461 461
     CallStats._reportError.call(cs, wrtcFuncNames.createAnswer, e, pc);
462 462
 });
463 463
 
@@ -468,7 +468,7 @@ CallStats.sendCreateAnswerFailed = _try_catch(function (e, pc, cs) {
468 468
  * @param {RTCPeerConnection} pc connection on which failure occured.
469 469
  * @param {CallStats} cs callstats instance related to the error (optional)
470 470
  */
471
-CallStats.sendSetLocalDescFailed = _try_catch(function (e, pc, cs) {
471
+CallStats.sendSetLocalDescFailed = _try_catch(function(e, pc, cs) {
472 472
     CallStats._reportError.call(cs, wrtcFuncNames.setLocalDescription, e, pc);
473 473
 });
474 474
 
@@ -479,7 +479,7 @@ CallStats.sendSetLocalDescFailed = _try_catch(function (e, pc, cs) {
479 479
  * @param {RTCPeerConnection} pc connection on which failure occured.
480 480
  * @param {CallStats} cs callstats instance related to the error (optional)
481 481
  */
482
-CallStats.sendSetRemoteDescFailed = _try_catch(function (e, pc, cs) {
482
+CallStats.sendSetRemoteDescFailed = _try_catch(function(e, pc, cs) {
483 483
     CallStats._reportError.call(cs, wrtcFuncNames.setRemoteDescription, e, pc);
484 484
 });
485 485
 
@@ -490,7 +490,7 @@ CallStats.sendSetRemoteDescFailed = _try_catch(function (e, pc, cs) {
490 490
  * @param {RTCPeerConnection} pc connection on which failure occured.
491 491
  * @param {CallStats} cs callstats instance related to the error (optional)
492 492
  */
493
-CallStats.sendAddIceCandidateFailed = _try_catch(function (e, pc, cs) {
493
+CallStats.sendAddIceCandidateFailed = _try_catch(function(e, pc, cs) {
494 494
     CallStats._reportError.call(cs, wrtcFuncNames.addIceCandidate, e, pc);
495 495
 });
496 496
 
@@ -500,14 +500,14 @@ CallStats.sendAddIceCandidateFailed = _try_catch(function (e, pc, cs) {
500 500
  * @param {Error} e error to send or {String} message
501 501
  * @param {CallStats} cs callstats instance related to the error (optional)
502 502
  */
503
-CallStats.sendApplicationLog = _try_catch(function (e, cs) {
503
+CallStats.sendApplicationLog = _try_catch(function(e, cs) {
504 504
     CallStats._reportError.call(cs, wrtcFuncNames.applicationLog, e, null);
505 505
 });
506 506
 
507 507
 /**
508 508
  * Clears allocated resources.
509 509
  */
510
-CallStats.dispose = function () {
510
+CallStats.dispose = function() {
511 511
     // The next line is commented because we need to be able to send feedback
512 512
     // even after the conference has been destroyed.
513 513
     // callStats = null;

+ 3
- 3
modules/statistics/LocalStatsCollector.js Parādīt failu

@@ -94,7 +94,7 @@ function LocalStatsCollector(stream, interval, callback) {
94 94
 /**
95 95
  * Starts the collecting the statistics.
96 96
  */
97
-LocalStatsCollector.prototype.start = function () {
97
+LocalStatsCollector.prototype.start = function() {
98 98
     if (!context ||
99 99
         RTCBrowserType.isTemasysPluginUsed()) {
100 100
         return;
@@ -111,7 +111,7 @@ LocalStatsCollector.prototype.start = function () {
111 111
     var self = this;
112 112
 
113 113
     this.intervalId = setInterval(
114
-        function () {
114
+        function() {
115 115
             var array = new Uint8Array(analyser.frequencyBinCount);
116 116
             analyser.getByteTimeDomainData(array);
117 117
             var audioLevel = timeDomainDataToAudioLevel(array);
@@ -127,7 +127,7 @@ LocalStatsCollector.prototype.start = function () {
127 127
 /**
128 128
  * Stops collecting the statistics.
129 129
  */
130
-LocalStatsCollector.prototype.stop = function () {
130
+LocalStatsCollector.prototype.stop = function() {
131 131
     if (this.intervalId) {
132 132
         clearInterval(this.intervalId);
133 133
         this.intervalId = null;

+ 22
- 22
modules/statistics/RTPStatsCollector.js Parādīt failu

@@ -87,7 +87,7 @@ function SsrcStats() {
87 87
  * Sets the "loss" object.
88 88
  * @param loss the value to set.
89 89
  */
90
-SsrcStats.prototype.setLoss = function (loss) {
90
+SsrcStats.prototype.setLoss = function(loss) {
91 91
     this.loss = loss || {};
92 92
 };
93 93
 
@@ -95,7 +95,7 @@ SsrcStats.prototype.setLoss = function (loss) {
95 95
  * Sets resolution that belong to the ssrc represented by this instance.
96 96
  * @param resolution new resolution value to be set.
97 97
  */
98
-SsrcStats.prototype.setResolution = function (resolution) {
98
+SsrcStats.prototype.setResolution = function(resolution) {
99 99
     this.resolution = resolution || {};
100 100
 };
101 101
 
@@ -104,7 +104,7 @@ SsrcStats.prototype.setResolution = function (resolution) {
104 104
  * the respective fields of the "bitrate" field of this object.
105 105
  * @param bitrate an object holding the values to add.
106 106
  */
107
-SsrcStats.prototype.addBitrate = function (bitrate) {
107
+SsrcStats.prototype.addBitrate = function(bitrate) {
108 108
     this.bitrate.download += bitrate.download;
109 109
     this.bitrate.upload += bitrate.upload;
110 110
 };
@@ -113,7 +113,7 @@ SsrcStats.prototype.addBitrate = function (bitrate) {
113 113
  * Resets the bit rate for given <tt>ssrc</tt> that belong to the peer
114 114
  * represented by this instance.
115 115
  */
116
-SsrcStats.prototype.resetBitrate = function () {
116
+SsrcStats.prototype.resetBitrate = function() {
117 117
     this.bitrate.download = 0;
118 118
     this.bitrate.upload = 0;
119 119
 };
@@ -215,7 +215,7 @@ module.exports = StatsCollector;
215 215
 /**
216 216
  * Stops stats updates.
217 217
  */
218
-StatsCollector.prototype.stop = function () {
218
+StatsCollector.prototype.stop = function() {
219 219
     if (this.audioLevelsIntervalId) {
220 220
         clearInterval(this.audioLevelsIntervalId);
221 221
         this.audioLevelsIntervalId = null;
@@ -231,7 +231,7 @@ StatsCollector.prototype.stop = function () {
231 231
  * Callback passed to <tt>getStats</tt> method.
232 232
  * @param error an error that occurred on <tt>getStats</tt> call.
233 233
  */
234
-StatsCollector.prototype.errorCallback = function (error) {
234
+StatsCollector.prototype.errorCallback = function(error) {
235 235
     GlobalOnErrorHandler.callErrorHandler(error);
236 236
     logger.error("Get stats error", error);
237 237
     this.stop();
@@ -240,14 +240,14 @@ StatsCollector.prototype.errorCallback = function (error) {
240 240
 /**
241 241
  * Starts stats updates.
242 242
  */
243
-StatsCollector.prototype.start = function (startAudioLevelStats) {
243
+StatsCollector.prototype.start = function(startAudioLevelStats) {
244 244
     var self = this;
245 245
     if(startAudioLevelStats) {
246 246
         this.audioLevelsIntervalId = setInterval(
247
-            function () {
247
+            function() {
248 248
                 // Interval updates
249 249
                 self.peerconnection.getStats(
250
-                    function (report) {
250
+                    function(report) {
251 251
                         var results = null;
252 252
                         if (!report || !report.result ||
253 253
                             typeof report.result != 'function') {
@@ -269,10 +269,10 @@ StatsCollector.prototype.start = function (startAudioLevelStats) {
269 269
 
270 270
     if (browserSupported) {
271 271
         this.statsIntervalId = setInterval(
272
-            function () {
272
+            function() {
273 273
                 // Interval updates
274 274
                 self.peerconnection.getStats(
275
-                    function (report) {
275
+                    function(report) {
276 276
                         var results = null;
277 277
                         if (!report || !report.result ||
278 278
                             typeof report.result != 'function') {
@@ -308,11 +308,11 @@ StatsCollector.prototype.start = function (startAudioLevelStats) {
308 308
  * @param {Object.<string,string>} keys the map of LibJitsi browser-agnostic
309 309
  * names to RTCPeerConnection#getStats browser-specific keys
310 310
  */
311
-StatsCollector.prototype._defineGetStatValueMethod = function (keys) {
311
+StatsCollector.prototype._defineGetStatValueMethod = function(keys) {
312 312
     // Define the function which converts a LibJitsiMeet browser-asnostic name
313 313
     // to a browser-specific key of a report returned by
314 314
     // RTCPeerConnection#getStats.
315
-    var keyFromName = function (name) {
315
+    var keyFromName = function(name) {
316 316
         var key = keys[name];
317 317
         if (key) {
318 318
             return key;
@@ -337,7 +337,7 @@ StatsCollector.prototype._defineGetStatValueMethod = function (keys) {
337 337
         // example, if item has a stat property of type function, then it's very
338 338
         // likely that whoever defined it wanted you to call it in order to
339 339
         // retrieve the value associated with a specific key.
340
-        itemStatByKey = function (item, key) {
340
+        itemStatByKey = function(item, key) {
341 341
             return item.stat(key); 
342 342
         };
343 343
         break;
@@ -345,9 +345,9 @@ StatsCollector.prototype._defineGetStatValueMethod = function (keys) {
345 345
         // The implementation provided by react-native-webrtc follows the
346 346
         // Objective-C WebRTC API: RTCStatsReport has a values property of type
347 347
         // Array in which each element is a key-value pair.
348
-        itemStatByKey = function (item, key) {
348
+        itemStatByKey = function(item, key) {
349 349
             var value;
350
-            item.values.some(function (pair) {
350
+            item.values.some(function(pair) {
351 351
                 if (pair.hasOwnProperty(key)) {
352 352
                     value = pair[key];
353 353
                     return true;
@@ -359,7 +359,7 @@ StatsCollector.prototype._defineGetStatValueMethod = function (keys) {
359 359
         };
360 360
         break;
361 361
     default:
362
-        itemStatByKey = function (item, key) {
362
+        itemStatByKey = function(item, key) {
363 363
             return item[key]; 
364 364
         };
365 365
     }
@@ -367,7 +367,7 @@ StatsCollector.prototype._defineGetStatValueMethod = function (keys) {
367 367
     // Compose the 2 functions defined above to get a function which retrieves
368 368
     // the value from a specific report returned by RTCPeerConnection#getStats
369 369
     // associated with a specific LibJitsiMeet browser-agnostic name.
370
-    return function (item, name) {
370
+    return function(item, name) {
371 371
         return itemStatByKey(item, keyFromName(name));
372 372
     };
373 373
 };
@@ -375,7 +375,7 @@ StatsCollector.prototype._defineGetStatValueMethod = function (keys) {
375 375
 /**
376 376
  * Stats processing logic.
377 377
  */
378
-StatsCollector.prototype.processStatsReport = function () {
378
+StatsCollector.prototype.processStatsReport = function() {
379 379
     if (!this.previousStatsReport) {
380 380
         return;
381 381
     }
@@ -421,7 +421,7 @@ StatsCollector.prototype.processStatsReport = function () {
421 421
             }
422 422
             // Save the address unless it has been saved already.
423 423
             var conferenceStatsTransport = this.conferenceStats.transport;
424
-            if(!conferenceStatsTransport.some(function (t) {
424
+            if(!conferenceStatsTransport.some(function(t) {
425 425
                 return (
426 426
                         t.ip == ip && t.type == type && t.localip == localip
427 427
                 );
@@ -558,7 +558,7 @@ StatsCollector.prototype.processStatsReport = function () {
558 558
     var bitrateUpload = 0;
559 559
     var resolutions = {};
560 560
     Object.keys(this.ssrc2stats).forEach(
561
-        function (ssrc) {
561
+        function(ssrc) {
562 562
             var ssrcStats = this.ssrc2stats[ssrc];
563 563
             // process packet loss stats
564 564
             var loss = ssrcStats.loss;
@@ -605,7 +605,7 @@ StatsCollector.prototype.processStatsReport = function () {
605 605
 /**
606 606
  * Stats processing logic.
607 607
  */
608
-StatsCollector.prototype.processAudioLevelReport = function () {
608
+StatsCollector.prototype.processAudioLevelReport = function() {
609 609
     if (!this.baselineAudioLevelsReport) {
610 610
         return;
611 611
     }

+ 33
- 33
modules/statistics/statistics.js Parādīt failu

@@ -67,7 +67,7 @@ function formatJitsiTrackErrorForCallStats(error) {
67 67
  * Init statistic options
68 68
  * @param options
69 69
  */
70
-Statistics.init = function (options) {
70
+Statistics.init = function(options) {
71 71
     Statistics.audioLevelsEnabled = !options.disableAudioLevels;
72 72
 
73 73
     if(typeof options.audioLevelsInterval === 'number') {
@@ -108,7 +108,7 @@ Statistics.analytics = analytics;
108 108
  */
109 109
 Statistics.callsStatsInstances = [];
110 110
 
111
-Statistics.prototype.startRemoteStats = function (peerconnection) {
111
+Statistics.prototype.startRemoteStats = function(peerconnection) {
112 112
     this.stopRemoteStats();
113 113
 
114 114
     try {
@@ -124,7 +124,7 @@ Statistics.prototype.startRemoteStats = function (peerconnection) {
124 124
 
125 125
 Statistics.localStats = [];
126 126
 
127
-Statistics.startLocalStats = function (stream, callback) {
127
+Statistics.startLocalStats = function(stream, callback) {
128 128
     if(!Statistics.audioLevelsEnabled) {
129 129
         return;
130 130
     }
@@ -148,33 +148,33 @@ Statistics.prototype.removeAudioLevelListener = function(listener) {
148 148
     this.eventEmitter.removeListener(StatisticsEvents.AUDIO_LEVEL, listener);
149 149
 };
150 150
 
151
-Statistics.prototype.addBeforeDisposedListener = function (listener) {
151
+Statistics.prototype.addBeforeDisposedListener = function(listener) {
152 152
     this.eventEmitter.on(StatisticsEvents.BEFORE_DISPOSED, listener);
153 153
 };
154 154
 
155
-Statistics.prototype.removeBeforeDisposedListener = function (listener) {
155
+Statistics.prototype.removeBeforeDisposedListener = function(listener) {
156 156
     this.eventEmitter.removeListener(
157 157
         StatisticsEvents.BEFORE_DISPOSED, listener);
158 158
 };
159 159
 
160
-Statistics.prototype.addConnectionStatsListener = function (listener) {
160
+Statistics.prototype.addConnectionStatsListener = function(listener) {
161 161
     this.eventEmitter.on(StatisticsEvents.CONNECTION_STATS, listener);
162 162
 };
163 163
 
164
-Statistics.prototype.removeConnectionStatsListener = function (listener) {
164
+Statistics.prototype.removeConnectionStatsListener = function(listener) {
165 165
     this.eventEmitter.removeListener(StatisticsEvents.CONNECTION_STATS, listener);
166 166
 };
167 167
 
168
-Statistics.prototype.addByteSentStatsListener = function (listener) {
168
+Statistics.prototype.addByteSentStatsListener = function(listener) {
169 169
     this.eventEmitter.on(StatisticsEvents.BYTE_SENT_STATS, listener);
170 170
 };
171 171
 
172
-Statistics.prototype.removeByteSentStatsListener = function (listener) {
172
+Statistics.prototype.removeByteSentStatsListener = function(listener) {
173 173
     this.eventEmitter.removeListener(StatisticsEvents.BYTE_SENT_STATS,
174 174
         listener);
175 175
 };
176 176
 
177
-Statistics.prototype.dispose = function () {
177
+Statistics.prototype.dispose = function() {
178 178
     if (this.eventEmitter) {
179 179
         this.eventEmitter.emit(StatisticsEvents.BEFORE_DISPOSED);
180 180
     }
@@ -185,7 +185,7 @@ Statistics.prototype.dispose = function () {
185 185
     }
186 186
 };
187 187
 
188
-Statistics.stopLocalStats = function (stream) {
188
+Statistics.stopLocalStats = function(stream) {
189 189
     if(!Statistics.audioLevelsEnabled) {
190 190
         return;
191 191
     }
@@ -199,7 +199,7 @@ Statistics.stopLocalStats = function (stream) {
199 199
     }
200 200
 };
201 201
 
202
-Statistics.prototype.stopRemoteStats = function () {
202
+Statistics.prototype.stopRemoteStats = function() {
203 203
     if (!this.rtpStats) {
204 204
         return;
205 205
     }
@@ -214,7 +214,7 @@ Statistics.prototype.stopRemoteStats = function () {
214 214
  * Initializes the callstats.io API.
215 215
  * @param peerConnection {JingleSessionPC} the session object
216 216
  */
217
-Statistics.prototype.startCallStats = function (session) {
217
+Statistics.prototype.startCallStats = function(session) {
218 218
     if(this.callStatsIntegrationEnabled && !this.callStatsStarted) {
219 219
         // Here we overwrite the previous instance, but it must be bound to
220 220
         // the new PeerConnection
@@ -227,7 +227,7 @@ Statistics.prototype.startCallStats = function (session) {
227 227
 /**
228 228
  * Removes the callstats.io instances.
229 229
  */
230
-Statistics.prototype.stopCallStats = function () {
230
+Statistics.prototype.stopCallStats = function() {
231 231
     if(this.callStatsStarted) {
232 232
         var index = Statistics.callsStatsInstances.indexOf(this.callstats);
233 233
         if(index > -1) {
@@ -248,7 +248,7 @@ Statistics.prototype.stopCallStats = function () {
248 248
  * @returns true if the callstats integration is enabled, otherwise returns
249 249
  * false.
250 250
  */
251
-Statistics.prototype.isCallstatsEnabled = function () {
251
+Statistics.prototype.isCallstatsEnabled = function() {
252 252
     return this.callStatsIntegrationEnabled;
253 253
 };
254 254
 
@@ -256,7 +256,7 @@ Statistics.prototype.isCallstatsEnabled = function () {
256 256
  * Notifies CallStats and analytics(if present) for ice connection failed
257 257
  * @param {RTCPeerConnection} pc connection on which failure occured.
258 258
  */
259
-Statistics.prototype.sendIceConnectionFailedEvent = function (pc) {
259
+Statistics.prototype.sendIceConnectionFailedEvent = function(pc) {
260 260
     if(this.callstats) {
261 261
         this.callstats.sendIceConnectionFailedEvent(pc, this.callstats);
262 262
     }
@@ -268,7 +268,7 @@ Statistics.prototype.sendIceConnectionFailedEvent = function (pc) {
268 268
  * @param mute {boolean} true for muted and false for not muted
269 269
  * @param type {String} "audio"/"video"
270 270
  */
271
-Statistics.prototype.sendMuteEvent = function (muted, type) {
271
+Statistics.prototype.sendMuteEvent = function(muted, type) {
272 272
     if(this.callstats) {
273 273
         CallStats.sendMuteEvent(muted, type, this.callstats);
274 274
     }
@@ -279,7 +279,7 @@ Statistics.prototype.sendMuteEvent = function (muted, type) {
279 279
  * @param start {boolean} true for starting screen sharing and
280 280
  * false for not stopping
281 281
  */
282
-Statistics.prototype.sendScreenSharingEvent = function (start) {
282
+Statistics.prototype.sendScreenSharingEvent = function(start) {
283 283
     if(this.callstats) {
284 284
         CallStats.sendScreenSharingEvent(start, this.callstats);
285 285
     }
@@ -289,7 +289,7 @@ Statistics.prototype.sendScreenSharingEvent = function (start) {
289 289
  * Notifies the statistics module that we are now the dominant speaker of the
290 290
  * conference.
291 291
  */
292
-Statistics.prototype.sendDominantSpeakerEvent = function () {
292
+Statistics.prototype.sendDominantSpeakerEvent = function() {
293 293
     if(this.callstats) {
294 294
         CallStats.sendDominantSpeakerEvent(this.callstats);
295 295
     }
@@ -300,9 +300,9 @@ Statistics.prototype.sendDominantSpeakerEvent = function () {
300 300
  * @param {{deviceList: {String:String}}} devicesData - list of devices with
301 301
  *      their data
302 302
  */
303
-Statistics.sendActiveDeviceListEvent = function (devicesData) {
303
+Statistics.sendActiveDeviceListEvent = function(devicesData) {
304 304
     if (Statistics.callsStatsInstances.length) {
305
-        Statistics.callsStatsInstances.forEach(function (cs) {
305
+        Statistics.callsStatsInstances.forEach(function(cs) {
306 306
             CallStats.sendActiveDeviceListEvent(devicesData, cs);
307 307
         });
308 308
     } else {
@@ -322,7 +322,7 @@ Statistics.sendActiveDeviceListEvent = function (devicesData) {
322 322
  *        renders the stream.
323 323
  */
324 324
 Statistics.prototype.associateStreamWithVideoTag =
325
-function (ssrc, isLocal, usageLabel, containerId) {
325
+function(ssrc, isLocal, usageLabel, containerId) {
326 326
     if(this.callstats) {
327 327
         this.callstats.associateStreamWithVideoTag(
328 328
             ssrc, isLocal, usageLabel, containerId);
@@ -334,10 +334,10 @@ function (ssrc, isLocal, usageLabel, containerId) {
334 334
  *
335 335
  * @param {Error} e error to send
336 336
  */
337
-Statistics.sendGetUserMediaFailed = function (e) {
337
+Statistics.sendGetUserMediaFailed = function(e) {
338 338
 
339 339
     if (Statistics.callsStatsInstances.length) {
340
-        Statistics.callsStatsInstances.forEach(function (cs) {
340
+        Statistics.callsStatsInstances.forEach(function(cs) {
341 341
             CallStats.sendGetUserMediaFailed(
342 342
                 e instanceof JitsiTrackError
343 343
                     ? formatJitsiTrackErrorForCallStats(e)
@@ -359,7 +359,7 @@ Statistics.sendGetUserMediaFailed = function (e) {
359 359
  * @param {Error} e error to send
360 360
  * @param {RTCPeerConnection} pc connection on which failure occured.
361 361
  */
362
-Statistics.prototype.sendCreateOfferFailed = function (e, pc) {
362
+Statistics.prototype.sendCreateOfferFailed = function(e, pc) {
363 363
     if(this.callstats) {
364 364
         CallStats.sendCreateOfferFailed(e, pc, this.callstats);
365 365
     }
@@ -371,7 +371,7 @@ Statistics.prototype.sendCreateOfferFailed = function (e, pc) {
371 371
  * @param {Error} e error to send
372 372
  * @param {RTCPeerConnection} pc connection on which failure occured.
373 373
  */
374
-Statistics.prototype.sendCreateAnswerFailed = function (e, pc) {
374
+Statistics.prototype.sendCreateAnswerFailed = function(e, pc) {
375 375
     if(this.callstats) {
376 376
         CallStats.sendCreateAnswerFailed(e, pc, this.callstats);
377 377
     }
@@ -383,7 +383,7 @@ Statistics.prototype.sendCreateAnswerFailed = function (e, pc) {
383 383
  * @param {Error} e error to send
384 384
  * @param {RTCPeerConnection} pc connection on which failure occured.
385 385
  */
386
-Statistics.prototype.sendSetLocalDescFailed = function (e, pc) {
386
+Statistics.prototype.sendSetLocalDescFailed = function(e, pc) {
387 387
     if(this.callstats) {
388 388
         CallStats.sendSetLocalDescFailed(e, pc, this.callstats);
389 389
     }
@@ -395,7 +395,7 @@ Statistics.prototype.sendSetLocalDescFailed = function (e, pc) {
395 395
  * @param {Error} e error to send
396 396
  * @param {RTCPeerConnection} pc connection on which failure occured.
397 397
  */
398
-Statistics.prototype.sendSetRemoteDescFailed = function (e, pc) {
398
+Statistics.prototype.sendSetRemoteDescFailed = function(e, pc) {
399 399
     if(this.callstats) {
400 400
         CallStats.sendSetRemoteDescFailed(e, pc, this.callstats);
401 401
     }
@@ -407,7 +407,7 @@ Statistics.prototype.sendSetRemoteDescFailed = function (e, pc) {
407 407
  * @param {Error} e error to send
408 408
  * @param {RTCPeerConnection} pc connection on which failure occured.
409 409
  */
410
-Statistics.prototype.sendAddIceCandidateFailed = function (e, pc) {
410
+Statistics.prototype.sendAddIceCandidateFailed = function(e, pc) {
411 411
     if(this.callstats) {
412 412
         CallStats.sendAddIceCandidateFailed(e, pc, this.callstats);
413 413
     }
@@ -418,9 +418,9 @@ Statistics.prototype.sendAddIceCandidateFailed = function (e, pc) {
418 418
  *
419 419
  * @param {String} a log message to send or an {Error} object to be reported
420 420
  */
421
-Statistics.sendLog = function (m) {
421
+Statistics.sendLog = function(m) {
422 422
     if (Statistics.callsStatsInstances.length) {
423
-        Statistics.callsStatsInstances.forEach(function (cs) {
423
+        Statistics.callsStatsInstances.forEach(function(cs) {
424 424
             CallStats.sendApplicationLog(m, cs);
425 425
         });
426 426
     } else {
@@ -449,7 +449,7 @@ Statistics.LOCAL_JID = require("../../service/statistics/constants").LOCAL_JID;
449 449
  *
450 450
  * @param {Error} error
451 451
  */
452
-Statistics.reportGlobalError = function (error) {
452
+Statistics.reportGlobalError = function(error) {
453 453
     if (error instanceof JitsiTrackError && error.gum) {
454 454
         Statistics.sendGetUserMediaFailed(error);
455 455
     } else {
@@ -462,7 +462,7 @@ Statistics.reportGlobalError = function (error) {
462 462
  * @param {string} eventName the event name.
463 463
  * @param {Object} data the data to be sent.
464 464
  */
465
-Statistics.sendEventToAll = function (eventName, data) {
465
+Statistics.sendEventToAll = function(eventName, data) {
466 466
     this.analytics.sendEvent(eventName, data);
467 467
     Statistics.sendLog(JSON.stringify({name: eventName, data}));
468 468
 };

+ 8
- 8
modules/transcription/audioRecorder.js Parādīt failu

@@ -75,7 +75,7 @@ function instantiateTrackRecorder(track) {
75 75
     // audio already has been recorder once
76 76
     trackRecorder.data = [];
77 77
     // function handling a dataEvent, e.g the stream gets new data
78
-    trackRecorder.recorder.ondataavailable = function (dataEvent) {
78
+    trackRecorder.recorder.ondataavailable = function(dataEvent) {
79 79
         if(dataEvent.data.size > 0) {
80 80
             trackRecorder.data.push(dataEvent.data);
81 81
         }
@@ -130,7 +130,7 @@ audioRecorder.determineCorrectFileType = determineCorrectFileType;
130 130
  *
131 131
  * @param track the track potentially holding an audio stream
132 132
  */
133
-audioRecorder.prototype.addTrack = function (track) {
133
+audioRecorder.prototype.addTrack = function(track) {
134 134
     if(track.isAudioTrack()) {
135 135
         // create the track recorder
136 136
         var trackRecorder = instantiateTrackRecorder(track);
@@ -203,7 +203,7 @@ audioRecorder.prototype.updateNames = function(){
203 203
 /**
204 204
  * Starts the audio recording of every local and remote track
205 205
  */
206
-audioRecorder.prototype.start = function () {
206
+audioRecorder.prototype.start = function() {
207 207
     if(this.isRecording) {
208 208
         throw new Error("audiorecorder is already recording");
209 209
     }
@@ -235,9 +235,9 @@ audioRecorder.prototype.stop = function() {
235 235
 /**
236 236
  * link hacking to download all recorded audio streams
237 237
  */
238
-audioRecorder.prototype.download = function () {
238
+audioRecorder.prototype.download = function() {
239 239
     var t = this;
240
-    this.recorders.forEach(function (trackRecorder) {
240
+    this.recorders.forEach(function(trackRecorder) {
241 241
         var blob = new Blob(trackRecorder.data, {type: t.fileType});
242 242
         var url = URL.createObjectURL(blob);
243 243
         var a = document.createElement('a');
@@ -255,7 +255,7 @@ audioRecorder.prototype.download = function () {
255 255
  * which include the name of the owner of the track and the starting time stamp
256 256
  * @returns {Array} an array of RecordingResult objects
257 257
  */
258
-audioRecorder.prototype.getRecordingResults = function () {
258
+audioRecorder.prototype.getRecordingResults = function() {
259 259
     if(this.isRecording) {
260 260
         throw new Error("cannot get blobs because the AudioRecorder is still" +
261 261
             "recording!");
@@ -265,7 +265,7 @@ audioRecorder.prototype.getRecordingResults = function () {
265 265
 
266 266
     var array = [];
267 267
     var t = this;
268
-    this.recorders.forEach(function (recorder) {
268
+    this.recorders.forEach(function(recorder) {
269 269
         array.push(
270 270
             new RecordingResult(
271 271
             new Blob(recorder.data, {type: t.fileType}),
@@ -280,7 +280,7 @@ audioRecorder.prototype.getRecordingResults = function () {
280 280
  * Gets the mime type of the recorder audio
281 281
  * @returns {String} the mime type of the recorder audio
282 282
  */
283
-audioRecorder.prototype.getFileType = function () {
283
+audioRecorder.prototype.getFileType = function() {
284 284
     return this.fileType;
285 285
 };
286 286
 

+ 1
- 1
modules/transcription/transcriber.js Parādīt failu

@@ -163,7 +163,7 @@ transcriber.prototype.merge = function() {
163 163
     hasPopulatedArrays(arrays);
164 164
 
165 165
     // populate all the potential Words for a first time
166
-    arrays.forEach(function (array){
166
+    arrays.forEach(function(array){
167 167
         pushWordToSortedArray(potentialWords, array);
168 168
     });
169 169
 

+ 3
- 3
modules/transcription/word.js Parādīt failu

@@ -4,7 +4,7 @@
4 4
  * @param begin the time the word was started being uttered
5 5
  * @param end the time the word stopped being uttered
6 6
  */
7
-var Word = function (word, begin, end) {
7
+var Word = function(word, begin, end) {
8 8
     this.word = word;
9 9
     this.begin = begin;
10 10
     this.end = end;
@@ -22,7 +22,7 @@ Word.prototype.getWord = function() {
22 22
  * Get the time the word started being uttered
23 23
  * @returns {*} the start time as an integer
24 24
  */
25
-Word.prototype.getBeginTime = function () {
25
+Word.prototype.getBeginTime = function() {
26 26
     return this.begin;
27 27
 };
28 28
 
@@ -30,7 +30,7 @@ Word.prototype.getBeginTime = function () {
30 30
  * Get the time the word stopped being uttered
31 31
  * @returns {*} the end time as an integer
32 32
  */
33
-Word.prototype.getEndTime = function () {
33
+Word.prototype.getEndTime = function() {
34 34
     return this.end;
35 35
 };
36 36
 

+ 1
- 1
modules/util/AuthUtil.js Parādīt failu

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

+ 2
- 2
modules/util/EventEmitterForwarder.js Parādīt failu

@@ -5,7 +5,7 @@
5 5
  * @param dest {object} instance of EventEmitter or another class that
6 6
  * implements emit method which will emit an event.
7 7
  */
8
-function EventEmitterForwarder (src, dest) {
8
+function EventEmitterForwarder(src, dest) {
9 9
     if (!src || !dest || typeof src.addListener !== "function" ||
10 10
         typeof dest.emit !== "function") {
11 11
         throw new Error("Invalid arguments passed to EventEmitterForwarder");
@@ -22,7 +22,7 @@ function EventEmitterForwarder (src, dest) {
22 22
  * @param arguments all other passed arguments are going to be fired with
23 23
  * dstEvent.
24 24
  */
25
-EventEmitterForwarder.prototype.forward = function () {
25
+EventEmitterForwarder.prototype.forward = function() {
26 26
     // This line is only for fixing jshint errors.
27 27
     var args = arguments;
28 28
     var srcEvent = args[0];

+ 5
- 5
modules/util/GlobalOnErrorHandler.js Parādīt failu

@@ -19,7 +19,7 @@ var oldOnErrorHandler = window.onerror;
19 19
  * all handlers that were previously added.
20 20
  */
21 21
 function JitsiGlobalErrorHandler(message, source, lineno, colno, error) {
22
-    handlers.forEach(function (handler) {
22
+    handlers.forEach(function(handler) {
23 23
         handler(message, source, lineno, colno, error);
24 24
     });
25 25
     if (oldOnErrorHandler) {
@@ -35,7 +35,7 @@ var oldOnUnhandledRejection = window.onunhandledrejection;
35 35
  * that were previously added. This handler handles rejected Promises.
36 36
  */
37 37
 function JitsiGlobalUnhandledRejection(event) {
38
-    handlers.forEach(function (handler) {
38
+    handlers.forEach(function(handler) {
39 39
         handler(null, null, null, null, event.reason);
40 40
     });
41 41
     if(oldOnUnhandledRejection) {
@@ -53,14 +53,14 @@ var GlobalOnErrorHandler = {
53 53
      * Adds new error handlers.
54 54
      * @param handler the new handler.
55 55
      */
56
-    addHandler (handler) {
56
+    addHandler(handler) {
57 57
         handlers.push(handler);
58 58
     },
59 59
     /**
60 60
      * Calls the global error handler if there is one.
61 61
      * @param error the error to pass to the error handler
62 62
      */
63
-    callErrorHandler (error) {
63
+    callErrorHandler(error) {
64 64
         var errHandler = window.onerror;
65 65
         if(!errHandler) {
66 66
             return;
@@ -71,7 +71,7 @@ var GlobalOnErrorHandler = {
71 71
      * Calls the global rejection handler if there is one.
72 72
      * @param error the error to pass to the rejection handler.
73 73
      */
74
-    callUnhandledRejectionHandler (error) {
74
+    callUnhandledRejectionHandler(error) {
75 75
         var errHandler = window.onunhandledrejection;
76 76
         if(!errHandler) {
77 77
             return;

+ 2
- 2
modules/util/Listenable.js Parādīt failu

@@ -23,7 +23,7 @@ export default class Listenable {
23 23
      * @param {String} eventName the name of the event
24 24
      * @param {Function} listener the listener.
25 25
      */
26
-    addListener (eventName, listener) {
26
+    addListener(eventName, listener) {
27 27
         this.eventEmitter.addListener(eventName, listener);
28 28
     }
29 29
 
@@ -33,7 +33,7 @@ export default class Listenable {
33 33
      * listener
34 34
      * @param {Function} listener the listener.
35 35
      */
36
-    removeListener (eventName, listener) {
36
+    removeListener(eventName, listener) {
37 37
         this.eventEmitter.removeListener(eventName, listener);
38 38
     }
39 39
 }

+ 1
- 1
modules/util/RandomUtil.js Parādīt failu

@@ -59,7 +59,7 @@ var RandomUtil = {
59 59
      * Returns a random string of hex digits with length 'len'.
60 60
      * @param len the length.
61 61
      */
62
-    randomHexString (len) {
62
+    randomHexString(len) {
63 63
         var ret = '';
64 64
         while (len--) {
65 65
             ret += this.randomHexDigit();

+ 1
- 1
modules/util/ScriptUtil.js Parādīt failu

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

+ 1
- 1
modules/util/UsernameGenerator.js Parādīt failu

@@ -429,7 +429,7 @@ var names = [
429 429
  * Generate random username.
430 430
  * @returns {string} random username
431 431
  */
432
-function generateUsername () {
432
+function generateUsername() {
433 433
     var name = RandomUtil.randomElement(names);
434 434
     var suffix = RandomUtil.randomAlphanumStr(3);
435 435
 

+ 58
- 58
modules/xmpp/ChatRoom.js Parādīt failu

@@ -10,9 +10,9 @@ import XMPPEvents from "../../service/xmpp/XMPPEvents";
10 10
 const logger = getLogger(__filename);
11 11
 
12 12
 var parser = {
13
-    packet2JSON (packet, nodes) {
13
+    packet2JSON(packet, nodes) {
14 14
         var self = this;
15
-        $(packet).children().each(function () {
15
+        $(packet).children().each(function() {
16 16
             var tagName = $(this).prop("tagName");
17 17
             const node = {
18 18
                 tagName
@@ -30,7 +30,7 @@ var parser = {
30 30
             self.packet2JSON($(this), node.children);
31 31
         });
32 32
     },
33
-    json2packet (nodes, packet) {
33
+    json2packet(nodes, packet) {
34 34
         for(let i = 0; i < nodes.length; i++) {
35 35
             const node = nodes[i];
36 36
             if(!node || node === null){
@@ -94,7 +94,7 @@ export default class ChatRoom extends Listenable {
94 94
         this.locked = false;
95 95
     }
96 96
 
97
-    initPresenceMap () {
97
+    initPresenceMap() {
98 98
         this.presMap['to'] = this.myroomjid;
99 99
         this.presMap['xns'] = 'http://jabber.org/protocol/muc';
100 100
         this.presMap["nodes"] = [];
@@ -108,7 +108,7 @@ export default class ChatRoom extends Listenable {
108 108
         this.addVideoInfoToPresence(false);
109 109
     }
110 110
 
111
-    updateDeviceAvailability (devices) {
111
+    updateDeviceAvailability(devices) {
112 112
         this.presMap["nodes"].push({
113 113
             "tagName": "devices",
114 114
             "children": [
@@ -124,15 +124,15 @@ export default class ChatRoom extends Listenable {
124 124
         });
125 125
     }
126 126
 
127
-    join (password) {
127
+    join(password) {
128 128
         this.password = password;
129 129
         var self = this;
130
-        this.moderator.allocateConferenceFocus(function () {
130
+        this.moderator.allocateConferenceFocus(function() {
131 131
             self.sendPresence(true);
132 132
         });
133 133
     }
134 134
 
135
-    sendPresence (fromJoin) {
135
+    sendPresence(fromJoin) {
136 136
         var to = this.presMap['to'];
137 137
         if (!to || (!this.joined && !fromJoin)) {
138 138
             // Too early to send presence - not initialized
@@ -170,7 +170,7 @@ export default class ChatRoom extends Listenable {
170 170
      * Sends the presence unavailable, signaling the server
171 171
      * we want to leave the room.
172 172
      */
173
-    doLeave () {
173
+    doLeave() {
174 174
         logger.log("do leave", this.myroomjid);
175 175
         var pres = $pres({to: this.myroomjid, type: 'unavailable' });
176 176
         this.presMap.length = 0;
@@ -191,27 +191,27 @@ export default class ChatRoom extends Listenable {
191 191
         this.connection.flush();
192 192
     }
193 193
 
194
-    discoRoomInfo () {
194
+    discoRoomInfo() {
195 195
       // https://xmpp.org/extensions/xep-0045.html#disco-roominfo
196 196
 
197 197
         var getInfo = $iq({type: 'get', to: this.roomjid})
198 198
         .c('query', {xmlns: Strophe.NS.DISCO_INFO});
199 199
 
200
-        this.connection.sendIQ(getInfo, function (result) {
200
+        this.connection.sendIQ(getInfo, function(result) {
201 201
             var locked = $(result).find('>query>feature[var="muc_passwordprotected"]')
202 202
             .length === 1;
203 203
             if (locked != this.locked) {
204 204
                 this.eventEmitter.emit(XMPPEvents.MUC_LOCK_CHANGED, locked);
205 205
                 this.locked = locked;
206 206
             }
207
-        }.bind(this), function (error) {
207
+        }.bind(this), function(error) {
208 208
             GlobalOnErrorHandler.callErrorHandler(error);
209 209
             logger.error("Error getting room info: ", error);
210 210
         }.bind(this));
211 211
     }
212 212
 
213 213
 
214
-    createNonAnonymousRoom () {
214
+    createNonAnonymousRoom() {
215 215
         // http://xmpp.org/extensions/xep-0045.html#createroom-reserved
216 216
 
217 217
         var getForm = $iq({type: 'get', to: this.roomjid})
@@ -220,7 +220,7 @@ export default class ChatRoom extends Listenable {
220 220
 
221 221
         var self = this;
222 222
 
223
-        this.connection.sendIQ(getForm, function (form) {
223
+        this.connection.sendIQ(getForm, function(form) {
224 224
 
225 225
             if (!$(form).find(
226 226
                     '>query>x[xmlns="jabber:x:data"]' +
@@ -245,13 +245,13 @@ export default class ChatRoom extends Listenable {
245 245
 
246 246
             self.connection.sendIQ(formSubmit);
247 247
 
248
-        }, function (error) {
248
+        }, function(error) {
249 249
             GlobalOnErrorHandler.callErrorHandler(error);
250 250
             logger.error("Error getting room configuration form: ", error);
251 251
         });
252 252
     }
253 253
 
254
-    onPresence (pres) {
254
+    onPresence(pres) {
255 255
         var from = pres.getAttribute('from');
256 256
         // Parse roles.
257 257
         var member = {};
@@ -407,7 +407,7 @@ export default class ChatRoom extends Listenable {
407 407
      * @param from jid of the focus
408 408
      * @param mucJid the jid of the focus in the muc
409 409
      */
410
-    _initFocus (from, mucJid) {
410
+    _initFocus(from, mucJid) {
411 411
         this.focusMucJid = from;
412 412
         if(!this.recording) {
413 413
             this.recording = new Recorder(this.options.recordingType,
@@ -424,11 +424,11 @@ export default class ChatRoom extends Listenable {
424 424
      * Sets the special listener to be used for "command"s whose name starts with
425 425
      * "jitsi_participant_".
426 426
      */
427
-    setParticipantPropertyListener (listener) {
427
+    setParticipantPropertyListener(listener) {
428 428
         this.participantPropertyListener = listener;
429 429
     }
430 430
 
431
-    processNode (node, from) {
431
+    processNode(node, from) {
432 432
         // make sure we catch all errors coming from any handler
433 433
         // otherwise we can remove the presence handler from strophe
434 434
         try {
@@ -446,7 +446,7 @@ export default class ChatRoom extends Listenable {
446 446
         }
447 447
     }
448 448
 
449
-    sendMessage (body, nickname) {
449
+    sendMessage(body, nickname) {
450 450
         var msg = $msg({to: this.roomjid, type: 'groupchat'});
451 451
         msg.c('body', body).up();
452 452
         if (nickname) {
@@ -456,7 +456,7 @@ export default class ChatRoom extends Listenable {
456 456
         this.eventEmitter.emit(XMPPEvents.SENDING_CHAT_MESSAGE, body);
457 457
     }
458 458
 
459
-    setSubject (subject) {
459
+    setSubject(subject) {
460 460
         var msg = $msg({to: this.roomjid, type: 'groupchat'});
461 461
         msg.c('subject', subject);
462 462
         this.connection.send(msg);
@@ -468,7 +468,7 @@ export default class ChatRoom extends Listenable {
468 468
      * @param skipEvents optional params to skip any events, including check
469 469
      * whether this is the focus that left
470 470
      */
471
-    onParticipantLeft (jid, skipEvents) {
471
+    onParticipantLeft(jid, skipEvents) {
472 472
 
473 473
         delete this.lastPresences[jid];
474 474
 
@@ -481,7 +481,7 @@ export default class ChatRoom extends Listenable {
481 481
         this.moderator.onMucMemberLeft(jid);
482 482
     }
483 483
 
484
-    onPresenceUnavailable (pres, from) {
484
+    onPresenceUnavailable(pres, from) {
485 485
         // room destroyed ?
486 486
         if ($(pres).find('>x[xmlns="http://jabber.org/protocol/muc#user"]' +
487 487
             '>destroy').length) {
@@ -535,7 +535,7 @@ export default class ChatRoom extends Listenable {
535 535
         }
536 536
     }
537 537
 
538
-    onMessage (msg, from) {
538
+    onMessage(msg, from) {
539 539
         var nick =
540 540
             $(msg).find('>nick[xmlns="http://jabber.org/protocol/nick"]')
541 541
                 .text() ||
@@ -583,7 +583,7 @@ export default class ChatRoom extends Listenable {
583 583
         }
584 584
     }
585 585
 
586
-    onPresenceError (pres, from) {
586
+    onPresenceError(pres, from) {
587 587
         if ($(pres).find('>error[type="auth"]>not-authorized[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length) {
588 588
             logger.log('on password required', from);
589 589
             this.eventEmitter.emit(XMPPEvents.PASSWORD_REQUIRED);
@@ -611,7 +611,7 @@ export default class ChatRoom extends Listenable {
611 611
         }
612 612
     }
613 613
 
614
-    kick (jid) {
614
+    kick(jid) {
615 615
         var kickIQ = $iq({to: this.roomjid, type: 'set'})
616 616
             .c('query', {xmlns: 'http://jabber.org/protocol/muc#admin'})
617 617
             .c('item', {nick: Strophe.getResourceFromJid(jid), role: 'none'})
@@ -619,19 +619,19 @@ export default class ChatRoom extends Listenable {
619 619
 
620 620
         this.connection.sendIQ(
621 621
             kickIQ,
622
-            function (result) {
622
+            function(result) {
623 623
                 logger.log('Kick participant with jid: ', jid, result);
624 624
             },
625
-            function (error) {
625
+            function(error) {
626 626
                 logger.log('Kick participant error: ', error);
627 627
             });
628 628
     }
629 629
 
630
-    lockRoom (key, onSuccess, onError, onNotSupported) {
630
+    lockRoom(key, onSuccess, onError, onNotSupported) {
631 631
         // http://xmpp.org/extensions/xep-0045.html#roomconfig
632 632
         var ob = this;
633 633
         this.connection.sendIQ($iq({to: this.roomjid, type: 'get'}).c('query', {xmlns: 'http://jabber.org/protocol/muc#owner'}),
634
-            function (res) {
634
+            function(res) {
635 635
                 if ($(res).find('>query>x[xmlns="jabber:x:data"]>field[var="muc#roomconfig_roomsecret"]').length) {
636 636
                     var formsubmit = $iq({to: ob.roomjid, type: 'set'}).c('query', {xmlns: 'http://jabber.org/protocol/muc#owner'});
637 637
                     formsubmit.c('x', {xmlns: 'jabber:x:data', type: 'submit'});
@@ -649,24 +649,24 @@ export default class ChatRoom extends Listenable {
649 649
             }, onError);
650 650
     }
651 651
 
652
-    addToPresence (key, values) {
652
+    addToPresence(key, values) {
653 653
         values.tagName = key;
654 654
         this.removeFromPresence(key);
655 655
         this.presMap.nodes.push(values);
656 656
     }
657 657
 
658
-    removeFromPresence (key) {
658
+    removeFromPresence(key) {
659 659
         var nodes = this.presMap.nodes.filter(function(node) {
660 660
             return key !== node.tagName;
661 661
         });
662 662
         this.presMap.nodes = nodes;
663 663
     }
664 664
 
665
-    addPresenceListener (name, handler) {
665
+    addPresenceListener(name, handler) {
666 666
         this.presHandlers[name] = handler;
667 667
     }
668 668
 
669
-    removePresenceListener (name) {
669
+    removePresenceListener(name) {
670 670
         delete this.presHandlers[name];
671 671
     }
672 672
 
@@ -678,7 +678,7 @@ export default class ChatRoom extends Listenable {
678 678
      * <tt>false</tt> if is not. When given <tt>mucJid</tt> does not exist in
679 679
      * the MUC then <tt>null</tt> is returned.
680 680
      */
681
-    isFocus (mucJid) {
681
+    isFocus(mucJid) {
682 682
         var member = this.members[mucJid];
683 683
         if (member) {
684 684
             return member.isFocus;
@@ -687,29 +687,29 @@ export default class ChatRoom extends Listenable {
687 687
         }
688 688
     }
689 689
 
690
-    isModerator () {
690
+    isModerator() {
691 691
         return this.role === 'moderator';
692 692
     }
693 693
 
694
-    getMemberRole (peerJid) {
694
+    getMemberRole(peerJid) {
695 695
         if (this.members[peerJid]) {
696 696
             return this.members[peerJid].role;
697 697
         }
698 698
         return null;
699 699
     }
700 700
 
701
-    setVideoMute (mute, callback) {
701
+    setVideoMute(mute, callback) {
702 702
         this.sendVideoInfoPresence(mute);
703 703
         if(callback) {
704 704
             callback(mute);
705 705
         }
706 706
     }
707 707
 
708
-    setAudioMute (mute, callback) {
708
+    setAudioMute(mute, callback) {
709 709
         return this.sendAudioInfoPresence(mute, callback);
710 710
     }
711 711
 
712
-    addAudioInfoToPresence (mute) {
712
+    addAudioInfoToPresence(mute) {
713 713
         this.removeFromPresence("audiomuted");
714 714
         this.addToPresence("audiomuted",
715 715
             {attributes:
@@ -717,7 +717,7 @@ export default class ChatRoom extends Listenable {
717 717
                 value: mute.toString()});
718 718
     }
719 719
 
720
-    sendAudioInfoPresence (mute, callback) {
720
+    sendAudioInfoPresence(mute, callback) {
721 721
         this.addAudioInfoToPresence(mute);
722 722
         if(this.connection) {
723 723
             this.sendPresence();
@@ -727,7 +727,7 @@ export default class ChatRoom extends Listenable {
727 727
         }
728 728
     }
729 729
 
730
-    addVideoInfoToPresence (mute) {
730
+    addVideoInfoToPresence(mute) {
731 731
         this.removeFromPresence("videomuted");
732 732
         this.addToPresence("videomuted",
733 733
             {attributes:
@@ -735,7 +735,7 @@ export default class ChatRoom extends Listenable {
735 735
                 value: mute.toString()});
736 736
     }
737 737
 
738
-    sendVideoInfoPresence (mute) {
738
+    sendVideoInfoPresence(mute) {
739 739
         this.addVideoInfoToPresence(mute);
740 740
         if(!this.connection) {
741 741
             return;
@@ -754,7 +754,7 @@ export default class ChatRoom extends Listenable {
754 754
      * info or <tt>null</tt> either if there is no presence available or if
755 755
      * the media type given is invalid.
756 756
      */
757
-    getMediaPresenceInfo (endpointId, mediaType) {
757
+    getMediaPresenceInfo(endpointId, mediaType) {
758 758
         // Will figure out current muted status by looking up owner's presence
759 759
         const pres = this.lastPresences[this.roomjid + "/" + endpointId];
760 760
         if (!pres) {
@@ -789,7 +789,7 @@ export default class ChatRoom extends Listenable {
789 789
     /**
790 790
      * Returns true if the recording is supproted and false if not.
791 791
      */
792
-    isRecordingSupported () {
792
+    isRecordingSupported() {
793 793
         if(this.recording) {
794 794
             return this.recording.isSupported();
795 795
         }
@@ -800,14 +800,14 @@ export default class ChatRoom extends Listenable {
800 800
      * Returns null if the recording is not supported, "on" if the recording started
801 801
      * and "off" if the recording is not started.
802 802
      */
803
-    getRecordingState () {
803
+    getRecordingState() {
804 804
         return this.recording ? this.recording.getState() : undefined;
805 805
     }
806 806
 
807 807
     /**
808 808
      * Returns the url of the recorded video.
809 809
      */
810
-    getRecordingURL () {
810
+    getRecordingURL() {
811 811
         return this.recording ? this.recording.getURL() : null;
812 812
     }
813 813
 
@@ -816,7 +816,7 @@ export default class ChatRoom extends Listenable {
816 816
      * @param token token for authentication
817 817
      * @param statusChangeHandler {function} receives the new status as argument.
818 818
      */
819
-    toggleRecording (options, statusChangeHandler) {
819
+    toggleRecording(options, statusChangeHandler) {
820 820
         if(this.recording) {
821 821
             return this.recording.toggleRecording(options, statusChangeHandler);
822 822
         }
@@ -828,7 +828,7 @@ export default class ChatRoom extends Listenable {
828 828
     /**
829 829
      * Returns true if the SIP calls are supported and false otherwise
830 830
      */
831
-    isSIPCallingSupported () {
831
+    isSIPCallingSupported() {
832 832
         if(this.moderator) {
833 833
             return this.moderator.isSipGatewayEnabled();
834 834
         }
@@ -839,7 +839,7 @@ export default class ChatRoom extends Listenable {
839 839
      * Dials a number.
840 840
      * @param number the number
841 841
      */
842
-    dial (number) {
842
+    dial(number) {
843 843
         return this.connection.rayo.dial(number, "fromnumber",
844 844
             Strophe.getNodeFromJid(this.myroomjid), this.password,
845 845
             this.focusMucJid);
@@ -848,21 +848,21 @@ export default class ChatRoom extends Listenable {
848 848
     /**
849 849
      * Hangup an existing call
850 850
      */
851
-    hangup () {
851
+    hangup() {
852 852
         return this.connection.rayo.hangup();
853 853
     }
854 854
 
855 855
     /**
856 856
      * Returns the phone number for joining the conference.
857 857
      */
858
-    getPhoneNumber () {
858
+    getPhoneNumber() {
859 859
         return this.phoneNumber;
860 860
     }
861 861
 
862 862
     /**
863 863
      * Returns the pin for joining the conference with phone.
864 864
      */
865
-    getPhonePin () {
865
+    getPhonePin() {
866 866
         return this.phonePin;
867 867
     }
868 868
 
@@ -871,7 +871,7 @@ export default class ChatRoom extends Listenable {
871 871
      * @param jid of the participant
872 872
      * @param mute
873 873
      */
874
-    muteParticipant (jid, mute) {
874
+    muteParticipant(jid, mute) {
875 875
         logger.info("set mute", mute);
876 876
         var iqToFocus = $iq(
877 877
             {to: this.focusMucJid, type: 'set'})
@@ -884,15 +884,15 @@ export default class ChatRoom extends Listenable {
884 884
 
885 885
         this.connection.sendIQ(
886 886
             iqToFocus,
887
-            function (result) {
887
+            function(result) {
888 888
                 logger.log('set mute', result);
889 889
             },
890
-            function (error) {
890
+            function(error) {
891 891
                 logger.log('set mute error', error);
892 892
             });
893 893
     }
894 894
 
895
-    onMute (iq) {
895
+    onMute(iq) {
896 896
         var from = iq.getAttribute('from');
897 897
         if (from !== this.focusMucJid) {
898 898
             logger.warn("Ignored mute from non focus peer");
@@ -912,7 +912,7 @@ export default class ChatRoom extends Listenable {
912 912
      * than 5s after sending presence unavailable. Otherwise the promise is
913 913
      * rejected.
914 914
      */
915
-    leave () {
915
+    leave() {
916 916
         return new Promise((resolve, reject) => {
917 917
             const timeout = setTimeout(() => onMucLeft(true), 5000);
918 918
             const eventEmitter = this.eventEmitter;

+ 1
- 1
modules/xmpp/ConnectionPlugin.js Parādīt failu

@@ -14,7 +14,7 @@ function getConnectionPluginDefinition(base = class{}) {
14 14
             super(...args);
15 15
             this.connection = null;
16 16
         }
17
-        init (connection) {
17
+        init(connection) {
18 18
             this.connection = connection;
19 19
         }
20 20
     };

+ 26
- 26
modules/xmpp/JingleSessionPC.js Parādīt failu

@@ -264,7 +264,7 @@ export default class JingleSessionPC extends JingleSession {
264 264
 
265 265
         const localSDP = new SDP(this.peerconnection.localDescription.sdp);
266 266
         for (let mid = 0; mid < localSDP.media.length; mid++) {
267
-            const cands = candidates.filter(function (el) {
267
+            const cands = candidates.filter(function(el) {
268 268
                 return el.sdpMLineIndex == mid;
269 269
             });
270 270
             const mline
@@ -312,7 +312,7 @@ export default class JingleSessionPC extends JingleSession {
312 312
         // a lot later. See webrtc issue #2340
313 313
         // logger.log('was this the last candidate', this.lasticecandidate);
314 314
         this.connection.sendIQ(
315
-            cand, null, this.newJingleErrorHandler(cand, function (error) {
315
+            cand, null, this.newJingleErrorHandler(cand, function(error) {
316 316
                 GlobalOnErrorHandler.callErrorHandler(
317 317
                     new Error("Jingle error: " + JSON.stringify(error)));
318 318
             }), IQ_TIMEOUT);
@@ -639,14 +639,14 @@ export default class JingleSessionPC extends JingleSession {
639 639
      */
640 640
     _parseSsrcInfoFromSourceAdd(sourceAddElem, currentRemoteSdp) {
641 641
         const addSsrcInfo = [];
642
-        $(sourceAddElem).each(function (idx, content) {
642
+        $(sourceAddElem).each(function(idx, content) {
643 643
             const name = $(content).attr('name');
644 644
             let lines = '';
645 645
             $(content)
646 646
                 .find('ssrc-group[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]')
647 647
                 .each(function() {
648 648
                     const semantics = this.getAttribute('semantics');
649
-                    const ssrcs = $(this).find('>source').map(function () {
649
+                    const ssrcs = $(this).find('>source').map(function() {
650 650
                         return this.getAttribute('ssrc');
651 651
                     }).get();
652 652
 
@@ -659,14 +659,14 @@ export default class JingleSessionPC extends JingleSession {
659 659
             const tmp
660 660
                 = $(content).find(
661 661
                     'source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]');
662
-            tmp.each(function () {
662
+            tmp.each(function() {
663 663
                 const ssrc = $(this).attr('ssrc');
664 664
                 if (currentRemoteSdp.containsSSRC(ssrc)) {
665 665
                     logger.warn(
666 666
                         "Source-add request for existing SSRC: " + ssrc);
667 667
                     return;
668 668
                 }
669
-                $(this).find('>parameter').each(function () {
669
+                $(this).find('>parameter').each(function() {
670 670
                     lines += 'a=ssrc:' + ssrc + ' ' + $(this).attr('name');
671 671
                     if ($(this).attr('value') && $(this).attr('value').length) {
672 672
                         lines += ':' + $(this).attr('value');
@@ -1014,14 +1014,14 @@ export default class JingleSessionPC extends JingleSession {
1014 1014
      */
1015 1015
     _parseSsrcInfoFromSourceRemove(sourceRemoveElem, currentRemoteSdp) {
1016 1016
         const removeSsrcInfo = [];
1017
-        $(sourceRemoveElem).each(function (idx, content) {
1017
+        $(sourceRemoveElem).each(function(idx, content) {
1018 1018
             const name = $(content).attr('name');
1019 1019
             let lines = '';
1020 1020
             $(content)
1021 1021
                 .find('ssrc-group[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]')
1022 1022
                 .each(function() {
1023 1023
                     const semantics = this.getAttribute('semantics');
1024
-                    const ssrcs = $(this).find('>source').map(function () {
1024
+                    const ssrcs = $(this).find('>source').map(function() {
1025 1025
                         return this.getAttribute('ssrc');
1026 1026
                     }).get();
1027 1027
 
@@ -1035,7 +1035,7 @@ export default class JingleSessionPC extends JingleSession {
1035 1035
             const tmp
1036 1036
                 = $(content).find(
1037 1037
                     'source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]');
1038
-            tmp.each(function () {
1038
+            tmp.each(function() {
1039 1039
                 const ssrc = $(this).attr('ssrc');
1040 1040
                 ssrcs.push(ssrc);
1041 1041
             });
@@ -1159,7 +1159,7 @@ export default class JingleSessionPC extends JingleSession {
1159 1159
         }
1160 1160
 
1161 1161
         // Find the right sender (for audio or video)
1162
-        this.peerconnection.peerconnection.getSenders().some(function (s) {
1162
+        this.peerconnection.peerconnection.getSenders().some(function(s) {
1163 1163
             if (s.track === track) {
1164 1164
                 sender = s;
1165 1165
                 return true;
@@ -1274,7 +1274,7 @@ export default class JingleSessionPC extends JingleSession {
1274 1274
             logger.info("Sending source-remove", remove.tree());
1275 1275
             this.connection.sendIQ(
1276 1276
                 remove, null,
1277
-                this.newJingleErrorHandler(remove, function (error) {
1277
+                this.newJingleErrorHandler(remove, function(error) {
1278 1278
                     GlobalOnErrorHandler.callErrorHandler(
1279 1279
                         new Error("Jingle error: " + JSON.stringify(error)));
1280 1280
                 }), IQ_TIMEOUT);
@@ -1299,7 +1299,7 @@ export default class JingleSessionPC extends JingleSession {
1299 1299
         if (added && add) {
1300 1300
             logger.info("Sending source-add", add.tree());
1301 1301
             this.connection.sendIQ(
1302
-                add, null, this.newJingleErrorHandler(add, function (error) {
1302
+                add, null, this.newJingleErrorHandler(add, function(error) {
1303 1303
                     GlobalOnErrorHandler.callErrorHandler(
1304 1304
                         new Error("Jingle error: " + JSON.stringify(error)));
1305 1305
                 }), IQ_TIMEOUT);
@@ -1327,7 +1327,7 @@ export default class JingleSessionPC extends JingleSession {
1327 1327
      * @returns {function(this:JingleSessionPC)}
1328 1328
      */
1329 1329
     newJingleErrorHandler(request, failureCb) {
1330
-        return function (errResponse) {
1330
+        return function(errResponse) {
1331 1331
 
1332 1332
             const error = {};
1333 1333
 
@@ -1447,18 +1447,18 @@ export default class JingleSessionPC extends JingleSession {
1447 1447
         let ssrcs = this.modifiedSSRCs["unmute"];
1448 1448
         this.modifiedSSRCs["unmute"] = [];
1449 1449
         if (ssrcs && ssrcs.length) {
1450
-            ssrcs.forEach(function (ssrcObj) {
1450
+            ssrcs.forEach(function(ssrcObj) {
1451 1451
                 const desc = $(jingle.tree()).find(">jingle>content[name=\"" +
1452 1452
                     ssrcObj.mtype + "\"]>description");
1453 1453
                 if (!desc || !desc.length) {
1454 1454
                     return;
1455 1455
                 }
1456
-                ssrcObj.ssrcs.forEach(function (ssrc) {
1456
+                ssrcObj.ssrcs.forEach(function(ssrc) {
1457 1457
                     const sourceNode = desc.find(">source[ssrc=\"" +
1458 1458
                         ssrc + "\"]");
1459 1459
                     sourceNode.remove();
1460 1460
                 });
1461
-                ssrcObj.groups.forEach(function (group) {
1461
+                ssrcObj.groups.forEach(function(group) {
1462 1462
                     const groupNode = desc.find(">ssrc-group[semantics=\"" +
1463 1463
                         group.semantics + "\"]:has(source[ssrc=\"" +
1464 1464
                         group.ssrcs[0] + "\"])");
@@ -1470,12 +1470,12 @@ export default class JingleSessionPC extends JingleSession {
1470 1470
         ssrcs = this.modifiedSSRCs["addMuted"];
1471 1471
         this.modifiedSSRCs["addMuted"] = [];
1472 1472
         if (ssrcs && ssrcs.length) {
1473
-            ssrcs.forEach(function (ssrcObj) {
1473
+            ssrcs.forEach(function(ssrcObj) {
1474 1474
                 const desc
1475 1475
                     = JingleSessionPC.createDescriptionNode(
1476 1476
                         jingle, ssrcObj.mtype);
1477 1477
                 const cname = Math.random().toString(36).substring(2);
1478
-                ssrcObj.ssrcs.forEach(function (ssrc) {
1478
+                ssrcObj.ssrcs.forEach(function(ssrc) {
1479 1479
                     const sourceNode
1480 1480
                         = desc.find(">source[ssrc=\"" + ssrc + "\"]");
1481 1481
                     sourceNode.remove();
@@ -1489,7 +1489,7 @@ export default class JingleSessionPC extends JingleSession {
1489 1489
                         "</source>";
1490 1490
                     desc.append(sourceXML);
1491 1491
                 });
1492
-                ssrcObj.groups.forEach(function (group) {
1492
+                ssrcObj.groups.forEach(function(group) {
1493 1493
                     const groupNode
1494 1494
                         = desc.find(">ssrc-group[semantics=\"" +
1495 1495
                             group.semantics + "\"]:has(source[ssrc=\""
@@ -1517,15 +1517,15 @@ export default class JingleSessionPC extends JingleSession {
1517 1517
         let ssrcs = this.modifiedSSRCs["mute"];
1518 1518
         this.modifiedSSRCs["mute"] = [];
1519 1519
         if (ssrcs && ssrcs.length) {
1520
-            ssrcs.forEach(function (ssrcObj) {
1521
-                ssrcObj.ssrcs.forEach(function (ssrc) {
1520
+            ssrcs.forEach(function(ssrcObj) {
1521
+                ssrcObj.ssrcs.forEach(function(ssrc) {
1522 1522
                     const sourceNode
1523 1523
                         = $(jingle.tree()).find(">jingle>content[name=\"" +
1524 1524
                             ssrcObj.mtype + "\"]>description>source[ssrc=\"" +
1525 1525
                             ssrc + "\"]");
1526 1526
                     sourceNode.remove();
1527 1527
                 });
1528
-                ssrcObj.groups.forEach(function (group) {
1528
+                ssrcObj.groups.forEach(function(group) {
1529 1529
                     const groupNode
1530 1530
                         = $(jingle.tree()).find(
1531 1531
                             ">jingle>content[name=\"" + ssrcObj.mtype +
@@ -1540,11 +1540,11 @@ export default class JingleSessionPC extends JingleSession {
1540 1540
         ssrcs = this.modifiedSSRCs["remove"];
1541 1541
         this.modifiedSSRCs["remove"] = [];
1542 1542
         if (ssrcs && ssrcs.length) {
1543
-            ssrcs.forEach(function (ssrcObj) {
1543
+            ssrcs.forEach(function(ssrcObj) {
1544 1544
                 const desc
1545 1545
                     = JingleSessionPC.createDescriptionNode(
1546 1546
                         jingle, ssrcObj.mtype);
1547
-                ssrcObj.ssrcs.forEach(function (ssrc) {
1547
+                ssrcObj.ssrcs.forEach(function(ssrc) {
1548 1548
                     const sourceNode
1549 1549
                         = desc.find(">source[ssrc=\"" + ssrc + "\"]");
1550 1550
                     if (!sourceNode || !sourceNode.length) {
@@ -1555,7 +1555,7 @@ export default class JingleSessionPC extends JingleSession {
1555 1555
                             "ssrc=\"" + ssrc + "\"></source>");
1556 1556
                     }
1557 1557
                 });
1558
-                ssrcObj.groups.forEach(function (group) {
1558
+                ssrcObj.groups.forEach(function(group) {
1559 1559
                     const groupNode
1560 1560
                         = desc.find(">ssrc-group[semantics=\"" +
1561 1561
                             group.semantics + "\"]:has(source[ssrc=\"" +
@@ -1605,7 +1605,7 @@ export default class JingleSessionPC extends JingleSession {
1605 1605
      * Extracts the ice username fragment from an SDP string.
1606 1606
      */
1607 1607
     static getUfrag(sdp) {
1608
-        const ufragLines = sdp.split('\n').filter(function (line) {
1608
+        const ufragLines = sdp.split('\n').filter(function(line) {
1609 1609
             return line.startsWith("a=ice-ufrag:");
1610 1610
         });
1611 1611
         if (ufragLines.length > 0) {

+ 6
- 6
modules/xmpp/RtxModifier.js Parādīt failu

@@ -19,7 +19,7 @@ const logger = getLogger(__filename);
19 19
  *  primary ssrc
20 20
  * @param {number} rtxSsrc the rtx ssrc to associate with the primary ssrc
21 21
  */
22
-function updateAssociatedRtxStream (mLine, primarySsrcInfo, rtxSsrc) {
22
+function updateAssociatedRtxStream(mLine, primarySsrcInfo, rtxSsrc) {
23 23
     logger.debug(
24 24
         `Updating mline to associate ${rtxSsrc}` +
25 25
         `rtx ssrc with primary stream, ${primarySsrcInfo.id}`);
@@ -73,7 +73,7 @@ export default class RtxModifier {
73 73
     /**
74 74
      * Constructor
75 75
      */
76
-    constructor () {
76
+    constructor() {
77 77
         /**
78 78
          * Map of video ssrc to corresponding RTX
79 79
          *  ssrc
@@ -86,7 +86,7 @@ export default class RtxModifier {
86 86
      *  their corresponding rtx ssrcs so that they will
87 87
      *  not be used for the next call to modifyRtxSsrcs
88 88
      */
89
-    clearSsrcCache () {
89
+    clearSsrcCache() {
90 90
         this.correspondingRtxSsrcs.clear();
91 91
     }
92 92
 
@@ -96,7 +96,7 @@ export default class RtxModifier {
96 96
      * @param {Map} ssrcMapping a mapping of primary video
97 97
      *  ssrcs to their corresponding rtx ssrcs
98 98
      */
99
-    setSsrcCache (ssrcMapping) {
99
+    setSsrcCache(ssrcMapping) {
100 100
         logger.debug("Setting ssrc cache to ", ssrcMapping);
101 101
         this.correspondingRtxSsrcs = ssrcMapping;
102 102
     }
@@ -108,7 +108,7 @@ export default class RtxModifier {
108 108
      *  the same RTX ssrc will be used again.
109 109
      * @param {string} sdpStr sdp in raw string format
110 110
      */
111
-    modifyRtxSsrcs (sdpStr) {
111
+    modifyRtxSsrcs(sdpStr) {
112 112
         const sdpTransformer = new SdpTransformWrap(sdpStr);
113 113
         const videoMLine = sdpTransformer.selectMedia("video");
114 114
         if (!videoMLine) {
@@ -175,7 +175,7 @@ export default class RtxModifier {
175 175
      * @param {string} sdpStr sdp in raw string format
176 176
      * @returns {string} sdp string with all rtx streams stripped
177 177
      */
178
-    stripRtx (sdpStr) {
178
+    stripRtx(sdpStr) {
179 179
         const sdpTransformer = new SdpTransformWrap(sdpStr);
180 180
         const videoMLine = sdpTransformer.selectMedia("video");
181 181
         if (!videoMLine) {

+ 4
- 4
modules/xmpp/RtxModifier.spec.js Parādīt failu

@@ -10,7 +10,7 @@ import * as SDPUtil from "./SDPUtil";
10 10
  * @param {object} parsedSdp the sdp as parsed by transform.parse
11 11
  * @returns {number} the number of video ssrcs in the given sdp
12 12
  */
13
-function numVideoSsrcs (parsedSdp) {
13
+function numVideoSsrcs(parsedSdp) {
14 14
     const videoMLine = parsedSdp.media.find(m => m.type === "video");
15 15
     return videoMLine.ssrcs
16 16
     .map(ssrcInfo => ssrcInfo.id)
@@ -23,7 +23,7 @@ function numVideoSsrcs (parsedSdp) {
23 23
  * @param {object} parsedSdp the sdp as parsed by transform.parse
24 24
  * @returns {number} the primary video ssrc in the given sdp
25 25
  */
26
-function getPrimaryVideoSsrc (parsedSdp) {
26
+function getPrimaryVideoSsrc(parsedSdp) {
27 27
     const videoMLine = parsedSdp.media.find(m => m.type === "video");
28 28
     return parseInt(SDPUtil.parsePrimaryVideoSsrc(videoMLine));
29 29
 }
@@ -36,7 +36,7 @@ function getPrimaryVideoSsrc (parsedSdp) {
36 36
  * @param {object} parsedSdp the sdp as parsed by transform.parse
37 37
  * @returns {list<number>} the primary video ssrcs in the given sdp
38 38
  */
39
-function getPrimaryVideoSsrcs (parsedSdp) {
39
+function getPrimaryVideoSsrcs(parsedSdp) {
40 40
     const videoMLine = parsedSdp.media.find(m => m.type === "video");
41 41
     if (numVideoSsrcs(parsedSdp) === 1) {
42 42
         return [videoMLine.ssrcs[0].id];
@@ -59,7 +59,7 @@ function getPrimaryVideoSsrcs (parsedSdp) {
59 59
  * @returns {list<object>} a list of the groups from the given sdp
60 60
  *  that matched the passed semantics
61 61
  */
62
-function getVideoGroups (parsedSdp, groupSemantics) {
62
+function getVideoGroups(parsedSdp, groupSemantics) {
63 63
     const videoMLine = parsedSdp.media.find(m => m.type === "video");
64 64
     videoMLine.ssrcGroups = videoMLine.ssrcGroups || [];
65 65
     return videoMLine.ssrcGroups

+ 26
- 26
modules/xmpp/SDP.js Parādīt failu

@@ -56,7 +56,7 @@ SDP.prototype.getMediaSsrcMap = function() {
56 56
             ssrcGroups: []
57 57
         };
58 58
         media_ssrcs[mediaindex] = media;
59
-        tmp.forEach(function (line) {
59
+        tmp.forEach(function(line) {
60 60
             var linessrc = line.substring(7).split(' ')[0];
61 61
             // allocate new ChannelSsrc
62 62
             if(!media.ssrcs[linessrc]) {
@@ -87,11 +87,11 @@ SDP.prototype.getMediaSsrcMap = function() {
87 87
  * @param ssrc the ssrc to check.
88 88
  * @returns {boolean} <tt>true</tt> if this SDP contains given SSRC.
89 89
  */
90
-SDP.prototype.containsSSRC = function (ssrc) {
90
+SDP.prototype.containsSSRC = function(ssrc) {
91 91
     // FIXME this code is really strange - improve it if you can
92 92
     var medias = this.getMediaSsrcMap();
93 93
     var result = false;
94
-    Object.keys(medias).forEach(function (mediaindex) {
94
+    Object.keys(medias).forEach(function(mediaindex) {
95 95
         if (result) {
96 96
             return;
97 97
         }
@@ -103,7 +103,7 @@ SDP.prototype.containsSSRC = function (ssrc) {
103 103
 };
104 104
 
105 105
 // remove iSAC and CN from SDP
106
-SDP.prototype.mangle = function () {
106
+SDP.prototype.mangle = function() {
107 107
     var i, j, mline, lines, rtpmap, newdesc;
108 108
     for (i = 0; i < this.media.length; i++) {
109 109
         lines = this.media[i].split('\r\n');
@@ -152,7 +152,7 @@ SDP.prototype.removeMediaLines = function(mediaindex, prefix) {
152 152
 };
153 153
 
154 154
 // add content's to a jingle element
155
-SDP.prototype.toJingle = function (elem, thecreator) {
155
+SDP.prototype.toJingle = function(elem, thecreator) {
156 156
     var i, j, k, mline, ssrc, rtpmap, tmp, lines;
157 157
     // new bundle plan
158 158
     lines = SDPUtil.find_lines(this.session, 'a=group:');
@@ -226,7 +226,7 @@ SDP.prototype.toJingle = function (elem, thecreator) {
226 226
                 // FIXME: group by ssrc and support multiple different ssrcs
227 227
                 var ssrclines = SDPUtil.find_lines(this.media[i], 'a=ssrc:');
228 228
                 if(ssrclines.length > 0) {
229
-                    ssrclines.forEach(function (line) {
229
+                    ssrclines.forEach(function(line) {
230 230
                         var idx = line.indexOf(' ');
231 231
                         var linessrc = line.substr(0, idx).substr(7);
232 232
                         if (linessrc != ssrc) {
@@ -355,7 +355,7 @@ SDP.prototype.toJingle = function (elem, thecreator) {
355 355
     return elem;
356 356
 };
357 357
 
358
-SDP.prototype.transportToJingle = function (mediaindex, elem) {
358
+SDP.prototype.transportToJingle = function(mediaindex, elem) {
359 359
     var tmp, sctpmap, sctpAttrs, fingerprints;
360 360
     var self = this;
361 361
     elem.c('transport');
@@ -397,7 +397,7 @@ SDP.prototype.transportToJingle = function (mediaindex, elem) {
397 397
         // XEP-0176
398 398
         if (SDPUtil.find_line(this.media[mediaindex], 'a=candidate:', this.session)) { // add any a=candidate lines
399 399
             var lines = SDPUtil.find_lines(this.media[mediaindex], 'a=candidate:', this.session);
400
-            lines.forEach(function (line) {
400
+            lines.forEach(function(line) {
401 401
                 var candidate = SDPUtil.candidateToJingle(line);
402 402
                 if (self.failICE) {
403 403
                     candidate.ip = "1.1.1.1";
@@ -417,9 +417,9 @@ SDP.prototype.transportToJingle = function (mediaindex, elem) {
417 417
     elem.up(); // end of transport
418 418
 };
419 419
 
420
-SDP.prototype.rtcpFbToJingle = function (mediaindex, elem, payloadtype) { // XEP-0293
420
+SDP.prototype.rtcpFbToJingle = function(mediaindex, elem, payloadtype) { // XEP-0293
421 421
     var lines = SDPUtil.find_lines(this.media[mediaindex], 'a=rtcp-fb:' + payloadtype);
422
-    lines.forEach(function (line) {
422
+    lines.forEach(function(line) {
423 423
         var tmp = SDPUtil.parse_rtcpfb(line);
424 424
         if (tmp.type == 'trr-int') {
425 425
             elem.c('rtcp-fb-trr-int', {xmlns: 'urn:xmpp:jingle:apps:rtp:rtcp-fb:0', value: tmp.params[0]});
@@ -434,7 +434,7 @@ SDP.prototype.rtcpFbToJingle = function (mediaindex, elem, payloadtype) { // XEP
434 434
     });
435 435
 };
436 436
 
437
-SDP.prototype.rtcpFbFromJingle = function (elem, payloadtype) { // XEP-0293
437
+SDP.prototype.rtcpFbFromJingle = function(elem, payloadtype) { // XEP-0293
438 438
     var media = '';
439 439
     var tmp = elem.find('>rtcp-fb-trr-int[xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0"]');
440 440
     if (tmp.length) {
@@ -447,7 +447,7 @@ SDP.prototype.rtcpFbFromJingle = function (elem, payloadtype) { // XEP-0293
447 447
         media += '\r\n';
448 448
     }
449 449
     tmp = elem.find('>rtcp-fb[xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0"]');
450
-    tmp.each(function () {
450
+    tmp.each(function() {
451 451
         media += 'a=rtcp-fb:' + payloadtype + ' ' + $(this).attr('type');
452 452
         if ($(this).attr('subtype')) {
453 453
             media += ' ' + $(this).attr('subtype');
@@ -458,7 +458,7 @@ SDP.prototype.rtcpFbFromJingle = function (elem, payloadtype) { // XEP-0293
458 458
 };
459 459
 
460 460
 // construct an SDP from a jingle stanza
461
-SDP.prototype.fromJingle = function (jingle) {
461
+SDP.prototype.fromJingle = function(jingle) {
462 462
     var self = this;
463 463
     this.raw = 'v=0\r\n' +
464 464
         'o=- 1923518516 2 IN IP4 0.0.0.0\r\n' +// FIXME
@@ -466,8 +466,8 @@ SDP.prototype.fromJingle = function (jingle) {
466 466
         't=0 0\r\n';
467 467
     // http://tools.ietf.org/html/draft-ietf-mmusic-sdp-bundle-negotiation-04#section-8
468 468
     if ($(jingle).find('>group[xmlns="urn:xmpp:jingle:apps:grouping:0"]').length) {
469
-        $(jingle).find('>group[xmlns="urn:xmpp:jingle:apps:grouping:0"]').each(function (idx, group) {
470
-            var contents = $(group).find('>content').map(function (idx, content) {
469
+        $(jingle).find('>group[xmlns="urn:xmpp:jingle:apps:grouping:0"]').each(function(idx, group) {
470
+            var contents = $(group).find('>content').map(function(idx, content) {
471 471
                 return content.getAttribute('name');
472 472
             }).get();
473 473
             if (contents.length > 0) {
@@ -477,7 +477,7 @@ SDP.prototype.fromJingle = function (jingle) {
477 477
     }
478 478
 
479 479
     this.session = this.raw;
480
-    jingle.find('>content').each(function () {
480
+    jingle.find('>content').each(function() {
481 481
         var m = self.jingle2media($(this));
482 482
         self.media.push(m);
483 483
     });
@@ -494,7 +494,7 @@ SDP.prototype.fromJingle = function (jingle) {
494 494
 };
495 495
 
496 496
 // translate a jingle content element into an an SDP media part
497
-SDP.prototype.jingle2media = function (content) {
497
+SDP.prototype.jingle2media = function(content) {
498 498
     var media = '',
499 499
         desc = content.find('description'),
500 500
         self = this,
@@ -516,7 +516,7 @@ SDP.prototype.jingle2media = function (content) {
516 516
     }
517 517
     if (!sctp.length) {
518 518
         tmp.fmt = desc.find('payload-type').map(
519
-            function () {
519
+            function() {
520 520
                 return this.getAttribute('id');
521 521
             }).get();
522 522
         media += SDPUtil.build_mline(tmp) + '\r\n';
@@ -545,7 +545,7 @@ SDP.prototype.jingle2media = function (content) {
545 545
         if (tmp.attr('pwd')) {
546 546
             media += SDPUtil.build_icepwd(tmp.attr('pwd')) + '\r\n';
547 547
         }
548
-        tmp.find('>fingerprint').each(function () {
548
+        tmp.find('>fingerprint').each(function() {
549 549
             // FIXME: check namespace at some point
550 550
             media += 'a=fingerprint:' + this.getAttribute('hash');
551 551
             media += ' ' + $(this).text();
@@ -579,7 +579,7 @@ SDP.prototype.jingle2media = function (content) {
579 579
     }
580 580
 
581 581
     if (desc.find('encryption').length) {
582
-        desc.find('encryption>crypto').each(function () {
582
+        desc.find('encryption>crypto').each(function() {
583 583
             media += 'a=crypto:' + this.getAttribute('tag');
584 584
             media += ' ' + this.getAttribute('crypto-suite');
585 585
             media += ' ' + this.getAttribute('key-params');
@@ -589,11 +589,11 @@ SDP.prototype.jingle2media = function (content) {
589 589
             media += '\r\n';
590 590
         });
591 591
     }
592
-    desc.find('payload-type').each(function () {
592
+    desc.find('payload-type').each(function() {
593 593
         media += SDPUtil.build_rtpmap(this) + '\r\n';
594 594
         if ($(this).find('>parameter').length) {
595 595
             media += 'a=fmtp:' + this.getAttribute('id') + ' ';
596
-            media += $(this).find('parameter').map(function () {
596
+            media += $(this).find('parameter').map(function() {
597 597
                 return (this.getAttribute('name')
598 598
                         ? this.getAttribute('name') + '=' : '') +
599 599
                     this.getAttribute('value');
@@ -609,11 +609,11 @@ SDP.prototype.jingle2media = function (content) {
609 609
 
610 610
     // xep-0294
611 611
     tmp = desc.find('>rtp-hdrext[xmlns="urn:xmpp:jingle:apps:rtp:rtp-hdrext:0"]');
612
-    tmp.each(function () {
612
+    tmp.each(function() {
613 613
         media += 'a=extmap:' + this.getAttribute('id') + ' ' + this.getAttribute('uri') + '\r\n';
614 614
     });
615 615
 
616
-    content.find('>transport[xmlns="urn:xmpp:jingle:transports:ice-udp:1"]>candidate').each(function () {
616
+    content.find('>transport[xmlns="urn:xmpp:jingle:transports:ice-udp:1"]>candidate').each(function() {
617 617
         var protocol = this.getAttribute('protocol');
618 618
         protocol = typeof protocol === 'string' ? protocol.toLowerCase() : '';
619 619
 
@@ -641,9 +641,9 @@ SDP.prototype.jingle2media = function (content) {
641 641
     });
642 642
 
643 643
     tmp = content.find('description>source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]');
644
-    tmp.each(function () {
644
+    tmp.each(function() {
645 645
         var ssrc = this.getAttribute('ssrc');
646
-        $(this).find('>parameter').each(function () {
646
+        $(this).find('>parameter').each(function() {
647 647
             var name = this.getAttribute('name');
648 648
             var value = this.getAttribute('value');
649 649
             value = SDPUtil.filter_special_chars(value);

+ 2
- 2
modules/xmpp/SDPDiffer.js Parādīt failu

@@ -124,7 +124,7 @@ SDPDiffer.prototype.toJingle = function(modify) {
124 124
             modify.c('source', { xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
125 125
             modify.attrs({ssrc: mediaSsrc.ssrc});
126 126
             // iterate over ssrc lines
127
-            mediaSsrc.lines.forEach(function (line) {
127
+            mediaSsrc.lines.forEach(function(line) {
128 128
                 var idx = line.indexOf(' ');
129 129
                 var kv = line.substr(idx + 1);
130 130
                 modify.c('parameter');
@@ -151,7 +151,7 @@ SDPDiffer.prototype.toJingle = function(modify) {
151 151
                     xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0'
152 152
                 });
153 153
 
154
-                ssrcGroup.ssrcs.forEach(function (ssrc) {
154
+                ssrcGroup.ssrcs.forEach(function(ssrc) {
155 155
                     modify.c('source', { ssrc })
156 156
                         .up(); // end of source
157 157
                 });

+ 27
- 27
modules/xmpp/SDPUtil.js Parādīt failu

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

+ 4
- 4
modules/xmpp/SdpConsistency.js Parādīt failu

@@ -18,7 +18,7 @@ export default class SdpConsistency {
18 18
     /**
19 19
      * Constructor
20 20
      */
21
-    constructor () {
21
+    constructor() {
22 22
         this.clearSsrcCache();
23 23
     }
24 24
 
@@ -27,7 +27,7 @@ export default class SdpConsistency {
27 27
      *  they will not be used for the next call to
28 28
      *  makeVideoPrimarySsrcsConsistent
29 29
      */
30
-    clearSsrcCache () {
30
+    clearSsrcCache() {
31 31
         this.cachedPrimarySsrc = null;
32 32
     }
33 33
 
@@ -38,7 +38,7 @@ export default class SdpConsistency {
38 38
      *  in future calls to makeVideoPrimarySsrcsConsistent
39 39
      * @throws Error if <tt>primarySsrc</tt> is not a number
40 40
      */
41
-    setPrimarySsrc (primarySsrc) {
41
+    setPrimarySsrc(primarySsrc) {
42 42
         if (typeof primarySsrc !== 'number') {
43 43
             throw new Error("Primary SSRC must be a number!");
44 44
         }
@@ -56,7 +56,7 @@ export default class SdpConsistency {
56 56
      * @returns {string} a (potentially) modified sdp string
57 57
      *  with ssrcs consistent with this class' cache
58 58
      */
59
-    makeVideoPrimarySsrcsConsistent (sdpStr) {
59
+    makeVideoPrimarySsrcsConsistent(sdpStr) {
60 60
         const sdpTransformer = new SdpTransformWrap(sdpStr);
61 61
         const videoMLine = sdpTransformer.selectMedia("video");
62 62
         if (!videoMLine) {

+ 8
- 8
modules/xmpp/SdpTransformUtil.js Parādīt failu

@@ -105,7 +105,7 @@ class MLineWrap {
105 105
         this.mLine = mLine;
106 106
     }
107 107
 
108
-    get _ssrcs () {
108
+    get _ssrcs() {
109 109
         if (!this.mLine.ssrcs) {
110 110
             this.mLine.ssrcs = [];
111 111
         }
@@ -124,7 +124,7 @@ class MLineWrap {
124 124
      * Modifies the direction of the underlying media description.
125 125
      * @param {string} direction the new direction to be set
126 126
      */
127
-    set direction (direction) {
127
+    set direction(direction) {
128 128
         this.mLine.direction = direction;
129 129
     }
130 130
 
@@ -132,7 +132,7 @@ class MLineWrap {
132 132
      * Exposes the SSRC group array of the underlying media description object.
133 133
      * @return {Array.<Object>}
134 134
      */
135
-    get ssrcGroups () {
135
+    get ssrcGroups() {
136 136
         if (!this.mLine.ssrcGroups) {
137 137
             this.mLine.ssrcGroups = [];
138 138
         }
@@ -144,7 +144,7 @@ class MLineWrap {
144 144
      * object.
145 145
      * @param {Array.<Object>} ssrcGroups
146 146
      */
147
-    set ssrcGroups (ssrcGroups) {
147
+    set ssrcGroups(ssrcGroups) {
148 148
         this.mLine.ssrcGroups = ssrcGroups;
149 149
     }
150 150
 
@@ -257,7 +257,7 @@ class MLineWrap {
257 257
      * @returns {number|undefined} the primary video ssrc
258 258
      * @throws Error if the underlying media description is not a video
259 259
      */
260
-    getPrimaryVideoSsrc () {
260
+    getPrimaryVideoSsrc() {
261 261
         const mediaType = this.mLine.type;
262 262
 
263 263
         if (mediaType !== 'video') {
@@ -292,7 +292,7 @@ class MLineWrap {
292 292
      * @returns {number|undefined} the rtx ssrc (or undefined if there isn't
293 293
      * one)
294 294
      */
295
-    getRtxSSRC (primarySsrc) {
295
+    getRtxSSRC(primarySsrc) {
296 296
         const fidGroup = this.findGroupByPrimarySSRC("FID", primarySsrc);
297 297
         return fidGroup && parseSecondarySSRC(fidGroup);
298 298
     }
@@ -301,7 +301,7 @@ class MLineWrap {
301 301
      * Obtains all SSRCs contained in the underlying media description.
302 302
      * @return {Array.<number>} an array with all SSRC as numbers.
303 303
      */
304
-    getSSRCs () {
304
+    getSSRCs() {
305 305
         return this._ssrcs
306 306
             .map(ssrcInfo => ssrcInfo.id)
307 307
             .filter((ssrc, index, array) => array.indexOf(ssrc) === index);
@@ -312,7 +312,7 @@ class MLineWrap {
312 312
      * @return {Array.<number>} an array of all primary video SSRCs as numbers.
313 313
      * @throws Error if the wrapped media description is not a video.
314 314
      */
315
-    getPrimaryVideoSSRCs () {
315
+    getPrimaryVideoSSRCs() {
316 316
         const mediaType = this.mLine.type;
317 317
 
318 318
         if (mediaType !== 'video') {

+ 21
- 21
modules/xmpp/moderator.js Parādīt failu

@@ -9,7 +9,7 @@ import Settings from "../settings/Settings";
9 9
 
10 10
 function createExpBackoffTimer(step) {
11 11
     var count = 1;
12
-    return function (reset) {
12
+    return function(reset) {
13 13
         // Reset call
14 14
         if (reset) {
15 15
             count = 1;
@@ -62,16 +62,16 @@ function Moderator(roomName, xmpp, emitter, options) {
62 62
     }
63 63
 }
64 64
 
65
-Moderator.prototype.isExternalAuthEnabled = function () {
65
+Moderator.prototype.isExternalAuthEnabled = function() {
66 66
     return this.externalAuthEnabled;
67 67
 };
68 68
 
69
-Moderator.prototype.isSipGatewayEnabled = function () {
69
+Moderator.prototype.isSipGatewayEnabled = function() {
70 70
     return this.sipGatewayEnabled;
71 71
 };
72 72
 
73 73
 
74
-Moderator.prototype.onMucMemberLeft = function (jid) {
74
+Moderator.prototype.onMucMemberLeft = function(jid) {
75 75
     logger.info("Someone left is it focus ? " + jid);
76 76
     var resource = Strophe.getResourceFromJid(jid);
77 77
     if (resource === 'focus') {
@@ -82,7 +82,7 @@ Moderator.prototype.onMucMemberLeft = function (jid) {
82 82
 };
83 83
 
84 84
 
85
-Moderator.prototype.setFocusUserJid = function (focusJid) {
85
+Moderator.prototype.setFocusUserJid = function(focusJid) {
86 86
     if (!this.focusUserJid) {
87 87
         this.focusUserJid = focusJid;
88 88
         logger.info("Focus jid set to:  " + this.focusUserJid);
@@ -90,11 +90,11 @@ Moderator.prototype.setFocusUserJid = function (focusJid) {
90 90
 };
91 91
 
92 92
 
93
-Moderator.prototype.getFocusUserJid = function () {
93
+Moderator.prototype.getFocusUserJid = function() {
94 94
     return this.focusUserJid;
95 95
 };
96 96
 
97
-Moderator.prototype.getFocusComponent = function () {
97
+Moderator.prototype.getFocusComponent = function() {
98 98
     // Get focus component address
99 99
     var focusComponent = this.options.connection.hosts.focus;
100 100
     // If not specified use default:  'focus.domain'
@@ -104,7 +104,7 @@ Moderator.prototype.getFocusComponent = function () {
104 104
     return focusComponent;
105 105
 };
106 106
 
107
-Moderator.prototype.createConferenceIq = function () {
107
+Moderator.prototype.createConferenceIq = function() {
108 108
     // Generate create conference IQ
109 109
     var elem = $iq({to: this.getFocusComponent(), type: 'set'});
110 110
 
@@ -218,7 +218,7 @@ Moderator.prototype.createConferenceIq = function () {
218 218
 };
219 219
 
220 220
 
221
-Moderator.prototype.parseSessionId = function (resultIq) {
221
+Moderator.prototype.parseSessionId = function(resultIq) {
222 222
     var sessionId = $(resultIq).find('conference').attr('session-id');
223 223
     if (sessionId) {
224 224
         logger.info('Received sessionId:  ' + sessionId);
@@ -226,7 +226,7 @@ Moderator.prototype.parseSessionId = function (resultIq) {
226 226
     }
227 227
 };
228 228
 
229
-Moderator.prototype.parseConfigOptions = function (resultIq) {
229
+Moderator.prototype.parseConfigOptions = function(resultIq) {
230 230
 
231 231
     this.setFocusUserJid(
232 232
         $(resultIq).find('conference').attr('focusjid'));
@@ -274,7 +274,7 @@ Moderator.prototype.parseConfigOptions = function (resultIq) {
274 274
  * @param {Function} callback - the function to be called back upon the
275 275
  * successful allocation of the conference focus
276 276
  */
277
-Moderator.prototype.allocateConferenceFocus = function (callback) {
277
+Moderator.prototype.allocateConferenceFocus = function(callback) {
278 278
     // Try to use focus user JID from the config
279 279
     this.setFocusUserJid(this.options.connection.focusUserJid);
280 280
     // Send create conference IQ
@@ -298,7 +298,7 @@ Moderator.prototype.allocateConferenceFocus = function (callback) {
298 298
  * @param {Function} callback - the function to be called back upon the
299 299
  * successful allocation of the conference focus
300 300
  */
301
-Moderator.prototype._allocateConferenceFocusError = function (error, callback) {
301
+Moderator.prototype._allocateConferenceFocusError = function(error, callback) {
302 302
     // If the session is invalid, remove and try again without session ID to get
303 303
     // a new one
304 304
     var invalidSession = $(error).find('>error>session-invalid').length;
@@ -363,7 +363,7 @@ Moderator.prototype._allocateConferenceFocusError = function (error, callback) {
363 363
  * @param {Function} callback - the function to be called back upon the
364 364
  * successful allocation of the conference focus
365 365
  */
366
-Moderator.prototype._allocateConferenceFocusSuccess = function (
366
+Moderator.prototype._allocateConferenceFocusSuccess = function(
367 367
         result,
368 368
         callback) {
369 369
     // Setup config options
@@ -384,7 +384,7 @@ Moderator.prototype._allocateConferenceFocusSuccess = function (
384 384
     }
385 385
 };
386 386
 
387
-Moderator.prototype.authenticate = function () {
387
+Moderator.prototype.authenticate = function() {
388 388
     return new Promise((resolve, reject) => {
389 389
         this.connection.sendIQ(
390 390
             this.createConferenceIq(),
@@ -399,7 +399,7 @@ Moderator.prototype.authenticate = function () {
399 399
     });
400 400
 };
401 401
 
402
-Moderator.prototype.getLoginUrl = function (urlCallback, failureCallback) {
402
+Moderator.prototype.getLoginUrl = function(urlCallback, failureCallback) {
403 403
     this._getLoginUrl(/* popup */ false, urlCallback, failureCallback);
404 404
 };
405 405
 
@@ -410,7 +410,7 @@ Moderator.prototype.getLoginUrl = function (urlCallback, failureCallback) {
410 410
  * @param urlCb
411 411
  * @param failureCb
412 412
  */
413
-Moderator.prototype._getLoginUrl = function (popup, urlCb, failureCb) {
413
+Moderator.prototype._getLoginUrl = function(popup, urlCb, failureCb) {
414 414
     var iq = $iq({to: this.getFocusComponent(), type: 'get'});
415 415
     var attrs = {
416 416
         xmlns: 'http://jitsi.org/protocol/focus',
@@ -437,7 +437,7 @@ Moderator.prototype._getLoginUrl = function (popup, urlCb, failureCb) {
437 437
     }
438 438
     this.connection.sendIQ(
439 439
         iq,
440
-        function (result) {
440
+        function(result) {
441 441
             var url = $(result).find('login-url').attr('url');
442 442
             url = decodeURIComponent(url);
443 443
             if (url) {
@@ -451,11 +451,11 @@ Moderator.prototype._getLoginUrl = function (popup, urlCb, failureCb) {
451 451
     );
452 452
 };
453 453
 
454
-Moderator.prototype.getPopupLoginUrl = function (urlCallback, failureCallback) {
454
+Moderator.prototype.getPopupLoginUrl = function(urlCallback, failureCallback) {
455 455
     this._getLoginUrl(/* popup */ true, urlCallback, failureCallback);
456 456
 };
457 457
 
458
-Moderator.prototype.logout = function (callback) {
458
+Moderator.prototype.logout = function(callback) {
459 459
     var iq = $iq({to: this.getFocusComponent(), type: 'set'});
460 460
     var sessionId = Settings.getSessionId();
461 461
     if (!sessionId) {
@@ -468,7 +468,7 @@ Moderator.prototype.logout = function (callback) {
468 468
     });
469 469
     this.connection.sendIQ(
470 470
         iq,
471
-        function (result) {
471
+        function(result) {
472 472
             var logoutUrl = $(result).find('logout').attr('logout-url');
473 473
             if (logoutUrl) {
474 474
                 logoutUrl = decodeURIComponent(logoutUrl);
@@ -477,7 +477,7 @@ Moderator.prototype.logout = function (callback) {
477 477
             Settings.clearSessionId();
478 478
             callback(logoutUrl);
479 479
         }.bind(this),
480
-        function (error) {
480
+        function(error) {
481 481
             var errmsg = "Logout error";
482 482
             GlobalOnErrorHandler.callErrorHandler(new Error(errmsg));
483 483
             logger.error(errmsg, error);

+ 17
- 17
modules/xmpp/recording.js Parādīt failu

@@ -53,7 +53,7 @@ Recording.action = {
53 53
     STOP: "stop"
54 54
 };
55 55
 
56
-Recording.prototype.handleJibriPresence = function (jibri) {
56
+Recording.prototype.handleJibriPresence = function(jibri) {
57 57
     var attributes = jibri.attributes;
58 58
     if(!attributes) {
59 59
         return;
@@ -84,7 +84,7 @@ Recording.prototype.handleJibriPresence = function (jibri) {
84 84
 };
85 85
 
86 86
 Recording.prototype.setRecordingJibri
87
-    = function (state, callback, errCallback, options) {
87
+    = function(state, callback, errCallback, options) {
88 88
 
89 89
         if (state == this.state){
90 90
             errCallback(JitsiRecorderErrors.INVALID_STATE);
@@ -105,19 +105,19 @@ Recording.prototype.setRecordingJibri
105 105
         logger.log(iq.nodeTree);
106 106
         this.connection.sendIQ(
107 107
         iq,
108
-        function (result) {
108
+        function(result) {
109 109
             logger.log("Result", result);
110 110
             callback($(result).find('jibri').attr('state'),
111 111
             $(result).find('jibri').attr('url'));
112 112
         },
113
-        function (error) {
113
+        function(error) {
114 114
             logger.log('Failed to start recording, error: ', error);
115 115
             errCallback(error);
116 116
         });
117 117
     };
118 118
 
119 119
 Recording.prototype.setRecordingJirecon =
120
-    function (state, callback, errCallback) {
120
+    function(state, callback, errCallback) {
121 121
 
122 122
         if (state == this.state){
123 123
             errCallback(new Error("Invalid state!"));
@@ -137,7 +137,7 @@ Recording.prototype.setRecordingJirecon =
137 137
         var self = this;
138 138
         this.connection.sendIQ(
139 139
         iq,
140
-        function (result) {
140
+        function(result) {
141 141
             // TODO wait for an IQ with the real status, since this is
142 142
             // provisional?
143 143
             self.jireconRid = $(result).find('recording').attr('rid');
@@ -151,7 +151,7 @@ Recording.prototype.setRecordingJirecon =
151 151
 
152 152
             callback(state);
153 153
         },
154
-        function (error) {
154
+        function(error) {
155 155
             logger.log('Failed to start recording, error: ', error);
156 156
             errCallback(error);
157 157
         });
@@ -161,7 +161,7 @@ Recording.prototype.setRecordingJirecon =
161 161
 // the recording on the bridge. Waits for the result IQ and calls 'callback'
162 162
 // with the new recording state, according to the IQ.
163 163
 Recording.prototype.setRecordingColibri =
164
-function (state, callback, errCallback, options) {
164
+function(state, callback, errCallback, options) {
165 165
     var elem = $iq({to: this.focusMucJid, type: 'set'});
166 166
     elem.c('conference', {
167 167
         xmlns: 'http://jitsi.org/protocol/colibri'
@@ -170,7 +170,7 @@ function (state, callback, errCallback, options) {
170 170
 
171 171
     var self = this;
172 172
     this.connection.sendIQ(elem,
173
-        function (result) {
173
+        function(result) {
174 174
             logger.log('Set recording "', state, '". Result:', result);
175 175
             var recordingElem = $(result).find('>conference>recording');
176 176
             var newState = recordingElem.attr('state');
@@ -188,7 +188,7 @@ function (state, callback, errCallback, options) {
188 188
                 }, 'http://jitsi.org/protocol/colibri', 'iq', null, null, null);
189 189
             }
190 190
         },
191
-        function (error) {
191
+        function(error) {
192 192
             logger.warn(error);
193 193
             errCallback(error);
194 194
         }
@@ -196,7 +196,7 @@ function (state, callback, errCallback, options) {
196 196
 };
197 197
 
198 198
 Recording.prototype.setRecording =
199
-function (state, callback, errCallback, options) {
199
+function(state, callback, errCallback, options) {
200 200
     switch(this.type){
201 201
     case Recording.types.JIRECON:
202 202
         this.setRecordingJirecon(state, callback, errCallback, options);
@@ -220,7 +220,7 @@ function (state, callback, errCallback, options) {
220 220
  * @param token token for authentication
221 221
  * @param statusChangeHandler {function} receives the new status as argument.
222 222
  */
223
-Recording.prototype.toggleRecording = function (options, statusChangeHandler) {
223
+Recording.prototype.toggleRecording = function(options, statusChangeHandler) {
224 224
     var oldState = this.state;
225 225
 
226 226
     // If the recorder is currently unavailable we throw an error.
@@ -254,7 +254,7 @@ Recording.prototype.toggleRecording = function (options, statusChangeHandler) {
254 254
     var self = this;
255 255
     logger.log("Toggle recording (old state, new state): ", oldState, newState);
256 256
     this.setRecording(newState,
257
-        function (state, url) {
257
+        function(state, url) {
258 258
             // If the state is undefined we're going to wait for presence
259 259
             // update.
260 260
             if (state && state !== oldState) {
@@ -262,7 +262,7 @@ Recording.prototype.toggleRecording = function (options, statusChangeHandler) {
262 262
                 self.url = url;
263 263
                 statusChangeHandler(state);
264 264
             }
265
-        }, function (error) {
265
+        }, function(error) {
266 266
             statusChangeHandler(Recording.status.FAILED, error);
267 267
         }, options);
268 268
 };
@@ -270,7 +270,7 @@ Recording.prototype.toggleRecording = function (options, statusChangeHandler) {
270 270
 /**
271 271
  * Returns true if the recording is supproted and false if not.
272 272
  */
273
-Recording.prototype.isSupported = function () {
273
+Recording.prototype.isSupported = function() {
274 274
     return this._isSupported;
275 275
 };
276 276
 
@@ -278,14 +278,14 @@ Recording.prototype.isSupported = function () {
278 278
  * Returns null if the recording is not supported, "on" if the recording started
279 279
  * and "off" if the recording is not started.
280 280
  */
281
-Recording.prototype.getState = function () {
281
+Recording.prototype.getState = function() {
282 282
     return this.state;
283 283
 };
284 284
 
285 285
 /**
286 286
  * Returns the url of the recorded video.
287 287
  */
288
-Recording.prototype.getURL = function () {
288
+Recording.prototype.getURL = function() {
289 289
     return this.url;
290 290
 };
291 291
 

+ 7
- 7
modules/xmpp/strophe.emuc.js Parādīt failu

@@ -17,7 +17,7 @@ class MucConnectionPlugin extends ConnectionPluginListenable {
17 17
         this.rooms = {};
18 18
     }
19 19
 
20
-    init (connection) {
20
+    init(connection) {
21 21
         super.init(connection);
22 22
         // add handlers (just once)
23 23
         this.connection.addHandler(this.onPresence.bind(this), null,
@@ -32,7 +32,7 @@ class MucConnectionPlugin extends ConnectionPluginListenable {
32 32
             'http://jitsi.org/jitmeet/audio', 'iq', 'set',null,null);
33 33
     }
34 34
 
35
-    createRoom (jid, password, options) {
35
+    createRoom(jid, password, options) {
36 36
         const roomJid = Strophe.getBareJidFromJid(jid);
37 37
         if (this.rooms[roomJid]) {
38 38
             const errmsg = "You are already in the room!";
@@ -46,13 +46,13 @@ class MucConnectionPlugin extends ConnectionPluginListenable {
46 46
         return this.rooms[roomJid];
47 47
     }
48 48
 
49
-    doLeave (jid) {
49
+    doLeave(jid) {
50 50
         this.eventEmitter.emit(
51 51
             XMPPEvents.EMUC_ROOM_REMOVED, this.rooms[jid]);
52 52
         delete this.rooms[jid];
53 53
     }
54 54
 
55
-    onPresence (pres) {
55
+    onPresence(pres) {
56 56
         const from = pres.getAttribute('from');
57 57
 
58 58
         // What is this for? A workaround for something?
@@ -76,7 +76,7 @@ class MucConnectionPlugin extends ConnectionPluginListenable {
76 76
         return true;
77 77
     }
78 78
 
79
-    onPresenceUnavailable (pres) {
79
+    onPresenceUnavailable(pres) {
80 80
         const from = pres.getAttribute('from');
81 81
         const room = this.rooms[Strophe.getBareJidFromJid(from)];
82 82
         if(!room) {
@@ -87,7 +87,7 @@ class MucConnectionPlugin extends ConnectionPluginListenable {
87 87
         return true;
88 88
     }
89 89
 
90
-    onPresenceError (pres) {
90
+    onPresenceError(pres) {
91 91
         const from = pres.getAttribute('from');
92 92
         const room = this.rooms[Strophe.getBareJidFromJid(from)];
93 93
         if(!room) {
@@ -98,7 +98,7 @@ class MucConnectionPlugin extends ConnectionPluginListenable {
98 98
         return true;
99 99
     }
100 100
 
101
-    onMessage (msg) {
101
+    onMessage(msg) {
102 102
         // FIXME: this is a hack. but jingle on muc makes nickchanges hard
103 103
         const from = msg.getAttribute('from');
104 104
         const room = this.rooms[Strophe.getBareJidFromJid(from)];

+ 5
- 5
modules/xmpp/strophe.jingle.js Parādīt failu

@@ -24,13 +24,13 @@ class JingleConnectionPlugin extends ConnectionPlugin {
24 24
         };
25 25
     }
26 26
 
27
-    init (connection) {
27
+    init(connection) {
28 28
         super.init(connection);
29 29
         this.connection.addHandler(this.onJingle.bind(this),
30 30
             'urn:xmpp:jingle:1', 'iq', 'set', null, null);
31 31
     }
32 32
 
33
-    onJingle (iq) {
33
+    onJingle(iq) {
34 34
         const sid = $(iq).find('jingle').attr('sid');
35 35
         const action = $(iq).find('jingle').attr('action');
36 36
         const fromJid = iq.getAttribute('from');
@@ -154,7 +154,7 @@ class JingleConnectionPlugin extends ConnectionPlugin {
154 154
         return true;
155 155
     }
156 156
 
157
-    terminate (sid, reasonCondition, reasonText) {
157
+    terminate(sid, reasonCondition, reasonText) {
158 158
         if (this.sessions.hasOwnProperty(sid)) {
159 159
             if (this.sessions[sid].state != 'ended') {
160 160
                 this.sessions[sid].onTerminated(reasonCondition, reasonText);
@@ -163,7 +163,7 @@ class JingleConnectionPlugin extends ConnectionPlugin {
163 163
         }
164 164
     }
165 165
 
166
-    getStunAndTurnCredentials () {
166
+    getStunAndTurnCredentials() {
167 167
         // get stun and turn configuration from server via xep-0215
168 168
         // uses time-limited credentials as described in
169 169
         // http://tools.ietf.org/html/draft-uberti-behave-turn-rest-00
@@ -239,7 +239,7 @@ class JingleConnectionPlugin extends ConnectionPlugin {
239 239
     /**
240 240
      * Returns the data saved in 'updateLog' in a format to be logged.
241 241
      */
242
-    getLog () {
242
+    getLog() {
243 243
         const data = {};
244 244
         Object.keys(this.sessions).forEach(sid => {
245 245
             const session = this.sessions[sid];

+ 4
- 4
modules/xmpp/strophe.logger.js Parādīt failu

@@ -10,21 +10,21 @@ class StropheLogger extends ConnectionPlugin {
10 10
         this.log = [];
11 11
     }
12 12
 
13
-    init (connection) {
13
+    init(connection) {
14 14
         super.init(connection);
15 15
         this.connection.rawInput = this.log_incoming.bind(this);
16 16
         this.connection.rawOutput = this.log_outgoing.bind(this);
17 17
     }
18 18
 
19
-    log_incoming (stanza) {
19
+    log_incoming(stanza) {
20 20
         this.log.push([new Date().getTime(), 'incoming', stanza]);
21 21
     }
22 22
 
23
-    log_outgoing (stanza) {
23
+    log_outgoing(stanza) {
24 24
         this.log.push([new Date().getTime(), 'outgoing', stanza]);
25 25
     }
26 26
 }
27 27
 
28
-export default function () {
28
+export default function() {
29 29
     Strophe.addConnectionPlugin('logger', new StropheLogger());
30 30
 }

+ 6
- 6
modules/xmpp/strophe.ping.js Parādīt failu

@@ -41,7 +41,7 @@ class PingConnectionPlugin extends ConnectionPlugin {
41 41
      * Initializes the plugin. Method called by Strophe.
42 42
      * @param connection Strophe connection instance.
43 43
      */
44
-    init (connection) {
44
+    init(connection) {
45 45
         super.init(connection);
46 46
         Strophe.addNamespace('PING', "urn:xmpp:ping");
47 47
     }
@@ -55,7 +55,7 @@ class PingConnectionPlugin extends ConnectionPlugin {
55 55
      *        timeout <tt>error<//t> callback is called with undefined error
56 56
      *        argument.
57 57
      */
58
-    ping (jid, success, error, timeout) {
58
+    ping(jid, success, error, timeout) {
59 59
         const iq = $iq({type: 'get', to: jid});
60 60
         iq.c('ping', {xmlns: Strophe.NS.PING});
61 61
         this.connection.sendIQ(iq, success, error, timeout);
@@ -67,7 +67,7 @@ class PingConnectionPlugin extends ConnectionPlugin {
67 67
      * @param callback function with boolean argument which will be
68 68
      * <tt>true</tt> if XEP-0199 ping is supported by given <tt>jid</tt>
69 69
      */
70
-    hasPingSupport (jid, callback) {
70
+    hasPingSupport(jid, callback) {
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";
@@ -85,7 +85,7 @@ class PingConnectionPlugin extends ConnectionPlugin {
85 85
      * @param remoteJid remote JID to which ping requests will be sent to.
86 86
      * @param interval task interval in ms.
87 87
      */
88
-    startInterval (remoteJid, interval = PING_INTERVAL) {
88
+    startInterval(remoteJid, interval = PING_INTERVAL) {
89 89
         if (this.intervalId) {
90 90
             const errmsg = "Ping task scheduled already";
91 91
             GlobalOnErrorHandler.callErrorHandler(new Error(errmsg));
@@ -118,7 +118,7 @@ class PingConnectionPlugin extends ConnectionPlugin {
118 118
     /**
119 119
      * Stops current "ping"  interval task.
120 120
      */
121
-    stopInterval () {
121
+    stopInterval() {
122 122
         if (this.intervalId) {
123 123
             window.clearInterval(this.intervalId);
124 124
             this.intervalId = null;
@@ -128,6 +128,6 @@ class PingConnectionPlugin extends ConnectionPlugin {
128 128
     }
129 129
 }
130 130
 
131
-export default function (xmpp) {
131
+export default function(xmpp) {
132 132
     Strophe.addConnectionPlugin('ping', new PingConnectionPlugin(xmpp));
133 133
 }

+ 4
- 4
modules/xmpp/strophe.rayo.js Parādīt failu

@@ -7,18 +7,18 @@ import ConnectionPlugin from "./ConnectionPlugin";
7 7
 const RAYO_XMLNS = 'urn:xmpp:rayo:1';
8 8
 
9 9
 class RayoConnectionPlugin extends ConnectionPlugin {
10
-    init (connection) {
10
+    init(connection) {
11 11
         super.init(connection);
12 12
 
13 13
         this.connection.addHandler(
14 14
             this.onRayo.bind(this), RAYO_XMLNS, 'iq', 'set', null, null);
15 15
     }
16 16
 
17
-    onRayo (iq) {
17
+    onRayo(iq) {
18 18
         logger.info("Rayo IQ", iq);
19 19
     }
20 20
 
21
-    dial (to, from, roomName, roomPass, focusMucJid) {
21
+    dial(to, from, roomName, roomPass, focusMucJid) {
22 22
         return new Promise((resolve, reject) => {
23 23
             if(!focusMucJid) {
24 24
                 reject(new Error("Internal error!"));
@@ -60,7 +60,7 @@ class RayoConnectionPlugin extends ConnectionPlugin {
60 60
         });
61 61
     }
62 62
 
63
-    hangup () {
63
+    hangup() {
64 64
         return new Promise((resolve, reject) => {
65 65
             if (!this.call_resource) {
66 66
                 reject(new Error("No call in progress"));

+ 4
- 4
modules/xmpp/strophe.util.js Parādīt failu

@@ -40,9 +40,9 @@ const resetLastErrorStatusRegExpr = /request id \d+.\d+ got 200/;
40 40
 const lastErrorStatusRegExpr
41 41
     = /request errored, status: (\d+), number of errors: \d+/;
42 42
 
43
-export default function () {
43
+export default function() {
44 44
 
45
-    Strophe.log = function (level, msg) {
45
+    Strophe.log = function(level, msg) {
46 46
         // Our global handler reports uncaught errors to the stats which may
47 47
         // interpret those as partial call failure.
48 48
         // Strophe log entry about secondary request timeout does not mean that
@@ -90,11 +90,11 @@ export default function () {
90 90
      * @return {number} HTTP error code, '0' for unknown or "god knows what"
91 91
      * (this is a hack).
92 92
      */
93
-    Strophe.getLastErrorStatus = function () {
93
+    Strophe.getLastErrorStatus = function() {
94 94
         return lastErrorStatus;
95 95
     };
96 96
 
97
-    Strophe.getStatusString = function (status) {
97
+    Strophe.getStatusString = function(status) {
98 98
         switch (status) {
99 99
         case Strophe.Status.ERROR:
100 100
             return "ERROR";

+ 15
- 15
modules/xmpp/xmpp.js Parādīt failu

@@ -55,7 +55,7 @@ export default class XMPP extends Listenable {
55 55
     /**
56 56
      * Initializes the list of feature advertised through the disco-info mechanism
57 57
      */
58
-    initFeaturesList () {
58
+    initFeaturesList() {
59 59
         // http://xmpp.org/extensions/xep-0167.html#support
60 60
         // http://xmpp.org/extensions/xep-0176.html#support
61 61
         this.caps.addFeature('urn:xmpp:jingle:1');
@@ -92,7 +92,7 @@ export default class XMPP extends Listenable {
92 92
         }
93 93
     }
94 94
 
95
-    getConnection () {
95
+    getConnection() {
96 96
         return this.connection; 
97 97
     }
98 98
 
@@ -102,7 +102,7 @@ export default class XMPP extends Listenable {
102 102
      * @status the connection status
103 103
      * @msg message
104 104
      */
105
-    connectionHandler (password, status, msg) {
105
+    connectionHandler(password, status, msg) {
106 106
         const now = window.performance.now();
107 107
         const statusStr = Strophe.getStatusString(status).toLowerCase();
108 108
         this.connectionTimes[statusStr] = now;
@@ -120,7 +120,7 @@ export default class XMPP extends Listenable {
120 120
             var pingJid = this.connection.domain;
121 121
             this.connection.ping.hasPingSupport(
122 122
                 pingJid,
123
-                function (hasPing) {
123
+                function(hasPing) {
124 124
                     if (hasPing) {
125 125
                         this.connection.ping.startInterval(pingJid);
126 126
                     } else {
@@ -194,7 +194,7 @@ export default class XMPP extends Listenable {
194 194
         }
195 195
     }
196 196
 
197
-    _connect (jid, password) {
197
+    _connect(jid, password) {
198 198
         // connection.connect() starts the connection process.
199 199
         //
200 200
         // As the connection process proceeds, the user supplied callback will
@@ -236,7 +236,7 @@ export default class XMPP extends Listenable {
236 236
      *
237 237
      * @param options {object} connecting options - rid, sid, jid and password.
238 238
      */
239
-    attach (options) {
239
+    attach(options) {
240 240
         const now = this.connectionTimes["attaching"] = window.performance.now();
241 241
         logger.log("(TIME) Strophe Attaching\t:" + now);
242 242
         this.connection.attach(options.jid, options.sid,
@@ -244,7 +244,7 @@ export default class XMPP extends Listenable {
244 244
             this.connectionHandler.bind(this, options.password));
245 245
     }
246 246
 
247
-    connect (jid, password) {
247
+    connect(jid, password) {
248 248
         this.connectParams = {
249 249
             jid,
250 250
             password
@@ -265,7 +265,7 @@ export default class XMPP extends Listenable {
265 265
         return this._connect(jid, password);
266 266
     }
267 267
 
268
-    createRoom (roomName, options) {
268
+    createRoom(roomName, options) {
269 269
         // By default MUC nickname is the resource part of the JID
270 270
         let mucNickname = Strophe.getNodeFromJid(this.connection.jid);
271 271
         let roomjid = roomName + "@" + this.options.hosts.muc + "/";
@@ -294,7 +294,7 @@ export default class XMPP extends Listenable {
294 294
      * Returns the logs from strophe.jingle.
295 295
      * @returns {Object}
296 296
      */
297
-    getJingleLog () {
297
+    getJingleLog() {
298 298
         const jingle = this.connection.jingle;
299 299
         return jingle ? jingle.getLog() : {};
300 300
     }
@@ -302,23 +302,23 @@ export default class XMPP extends Listenable {
302 302
     /**
303 303
      * Returns the logs from strophe.
304 304
      */
305
-    getXmppLog () {
305
+    getXmppLog() {
306 306
         return (this.connection.logger || {}).log || null;
307 307
     }
308 308
 
309
-    dial (to, from, roomName,roomPass) {
309
+    dial(to, from, roomName,roomPass) {
310 310
         this.connection.rayo.dial(to, from, roomName,roomPass);
311 311
     }
312 312
 
313
-    setMute (jid, mute) {
313
+    setMute(jid, mute) {
314 314
         this.connection.moderate.setMute(jid, mute);
315 315
     }
316 316
 
317
-    eject (jid) {
317
+    eject(jid) {
318 318
         this.connection.moderate.eject(jid);
319 319
     }
320 320
 
321
-    getSessions () {
321
+    getSessions() {
322 322
         return this.connection.jingle.sessions;
323 323
     }
324 324
 
@@ -328,7 +328,7 @@ export default class XMPP extends Listenable {
328 328
      * @param ev optionally, the event which triggered the necessity to disconnect
329 329
      * from the XMPP server (e.g. beforeunload, unload)
330 330
      */
331
-    disconnect (ev) {
331
+    disconnect(ev) {
332 332
         if (this.disconnectInProgress
333 333
                 || !this.connection
334 334
                 || !this.connection.connected) {

+ 2
- 2
service/RTC/SignalingLayer.js Parādīt failu

@@ -20,7 +20,7 @@ export default class SignalingLayer {
20 20
      * @param {string} ssrc a string representation of the SSRC number.
21 21
      * @return {string|null} the endpoint ID for given media SSRC.
22 22
      */
23
-    getSSRCOwner (ssrc) { // eslint-disable-line no-unused-vars
23
+    getSSRCOwner(ssrc) { // eslint-disable-line no-unused-vars
24 24
         throw new Error('not implemented');
25 25
     }
26 26
     /**
@@ -34,7 +34,7 @@ export default class SignalingLayer {
34 34
      * info or <tt>null</tt> either if there is no presence available for given
35 35
      * JID or if the media type given is invalid.
36 36
      */
37
-    getPeerMediaInfo (owner, mediaType) { // eslint-disable-line no-unused-vars
37
+    getPeerMediaInfo(owner, mediaType) { // eslint-disable-line no-unused-vars
38 38
         throw new Error('not implemented');
39 39
     }
40 40
 }

Notiek ielāde…
Atcelt
Saglabāt