Просмотр исходного кода

[eslint] lines-around-comment

master
Lyubo Marinov 8 лет назад
Родитель
Сommit
068f290835
56 измененных файлов: 405 добавлений и 0 удалений
  1. 9
    0
      .eslintrc.js
  2. 19
    0
      JitsiConference.js
  3. 15
    0
      JitsiConferenceErrors.js
  4. 2
    0
      JitsiConferenceEventManager.js
  5. 35
    0
      JitsiConferenceEvents.js
  6. 4
    0
      JitsiConnectionErrors.js
  7. 3
    0
      JitsiConnectionEvents.js
  8. 8
    0
      JitsiMediaDevices.js
  9. 1
    0
      JitsiMediaDevicesEvents.js
  10. 9
    0
      JitsiMeetJS.js
  11. 12
    0
      JitsiTrackErrors.js
  12. 4
    0
      JitsiTrackEvents.js
  13. 7
    0
      doc/example/example.js
  14. 3
    0
      modules/RTC/DataChannels.js
  15. 2
    0
      modules/RTC/JitsiLocalTrack.js
  16. 2
    0
      modules/RTC/JitsiRemoteTrack.js
  17. 5
    0
      modules/RTC/RTC.js
  18. 3
    0
      modules/RTC/RTCBrowserType.js
  19. 2
    0
      modules/RTC/RTCUIHelper.js
  20. 16
    0
      modules/RTC/RTCUtils.js
  21. 5
    0
      modules/RTC/ScreenObtainer.js
  22. 19
    0
      modules/RTC/TraceablePeerConnection.js
  23. 1
    0
      modules/connectivity/ConnectionQuality.js
  24. 4
    0
      modules/connectivity/ParticipantConnectionStatus.js
  25. 1
    0
      modules/statistics/AnalyticsAdapter.js
  26. 2
    0
      modules/statistics/CallStats.js
  27. 4
    0
      modules/statistics/RTPStatsCollector.js
  28. 4
    0
      modules/statistics/statistics.js
  29. 16
    0
      modules/transcription/audioRecorder.js
  30. 21
    0
      modules/transcription/transcriber.js
  31. 6
    0
      modules/transcription/transcriptionServices/SphinxTranscriptionService.js
  32. 2
    0
      modules/util/EventEmitterForwarder.js
  33. 2
    0
      modules/util/GlobalOnErrorHandler.js
  34. 1
    0
      modules/util/Listenable.js
  35. 1
    0
      modules/util/RandomUtil.js
  36. 2
    0
      modules/version/ComponentsVersions.js
  37. 6
    0
      modules/xmpp/ChatRoom.js
  38. 23
    0
      modules/xmpp/JingleSessionPC.js
  39. 4
    0
      modules/xmpp/RtxModifier.js
  40. 8
    0
      modules/xmpp/RtxModifier.spec.js
  41. 13
    0
      modules/xmpp/SDP.js
  42. 3
    0
      modules/xmpp/SDPDiffer.js
  43. 8
    0
      modules/xmpp/SDPUtil.js
  44. 4
    0
      modules/xmpp/SampleSdpStrings.js
  45. 1
    0
      modules/xmpp/SdpTransformUtil.js
  46. 17
    0
      modules/xmpp/moderator.js
  47. 1
    0
      modules/xmpp/strophe.emuc.js
  48. 6
    0
      modules/xmpp/strophe.jingle.js
  49. 1
    0
      modules/xmpp/strophe.ping.js
  50. 2
    0
      modules/xmpp/strophe.util.js
  51. 3
    0
      modules/xmpp/xmpp.js
  52. 9
    0
      service/RTC/RTCEvents.js
  53. 2
    0
      service/RTC/Resolutions.js
  54. 1
    0
      service/RTC/SignalingLayer.js
  55. 1
    0
      service/RTC/VideoType.js
  56. 40
    0
      service/xmpp/XMPPEvents.js

+ 9
- 0
.eslintrc.js Просмотреть файл

@@ -169,6 +169,15 @@ module.exports = {
169 169
         'key-spacing': 2,
170 170
         'keyword-spacing': 2,
171 171
         'linebreak-style': [ 'error', 'unix' ],
172
+        'lines-around-comment': [
173
+            'error',
174
+            {
175
+                'allowBlockStart': true,
176
+                'allowObjectStart': true,
177
+                'beforeBlockComment': true,
178
+                'beforeLineComment': true
179
+            }
180
+        ],
172 181
         'max-lines': 0,
173 182
         'max-nested-callbacks': 2,
174 183
         'max-statements': 0,

+ 19
- 0
JitsiConference.js Просмотреть файл

@@ -50,6 +50,7 @@ function JitsiConference(options) {
50 50
     this._init(options);
51 51
     this.componentsVersions = new ComponentsVersions(this);
52 52
     this.participants = {};
53
+
53 54
     /**
54 55
      * Jingle Session instance
55 56
      * @type {JingleSessionPC}
@@ -70,6 +71,7 @@ function JitsiConference(options) {
70 71
         video: undefined
71 72
     };
72 73
     this.isMutedByFocus = false;
74
+
73 75
     // Flag indicates if the 'onCallEnded' method was ever called on this
74 76
     // instance. Used to log extra analytics event for debugging purpose.
75 77
     // We need to know if the potential issue happened before or after
@@ -106,6 +108,7 @@ JitsiConference.prototype._init = function(options) {
106 108
     if (options.connection) {
107 109
         this.connection = options.connection;
108 110
         this.xmpp = this.connection.xmpp;
111
+
109 112
         // Setup XMPP events only if we have new connection object.
110 113
         this.eventManager.setupXMPPListeners();
111 114
     }
@@ -198,6 +201,7 @@ JitsiConference.prototype.leave = function() {
198 201
             // ChatRoom instance.
199 202
             this.getParticipants().forEach(
200 203
                 participant => this.onMemberLeft(participant.getJid()));
204
+
201 205
             // Close the JingleSession
202 206
             if (this.jingleSession) {
203 207
                 this.jingleSession.close();
@@ -427,12 +431,14 @@ JitsiConference.prototype.setSubject = function(subject) {
427 431
 JitsiConference.prototype.getTranscriber = function() {
428 432
     if (this.transcriber === undefined) {
429 433
         this.transcriber = new Transcriber();
434
+
430 435
         // add all existing local audio tracks to the transcriber
431 436
         const localAudioTracks = this.getLocalTracks(MediaType.AUDIO);
432 437
 
433 438
         for (const localAudio of localAudioTracks) {
434 439
             this.transcriber.addTrack(localAudio);
435 440
         }
441
+
436 442
         // and all remote audio tracks
437 443
         const remoteAudioTracks = this.rtc.getRemoteTracks(MediaType.AUDIO);
438 444
 
@@ -490,6 +496,7 @@ JitsiConference.prototype._fireMuteChangeEvent = function(track) {
490 496
     // check if track was muted by focus and now is unmuted by user
491 497
     if (this.isMutedByFocus && track.isAudioTrack() && !track.isMuted()) {
492 498
         this.isMutedByFocus = false;
499
+
493 500
         // unmute local user on server
494 501
         this.room.muteParticipant(this.room.myroomjid, false);
495 502
     }
@@ -553,6 +560,7 @@ JitsiConference.prototype.replaceTrack = function(oldTrack, newTrack) {
553 560
             return Promise.reject(
554 561
                 new JitsiTrackError(JitsiTrackErrors.TRACK_IS_DISPOSED));
555 562
         }
563
+
556 564
         // Set up the ssrcHandler for the new track before we add it at the lower levels
557 565
         newTrack.ssrcHandler = function(conference, ssrcMap) {
558 566
             const trackSSRCInfo = ssrcMap.get(this.getMSID());
@@ -1068,10 +1076,12 @@ JitsiConference.prototype.onIncomingCall
1068 1076
     // Accept incoming call
1069 1077
     this.jingleSession = jingleSession;
1070 1078
     this.room.connectionTimes['session.initiate'] = now;
1079
+
1071 1080
     // Log "session.restart"
1072 1081
     if (this.wasStopped) {
1073 1082
         Statistics.sendEventToAll('session.restart');
1074 1083
     }
1084
+
1075 1085
     // add info whether call is cross-region
1076 1086
     let crossRegion = null;
1077 1087
 
@@ -1090,9 +1100,11 @@ JitsiConference.prototype.onIncomingCall
1090 1100
     }
1091 1101
 
1092 1102
     this.rtc.initializeDataChannels(jingleSession.peerconnection);
1103
+
1093 1104
     // Add local Tracks to the ChatRoom
1094 1105
     this.getLocalTracks().forEach(localTrack => {
1095 1106
         let ssrcInfo = null;
1107
+
1096 1108
         /**
1097 1109
          * We don't do this for Firefox because, on Firefox, we keep the
1098 1110
          *  stream in the peer connection and just set 'enabled' on the
@@ -1145,6 +1157,7 @@ JitsiConference.prototype.onIncomingCall
1145 1157
             logger.error(e);
1146 1158
         }
1147 1159
     });
1160
+
1148 1161
     // Generate the 'recvonly' SSRC in case there are no video tracks
1149 1162
     if (!this.getLocalTracks(MediaType.VIDEO).length) {
1150 1163
         jingleSession.generateRecvonlySsrc();
@@ -1178,17 +1191,22 @@ JitsiConference.prototype.onCallEnded
1178 1191
 = function(JingleSession, reasonCondition, reasonText) {
1179 1192
     logger.info(`Call ended: ${reasonCondition} - ${reasonText}`);
1180 1193
     this.wasStopped = true;
1194
+
1181 1195
     // Send session.terminate event
1182 1196
     Statistics.sendEventToAll('session.terminate');
1197
+
1183 1198
     // Stop the stats
1184 1199
     if (this.statistics) {
1185 1200
         this.statistics.stopRemoteStats();
1186 1201
         this.statistics.stopCallStats();
1187 1202
     }
1203
+
1188 1204
     // Current JingleSession is invalid so set it to null on the room
1189 1205
     this.jingleSession = null;
1206
+
1190 1207
     // Let the RTC service do any cleanups
1191 1208
     this.rtc.onCallEnded();
1209
+
1192 1210
     // PeerConnection has been closed which means that SSRCs stored in
1193 1211
     // JitsiLocalTrack will not match those assigned by the old PeerConnection
1194 1212
     // and SSRC replacement logic will not work as expected.
@@ -1200,6 +1218,7 @@ JitsiConference.prototype.onCallEnded
1200 1218
     this.getLocalTracks().forEach(localTrack => {
1201 1219
         // Reset SSRC as it will no longer be valid
1202 1220
         localTrack._setSSRC(null);
1221
+
1203 1222
         // Bind the handler to fetch new SSRC, it will un register itself once
1204 1223
         // it reads the values
1205 1224
         self.rtc.addListener(

+ 15
- 0
JitsiConferenceErrors.js Просмотреть файл

@@ -6,65 +6,80 @@
6 6
  * Indicates that client must be authenticated to create the conference.
7 7
  */
8 8
 export const AUTHENTICATION_REQUIRED = 'conference.authenticationRequired';
9
+
9 10
 /**
10 11
  * Indicates that chat error occurred.
11 12
  */
12 13
 export const CHAT_ERROR = 'conference.chatError';
14
+
13 15
 /**
14 16
  * Indicates that conference has been destroyed.
15 17
  */
16 18
 export const CONFERENCE_DESTROYED = 'conference.destroyed';
19
+
17 20
 /**
18 21
  * Indicates that max users limit has been reached.
19 22
  */
20 23
 export const CONFERENCE_MAX_USERS = 'conference.max_users';
24
+
21 25
 /**
22 26
  * Indicates that a connection error occurred when trying to join a conference.
23 27
  */
24 28
 export const CONNECTION_ERROR = 'conference.connectionError';
29
+
25 30
 /**
26 31
  * Indicates that a connection error is due to not allowed,
27 32
  * occurred when trying to join a conference.
28 33
  */
29 34
 export const NOT_ALLOWED_ERROR = 'conference.connectionError.notAllowed';
35
+
30 36
 /**
31 37
  * Indicates that focus error happened.
32 38
  */
33 39
 export const FOCUS_DISCONNECTED = 'conference.focusDisconnected';
40
+
34 41
 /**
35 42
  * Indicates that focus left the conference.
36 43
  */
37 44
 export const FOCUS_LEFT = 'conference.focusLeft';
45
+
38 46
 /**
39 47
  * Indicates that graceful shutdown happened.
40 48
  */
41 49
 export const GRACEFUL_SHUTDOWN = 'conference.gracefulShutdown';
50
+
42 51
 /**
43 52
  * Indicates that the versions of the server side components are incompatible
44 53
  * with the client side.
45 54
  */
46 55
 export const INCOMPATIBLE_SERVER_VERSIONS
47 56
     = 'conference.incompatible_server_versions';
57
+
48 58
 /**
49 59
  * Indicates that jingle fatal error happened.
50 60
  */
51 61
 export const JINGLE_FATAL_ERROR = 'conference.jingleFatalError';
62
+
52 63
 /**
53 64
  * Indicates that password cannot be set for this conference.
54 65
  */
55 66
 export const PASSWORD_NOT_SUPPORTED = 'conference.passwordNotSupported';
67
+
56 68
 /**
57 69
  * Indicates that a password is required in order to join the conference.
58 70
  */
59 71
 export const PASSWORD_REQUIRED = 'conference.passwordRequired';
72
+
60 73
 /**
61 74
  * Indicates that reservation system returned error.
62 75
  */
63 76
 export const RESERVATION_ERROR = 'conference.reservationError';
77
+
64 78
 /**
65 79
  * Indicates that the conference setup failed.
66 80
  */
67 81
 export const SETUP_FAILED = 'conference.setup_failed';
82
+
68 83
 /**
69 84
  * Indicates that there is no available videobridge.
70 85
  */

+ 2
- 0
JitsiConferenceEventManager.js Просмотреть файл

@@ -66,6 +66,7 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function() {
66 66
 
67 67
     this.chatRoomForwarder.forward(XMPPEvents.MUC_JOINED,
68 68
         JitsiConferenceEvents.CONFERENCE_JOINED);
69
+
69 70
     // send some analytics events
70 71
     chatRoom.addListener(XMPPEvents.MUC_JOINED,
71 72
         () => {
@@ -554,6 +555,7 @@ JitsiConferenceEventManager.prototype.setupStatisticsListeners = function() {
554 555
 
555 556
         conference.rtc.setAudioLevel(resource, level);
556 557
     });
558
+
557 559
     // Forward the "before stats disposed" event
558 560
     conference.statistics.addBeforeDisposedListener(() => {
559 561
         conference.eventEmitter.emit(

+ 35
- 0
JitsiConferenceEvents.js Просмотреть файл

@@ -6,10 +6,12 @@
6 6
  * Indicates that authentication status changed.
7 7
  */
8 8
 export const AUTH_STATUS_CHANGED = 'conference.auth_status_changed';
9
+
9 10
 /**
10 11
  * Indicates that available devices changed.
11 12
  */
12 13
 export const AVAILABLE_DEVICES_CHANGED = 'conference.availableDevicesChanged';
14
+
13 15
 /**
14 16
  * A participant avatar has changed.
15 17
  */
@@ -26,70 +28,86 @@ export const BEFORE_STATISTICS_DISPOSED = 'conference.beforeStatisticsDisposed';
26 28
  * Indicates that an error occured.
27 29
  */
28 30
 export const CONFERENCE_ERROR = 'conference.error';
31
+
29 32
 /**
30 33
  * Indicates that conference failed.
31 34
  */
32 35
 export const CONFERENCE_FAILED = 'conference.failed';
36
+
33 37
 /**
34 38
  * Indicates that conference has been joined. The event does NOT provide any
35 39
  * parameters to its listeners.
36 40
  */
37 41
 export const CONFERENCE_JOINED = 'conference.joined';
42
+
38 43
 /**
39 44
  * Indicates that conference has been left.
40 45
  */
41 46
 export const CONFERENCE_LEFT = 'conference.left';
47
+
42 48
 /**
43 49
  * Indicates that the connection to the conference has been interrupted for some
44 50
  * reason.
45 51
  */
46 52
 export const CONNECTION_INTERRUPTED = 'conference.connectionInterrupted';
53
+
47 54
 /**
48 55
  * Indicates that the connection to the conference has been restored.
49 56
  */
50 57
 export const CONNECTION_RESTORED = 'conference.connectionRestored';
58
+
51 59
 /**
52 60
  * New local connection statistics are received.
53 61
  * @deprecated Use ConnectionQualityEvents.LOCAL_STATS_UPDATED instead.
54 62
  */
55 63
 export const CONNECTION_STATS = 'conference.connectionStats';
64
+
56 65
 /**
57 66
  * A user has changed it display name
58 67
  */
59 68
 export const DISPLAY_NAME_CHANGED = 'conference.displayNameChanged';
69
+
60 70
 /**
61 71
  * The dominant speaker was changed.
62 72
  */
63 73
 export const DOMINANT_SPEAKER_CHANGED = 'conference.dominantSpeaker';
74
+
64 75
 /**
65 76
  * Indicates that DTMF support changed.
66 77
  */
67 78
 export const DTMF_SUPPORT_CHANGED = 'conference.dtmfSupportChanged';
79
+
68 80
 /**
69 81
  * Indicates that a message from another participant is received on data
70 82
  * channel.
71 83
  */
72 84
 export const ENDPOINT_MESSAGE_RECEIVED = 'conference.endpoint_message_received';
85
+
73 86
 /**
74 87
  * You are included / excluded in somebody's last N set
75 88
  */
76 89
 export const IN_LAST_N_CHANGED = 'conference.inLastNChanged';
90
+
77 91
 /**
78 92
  * You are kicked from the conference.
79 93
  */
80 94
 export const KICKED = 'conferenece.kicked';
95
+
81 96
 /**
82 97
  * The Last N set is changed.
83 98
  */
84 99
 export const LAST_N_ENDPOINTS_CHANGED = 'conference.lastNEndpointsChanged';
100
+
85 101
 /**
86 102
  * Indicates that the room has been locked or unlocked.
87 103
  */
88 104
 export const LOCK_STATE_CHANGED = 'conference.lock_state_changed';
105
+
89 106
 /**
90 107
  * New text message was received.
91 108
  */
92 109
 export const MESSAGE_RECEIVED = 'conference.messageReceived';
110
+
93 111
 /**
94 112
  * Event fired when JVB sends notification about interrupted/restored user's
95 113
  * ICE connection status. First argument is the ID of the participant and
@@ -100,46 +118,56 @@ export const MESSAGE_RECEIVED = 'conference.messageReceived';
100 118
  */
101 119
 export const PARTICIPANT_CONN_STATUS_CHANGED
102 120
     = 'conference.participant_conn_status_changed';
121
+
103 122
 /**
104 123
  * Indicates that the features of the participant has been changed.
105 124
  */
106 125
 export const PARTCIPANT_FEATURES_CHANGED
107 126
     = 'conference.partcipant_features_changed';
127
+
108 128
 /**
109 129
  * Indicates that a the value of a specific property of a specific participant
110 130
  * has changed.
111 131
  */
112 132
 export const PARTICIPANT_PROPERTY_CHANGED
113 133
     = 'conference.participant_property_changed';
134
+
114 135
 /**
115 136
  * Indicates that phone number changed.
116 137
  */
117 138
 export const PHONE_NUMBER_CHANGED = 'conference.phoneNumberChanged';
139
+
118 140
 /**
119 141
  * Indicates that recording state changed.
120 142
  */
121 143
 export const RECORDER_STATE_CHANGED = 'conference.recorderStateChanged';
144
+
122 145
 /**
123 146
  * Indicates that start muted settings changed.
124 147
  */
125 148
 export const START_MUTED_POLICY_CHANGED
126 149
     = 'conference.start_muted_policy_changed';
150
+
127 151
 /**
128 152
  * Indicates that the local user has started muted.
129 153
  */
130 154
 export const STARTED_MUTED = 'conference.started_muted';
155
+
131 156
 /**
132 157
  * Indicates that subject of the conference has changed.
133 158
  */
134 159
 export const SUBJECT_CHANGED = 'conference.subjectChanged';
160
+
135 161
 /**
136 162
  * Indicates that DTMF support changed.
137 163
  */
138 164
 export const SUSPEND_DETECTED = 'conference.suspendDetected';
165
+
139 166
 /**
140 167
  * Event indicates that local user is talking while he muted himself
141 168
  */
142 169
 export const TALK_WHILE_MUTED = 'conference.talk_while_muted';
170
+
143 171
 /**
144 172
  * A new media track was added to the conference. The event provides the
145 173
  * following parameters to its listeners:
@@ -147,14 +175,17 @@ export const TALK_WHILE_MUTED = 'conference.talk_while_muted';
147 175
  * @param {JitsiTrack} track the added JitsiTrack
148 176
  */
149 177
 export const TRACK_ADDED = 'conference.trackAdded';
178
+
150 179
 /**
151 180
  * Audio levels of a media track ( attached to the conference) was changed.
152 181
  */
153 182
 export const TRACK_AUDIO_LEVEL_CHANGED = 'conference.audioLevelsChanged';
183
+
154 184
 /**
155 185
  * A media track ( attached to the conference) mute status was changed.
156 186
  */
157 187
 export const TRACK_MUTE_CHANGED = 'conference.trackMuteChanged';
188
+
158 189
 /**
159 190
  * The media track was removed from the conference. The event provides the
160 191
  * following parameters to its listeners:
@@ -162,18 +193,22 @@ export const TRACK_MUTE_CHANGED = 'conference.trackMuteChanged';
162 193
  * @param {JitsiTrack} track the removed JitsiTrack
163 194
  */
164 195
 export const TRACK_REMOVED = 'conference.trackRemoved';
196
+
165 197
 /**
166 198
  * A new user joinned the conference.
167 199
  */
168 200
 export const USER_JOINED = 'conference.userJoined';
201
+
169 202
 /**
170 203
  * A user has left the conference.
171 204
  */
172 205
 export const USER_LEFT = 'conference.userLeft';
206
+
173 207
 /**
174 208
  * User role changed.
175 209
  */
176 210
 export const USER_ROLE_CHANGED = 'conference.roleChanged';
211
+
177 212
 /**
178 213
  * User status changed.
179 214
  */

+ 4
- 0
JitsiConnectionErrors.js Просмотреть файл

@@ -14,18 +14,22 @@
14 14
  * case as long as the service is configured correctly (there is no bug).
15 15
  */
16 16
 export const CONNECTION_DROPPED_ERROR = 'connection.droppedError';
17
+
17 18
 /**
18 19
  * Indicates that a connection error occurred when trying to join a conference.
19 20
  */
20 21
 export const CONNECTION_ERROR = 'connection.connectionError';
22
+
21 23
 /**
22 24
  * Not specified errors.
23 25
  */
24 26
 export const OTHER_ERROR = 'connection.otherError';
27
+
25 28
 /**
26 29
  * Indicates that a password is required in order to join the conference.
27 30
  */
28 31
 export const PASSWORD_REQUIRED = 'connection.passwordRequired';
32
+
29 33
 /**
30 34
  * Indicates that the connection was dropped, because of too many 5xx HTTP
31 35
  * errors on BOSH requests.

+ 3
- 0
JitsiConnectionEvents.js Просмотреть файл

@@ -10,6 +10,7 @@
10 10
  * last (known) error message
11 11
  */
12 12
 export const CONNECTION_DISCONNECTED = 'connection.connectionDisconnected';
13
+
13 14
 /**
14 15
  * Indicates that the connection has been established. The event provides
15 16
  * the following parameters to its listeners:
@@ -18,6 +19,7 @@ export const CONNECTION_DISCONNECTED = 'connection.connectionDisconnected';
18 19
  * the context of the established connection)
19 20
  */
20 21
 export const CONNECTION_ESTABLISHED = 'connection.connectionEstablished';
22
+
21 23
 /**
22 24
  * Indicates that the connection has been failed for some reason. The event
23 25
  * provides the following parameters to its listeners:
@@ -25,6 +27,7 @@ export const CONNECTION_ESTABLISHED = 'connection.connectionEstablished';
25 27
  * @param err {string} the error (message) associated with the failure
26 28
  */
27 29
 export const CONNECTION_FAILED = 'connection.connectionFailed';
30
+
28 31
 /**
29 32
  * Indicates that the performed action cannot be executed because the
30 33
  * connection is not in the correct state(connected, disconnected, etc.)

+ 8
- 0
JitsiMediaDevices.js Просмотреть файл

@@ -46,6 +46,7 @@ const JitsiMediaDevices = {
46 46
     enumerateDevices(callback) {
47 47
         RTC.enumerateDevices(callback);
48 48
     },
49
+
49 50
     /**
50 51
      * Checks if its possible to enumerate available cameras/micropones.
51 52
      * @returns {Promise<boolean>} a Promise which will be resolved only once
@@ -55,6 +56,7 @@ const JitsiMediaDevices = {
55 56
     isDeviceListAvailable() {
56 57
         return RTC.isDeviceListAvailable();
57 58
     },
59
+
58 60
     /**
59 61
      * Returns true if changing the input (camera / microphone) or output
60 62
      * (audio) device is supported and false if not.
@@ -65,6 +67,7 @@ const JitsiMediaDevices = {
65 67
     isDeviceChangeAvailable(deviceType) {
66 68
         return RTC.isDeviceChangeAvailable(deviceType);
67 69
     },
70
+
68 71
     /**
69 72
      * Returns true if user granted permission to media devices.
70 73
      * @param {'audio'|'video'} [type] - type of devices to check,
@@ -83,6 +86,7 @@ const JitsiMediaDevices = {
83 86
             return permissions.video === true && permissions.audio === true;
84 87
         }
85 88
     },
89
+
86 90
     /**
87 91
      * Returns currently used audio output device id, 'default' stands
88 92
      * for default device
@@ -91,6 +95,7 @@ const JitsiMediaDevices = {
91 95
     getAudioOutputDevice() {
92 96
         return RTC.getAudioOutputDevice();
93 97
     },
98
+
94 99
     /**
95 100
      * Sets current audio output device.
96 101
      * @param {string} deviceId - id of 'audiooutput' device from
@@ -112,6 +117,7 @@ const JitsiMediaDevices = {
112 117
 
113 118
         return RTC.setAudioOutputDevice(deviceId);
114 119
     },
120
+
115 121
     /**
116 122
      * Adds an event handler.
117 123
      * @param {string} event - event name
@@ -120,6 +126,7 @@ const JitsiMediaDevices = {
120 126
     addEventListener(event, handler) {
121 127
         eventEmitter.addListener(event, handler);
122 128
     },
129
+
123 130
     /**
124 131
      * Removes event handler.
125 132
      * @param {string} event - event name
@@ -128,6 +135,7 @@ const JitsiMediaDevices = {
128 135
     removeEventListener(event, handler) {
129 136
         eventEmitter.removeListener(event, handler);
130 137
     },
138
+
131 139
     /**
132 140
      * Emits an event.
133 141
      * @param {string} event - event name

+ 1
- 0
JitsiMediaDevicesEvents.js Просмотреть файл

@@ -11,6 +11,7 @@
11 11
  *  @see https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo
12 12
  */
13 13
 export const DEVICE_LIST_CHANGED = 'mediaDevices.devicechange';
14
+
14 15
 /**
15 16
  * Indicates that the environment is currently showing permission prompt to
16 17
  * access camera and/or microphone. The event provides the following

+ 9
- 0
JitsiMeetJS.js Просмотреть файл

@@ -140,6 +140,7 @@ const LibJitsiMeet = {
140 140
 
141 141
         return RTC.init(options || {});
142 142
     },
143
+
143 144
     /**
144 145
      * Returns whether the desktop sharing is enabled or not.
145 146
      * @returns {boolean}
@@ -150,6 +151,7 @@ const LibJitsiMeet = {
150 151
     setLogLevel(level) {
151 152
         Logger.setLogLevel(level);
152 153
     },
154
+
153 155
     /**
154 156
      * Sets the log level to the <tt>Logger</tt> instance with given id.
155 157
      * @param {Logger.levels} level the logging level to be set
@@ -160,6 +162,7 @@ const LibJitsiMeet = {
160 162
     setLogLevelById(level, id) {
161 163
         Logger.setLogLevelById(level, id);
162 164
     },
165
+
163 166
     /**
164 167
      * Registers new global logger transport to the library logging framework.
165 168
      * @param globalTransport
@@ -168,6 +171,7 @@ const LibJitsiMeet = {
168 171
     addGlobalLogTransport(globalTransport) {
169 172
         Logger.addGlobalTransport(globalTransport);
170 173
     },
174
+
171 175
     /**
172 176
      * Removes global logging transport from the library logging framework.
173 177
      * @param globalTransport
@@ -176,6 +180,7 @@ const LibJitsiMeet = {
176 180
     removeGlobalLogTransport(globalTransport) {
177 181
         Logger.removeGlobalTransport(globalTransport);
178 182
     },
183
+
179 184
     /**
180 185
      * Creates the media tracks and returns them trough the callback.
181 186
      * @param options Object with properties / settings specifying the tracks which should be created.
@@ -339,6 +344,7 @@ const LibJitsiMeet = {
339 344
                 return Promise.reject(error);
340 345
             });
341 346
     },
347
+
342 348
     /**
343 349
      * Checks if its possible to enumerate available cameras/micropones.
344 350
      * @returns {Promise<boolean>} a Promise which will be resolved only once
@@ -352,6 +358,7 @@ const LibJitsiMeet = {
352 358
 
353 359
         return this.mediaDevices.isDeviceListAvailable();
354 360
     },
361
+
355 362
     /**
356 363
      * Returns true if changing the input (camera / microphone) or output
357 364
      * (audio) device is supported and false if not.
@@ -366,6 +373,7 @@ const LibJitsiMeet = {
366 373
 
367 374
         return this.mediaDevices.isDeviceChangeAvailable(deviceType);
368 375
     },
376
+
369 377
     /**
370 378
      * Executes callback with list of media devices connected.
371 379
      * @param {function} callback
@@ -376,6 +384,7 @@ const LibJitsiMeet = {
376 384
             + 'JitsiMeetJS.mediaDevices.enumerateDevices instead');
377 385
         this.mediaDevices.enumerateDevices(callback);
378 386
     },
387
+
379 388
     /**
380 389
      * @returns function that can be used to be attached to window.onerror and
381 390
      * if options.enableWindowOnErrorHandler is enabled returns

+ 12
- 0
JitsiTrackErrors.js Просмотреть файл

@@ -7,60 +7,72 @@
7 7
  */
8 8
 export const CHROME_EXTENSION_GENERIC_ERROR
9 9
     = 'gum.chrome_extension_generic_error';
10
+
10 11
 /**
11 12
  * An error which indicates that the jidesha extension for Chrome is
12 13
  * failed to install.
13 14
  */
14 15
 export const CHROME_EXTENSION_INSTALLATION_ERROR
15 16
     = 'gum.chrome_extension_installation_error';
17
+
16 18
 /**
17 19
  * An error which indicates that user canceled screen sharing window
18 20
  * selection dialog in jidesha extension for Chrome.
19 21
  */
20 22
 export const CHROME_EXTENSION_USER_CANCELED
21 23
     = 'gum.chrome_extension_user_canceled';
24
+
22 25
 /**
23 26
  * An error which indicates that some of requested constraints in
24 27
  * getUserMedia call were not satisfied.
25 28
  */
26 29
 export const CONSTRAINT_FAILED = 'gum.constraint_failed';
30
+
27 31
 /**
28 32
  * An error which indicates that the jidesha extension for Firefox is
29 33
  * needed to proceed with screen sharing, and that it is not installed.
30 34
  */
31 35
 export const FIREFOX_EXTENSION_NEEDED = 'gum.firefox_extension_needed';
36
+
32 37
 /**
33 38
  * Generic getUserMedia error.
34 39
  */
35 40
 export const GENERAL = 'gum.general';
41
+
36 42
 /**
37 43
  * An error which indicates that requested device was not found.
38 44
  */
39 45
 export const NOT_FOUND = 'gum.not_found';
46
+
40 47
 /**
41 48
  * An error which indicates that user denied permission to share requested
42 49
  * device.
43 50
  */
44 51
 export const PERMISSION_DENIED = 'gum.permission_denied';
52
+
45 53
 /**
46 54
  * An error which indicates that track has been already disposed and cannot
47 55
  * be longer used.
48 56
  */
49 57
 export const TRACK_IS_DISPOSED = 'track.track_is_disposed';
58
+
50 59
 /**
51 60
  * An error which indicates that track is currently in progress of muting or
52 61
  * unmuting itself.
53 62
  */
54 63
 export const TRACK_MUTE_UNMUTE_IN_PROGRESS = 'track.mute_unmute_inprogress';
64
+
55 65
 /**
56 66
  * An error which indicates that track has no MediaStream associated.
57 67
  */
58 68
 export const TRACK_NO_STREAM_FOUND = 'track.no_stream_found';
69
+
59 70
 /**
60 71
  * An error which indicates that requested video resolution is not supported
61 72
  * by a webcam.
62 73
  */
63 74
 export const UNSUPPORTED_RESOLUTION = 'gum.unsupported_resolution';
75
+
64 76
 /**
65 77
  * Indicates that the track is no receiving any data without reason(the
66 78
  * stream was stopped, etc)

+ 4
- 0
JitsiTrackEvents.js Просмотреть файл

@@ -2,6 +2,7 @@
2 2
  * The media track was removed to the conference.
3 3
  */
4 4
 export const LOCAL_TRACK_STOPPED = 'track.stopped';
5
+
5 6
 /**
6 7
  * Audio levels of a this track was changed.
7 8
  */
@@ -11,14 +12,17 @@ export const TRACK_AUDIO_LEVEL_CHANGED = 'track.audioLevelsChanged';
11 12
  * The audio output of the track was changed.
12 13
  */
13 14
 export const TRACK_AUDIO_OUTPUT_CHANGED = 'track.audioOutputChanged';
15
+
14 16
 /**
15 17
  * A media track mute status was changed.
16 18
  */
17 19
 export const TRACK_MUTE_CHANGED = 'track.trackMuteChanged';
20
+
18 21
 /**
19 22
  * The video type("camera" or "desktop") of the track was changed.
20 23
  */
21 24
 export const TRACK_VIDEOTYPE_CHANGED = 'track.videoTypeChanged';
25
+
22 26
 /**
23 27
  * Indicates that the track is no receiving any data without reason(the
24 28
  * stream was stopped, etc)

+ 7
- 0
doc/example/example.js Просмотреть файл

@@ -220,27 +220,34 @@ $(window).bind('unload', unload);
220 220
 // JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
221 221
 const initOptions = {
222 222
     disableAudioLevels: true,
223
+
223 224
     // The ID of the jidesha extension for Chrome.
224 225
     desktopSharingChromeExtId: 'mbocklcggfhnbahlnepmldehdhpjfcjp',
226
+
225 227
     // Whether desktop sharing should be disabled on Chrome.
226 228
     desktopSharingChromeDisabled: false,
229
+
227 230
     // The media sources to use when using screen sharing with the Chrome
228 231
     // extension.
229 232
     desktopSharingChromeSources: [ 'screen', 'window' ],
233
+
230 234
     // Required version of Chrome extension
231 235
     desktopSharingChromeMinExtVersion: '0.1',
232 236
 
233 237
     // The ID of the jidesha extension for Firefox. If null, we assume that no
234 238
     // extension is required.
235 239
     desktopSharingFirefoxExtId: null,
240
+
236 241
     // Whether desktop sharing should be disabled on Firefox.
237 242
     desktopSharingFirefoxDisabled: true,
243
+
238 244
     // The maximum version of Firefox which requires a jidesha extension.
239 245
     // Example: if set to 41, we will require the extension for Firefox versions
240 246
     // up to and including 41. On Firefox 42 and higher, we will run without the
241 247
     // extension.
242 248
     // If set to -1, an extension will be required for all versions of Firefox.
243 249
     desktopSharingFirefoxMaxVersionExtRequired: -1,
250
+
244 251
     // The URL to the Firefox extension for desktop sharing.
245 252
     desktopSharingFirefoxExtensionURL: null
246 253
 };

+ 3
- 0
modules/RTC/DataChannels.js Просмотреть файл

@@ -71,6 +71,7 @@ DataChannels.prototype.onDataChannel = function(event) {
71 71
 
72 72
     dataChannel.onmessage = function(event) {
73 73
         const data = event.data;
74
+
74 75
         // JSON
75 76
         let obj;
76 77
 
@@ -125,6 +126,7 @@ DataChannels.prototype.onDataChannel = function(event) {
125 126
             } else if (colibriClass === 'LastNEndpointsChangeEvent') {
126 127
                 // The new/latest list of last-n endpoint IDs.
127 128
                 const lastNEndpoints = obj.lastNEndpoints;
129
+
128 130
                 // The list of endpoint IDs which are entering the list of
129 131
                 // last-n at this time i.e. were not in the old list of last-n
130 132
                 // endpoint IDs.
@@ -150,6 +152,7 @@ DataChannels.prototype.onDataChannel = function(event) {
150 152
                     endpoint, isActive);
151 153
             } else {
152 154
                 logger.debug('Data channel JSON-formatted message: ', obj);
155
+
153 156
                 // The received message appears to be appropriately formatted
154 157
                 // (i.e. is a JSON object which assigns a value to the mandatory
155 158
                 // property colibriClass) so don't just swallow it, expose it to

+ 2
- 0
modules/RTC/JitsiLocalTrack.js Просмотреть файл

@@ -333,6 +333,7 @@ JitsiLocalTrack.prototype._setMute = function(mute) {
333 333
                 if (streamInfo) {
334 334
                     self._setStream(streamInfo.stream);
335 335
                     self.track = streamInfo.track;
336
+
336 337
                     // This is not good when video type changes after
337 338
                     // unmute, but let's not crash here
338 339
                     if (self.videoType !== streamInfo.videoType) {
@@ -552,6 +553,7 @@ JitsiLocalTrack.prototype.getDeviceId = function() {
552 553
  */
553 554
 JitsiLocalTrack.prototype._setByteSent = function(bytesSent) {
554 555
     this._bytesSent = bytesSent;
556
+
555 557
     // FIXME it's a shame that PeerConnection and ICE status does not belong
556 558
     // to the RTC module and it has to be accessed through
557 559
     // the conference(and through the XMPP chat room ???) instead

+ 2
- 0
modules/RTC/JitsiRemoteTrack.js Просмотреть файл

@@ -42,10 +42,12 @@ function JitsiRemoteTrack(rtc, conference, ownerEndpointId, stream, track,
42 42
     this.rtc = rtc;
43 43
     this.ownerEndpointId = ownerEndpointId;
44 44
     this.muted = muted;
45
+
45 46
     // we want to mark whether the track has been ever muted
46 47
     // to detect ttfm events for startmuted conferences, as it can significantly
47 48
     // increase ttfm values
48 49
     this.hasBeenMuted = muted;
50
+
49 51
     // Bind 'onmute' and 'onunmute' event handlers
50 52
     if (this.rtc && this.track) {
51 53
         this._bindMuteHandlers();

+ 5
- 0
modules/RTC/RTC.js Просмотреть файл

@@ -45,11 +45,13 @@ export default class RTC extends Listenable {
45 45
     constructor(conference, options = {}) {
46 46
         super();
47 47
         this.conference = conference;
48
+
48 49
         /**
49 50
          * A map of active <tt>TraceablePeerConnection</tt>.
50 51
          * @type {Map.<number, TraceablePeerConnection>}
51 52
          */
52 53
         this.peerConnections = new Map();
54
+
53 55
         /**
54 56
          * The counter used to generated id numbers assigned to peer connections
55 57
          * @type {number}
@@ -57,9 +59,11 @@ export default class RTC extends Listenable {
57 59
         this.peerConnectionIdCounter = 1;
58 60
 
59 61
         this.localTracks = [];
62
+
60 63
         // FIXME: We should support multiple streams per jid.
61 64
         this.remoteTracks = {};
62 65
         this.options = options;
66
+
63 67
         // A flag whether we had received that the data channel had opened
64 68
         // we can get this flag out of sync if for some reason data channel got
65 69
         // closed from server, a desired behaviour so we can see errors when this
@@ -120,6 +124,7 @@ export default class RTC extends Listenable {
120 124
             this._dataChannelOpenListener = () => {
121 125
                 // mark that dataChannel is opened
122 126
                 this.dataChannelsOpen = true;
127
+
123 128
                 // when the data channel becomes available, tell the bridge
124 129
                 // about video selections so that it can do adaptive simulcast,
125 130
                 // we want the notification to trigger even if userJid

+ 3
- 0
modules/RTC/RTCBrowserType.js Просмотреть файл

@@ -198,6 +198,7 @@ function detectChrome() {
198 198
     if (navigator.webkitGetUserMedia) {
199 199
         currentBrowser = RTCBrowserType.RTC_BROWSER_CHROME;
200 200
         const userAgent = navigator.userAgent.toLowerCase();
201
+
201 202
         // We can assume that user agent is chrome, because it's
202 203
         // enforced when 'ext' streaming method is set
203 204
         const ver = parseInt(userAgent.match(/chrome\/(\d+)\./)[1], 10);
@@ -323,6 +324,7 @@ function detectReactNative() {
323 324
     const match
324 325
         = navigator.userAgent.match(/\b(react[ \t_-]*native)(?:\/(\S+))?/i);
325 326
     let version;
327
+
326 328
     // If we're remote debugging a React Native app, it may be treated as
327 329
     // Chrome. Check navigator.product as well and always return some version
328 330
     // even if we can't get the real one.
@@ -358,6 +360,7 @@ function detectBrowser() {
358 360
         detectIE,
359 361
         detectSafari
360 362
     ];
363
+
361 364
     // Try all browser detectors
362 365
 
363 366
     for (let i = 0; i < detectors.length; i++) {

+ 2
- 0
modules/RTC/RTCUIHelper.js Просмотреть файл

@@ -42,6 +42,7 @@ const RTCUIHelper = {
42 42
 
43 43
         return undefined;
44 44
     },
45
+
45 46
     /**
46 47
      * Sets 'volume' property of given HTML element displaying RTC audio or
47 48
      * video stream.
@@ -53,6 +54,7 @@ const RTCUIHelper = {
53 54
             streamElement.volume = volume;
54 55
         }
55 56
     },
57
+
56 58
     /**
57 59
      * Sets 'autoplay' property of given HTML element displaying RTC audio or
58 60
      * video stream.

+ 16
- 0
modules/RTC/RTCUtils.js Просмотреть файл

@@ -49,8 +49,10 @@ const devices = {
49 49
 let audioOutputDeviceId = 'default'; // default device
50 50
 // whether user has explicitly set a device to use
51 51
 let audioOutputChanged = false;
52
+
52 53
 // Disables Acoustic Echo Cancellation
53 54
 let disableAEC = false;
55
+
54 56
 // Disables Noise Suppression
55 57
 let disableNS = false;
56 58
 
@@ -61,6 +63,7 @@ const isAudioOutputDeviceChangeAvailable
61 63
 let currentlyAvailableMediaDevices;
62 64
 
63 65
 let rawEnumerateDevicesWithCallback;
66
+
64 67
 /**
65 68
  * "rawEnumerateDevicesWithCallback" will be initialized only after WebRTC is
66 69
  * ready. Otherwise it is too early to assume that the devices listing is not
@@ -75,6 +78,7 @@ function initRawEnumerateDevicesWithCallback() {
75 78
                 callback,
76 79
                 () => callback([]));
77 80
         }
81
+
78 82
         // Safari:
79 83
         // "ReferenceError: Can't find variable: MediaStreamTrack"
80 84
         // when Temasys plugin is not installed yet, have to delay this call
@@ -164,6 +168,7 @@ function getConstraints(um, options) {
164 168
                 // New style of setting device id.
165 169
                 constraints.video.deviceId = options.cameraDeviceId;
166 170
             }
171
+
167 172
             // Old style.
168 173
             constraints.video.optional.push({
169 174
                 sourceId: options.cameraDeviceId
@@ -223,11 +228,13 @@ function getConstraints(um, options) {
223 228
                     // New style of setting device id.
224 229
                     constraints.audio.deviceId = options.micDeviceId;
225 230
                 }
231
+
226 232
                 // Old style.
227 233
                 constraints.audio.optional.push({
228 234
                     sourceId: options.micDeviceId
229 235
                 });
230 236
             }
237
+
231 238
             // if it is good enough for hangouts...
232 239
             constraints.audio.optional.push(
233 240
                 { googEchoCancellation: !disableAEC },
@@ -533,6 +540,7 @@ function convertMediaStreamTrackSource(source) {
533 540
     return {
534 541
         facing: source.facing || null,
535 542
         label: source.label,
543
+
536 544
         // theoretically deprecated MediaStreamTrack.getSources should
537 545
         // not return 'audiooutput' devices but let's handle it in any
538 546
         // case
@@ -620,6 +628,7 @@ function handleLocalStream(streams, resolution) {
620 628
             audioStream = streams.audio;
621 629
             videoStream = streams.video;
622 630
         }
631
+
623 632
         // Again, different choices on different types of browser.
624 633
         desktopStream = streams.desktopStream || streams.desktop;
625 634
     }
@@ -668,6 +677,7 @@ function wrapAttachMediaStream(origAttachMediaStream) {
668 677
                 && rtcUtils.isDeviceChangeAvailable('output')
669 678
                 && stream.getAudioTracks
670 679
                 && stream.getAudioTracks().length
680
+
671 681
                 // we skip setting audio output if there was no explicit change
672 682
                 && audioOutputChanged) {
673 683
             element.setSinkId(rtcUtils.getAudioOutputDevice())
@@ -729,6 +739,7 @@ function defaultSetVideoSrc(element, stream) {
729 739
 
730 740
     if (stream) {
731 741
         src = stream.jitsiObjectURL;
742
+
732 743
         // Save the created URL for stream so we can reuse it and not keep
733 744
         // creating URLs.
734 745
         if (!src) {
@@ -838,6 +849,7 @@ class RTCUtils extends Listenable {
838 849
                     // for the id of MediaStream. Let's just say that a number
839 850
                     // contains no special characters.
840 851
                     const id = stream.id;
852
+
841 853
                     // XXX The return statement is affected by automatic
842 854
                     // semicolon insertion (ASI). No line terminator is allowed
843 855
                     // between the return keyword and the expression.
@@ -1026,6 +1038,7 @@ class RTCUtils extends Listenable {
1026 1038
                 reject(new Error('Desktop sharing is not supported!'));
1027 1039
             }
1028 1040
             if (RTCBrowserType.isFirefox()
1041
+
1029 1042
                     // XXX The react-native-webrtc implementation that we
1030 1043
                     // utilize on React Native at the time of this writing does
1031 1044
                     // not support the MediaStream constructors defined by
@@ -1048,6 +1061,7 @@ class RTCUtils extends Listenable {
1048 1061
                         screenObtainer,
1049 1062
                         dsOptions);
1050 1063
                 }
1064
+
1051 1065
                 // With FF/IE we can't split the stream into audio and video because FF
1052 1066
                 // doesn't support media stream constructors. So, we need to get the
1053 1067
                 // audio stream separately from the video stream using two distinct GUM
@@ -1199,6 +1213,7 @@ class RTCUtils extends Listenable {
1199 1213
             };
1200 1214
 
1201 1215
             eventEmitter.addListener(RTCEvents.RTC_READY, listener);
1216
+
1202 1217
                 // We have no failed event, so... it either resolves or nothing
1203 1218
                 // happens
1204 1219
         });
@@ -1233,6 +1248,7 @@ class RTCUtils extends Listenable {
1233 1248
                 || RTCBrowserType.isNWJS()
1234 1249
                 || RTCBrowserType.isElectron();
1235 1250
     }
1251
+
1236 1252
     /**
1237 1253
      * A method to handle stopping of the stream.
1238 1254
      * One point to handle the differences in various implementations.

+ 5
- 0
modules/RTC/ScreenObtainer.js Просмотреть файл

@@ -85,6 +85,7 @@ const ScreenObtainer = {
85 85
                     onSuccess,
86 86
                     (error, constraints) => {
87 87
                         let jitsiError;
88
+
88 89
                         // FIXME:
89 90
                         // This is very very durty fix for recognising that the
90 91
                         // user have clicked the cancel button from the Desktop
@@ -255,6 +256,7 @@ const ScreenObtainer = {
255 256
                 alert(
256 257
                     'Jitsi Desktop Streamer requires update. '
257 258
                     + 'Changes will take effect after next Chrome restart.');
259
+
258 260
                 /* eslint-enable no-alert */
259 261
             }
260 262
 
@@ -264,6 +266,7 @@ const ScreenObtainer = {
264 266
                     arg => {
265 267
                         logger.log('Extension installed successfully', arg);
266 268
                         chromeExtInstalled = true;
269
+
267 270
                         // We need to give a moment to the endpoint to become
268 271
                         // available.
269 272
                         waitForExtensionAfterInstall(this.options, 200, 10)
@@ -417,6 +420,7 @@ function checkChromeExtInstalled(callback, options) {
417 420
 
418 421
                 return;
419 422
             }
423
+
420 424
             // Check installed extension version
421 425
             const extVersion = response.version;
422 426
 
@@ -476,6 +480,7 @@ function initInlineInstalls(options) {
476 480
 function initChromeExtension(options) {
477 481
     // Initialize Chrome extension inline installs
478 482
     initInlineInstalls(options);
483
+
479 484
     // Check if extension is installed
480 485
     checkChromeExtInstalled((installed, updateRequired) => {
481 486
         chromeExtInstalled = installed;

+ 19
- 0
modules/RTC/TraceablePeerConnection.js Просмотреть файл

@@ -7,6 +7,7 @@ import RTC from './RTC';
7 7
 import RTCBrowserType from './RTCBrowserType.js';
8 8
 import RTCEvents from '../../service/RTC/RTCEvents';
9 9
 import RtxModifier from '../xmpp/RtxModifier.js';
10
+
10 11
 // FIXME SDP tools should end up in some kind of util module
11 12
 import SDP from '../xmpp/SDP';
12 13
 import SdpConsistency from '../xmpp/SdpConsistency.js';
@@ -41,6 +42,7 @@ const SIMULCAST_LAYERS = 3;
41 42
 function TraceablePeerConnection(rtc, id, signalingLayer, ice_config,
42 43
                                  constraints, options) {
43 44
     const self = this;
45
+
44 46
     /**
45 47
      * The parent instance of RTC service which created this
46 48
      * <tt>TracablePeerConnection</tt>.
@@ -48,11 +50,13 @@ function TraceablePeerConnection(rtc, id, signalingLayer, ice_config,
48 50
      */
49 51
 
50 52
     this.rtc = rtc;
53
+
51 54
     /**
52 55
      * The peer connection identifier assigned by the RTC module.
53 56
      * @type {number}
54 57
      */
55 58
     this.id = id;
59
+
56 60
     /**
57 61
      * The signaling layer which operates this peer connection.
58 62
      * @type {SignalingLayer}
@@ -72,6 +76,7 @@ function TraceablePeerConnection(rtc, id, signalingLayer, ice_config,
72 76
     this.updateLog = [];
73 77
     this.stats = {};
74 78
     this.statsinterval = null;
79
+
75 80
     /**
76 81
      * @type {number}
77 82
      */
@@ -84,6 +89,7 @@ function TraceablePeerConnection(rtc, id, signalingLayer, ice_config,
84 89
     this.simulcast = new Simulcast({ numOfLayers: SIMULCAST_LAYERS,
85 90
         explodeRemoteSimulcast: false });
86 91
     this.sdpConsistency = new SdpConsistency();
92
+
87 93
     /**
88 94
      * TracablePeerConnection uses RTC's eventEmitter
89 95
      * @type {EventEmitter}
@@ -169,6 +175,7 @@ function TraceablePeerConnection(rtc, id, signalingLayer, ice_config,
169 175
             self.ondatachannel(event);
170 176
         }
171 177
     };
178
+
172 179
     // XXX: do all non-firefox browsers which we support also support this?
173 180
     if (!RTCBrowserType.isFirefox() && this.maxstats) {
174 181
         this.statsinterval = window.setInterval(() => {
@@ -225,6 +232,7 @@ TraceablePeerConnection.prototype._remoteStreamAdded = function(stream) {
225 232
 
226 233
         return;
227 234
     }
235
+
228 236
     // Bind 'addtrack'/'removetrack' event handlers
229 237
     if (RTCBrowserType.isChrome() || RTCBrowserType.isNWJS()
230 238
         || RTCBrowserType.isElectron()) {
@@ -235,6 +243,7 @@ TraceablePeerConnection.prototype._remoteStreamAdded = function(stream) {
235 243
             this._remoteTrackRemoved(event.target, event.track);
236 244
         };
237 245
     }
246
+
238 247
     // Call remoteTrackAdded for each track in the stream
239 248
     const streamAudioTracks = stream.getAudioTracks();
240 249
 
@@ -360,6 +369,7 @@ TraceablePeerConnection.prototype._remoteStreamRemoved = function(stream) {
360 369
 
361 370
         return;
362 371
     }
372
+
363 373
     // Call remoteTrackRemoved for each track in the stream
364 374
     const streamVideoTracks = stream.getVideoTracks();
365 375
 
@@ -441,6 +451,7 @@ function extractSSRCMap(desc) {
441 451
      * @type {Map<string,TrackSSRCInfo>}
442 452
      */
443 453
     const ssrcMap = new Map();
454
+
444 455
     /**
445 456
      * Groups mapped by primary SSRC number
446 457
      * @type {Map<number,Array<SSRCGroupInfo>>}
@@ -474,6 +485,7 @@ function extractSSRCMap(desc) {
474 485
                         = group.ssrcs.split(' ')
475 486
                                      .map(ssrcStr => parseInt(ssrcStr));
476 487
                     const primarySSRC = groupSSRCs[0];
488
+
477 489
                     // Note that group.semantics is already present
478 490
 
479 491
                     group.ssrcs = groupSSRCs;
@@ -669,6 +681,7 @@ TraceablePeerConnection.prototype.addStream = function(stream, ssrcInfo) {
669 681
 
670 682
 TraceablePeerConnection.prototype.removeStream = function(stream) {
671 683
     this.trace('removeStream', stream.id);
684
+
672 685
     // FF doesn't support this yet.
673 686
     if (this.peerconnection.removeStream) {
674 687
         this.peerconnection.removeStream(stream);
@@ -684,6 +697,7 @@ TraceablePeerConnection.prototype.createDataChannel = function(label, opts) {
684 697
 TraceablePeerConnection.prototype.setLocalDescription
685 698
         = function(description, successCallback, failureCallback) {
686 699
             this.trace('setLocalDescription::preTransform', dumpSDP(description));
700
+
687 701
     // if we're running on FF, transform to Plan A first.
688 702
             if (RTCBrowserType.usesUnifiedPlan()) {
689 703
                 description = this.interop.toUnifiedPlan(description);
@@ -711,6 +725,7 @@ TraceablePeerConnection.prototype.setLocalDescription
711 725
 TraceablePeerConnection.prototype.setRemoteDescription
712 726
         = function(description, successCallback, failureCallback) {
713 727
             this.trace('setRemoteDescription::preTransform', dumpSDP(description));
728
+
714 729
     // TODO the focus should squeze or explode the remote simulcast
715 730
             description = this.simulcast.mungeRemoteDescription(description);
716 731
             this.trace(
@@ -753,6 +768,7 @@ TraceablePeerConnection.prototype.setRemoteDescription
753 768
             failureCallback(err);
754 769
         }
755 770
     );
771
+
756 772
     /*
757 773
      if (this.statsinterval === null && this.maxstats > 0) {
758 774
      // start gathering stats
@@ -862,6 +878,7 @@ TraceablePeerConnection.prototype.createAnswer
862 878
             try {
863 879
                 this.trace(
864 880
                     'createAnswerOnSuccess::preTransform', dumpSDP(answer));
881
+
865 882
                 // if we're running on FF, transform to Plan A first.
866 883
                 if (RTCBrowserType.usesUnifiedPlan()) {
867 884
                     answer = this.interop.toPlanB(answer);
@@ -933,11 +950,13 @@ TraceablePeerConnection.prototype.createAnswer
933 950
         };
934 951
 
935 952
 TraceablePeerConnection.prototype.addIceCandidate
953
+
936 954
         // eslint-disable-next-line no-unused-vars
937 955
         = function(candidate, successCallback, failureCallback) {
938 956
     // var self = this;
939 957
             this.trace('addIceCandidate', JSON.stringify(candidate, null, ' '));
940 958
             this.peerconnection.addIceCandidate(candidate);
959
+
941 960
     /* maybe later
942 961
      this.peerconnection.addIceCandidate(candidate,
943 962
      function () {

+ 1
- 0
modules/connectivity/ConnectionQuality.js Просмотреть файл

@@ -284,6 +284,7 @@ export default class ConnectionQuality {
284 284
 
285 285
         let quality = 100;
286 286
         let packetLoss;
287
+
287 288
         // TODO: take into account packet loss for received streams
288 289
 
289 290
         if (this._localStats.packetLoss) {

+ 4
- 0
modules/connectivity/ParticipantConnectionStatus.js Просмотреть файл

@@ -34,6 +34,7 @@ export default class ParticipantConnectionStatus {
34 34
     constructor(rtc, conference, rtcMuteTimeout) {
35 35
         this.rtc = rtc;
36 36
         this.conference = conference;
37
+
37 38
         /**
38 39
          * A map of the "endpoint ID"(which corresponds to the resource part
39 40
          * of MUC JID(nickname)) to the timeout callback IDs scheduled using
@@ -41,6 +42,7 @@ export default class ParticipantConnectionStatus {
41 42
          * @type {Object.<string, number>}
42 43
          */
43 44
         this.trackTimers = {};
45
+
44 46
         /**
45 47
          * This map holds the endpoint connection status received from the JVB
46 48
          * (as it might be different than the one stored in JitsiParticipant).
@@ -48,6 +50,7 @@ export default class ParticipantConnectionStatus {
48 50
          * @type {Object.<string, boolean>}
49 51
          */
50 52
         this.connStatusFromJvb = { };
53
+
51 54
         /**
52 55
          * How long we're going to wait after the RTC video track muted event
53 56
          * for the corresponding signalling mute event, before the connection
@@ -59,6 +62,7 @@ export default class ParticipantConnectionStatus {
59 62
         this.rtcMuteTimeout
60 63
             = typeof rtcMuteTimeout === 'number'
61 64
                 ? rtcMuteTimeout : DEFAULT_RTC_MUTE_TIMEOUT;
65
+
62 66
         /**
63 67
          * This map holds a timestamp indicating  when participant's video track
64 68
          * was RTC muted (it is assumed that each participant can have only 1

+ 1
- 0
modules/statistics/AnalyticsAdapter.js Просмотреть файл

@@ -12,6 +12,7 @@ class AnalyticsAbstract {
12 12
 class CacheAnalytics extends AnalyticsAbstract {
13 13
     constructor() {
14 14
         super();
15
+
15 16
         // some events may happen before init or implementation script download
16 17
         // in this case we accumulate them in this array and send them on init
17 18
         this.eventCache = [];

+ 2
- 0
modules/statistics/CallStats.js Просмотреть файл

@@ -165,6 +165,7 @@ const CallStats = _try_catch(function(jingleSession, options) {
165 165
         this.callStatsSecret = options.callStatsSecret;
166 166
 
167 167
         CallStats.initializeInProgress = true;
168
+
168 169
         // userID is generated or given by the origin server
169 170
         callStats.initialize(this.callStatsID,
170 171
             this.callStatsSecret,
@@ -435,6 +436,7 @@ CallStats._reportError = function(type, e, pc) {
435 436
         });
436 437
         CallStats._checkInitialize();
437 438
     }
439
+
438 440
     // else just ignore it
439 441
 };
440 442
 

+ 4
- 0
modules/statistics/RTPStatsCollector.js Просмотреть файл

@@ -187,6 +187,7 @@ function StatsCollector(
187 187
     if (!keys) {
188 188
         throw `The browser type '${this._browserType}' isn't supported!`;
189 189
     }
190
+
190 191
     /**
191 192
      * The function which is to be used to retrieve the value associated in a
192 193
      * report returned by RTCPeerConnection#getStats with a LibJitsiMeet
@@ -210,6 +211,7 @@ function StatsCollector(
210 211
 
211 212
     this.statsIntervalId = null;
212 213
     this.statsIntervalMilis = statsInterval;
214
+
213 215
     // Map of ssrcs to SsrcStats
214 216
     this.ssrc2stats = {};
215 217
 }
@@ -438,6 +440,7 @@ StatsCollector.prototype.processStatsReport = function() {
438 440
             if (!ip || !type || !localip || active != 'true') {
439 441
                 continue;
440 442
             }
443
+
441 444
             // Save the address unless it has been saved already.
442 445
             const conferenceStatsTransport = this.conferenceStats.transport;
443 446
 
@@ -588,6 +591,7 @@ StatsCollector.prototype.processStatsReport = function() {
588 591
     Object.keys(this.ssrc2stats).forEach(
589 592
         function(ssrc) {
590 593
             const ssrcStats = this.ssrc2stats[ssrc];
594
+
591 595
             // process packet loss stats
592 596
             const loss = ssrcStats.loss;
593 597
             const type = loss.isDownloadStream ? 'download' : 'upload';

+ 4
- 0
modules/statistics/statistics.js Просмотреть файл

@@ -32,6 +32,7 @@ function loadCallStatsAPI(customScriptUrl) {
32 32
                 /* prepend */ true);
33 33
         isCallstatsLoaded = true;
34 34
     }
35
+
35 36
     // FIXME At the time of this writing, we hope that the callstats.io API will
36 37
     // have loaded by the time we needed it (i.e. CallStats.init is invoked).
37 38
 }
@@ -87,6 +88,7 @@ function Statistics(xmpp, options) {
87 88
     this.options = options || {};
88 89
     this.callStatsIntegrationEnabled
89 90
         = this.options.callStatsID && this.options.callStatsSecret
91
+
90 92
             // Even though AppID and AppSecret may be specified, the integration
91 93
             // of callstats.io may be disabled because of globally-disallowed
92 94
             // requests to any third parties.
@@ -95,6 +97,7 @@ function Statistics(xmpp, options) {
95 97
         loadCallStatsAPI(this.options.callStatsCustomScriptUrl);
96 98
     }
97 99
     this.callStats = null;
100
+
98 101
     // Flag indicates whether or not the CallStats have been started for this
99 102
     // Statistics instance
100 103
     this.callStatsStarted = false;
@@ -238,6 +241,7 @@ Statistics.prototype.stopCallStats = function() {
238 241
         if (index > -1) {
239 242
             Statistics.callsStatsInstances.splice(index, 1);
240 243
         }
244
+
241 245
         // The next line is commented because we need to be able to send
242 246
         // feedback even after the conference has been destroyed.
243 247
         // this.callstats = null;

+ 16
- 0
modules/transcription/audioRecorder.js Просмотреть файл

@@ -16,14 +16,18 @@ const AUDIO_OGG = 'audio/ogg';     // Supported in firefox
16 16
 const TrackRecorder = function(track) {
17 17
     // The JitsiTrack holding the stream
18 18
     this.track = track;
19
+
19 20
     // The MediaRecorder recording the stream
20 21
     this.recorder = null;
22
+
21 23
     // The array of data chunks recorded from the stream
22 24
     // acts as a buffer until the data is stored on disk
23 25
     this.data = null;
26
+
24 27
     // the name of the person of the JitsiTrack. This can be undefined and/or
25 28
     // not unique
26 29
     this.name = null;
30
+
27 31
     // the time of the start of the recording
28 32
     this.startTime = null;
29 33
 };
@@ -62,17 +66,21 @@ function stopRecorder(trackRecorder) {
62 66
  */
63 67
 function instantiateTrackRecorder(track) {
64 68
     const trackRecorder = new TrackRecorder(track);
69
+
65 70
     // Create a new stream which only holds the audio track
66 71
     const originalStream = trackRecorder.track.getOriginalStream();
67 72
     const stream = createEmptyStream();
68 73
 
69 74
     originalStream.getAudioTracks().forEach(track => stream.addTrack(track));
75
+
70 76
     // Create the MediaRecorder
71 77
     trackRecorder.recorder = new MediaRecorder(stream,
72 78
         { mimeType: audioRecorder.fileType });
79
+
73 80
     // array for holding the recorder data. Resets it when
74 81
     // audio already has been recorder once
75 82
     trackRecorder.data = [];
83
+
76 84
     // function handling a dataEvent, e.g the stream gets new data
77 85
     trackRecorder.recorder.ondataavailable = function(dataEvent) {
78 86
         if (dataEvent.data.size > 0) {
@@ -133,11 +141,14 @@ audioRecorder.prototype.addTrack = function(track) {
133 141
     if (track.isAudioTrack()) {
134 142
         // create the track recorder
135 143
         const trackRecorder = instantiateTrackRecorder(track);
144
+
136 145
         // push it to the local array of all recorders
137 146
 
138 147
         this.recorders.push(trackRecorder);
148
+
139 149
         // update the name of the trackRecorders
140 150
         this.updateNames();
151
+
141 152
         // If we're already recording, immediately start recording this new
142 153
         // track.
143 154
         if (this.isRecording) {
@@ -211,11 +222,14 @@ audioRecorder.prototype.start = function() {
211 222
     if (this.isRecording) {
212 223
         throw new Error('audiorecorder is already recording');
213 224
     }
225
+
214 226
     // set boolean isRecording flag to true so if new participants join the
215 227
     // conference, that track can instantly start recording as well
216 228
     this.isRecording = true;
229
+
217 230
     // start all the mediaRecorders
218 231
     this.recorders.forEach(trackRecorder => startRecorder(trackRecorder));
232
+
219 233
     // log that recording has started
220 234
     console.log(
221 235
         `Started the recording of the audio. There are currently ${
@@ -228,6 +242,7 @@ audioRecorder.prototype.start = function() {
228 242
 audioRecorder.prototype.stop = function() {
229 243
     // set the boolean flag to false
230 244
     this.isRecording = false;
245
+
231 246
     // stop all recorders
232 247
     this.recorders.forEach(trackRecorder => stopRecorder(trackRecorder));
233 248
     console.log('stopped recording');
@@ -263,6 +278,7 @@ audioRecorder.prototype.getRecordingResults = function() {
263 278
         throw new Error(
264 279
             'cannot get blobs because the AudioRecorder is still recording!');
265 280
     }
281
+
266 282
     // make sure the names are up to date before sending them off
267 283
     this.updateNames();
268 284
 

+ 21
- 0
modules/transcription/transcriber.js Просмотреть файл

@@ -20,23 +20,31 @@ const MAXIMUM_SENTENCE_LENGTH = 80;
20 20
 const transcriber = function() {
21 21
     // the object which can record all audio in the conference
22 22
     this.audioRecorder = new AudioRecorder();
23
+
23 24
     // this object can send the recorder audio to a speech-to-text service
24 25
     this.transcriptionService = new SphinxService();
26
+
25 27
     // holds a counter to keep track if merging can start
26 28
     this.counter = null;
29
+
27 30
     // holds the date when transcription started which makes it possible
28 31
     // to calculate the offset between recordings
29 32
     this.startTime = null;
33
+
30 34
     // will hold the transcription once it is completed
31 35
     this.transcription = null;
36
+
32 37
     // this will be a method which will be called once the transcription is done
33 38
     // with the transcription as parameter
34 39
     this.callback = null;
40
+
35 41
     // stores all the retrieved speech-to-text results to merge together
36 42
     // this value will store an Array<Word> object
37 43
     this.results = [];
44
+
38 45
     // Stores the current state of the transcription process
39 46
     this.state = BEFORE_STATE;
47
+
40 48
     // Used in the updateTranscription method to add a new line when the
41 49
     // sentence becomes to long
42 50
     this.lineLength = 0;
@@ -72,9 +80,11 @@ transcriber.prototype.stop = function stop(callback) {
72 80
                  RECORDING_STATE}" state. It's currently in the "${
73 81
                  this.state}" state`);
74 82
     }
83
+
75 84
     // stop the recording
76 85
     console.log('stopping recording and sending audio files');
77 86
     this.audioRecorder.stop();
87
+
78 88
     // and send all recorded audio the the transcription service
79 89
     const t = this;
80 90
 
@@ -84,8 +94,10 @@ transcriber.prototype.stop = function stop(callback) {
84 94
         t.transcriptionService.send(recordingResult, callBack);
85 95
         t.counter++;
86 96
     });
97
+
87 98
     // set the state to "transcribing" so that maybeMerge() functions correctly
88 99
     this.state = TRANSCRIBING_STATE;
100
+
89 101
     // and store the callback for later
90 102
     this.callback = callback;
91 103
 };
@@ -104,11 +116,13 @@ const blobCallBack = function(answer) {
104 116
     console.log(
105 117
         'retrieved an answer from the transcription service. The answer has an'
106 118
             + ` array of length: ${answer.wordArray.length}`);
119
+
107 120
     // first add the offset between the start of the transcription and
108 121
     // the start of the recording to all start and end times
109 122
     if (answer.wordArray.length > 0) {
110 123
         let offset = answer.startTime.getUTCMilliseconds()
111 124
             - this.startTime.getUTCMilliseconds();
125
+
112 126
         // transcriber time will always be earlier
113 127
 
114 128
         if (offset < 0) {
@@ -124,15 +138,18 @@ const blobCallBack = function(answer) {
124 138
         });
125 139
         array += ']';
126 140
         console.log(array);
141
+
127 142
         // give a name value to the Array object so that the merging can access
128 143
         // the name value without having to use the whole recordingResult object
129 144
         // in the algorithm
130 145
         answer.wordArray.name = answer.name;
131 146
     }
147
+
132 148
     // then store the array and decrease the counter
133 149
     this.results.push(answer.wordArray);
134 150
     this.counter--;
135 151
     console.log(`current counter: ${this.counter}`);
152
+
136 153
     // and check if all results have been received.
137 154
     this.maybeMerge();
138 155
 };
@@ -158,12 +175,14 @@ transcriber.prototype.merge = function() {
158 175
         `starting merge process!\n The length of the array: ${
159 176
              this.results.length}`);
160 177
     this.transcription = '';
178
+
161 179
     // the merging algorithm will look over all Word objects who are at pos 0 in
162 180
     // every array. It will then select the one closest in time to the
163 181
     // previously placed word, while removing the selected word from its array
164 182
     // note: words can be skipped the skipped word's begin and end time somehow
165 183
     // end up between the closest word start and end time
166 184
     const arrays = this.results;
185
+
167 186
     // arrays of Word objects
168 187
     const potentialWords = []; // array of the first Word objects
169 188
     // check if any arrays are already empty and remove them
@@ -186,6 +205,7 @@ transcriber.prototype.merge = function() {
186 205
                 lowestWordArray = wordArray;
187 206
             }
188 207
         });
208
+
189 209
         // put the word in the transcription
190 210
         wordToAdd = lowestWordArray.shift();
191 211
         this.updateTranscription(wordToAdd, lowestWordArray.name);
@@ -198,6 +218,7 @@ transcriber.prototype.merge = function() {
198 218
                     foundSmaller = true;
199 219
                 }
200 220
             });
221
+
201 222
             // add next word if no smaller time has been found
202 223
             if (!foundSmaller) {
203 224
                 wordToAdd = lowestWordArray.shift();

+ 6
- 0
modules/transcription/transcriptionServices/SphinxTranscriptionService.js Просмотреть файл

@@ -43,6 +43,7 @@ SphinxService.prototype.sendRequest = function(audioFileBlob, callback) {
43 43
                 `unable to accept response from sphinx server. status: ${
44 44
                     request.status}`);
45 45
         }
46
+
46 47
         // if not ready no point to throw an error
47 48
     };
48 49
     request.open('POST', this.url);
@@ -60,6 +61,7 @@ SphinxService.prototype.sendRequest = function(audioFileBlob, callback) {
60 61
  */
61 62
 SphinxService.prototype.formatResponse = function(response) {
62 63
     const result = JSON.parse(response).objects;
64
+
63 65
     // make sure to delete the session id object, which is always
64 66
     // the first value in the JSON array
65 67
 
@@ -81,10 +83,12 @@ SphinxService.prototype.formatResponse = function(response) {
81 83
  */
82 84
 SphinxService.prototype.verify = function(response) {
83 85
     console.log(`response from server:${response.toString()}`);
86
+
84 87
     // test if server responded with a string object
85 88
     if (typeof response !== 'string') {
86 89
         return false;
87 90
     }
91
+
88 92
     // test if the string can be parsed into valid JSON
89 93
     let json;
90 94
 
@@ -95,10 +99,12 @@ SphinxService.prototype.verify = function(response) {
95 99
 
96 100
         return false;
97 101
     }
102
+
98 103
     // check if the JSON has a "objects" value
99 104
     if (json.objects === undefined) {
100 105
         return false;
101 106
     }
107
+
102 108
     // get the "objects" value and check for a session ID
103 109
     const array = json.objects;
104 110
 

+ 2
- 0
modules/util/EventEmitterForwarder.js Просмотреть файл

@@ -24,9 +24,11 @@ function EventEmitterForwarder(src, dest) {
24 24
  */
25 25
 EventEmitterForwarder.prototype.forward = function(...args) {
26 26
     const srcEvent = args[0];
27
+
27 28
     // This will be the "this" value for emit function.
28 29
 
29 30
     args[0] = this.dest;
31
+
30 32
     // Using bind.apply to pass the arguments as Array-like object ("arguments")
31 33
     this.src.addListener(
32 34
         srcEvent,

+ 2
- 0
modules/util/GlobalOnErrorHandler.js Просмотреть файл

@@ -51,6 +51,7 @@ const GlobalOnErrorHandler = {
51 51
     addHandler(handler) {
52 52
         handlers.push(handler);
53 53
     },
54
+
54 55
     /**
55 56
      * Calls the global error handler if there is one.
56 57
      * @param error the error to pass to the error handler
@@ -63,6 +64,7 @@ const GlobalOnErrorHandler = {
63 64
         }
64 65
         errHandler(null, null, null, null, error);
65 66
     },
67
+
66 68
     /**
67 69
      * Calls the global rejection handler if there is one.
68 70
      * @param error the error to pass to the rejection handler.

+ 1
- 0
modules/util/Listenable.js Просмотреть файл

@@ -13,6 +13,7 @@ export default class Listenable {
13 13
      */
14 14
     constructor(eventEmitter = new EventEmitter()) {
15 15
         this.eventEmitter = eventEmitter;
16
+
16 17
         // aliases for addListener/removeListener
17 18
         this.addEventListener = this.on = this.addListener;
18 19
         this.removeEventListener = this.off = this.removeListener;

+ 1
- 0
modules/util/RandomUtil.js Просмотреть файл

@@ -55,6 +55,7 @@ const RandomUtil = {
55 55
     randomHexDigit() {
56 56
         return randomElement(HEX_DIGITS);
57 57
     },
58
+
58 59
     /**
59 60
      * Returns a random string of hex digits with length 'len'.
60 61
      * @param len the length.

+ 2
- 0
modules/version/ComponentsVersions.js Просмотреть файл

@@ -6,11 +6,13 @@ const Statistics = require('../statistics/statistics');
6 6
  * @type {string}
7 7
  */
8 8
 ComponentsVersions.FOCUS_COMPONENT = 'focus';
9
+
9 10
 /**
10 11
  * The constant for the name of the videobridge component.
11 12
  * @type {string}
12 13
  */
13 14
 ComponentsVersions.VIDEOBRIDGE_COMPONENT = 'videobridge';
15
+
14 16
 /**
15 17
  * The constant for the name of the XMPP server component.
16 18
  * @type {string}

+ 6
- 0
modules/xmpp/ChatRoom.js Просмотреть файл

@@ -49,6 +49,7 @@ const parser = {
49 49
                 packet.up();
50 50
             }
51 51
         }
52
+
52 53
         // packet.up();
53 54
     }
54 55
 };
@@ -114,6 +115,7 @@ export default class ChatRoom extends Listenable {
114 115
             'value': navigator.userAgent,
115 116
             'attributes': { xmlns: 'http://jitsi.org/jitmeet/user-agent' }
116 117
         });
118
+
117 119
         // We need to broadcast 'videomuted' status from the beginning, cause Jicofo
118 120
         // makes decisions based on that. Initialize it with 'false' here.
119 121
         this.addVideoInfoToPresence(false);
@@ -273,6 +275,7 @@ export default class ChatRoom extends Listenable {
273 275
 
274 276
     onPresence(pres) {
275 277
         const from = pres.getAttribute('from');
278
+
276 279
         // Parse roles.
277 280
         const member = {};
278 281
 
@@ -302,6 +305,7 @@ export default class ChatRoom extends Listenable {
302 305
         parser.packet2JSON(pres, nodes);
303 306
         this.lastPresences[from] = nodes;
304 307
         let jibri = null;
308
+
305 309
         // process nodes to extract data needed for MUC_JOINED and
306 310
         // MUC_MEMBER_JOINED events
307 311
 
@@ -692,8 +696,10 @@ export default class ChatRoom extends Listenable {
692 696
                         type: 'submit' });
693 697
                     formsubmit.c('field', { 'var': 'FORM_TYPE' }).c('value').t('http://jabber.org/protocol/muc#roomconfig').up().up();
694 698
                     formsubmit.c('field', { 'var': 'muc#roomconfig_roomsecret' }).c('value').t(key).up().up();
699
+
695 700
                     // Fixes a bug in prosody 0.9.+ https://code.google.com/p/lxmppd/issues/detail?id=373
696 701
                     formsubmit.c('field', { 'var': 'muc#roomconfig_whois' }).c('value').t('anyone').up().up();
702
+
697 703
                     // FIXME: is muc#roomconfig_passwordprotectedroom required?
698 704
                     this.connection.sendIQ(formsubmit, onSuccess, onError);
699 705
                 } else {

+ 23
- 0
modules/xmpp/JingleSessionPC.js Просмотреть файл

@@ -56,6 +56,7 @@ export default class JingleSessionPC extends JingleSession {
56 56
         this.closed = false;
57 57
 
58 58
         this.modifyingLocalStreams = false;
59
+
59 60
         /**
60 61
          * Used to keep state about muted/unmuted video streams
61 62
          *  so we can prevent errant source-add/source-removes
@@ -85,6 +86,7 @@ export default class JingleSessionPC extends JingleSession {
85 86
 
86 87
         this.webrtcIceUdpDisable = Boolean(options.webrtcIceUdpDisable);
87 88
         this.webrtcIceTcpDisable = Boolean(options.webrtcIceTcpDisable);
89
+
88 90
         /**
89 91
          * Flag used to enforce ICE failure through the URL parameter for
90 92
          * the automatic testing purpose.
@@ -98,15 +100,19 @@ export default class JingleSessionPC extends JingleSession {
98 100
 
99 101
     doInitialize() {
100 102
         this.lasticecandidate = false;
103
+
101 104
         // True if reconnect is in progress
102 105
         this.isreconnect = false;
106
+
103 107
         // Set to true if the connection was ever stable
104 108
         this.wasstable = false;
109
+
105 110
         // Create new peer connection instance
106 111
         this.peerconnection
107 112
             = this.rtc.createPeerConnection(
108 113
                 this,
109 114
                 this.connection.jingle.ice_config,
115
+
110 116
                 /* Options */
111 117
                 {
112 118
                     disableSimulcast: this.room.options.disableSimulcast,
@@ -123,6 +129,7 @@ export default class JingleSessionPC extends JingleSession {
123 129
                 // the check complete.
124 130
                 return;
125 131
             }
132
+
126 133
             // XXX this is broken, candidate is not parsed.
127 134
             const candidate = ev.candidate;
128 135
 
@@ -145,6 +152,7 @@ export default class JingleSessionPC extends JingleSession {
145 152
             }
146 153
             this.sendIceCandidate(candidate);
147 154
         };
155
+
148 156
         // Note there is a change in the spec about closed:
149 157
         // This value moved into the RTCPeerConnectionState enum in
150 158
         // the May 13, 2016 draft of the specification, as it reflects the state
@@ -165,6 +173,7 @@ export default class JingleSessionPC extends JingleSession {
165 173
                 this.room.eventEmitter.emit(XMPPEvents.SUSPEND_DETECTED);
166 174
             }
167 175
         };
176
+
168 177
         /**
169 178
          * The oniceconnectionstatechange event handler contains the code to
170 179
          * execute when the iceconnectionstatechange event, of type Event,
@@ -206,6 +215,7 @@ export default class JingleSessionPC extends JingleSession {
206 215
                     break;
207 216
                 }
208 217
                 this.isreconnect = true;
218
+
209 219
                     // Informs interested parties that the connection has been
210 220
                     // interrupted.
211 221
                 if (this.wasstable) {
@@ -260,6 +270,7 @@ export default class JingleSessionPC extends JingleSession {
260 270
             }
261 271
         } else {
262 272
             logger.log('sendIceCandidate: last candidate.');
273
+
263 274
             // FIXME: remember to re-think in ICE-restart
264 275
             this.lasticecandidate = true;
265 276
         }
@@ -294,6 +305,7 @@ export default class JingleSessionPC extends JingleSession {
294 305
                 for (let i = 0; i < cands.length; i++) {
295 306
                     const candidate
296 307
                         = SDPUtil.candidateToJingle(cands[i].candidate);
308
+
297 309
                     // Mangle ICE candidate if 'failICE' test option is enabled
298 310
 
299 311
                     if (this.failICE) {
@@ -301,6 +313,7 @@ export default class JingleSessionPC extends JingleSession {
301 313
                     }
302 314
                     cand.c('candidate', candidate).up();
303 315
                 }
316
+
304 317
                 // add fingerprint
305 318
                 const fingerprint_line
306 319
                     = SDPUtil.find_line(
@@ -323,6 +336,7 @@ export default class JingleSessionPC extends JingleSession {
323 336
                 cand.up(); // content
324 337
             }
325 338
         }
339
+
326 340
         // might merge last-candidate notification into this, but it is called
327 341
         // a lot later. See webrtc issue #2340
328 342
         // logger.log('was this the last candidate', this.lasticecandidate);
@@ -507,11 +521,13 @@ export default class JingleSessionPC extends JingleSession {
507 521
             success,
508 522
             this.newJingleErrorHandler(accept, error => {
509 523
                 failure(error);
524
+
510 525
                 // 'session-accept' is a critical timeout and we'll
511 526
                 // have to restart
512 527
                 this.room.eventEmitter.emit(XMPPEvents.SESSION_ACCEPT_TIMEOUT);
513 528
             }),
514 529
             IQ_TIMEOUT);
530
+
515 531
         // XXX Videobridge needs WebRTC's answer (ICE ufrag and pwd, DTLS
516 532
         // fingerprint and setup) ASAP in order to start the connection
517 533
         // establishment.
@@ -688,6 +704,7 @@ export default class JingleSessionPC extends JingleSession {
688 704
                                 }\r\n`;
689 705
                     }
690 706
                 });
707
+
691 708
             // handles both >source and >description>source
692 709
             const tmp
693 710
                 = $(content).find(
@@ -993,6 +1010,7 @@ export default class JingleSessionPC extends JingleSession {
993 1010
             const workFunction = finishedCallback => {
994 1011
                 const oldSdp
995 1012
                     = new SDP(this.peerconnection.localDescription.sdp);
1013
+
996 1014
                 // NOTE the code below assumes that no more than 1 video track
997 1015
                 // can be added to the peer connection.
998 1016
                 // Transition from no video to video (possibly screen sharing)
@@ -1004,6 +1022,7 @@ export default class JingleSessionPC extends JingleSession {
1004 1022
                     // 1. source-remove for the recvonly
1005 1023
                     // 2. source-add for the new video stream
1006 1024
                     this.peerconnection.clearRecvonlySsrc();
1025
+
1007 1026
                 // Transition from video to no video
1008 1027
                 } else if (oldTrack && oldTrack.isVideoTrack() && !newTrack) {
1009 1028
                     // Clearing current primary SSRC and generating the recvonly
@@ -1090,6 +1109,7 @@ export default class JingleSessionPC extends JingleSession {
1090 1109
                     }
1091 1110
                 });
1092 1111
             const ssrcs = [];
1112
+
1093 1113
             // handles both >source and >description>source versions
1094 1114
             const tmp
1095 1115
                 = $(content).find(
@@ -1168,6 +1188,7 @@ export default class JingleSessionPC extends JingleSession {
1168 1188
                 .then(() => {
1169 1189
                     const newSdp
1170 1190
                         = new SDP(this.peerconnection.localDescription.sdp);
1191
+
1171 1192
                     // FIXME objects should not be logged
1172 1193
 
1173 1194
                     logger.log('SDPs', oldSdp, newSdp);
@@ -1203,6 +1224,7 @@ export default class JingleSessionPC extends JingleSession {
1203 1224
             return;
1204 1225
         }
1205 1226
         let sender = null;
1227
+
1206 1228
         // On Firefox we don't replace MediaStreams as this messes up the
1207 1229
         // m-lines (which can't be removed in Plan Unified) and brings a lot
1208 1230
         // of complications. Instead, we use the RTPSender and remove just
@@ -1470,6 +1492,7 @@ export default class JingleSessionPC extends JingleSession {
1470 1492
      */
1471 1493
     close() {
1472 1494
         this.closed = true;
1495
+
1473 1496
         // do not try to close if already closed.
1474 1497
         this.peerconnection
1475 1498
             && ((this.peerconnection.signalingState

+ 4
- 0
modules/xmpp/RtxModifier.js Просмотреть файл

@@ -63,6 +63,7 @@ function updateAssociatedRtxStream(mLine, primarySsrcInfo, rtxSsrc) {
63 63
         ssrcs: `${primarySsrc} ${rtxSsrc}`
64 64
     });
65 65
 }
66
+
66 67
 /**
67 68
  * End helper functions
68 69
  */
@@ -148,6 +149,7 @@ export default class RtxModifier {
148 149
             } else {
149 150
                 logger.debug(
150 151
                     `No previously associated rtx ssrc for video ssrc ${ssrc}`);
152
+
151 153
                 // If there's one in the sdp already for it, we'll just set
152 154
                 //  that as the corresponding one
153 155
                 const previousAssociatedRtxStream = videoMLine.getRtxSSRC(ssrc);
@@ -213,9 +215,11 @@ export default class RtxModifier {
213 215
             return sdpStr;
214 216
         }
215 217
         const fidGroups = videoMLine.findGroups('FID');
218
+
216 219
         // Remove the fid groups from the mline
217 220
 
218 221
         videoMLine.removeGroupsBySemantics('FID');
222
+
219 223
         // Get the rtx ssrcs and remove them from the mline
220 224
         for (const fidGroup of fidGroups) {
221 225
             const rtxSsrc = parseSecondarySSRC(fidGroup);

+ 8
- 0
modules/xmpp/RtxModifier.spec.js Просмотреть файл

@@ -97,8 +97,10 @@ describe('RtxModifier', () => {
97 97
                 const newPrimaryVideoSsrc = getPrimaryVideoSsrc(newSdp);
98 98
 
99 99
                 expect(newPrimaryVideoSsrc).toEqual(this.primaryVideoSsrc);
100
+
100 101
           // Should now have an rtx ssrc as well
101 102
                 expect(numVideoSsrcs(newSdp)).toEqual(2);
103
+
102 104
           // Should now have an FID group
103 105
                 const fidGroups = getVideoGroups(newSdp, 'FID');
104 106
 
@@ -184,8 +186,10 @@ describe('RtxModifier', () => {
184 186
                 const newPrimaryVideoSsrcs = getPrimaryVideoSsrcs(newSdp);
185 187
 
186 188
                 expect(newPrimaryVideoSsrcs).toEqual(this.primaryVideoSsrcs);
189
+
187 190
           // Should now have rtx ssrcs as well
188 191
                 expect(numVideoSsrcs(newSdp)).toEqual(this.primaryVideoSsrcs.length * 2);
192
+
189 193
           // Should now have FID groups
190 194
                 const fidGroups = getVideoGroups(newSdp, 'FID');
191 195
 
@@ -206,6 +210,7 @@ describe('RtxModifier', () => {
206 210
 
207 211
                 const rtxMapping = new Map();
208 212
                 let fidGroups = getVideoGroups(newSdp, 'FID');
213
+
209 214
           // Save the first mapping that is made
210 215
 
211 216
                 fidGroups.forEach(fidGroup => {
@@ -215,6 +220,7 @@ describe('RtxModifier', () => {
215 220
 
216 221
                     rtxMapping.set(fidGroupPrimarySsrc, fidGroupRtxSsrc);
217 222
                 });
223
+
218 224
           // Now pass the original sdp through again and make sure we get the same mapping
219 225
                 newSdpStr = this.rtxModifier.modifyRtxSsrcs(this.transform.write(this.multipleVideoSdp));
220 226
                 newSdp = transform.parse(newSdpStr);
@@ -239,6 +245,7 @@ describe('RtxModifier', () => {
239 245
 
240 246
                 const rtxMapping = new Map();
241 247
                 let fidGroups = getVideoGroups(newSdp, 'FID');
248
+
242 249
           // Save the first mapping that is made
243 250
 
244 251
                 fidGroups.forEach(fidGroup => {
@@ -250,6 +257,7 @@ describe('RtxModifier', () => {
250 257
                 });
251 258
 
252 259
                 this.rtxModifier.clearSsrcCache();
260
+
253 261
           // Now pass the original sdp through again and make sure we get the same mapping
254 262
                 newSdpStr = this.rtxModifier.modifyRtxSsrcs(this.transform.write(this.multipleVideoSdp));
255 263
                 newSdp = transform.parse(newSdpStr);

+ 13
- 0
modules/xmpp/SDP.js Просмотреть файл

@@ -62,6 +62,7 @@ SDP.prototype.getMediaSsrcMap = function() {
62 62
         media_ssrcs[mediaindex] = media;
63 63
         tmp.forEach(line => {
64 64
             const linessrc = line.substring(7).split(' ')[0];
65
+
65 66
             // allocate new ChannelSsrc
66 67
 
67 68
             if (!media.ssrcs[linessrc]) {
@@ -89,6 +90,7 @@ SDP.prototype.getMediaSsrcMap = function() {
89 90
 
90 91
     return media_ssrcs;
91 92
 };
93
+
92 94
 /**
93 95
  * Returns <tt>true</tt> if this SDP contains given SSRC.
94 96
  * @param ssrc the ssrc to check.
@@ -151,6 +153,7 @@ SDP.prototype.removeSessionLines = function(prefix) {
151 153
 
152 154
     return lines;
153 155
 };
156
+
154 157
 // remove lines matching prefix from a media section specified by mediaindex
155 158
 // TODO: non-numeric mediaindex could match mid
156 159
 SDP.prototype.removeMediaLines = function(mediaindex, prefix) {
@@ -169,6 +172,7 @@ SDP.prototype.removeMediaLines = function(mediaindex, prefix) {
169 172
 // add content's to a jingle element
170 173
 SDP.prototype.toJingle = function(elem, thecreator) {
171 174
     let i, j, k, lines, mline, rtpmap, ssrc, tmp;
175
+
172 176
     // new bundle plan
173 177
 
174 178
     lines = SDPUtil.find_lines(this.session, 'a=group:');
@@ -221,6 +225,7 @@ SDP.prototype.toJingle = function(elem, thecreator) {
221 225
             for (j = 0; j < mline.fmt.length; j++) {
222 226
                 rtpmap = SDPUtil.find_line(this.media[i], `a=rtpmap:${mline.fmt[j]}`);
223 227
                 elem.c('payload-type', SDPUtil.parse_rtpmap(rtpmap));
228
+
224 229
                 // put any 'a=fmtp:' + mline.fmt[j] lines into <param name=foo value=bar/>
225 230
                 const afmtpline = SDPUtil.find_line(this.media[i], `a=fmtp:${mline.fmt[j]}`);
226 231
 
@@ -247,6 +252,7 @@ SDP.prototype.toJingle = function(elem, thecreator) {
247 252
                 // new style mapping
248 253
                 elem.c('source', { ssrc,
249 254
                     xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
255
+
250 256
                 // FIXME: group by ssrc and support multiple different ssrcs
251 257
                 const ssrclines = SDPUtil.find_lines(this.media[i], 'a=ssrc:');
252 258
 
@@ -290,8 +296,10 @@ SDP.prototype.toJingle = function(elem, thecreator) {
290 296
                         value: Math.random().toString(36).substring(7)
291 297
                     });
292 298
                     elem.up();
299
+
293 300
                     // FIXME what case does this code handle ? remove ???
294 301
                     let msid = null;
302
+
295 303
                     // FIXME what is this ? global APP.RTC in SDP ?
296 304
                     const localTrack = APP.RTC.getLocalTracks(mline.media);
297 305
 
@@ -366,6 +374,7 @@ SDP.prototype.toJingle = function(elem, thecreator) {
366 374
                             break;
367 375
                         }
368 376
                     }
377
+
369 378
                     // TODO: handle params
370 379
                     elem.up();
371 380
                 }
@@ -414,12 +423,14 @@ SDP.prototype.transportToJingle = function(mediaindex, elem) {
414 423
             number: sctpAttrs[0], /* SCTP port */
415 424
             protocol: sctpAttrs[1] /* protocol */
416 425
         });
426
+
417 427
         // Optional stream count attribute
418 428
         if (sctpAttrs.length > 2) {
419 429
             elem.attrs({ streams: sctpAttrs[2] });
420 430
         }
421 431
         elem.up();
422 432
     }
433
+
423 434
     // XEP-0320
424 435
     const fingerprints
425 436
         = SDPUtil.find_lines(this.media[mediaindex], 'a=fingerprint:', this.session);
@@ -440,6 +451,7 @@ SDP.prototype.transportToJingle = function(mediaindex, elem) {
440 451
     if (tmp) {
441 452
         tmp.xmlns = 'urn:xmpp:jingle:transports:ice-udp:1';
442 453
         elem.attrs(tmp);
454
+
443 455
         // XEP-0176
444 456
         if (SDPUtil.find_line(this.media[mediaindex], 'a=candidate:', this.session)) { // add any a=candidate lines
445 457
             const lines = SDPUtil.find_lines(this.media[mediaindex], 'a=candidate:', this.session);
@@ -673,6 +685,7 @@ SDP.prototype.jingle2media = function(content) {
673 685
                     .join('; ');
674 686
             media += '\r\n';
675 687
         }
688
+
676 689
         // xep-0293
677 690
         media += self.rtcpFbFromJingle($(this), this.getAttribute('id'));
678 691
     });

+ 3
- 0
modules/xmpp/SDPDiffer.js Просмотреть файл

@@ -54,6 +54,7 @@ SDPDiffer.prototype.getNewMedia = function() {
54 54
 
55 55
             return;
56 56
         }
57
+
57 58
         // Look for new ssrcs across the channel
58 59
         Object.keys(othersMedia.ssrcs).forEach(ssrc => {
59 60
             if (Object.keys(myMedia.ssrcs).indexOf(ssrc) === -1) {
@@ -126,6 +127,7 @@ SDPDiffer.prototype.toJingle = function(modify) {
126 127
         modify.c('description',
127 128
             { xmlns: 'urn:xmpp:jingle:apps:rtp:1',
128 129
                 media: media.mid });
130
+
129 131
         // FIXME: not completely sure this operates on blocks and / or handles
130 132
         // different ssrcs correctly
131 133
         // generate sources from lines
@@ -134,6 +136,7 @@ SDPDiffer.prototype.toJingle = function(modify) {
134 136
 
135 137
             modify.c('source', { xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
136 138
             modify.attrs({ ssrc: mediaSsrc.ssrc });
139
+
137 140
             // iterate over ssrc lines
138 141
             mediaSsrc.lines.forEach(line => {
139 142
                 const idx = line.indexOf(' ');

+ 8
- 0
modules/xmpp/SDPUtil.js Просмотреть файл

@@ -69,6 +69,7 @@ const SDPUtil = {
69 69
 
70 70
         return data;
71 71
     },
72
+
72 73
     /**
73 74
      * Parses SDP line "a=sctpmap:..." and extracts SCTP port from it.
74 75
      * @param line eg. "a=sctpmap:5000 webrtc-datachannel"
@@ -78,6 +79,7 @@ const SDPUtil = {
78 79
         const parts = line.substring(10).split(' ');
79 80
         const sctpPort = parts[0];
80 81
         const protocol = parts[1];
82
+
81 83
         // Stream count is optional
82 84
         const streamCount = parts.length > 2 ? parts[2] : null;
83 85
 
@@ -152,6 +154,7 @@ const SDPUtil = {
152 154
         candidate.priority = elems[3];
153 155
         candidate.ip = elems[4];
154 156
         candidate.port = elems[5];
157
+
155 158
         // elems[6] => "typ"
156 159
         candidate.type = elems[7];
157 160
         candidate.generation = 0; // default value, may be overwritten below
@@ -267,6 +270,7 @@ const SDPUtil = {
267 270
         if (!sessionpart) {
268 271
             return false;
269 272
         }
273
+
270 274
         // search session part
271 275
         lines = sessionpart.split('\r\n');
272 276
         for (let j = 0; j < lines.length; j++) {
@@ -289,6 +293,7 @@ const SDPUtil = {
289 293
         if (needles.length || !sessionpart) {
290 294
             return needles;
291 295
         }
296
+
292 297
         // search session part
293 298
         lines = sessionpart.split('\r\n');
294 299
         for (let j = 0; j < lines.length; j++) {
@@ -328,6 +333,7 @@ const SDPUtil = {
328 333
         candidate.priority = elems[3];
329 334
         candidate.ip = elems[4];
330 335
         candidate.port = elems[5];
336
+
331 337
         // elems[6] => "typ"
332 338
         candidate.type = elems[7];
333 339
 
@@ -367,6 +373,7 @@ const SDPUtil = {
367 373
         line += ' ';
368 374
 
369 375
         let protocol = cand.getAttribute('protocol');
376
+
370 377
         // use tcp candidates for FF
371 378
 
372 379
         if (RTCBrowserType.isFirefox() && protocol.toLowerCase() == 'ssltcp') {
@@ -509,6 +516,7 @@ const SDPUtil = {
509 516
     getMedia(sdp, type) {
510 517
         return sdp.media.find(m => m.type === type);
511 518
     },
519
+
512 520
     /**
513 521
      * Sets the given codecName as the preferred codec by
514 522
      *  moving it to the beginning of the payload types

+ 4
- 0
modules/xmpp/SampleSdpStrings.js Просмотреть файл

@@ -184,12 +184,16 @@ const simulcastRtxVideoMLineSdp = ''
184 184
 
185 185
 // A full sdp string representing a client doing simulcast
186 186
 const simulcastSdpStr = baseSessionSdp + baseAudioMLineSdp + simulcastVideoMLineSdp + baseDataMLineSdp;
187
+
187 188
 // A full sdp string representing a client doing simulcast and rtx
188 189
 const simulcastRtxSdpStr = baseSessionSdp + baseAudioMLineSdp + simulcastRtxVideoMLineSdp + baseDataMLineSdp;
190
+
189 191
 // A full sdp string representing a client doing a single video stream
190 192
 const plainVideoSdpStr = baseSessionSdp + baseAudioMLineSdp + plainVideoMLineSdp + baseDataMLineSdp;
193
+
191 194
 // A full sdp string representing a client doing a single video stream with rtx
192 195
 const rtxVideoSdpStr = baseSessionSdp + baseAudioMLineSdp + rtxVideoMLineSdp + baseDataMLineSdp;
196
+
193 197
 // A full sdp string representing a client doing a single video stream with multiple codec options
194 198
 const multiCodecVideoSdpStr = baseSessionSdp + baseAudioMLineSdp + multiCodecVideoMLine + baseDataMLineSdp;
195 199
 

+ 1
- 0
modules/xmpp/SdpTransformUtil.js Просмотреть файл

@@ -267,6 +267,7 @@ class MLineWrap {
267 267
             // Not using _ssrcs on purpose here
268 268
             return this.mLine.ssrcs[0].id;
269 269
         }
270
+
270 271
             // Look for a SIM or FID group
271 272
         if (this.mLine.ssrcGroups) {
272 273
             const simGroup = this.findGroup('SIM');

+ 17
- 0
modules/xmpp/moderator.js Просмотреть файл

@@ -19,6 +19,7 @@ function createExpBackoffTimer(step) {
19 19
 
20 20
             return;
21 21
         }
22
+
22 23
         // Calculate next timeout
23 24
         const timeout = Math.pow(2, count - 1);
24 25
 
@@ -33,6 +34,7 @@ function Moderator(roomName, xmpp, emitter, options) {
33 34
     this.xmppService = xmpp;
34 35
     this.getNextTimeout = createExpBackoffTimer(1000);
35 36
     this.getNextErrorTimeout = createExpBackoffTimer(1000);
37
+
36 38
     // External authentication stuff
37 39
     this.externalAuthEnabled = false;
38 40
     this.options = options;
@@ -46,6 +48,7 @@ function Moderator(roomName, xmpp, emitter, options) {
46 48
     this.eventEmitter = emitter;
47 49
 
48 50
     this.connection = this.xmppService.connection;
51
+
49 52
     // FIXME:
50 53
     // Message listener that talks to POPUP window
51 54
     function listener(event) {
@@ -58,9 +61,11 @@ function Moderator(roomName, xmpp, emitter, options) {
58 61
                 return;
59 62
             }
60 63
             Settings.setSessionId(event.data.sessionId);
64
+
61 65
             // After popup is closed we will authenticate
62 66
         }
63 67
     }
68
+
64 69
     // Register
65 70
     if (window.addEventListener) {
66 71
         window.addEventListener('message', listener, false);
@@ -102,6 +107,7 @@ Moderator.prototype.getFocusUserJid = function() {
102 107
 Moderator.prototype.getFocusComponent = function() {
103 108
     // Get focus component address
104 109
     let focusComponent = this.options.connection.hosts.focus;
110
+
105 111
     // If not specified use default:  'focus.domain'
106 112
 
107 113
     if (!focusComponent) {
@@ -138,6 +144,7 @@ Moderator.prototype.createConferenceIq = function() {
138 144
                 value: this.options.connection.enforcedBridge
139 145
             }).up();
140 146
     }
147
+
141 148
     // Tell the focus we have Jigasi configured
142 149
     if (this.options.connection.hosts !== undefined
143 150
         && this.options.connection.hosts.call_control !== undefined) {
@@ -287,11 +294,13 @@ Moderator.prototype.parseConfigOptions = function(resultIq) {
287 294
 Moderator.prototype.allocateConferenceFocus = function(callback) {
288 295
     // Try to use focus user JID from the config
289 296
     this.setFocusUserJid(this.options.connection.focusUserJid);
297
+
290 298
     // Send create conference IQ
291 299
     this.connection.sendIQ(
292 300
         this.createConferenceIq(),
293 301
         result => this._allocateConferenceFocusSuccess(result, callback),
294 302
         error => this._allocateConferenceFocusError(error, callback));
303
+
295 304
     // XXX We're pressed for time here because we're beginning a complex and/or
296 305
     // lengthy conference-establishment process which supposedly involves
297 306
     // multiple RTTs. We don't have the time to wait for Strophe to decide to
@@ -322,6 +331,7 @@ Moderator.prototype._allocateConferenceFocusError = function(error, callback) {
322 331
 
323 332
         return;
324 333
     }
334
+
325 335
     // Check for error returned by the reservation system
326 336
     const reservationErr = $(error).find('>error>reservation-error');
327 337
 
@@ -339,6 +349,7 @@ Moderator.prototype._allocateConferenceFocusError = function(error, callback) {
339 349
 
340 350
         return;
341 351
     }
352
+
342 353
     // Not authorized to create new room
343 354
     if ($(error).find('>error>not-authorized').length) {
344 355
         logger.warn('Unauthorized to start the conference', error);
@@ -358,9 +369,11 @@ Moderator.prototype._allocateConferenceFocusError = function(error, callback) {
358 369
 
359 370
     GlobalOnErrorHandler.callErrorHandler(new Error(errmsg));
360 371
     logger.error(errmsg, error);
372
+
361 373
     // Show message
362 374
     const focusComponent = this.getFocusComponent();
363 375
     const retrySec = waitMs / 1000;
376
+
364 377
     // FIXME: message is duplicated ? Do not show in case of session invalid
365 378
     // which means just a retry
366 379
 
@@ -368,6 +381,7 @@ Moderator.prototype._allocateConferenceFocusError = function(error, callback) {
368 381
         this.eventEmitter.emit(
369 382
                 XMPPEvents.FOCUS_DISCONNECTED, focusComponent, retrySec);
370 383
     }
384
+
371 385
     // Reset response timeout
372 386
     this.getNextTimeout(true);
373 387
     window.setTimeout(() => this.allocateConferenceFocus(callback), waitMs);
@@ -390,10 +404,12 @@ Moderator.prototype._allocateConferenceFocusSuccess = function(
390 404
 
391 405
     // Reset the error timeout (because we haven't failed here).
392 406
     this.getNextErrorTimeout(true);
407
+
393 408
     // eslint-disable-next-line newline-per-chained-call
394 409
     if ($(result).find('conference').attr('ready') === 'true') {
395 410
         // Reset the non-error timeout (because we've succeeded here).
396 411
         this.getNextTimeout(true);
412
+
397 413
         // Exec callback
398 414
         callback();
399 415
     } else {
@@ -448,6 +464,7 @@ Moderator.prototype._getLoginUrl = function(popup, urlCb, failureCb) {
448 464
         str = `POPUP ${str}`;
449 465
     }
450 466
     iq.c('login-url', attrs);
467
+
451 468
     /**
452 469
      * Implements a failure callback which reports an error message and an error
453 470
      * through (1) GlobalOnErrorHandler, (2) logger, and (3) failureCb.

+ 1
- 0
modules/xmpp/strophe.emuc.js Просмотреть файл

@@ -20,6 +20,7 @@ class MucConnectionPlugin extends ConnectionPluginListenable {
20 20
 
21 21
     init(connection) {
22 22
         super.init(connection);
23
+
23 24
         // add handlers (just once)
24 25
         this.connection.addHandler(this.onPresence.bind(this), null,
25 26
             'presence', null, null, null, null);

+ 6
- 0
modules/xmpp/strophe.jingle.js Просмотреть файл

@@ -25,6 +25,7 @@ class JingleConnectionPlugin extends ConnectionPlugin {
25 25
                 'OfferToReceiveAudio': true,
26 26
                 'OfferToReceiveVideo': true
27 27
             }
28
+
28 29
             // MozDontOfferDataChannel: true when this is firefox
29 30
         };
30 31
     }
@@ -39,6 +40,7 @@ class JingleConnectionPlugin extends ConnectionPlugin {
39 40
         const sid = $(iq).find('jingle').attr('sid');
40 41
         const action = $(iq).find('jingle').attr('action');
41 42
         const fromJid = iq.getAttribute('from');
43
+
42 44
         // send ack first
43 45
         const ack = $iq({ type: 'result',
44 46
             to: fromJid,
@@ -60,6 +62,7 @@ class JingleConnectionPlugin extends ConnectionPlugin {
60 62
 
61 63
                 return true;
62 64
             }
65
+
63 66
             // local jid is not checked
64 67
             if (fromJid != sess.peerjid) {
65 68
                 logger.warn(
@@ -84,6 +87,7 @@ class JingleConnectionPlugin extends ConnectionPlugin {
84 87
             return true;
85 88
         }
86 89
         const now = window.performance.now();
90
+
87 91
         // see http://xmpp.org/extensions/xep-0166.html#concepts-session
88 92
 
89 93
         switch (action) {
@@ -216,6 +220,7 @@ class JingleConnectionPlugin extends ConnectionPlugin {
216 220
                     case 'turns': {
217 221
                         dict.url = `${type}:`;
218 222
                         const username = el.attr('username');
223
+
219 224
                             // https://code.google.com/p/webrtc/issues/detail?id=1508
220 225
 
221 226
                         if (username) {
@@ -255,6 +260,7 @@ class JingleConnectionPlugin extends ConnectionPlugin {
255 260
                 logger.warn('getting turn credentials failed', err);
256 261
                 logger.warn('is mod_turncredentials or similar installed?');
257 262
             });
263
+
258 264
         // implement push?
259 265
     }
260 266
 

+ 1
- 0
modules/xmpp/strophe.ping.js Просмотреть файл

@@ -108,6 +108,7 @@ class PingConnectionPlugin extends ConnectionPlugin {
108 108
                 if (this.failedPings >= PING_THRESHOLD) {
109 109
                     GlobalOnErrorHandler.callErrorHandler(new Error(errmsg));
110 110
                     logger.error(errmsg, error);
111
+
111 112
                     // FIXME it doesn't help to disconnect when 3rd PING
112 113
                     // times out, it only stops Strophe from retrying.
113 114
                     // Not really sure what's the right thing to do in that

+ 2
- 0
modules/xmpp/strophe.util.js Просмотреть файл

@@ -55,6 +55,7 @@ export default function() {
55 55
                 && msg.indexOf('timed out (secondary), restarting') !== -1) {
56 56
             level = Strophe.LogLevel.WARN;
57 57
         }
58
+
58 59
         /* eslint-disable no-case-declarations */
59 60
         switch (level) {
60 61
         case Strophe.LogLevel.DEBUG:
@@ -83,6 +84,7 @@ export default function() {
83 84
             logger.error(msg);
84 85
             break;
85 86
         }
87
+
86 88
         /* eslint-enable no-case-declarations */
87 89
     };
88 90
 

+ 3
- 0
modules/xmpp/xmpp.js Просмотреть файл

@@ -176,6 +176,7 @@ export default class XMPP extends Listenable {
176 176
                 // more than 4 times. The connection is dropped without
177 177
                 // supplying a reason(error message/event) through the API.
178 178
                 logger.error('XMPP connection dropped!');
179
+
179 180
                 // XXX if the last request error is within 5xx range it means it
180 181
                 // was a server failure
181 182
                 const lastErrorStatus = Strophe.getLastErrorStatus();
@@ -260,6 +261,7 @@ export default class XMPP extends Listenable {
260 261
             let configDomain
261 262
                 = this.options.hosts.anonymousdomain
262 263
                     || this.options.hosts.domain;
264
+
263 265
             // Force authenticated domain if room is appended with '?login=true'
264 266
             // or if we're joining with the token
265 267
 
@@ -288,6 +290,7 @@ export default class XMPP extends Listenable {
288 290
             // node of the anonymous JID is very long - here we trim it a bit
289 291
             mucNickname = mucNickname.substr(0, 8);
290 292
         }
293
+
291 294
         // Constant JIDs need some random part to be appended in order to be
292 295
         // able to join the MUC more than once.
293 296
         if (this.authenticatedUser || cfgNickname !== null) {

+ 9
- 0
service/RTC/RTCEvents.js Просмотреть файл

@@ -3,12 +3,14 @@ const RTCEvents = {
3 3
      * Indicates error while create answer call.
4 4
      */
5 5
     CREATE_ANSWER_FAILED: 'rtc.create_answer_failed',
6
+
6 7
     /**
7 8
      * Indicates error while create offer call.
8 9
      * FIXME not used (yet), but hook up with create offer failure once added
9 10
      */
10 11
     CREATE_OFFER_FAILED: 'rtc.create_offer_failed',
11 12
     RTC_READY: 'rtc.ready',
13
+
12 14
     /**
13 15
      * FIXME: rename to something closer to "local streams SDP changed"
14 16
      * Indicates that the local sendrecv streams in local SDP are changed.
@@ -21,6 +23,7 @@ const RTCEvents = {
21 23
     LASTN_ENDPOINT_CHANGED: 'rtc.lastn_endpoint_changed',
22 24
     AVAILABLE_DEVICES_CHANGED: 'rtc.available_devices_changed',
23 25
     TRACK_ATTACHED: 'rtc.track_attached',
26
+
24 27
     /**
25 28
      * Event fired when we remote track is added to the conference.
26 29
      * The following structure is passed as an argument:
@@ -33,9 +36,11 @@ const RTCEvents = {
33 36
       *         'null' if unknown
34 37
      **/
35 38
     REMOTE_TRACK_ADDED: 'rtc.remote_track_added',
39
+
36 40
     // FIXME get rid of this event in favour of NO_DATA_FROM_SOURCE event
37 41
     // (currently implemented for local tracks only)
38 42
     REMOTE_TRACK_MUTE: 'rtc.remote_track_mute',
43
+
39 44
     /**
40 45
      * Indicates that the remote track has been removed from the conference.
41 46
      * 1st event argument is the ID of the parent WebRTC stream to which
@@ -43,13 +48,16 @@ const RTCEvents = {
43 48
      * 2nd event argument is the ID of the removed track.
44 49
      */
45 50
     REMOTE_TRACK_REMOVED: 'rtc.remote_track_removed',
51
+
46 52
     // FIXME get rid of this event in favour of NO_DATA_FROM_SOURCE event
47 53
     // (currently implemented for local tracks only)
48 54
     REMOTE_TRACK_UNMUTE: 'rtc.remote_track_unmute',
55
+
49 56
     /**
50 57
      * Indicates error while set local description.
51 58
      */
52 59
     SET_LOCAL_DESCRIPTION_FAILED: 'rtc.set_local_description_failed',
60
+
53 61
     /**
54 62
      * Indicates error while set remote description.
55 63
      */
@@ -57,6 +65,7 @@ const RTCEvents = {
57 65
     AUDIO_OUTPUT_DEVICE_CHANGED: 'rtc.audio_output_device_changed',
58 66
     DEVICE_LIST_CHANGED: 'rtc.device_list_changed',
59 67
     DEVICE_LIST_AVAILABLE: 'rtc.device_list_available',
68
+
60 69
     /**
61 70
      * Indicates that a message from another participant is received on
62 71
      * data channel.

+ 2
- 0
service/RTC/Resolutions.js Просмотреть файл

@@ -24,6 +24,7 @@ const Resolutions = {
24 24
         height: 720,
25 25
         order: 5
26 26
     },
27
+
27 28
     // 16:9 resolution first.
28 29
     '360': {
29 30
         width: 640,
@@ -40,6 +41,7 @@ const Resolutions = {
40 41
         height: 480,
41 42
         order: 3
42 43
     },
44
+
43 45
     // 16:9 resolution first.
44 46
     '180': {
45 47
         width: 320,

+ 1
- 0
service/RTC/SignalingLayer.js Просмотреть файл

@@ -23,6 +23,7 @@ export default class SignalingLayer {
23 23
     getSSRCOwner(ssrc) { // eslint-disable-line no-unused-vars
24 24
         throw new Error('not implemented');
25 25
     }
26
+
26 27
     /**
27 28
      * Obtains the info about given media advertised in the MUC presence of
28 29
      * the participant identified by the given MUC JID.

+ 1
- 0
service/RTC/VideoType.js Просмотреть файл

@@ -8,6 +8,7 @@ const VideoType = {
8 8
      * The camera video type.
9 9
      */
10 10
     CAMERA: 'camera',
11
+
11 12
     /**
12 13
      * The desktop video type.
13 14
      */

+ 40
- 0
service/xmpp/XMPPEvents.js Просмотреть файл

@@ -3,14 +3,17 @@ const XMPPEvents = {
3 3
      * Indicates error while adding ice candidate.
4 4
      */
5 5
     ADD_ICE_CANDIDATE_FAILED: 'xmpp.add_ice_candidate_failed',
6
+
6 7
     // Designates an event indicating that the focus has asked us to mute our
7 8
     // audio.
8 9
     AUDIO_MUTED_BY_FOCUS: 'xmpp.audio_muted_by_focus',
9 10
     AUTHENTICATION_REQUIRED: 'xmpp.authentication_required',
10 11
     BRIDGE_DOWN: 'xmpp.bridge_down',
12
+
11 13
     // Designates an event indicating that an offer (e.g. Jingle
12 14
     // session-initiate) was received.
13 15
     CALL_INCOMING: 'xmpp.callincoming.jingle',
16
+
14 17
     // Triggered when Jicofo kills our media session, this can happen while
15 18
     // we're still in the MUC, when it decides to terminate the media session.
16 19
     // For example when the session is idle for too long, because we're the only
@@ -18,25 +21,32 @@ const XMPPEvents = {
18 21
     CALL_ENDED: 'xmpp.callended.jingle',
19 22
     CHAT_ERROR_RECEIVED: 'xmpp.chat_error_received',
20 23
     CONFERENCE_SETUP_FAILED: 'xmpp.conference_setup_failed',
24
+
21 25
     // Designates an event indicating that the connection to the XMPP server
22 26
     // failed.
23 27
     CONNECTION_FAILED: 'xmpp.connection.failed',
28
+
24 29
     // Designates an event indicating that the media (ICE) connection was
25 30
     // interrupted. This should go to the RTC module.
26 31
     CONNECTION_INTERRUPTED: 'xmpp.connection.interrupted',
32
+
27 33
     // Designates an event indicating that the media (ICE) connection was
28 34
     // restored. This should go to the RTC module.
29 35
     CONNECTION_RESTORED: 'xmpp.connection.restored',
36
+
30 37
     // Designates an event indicating that the media (ICE) connection failed.
31 38
     // This should go to the RTC module.
32 39
     CONNECTION_ICE_FAILED: 'xmpp.connection.ice.failed',
40
+
33 41
     // Designates an event indicating that the display name of a participant
34 42
     // has changed.
35 43
     DISPLAY_NAME_CHANGED: 'xmpp.display_name_changed',
44
+
36 45
     /**
37 46
      * Chat room instance have been added to Strophe.emuc plugin.
38 47
      */
39 48
     EMUC_ROOM_ADDED: 'xmpp.emuc_room_added',
49
+
40 50
     /**
41 51
      * Chat room instance have been removed from Strophe.emuc plugin.
42 52
      */
@@ -45,11 +55,13 @@ const XMPPEvents = {
45 55
     FOCUS_DISCONNECTED: 'xmpp.focus_disconnected',
46 56
     FOCUS_LEFT: 'xmpp.focus_left',
47 57
     GRACEFUL_SHUTDOWN: 'xmpp.graceful_shutdown',
58
+
48 59
     /**
49 60
      * Event fired when 'transport-replace' Jingle message has been received,
50 61
      * before the new offer is set on the PeerConnection.
51 62
      */
52 63
     ICE_RESTARTING: 'rtc.ice_restarting',
64
+
53 65
     /* Event fired when XMPP error is returned to any request, it is meant to be
54 66
      * used to report 'signaling' errors to CallStats
55 67
      *
@@ -61,59 +73,78 @@ const XMPPEvents = {
61 73
      * }
62 74
      */
63 75
     JINGLE_ERROR: 'xmpp.jingle_error',
76
+
64 77
     // Event fired when we have failed to set initial offer
65 78
     JINGLE_FATAL_ERROR: 'xmpp.jingle_fatal_error',
79
+
66 80
     // Designates an event indicating that we were kicked from the XMPP MUC.
67 81
     KICKED: 'xmpp.kicked',
82
+
68 83
     // Designates an event indicating that our role in the XMPP MUC has changed.
69 84
     LOCAL_ROLE_CHANGED: 'xmpp.localrole_changed',
85
+
70 86
     // Designates an event indicating that an XMPP message in the MUC was
71 87
     // received.
72 88
     MESSAGE_RECEIVED: 'xmpp.message_received',
89
+
73 90
     // Designates an event indicating that the XMPP MUC was destroyed.
74 91
     MUC_DESTROYED: 'xmpp.muc_destroyed',
92
+
75 93
     // Designates an event indicating that we have joined the XMPP MUC.
76 94
     MUC_JOINED: 'xmpp.muc_joined',
95
+
77 96
     // Designates an event indicating that a participant joined the XMPP MUC.
78 97
     MUC_MEMBER_JOINED: 'xmpp.muc_member_joined',
98
+
79 99
     // Designates an event indicating that a participant left the XMPP MUC.
80 100
     MUC_MEMBER_LEFT: 'xmpp.muc_member_left',
101
+
81 102
     // Designates an event indicating that local participant left the muc
82 103
     MUC_LEFT: 'xmpp.muc_left',
104
+
83 105
     // Designates an event indicating that the MUC role of a participant has
84 106
     // changed.
85 107
     MUC_ROLE_CHANGED: 'xmpp.muc_role_changed',
108
+
86 109
     // Designates an event indicating that the MUC has been locked or unlocked.
87 110
     MUC_LOCK_CHANGED: 'xmpp.muc_lock_changed',
111
+
88 112
     // Designates an event indicating that a participant in the XMPP MUC has
89 113
     // advertised that they have audio muted (or unmuted).
90 114
     PARTICIPANT_AUDIO_MUTED: 'xmpp.audio_muted',
115
+
91 116
     // Designates an event indicating that a participant in the XMPP MUC has
92 117
     // advertised that they have video muted (or unmuted).
93 118
     PARTICIPANT_VIDEO_MUTED: 'xmpp.video_muted',
119
+
94 120
     // Designates an event indicating that the video type (e.g. 'camera' or
95 121
     // 'screen') for a participant has changed.
96 122
     // Note: currently this event fires every time we receive presence from
97 123
     // someone (regardless of whether or not the "video type" changed).
98 124
     PARTICIPANT_VIDEO_TYPE_CHANGED: 'xmpp.video_type',
125
+
99 126
     /**
100 127
      * Indicates that the features of the participant has been changed.
101 128
      */
102 129
     PARTCIPANT_FEATURES_CHANGED: 'xmpp.partcipant_features_changed',
103 130
     PASSWORD_REQUIRED: 'xmpp.password_required',
104 131
     PEERCONNECTION_READY: 'xmpp.peerconnection_ready',
132
+
105 133
     /**
106 134
      * Indicates that phone number changed.
107 135
      */
108 136
     PHONE_NUMBER_CHANGED: 'conference.phoneNumberChanged',
109 137
     PRESENCE_STATUS: 'xmpp.presence_status',
110 138
     PROMPT_FOR_LOGIN: 'xmpp.prompt_for_login',
139
+
111 140
     // xmpp is connected and obtained user media
112 141
     READY_TO_JOIN: 'xmpp.ready_to_join',
142
+
113 143
     /**
114 144
      * Indicates that recording state changed.
115 145
      */
116 146
     RECORDER_STATE_CHANGED: 'xmpp.recorderStateChanged',
147
+
117 148
     // Designates an event indicating that we received statistics from a
118 149
     // participant in the MUC.
119 150
     REMOTE_STATS: 'xmpp.remote_stats',
@@ -121,12 +152,15 @@ const XMPPEvents = {
121 152
     ROOM_CONNECT_ERROR: 'xmpp.room_connect_error',
122 153
     ROOM_CONNECT_NOT_ALLOWED_ERROR: 'xmpp.room_connect_error.not_allowed',
123 154
     ROOM_JOIN_ERROR: 'xmpp.room_join_error',
155
+
124 156
     /**
125 157
      * Indicates that max users limit has been reached.
126 158
      */
127 159
     ROOM_MAX_USERS_ERROR: 'xmpp.room_max_users_error',
160
+
128 161
     // Designates an event indicating that we sent an XMPP message to the MUC.
129 162
     SENDING_CHAT_MESSAGE: 'xmpp.sending_chat_message',
163
+
130 164
     /**
131 165
      * Event fired when we do not get our 'session-accept' acknowledged by
132 166
      * Jicofo. It most likely means that there is serious problem with our
@@ -138,20 +172,26 @@ const XMPPEvents = {
138 172
      * packets means that most likely it has never seen our IQ.
139 173
      */
140 174
     SESSION_ACCEPT_TIMEOUT: 'xmpp.session_accept_timeout',
175
+
141 176
     // Designates an event indicating that we should join the conference with
142 177
     // audio and/or video muted.
143 178
     START_MUTED_FROM_FOCUS: 'xmpp.start_muted_from_focus',
179
+
144 180
     // Designates an event indicating that the subject of the XMPP MUC has
145 181
     // changed.
146 182
     SUBJECT_CHANGED: 'xmpp.subject_changed',
183
+
147 184
     // suspending detected
148 185
     SUSPEND_DETECTED: 'xmpp.suspend_detected',
186
+
149 187
     // Designates an event indicating that the local ICE username fragment of
150 188
     // the jingle session has changed.
151 189
     LOCAL_UFRAG_CHANGED: 'xmpp.local_ufrag_changed',
190
+
152 191
     // Designates an event indicating that the local ICE username fragment of
153 192
     // the jingle session has changed.
154 193
     REMOTE_UFRAG_CHANGED: 'xmpp.remote_ufrag_changed',
194
+
155 195
     // Designates an event indicating that the local ICE connection state has
156 196
     // changed.
157 197
     ICE_CONNECTION_STATE_CHANGED: 'xmpp.ice_connection_state_changed'

Загрузка…
Отмена
Сохранить