소스 검색

feat(lint) update linter and apply it to TS code

dev0
Saúl Ibarra Corretgé 7 달 전
부모
커밋
f0e3cb289c
No account linked to committer's email address
58개의 변경된 파일6912개의 추가작업 그리고 4256개의 파일을 삭제
  1. 4
    0
      .eslintignore
  2. 13
    0
      .eslintrc.js
  3. 23
    22
      JitsiConferenceErrors.ts
  4. 43
    41
      JitsiConferenceEvents.ts
  5. 3
    2
      JitsiConnectionErrors.ts
  6. 8
    7
      JitsiConnectionEvents.ts
  7. 2
    1
      JitsiMediaDevicesEvents.ts
  8. 27
    19
      JitsiMeetJS.ts
  9. 6
    5
      JitsiTrackErrors.ts
  10. 23
    21
      JitsiTrackEvents.ts
  11. 5
    4
      JitsiTranscriptionStatus.ts
  12. 2
    1
      index.js
  13. 4
    4
      modules/RTC/JitsiLocalTrack.js
  14. 6
    0
      modules/RTCStats/DefaulLogStorage.ts
  15. 24
    20
      modules/RTCStats/RTCStats.ts
  16. 7
    6
      modules/RTCStats/RTCStatsEvents.ts
  17. 3
    3
      modules/connectivity/IceFailedHandling.ts
  18. 14
    16
      modules/connectivity/TrackStreamingStatus.ts
  19. 11
    10
      modules/detection/DetectionEvents.ts
  20. 4
    4
      modules/e2ee/E2EEErrors.ts
  21. 1
    1
      modules/e2ee/ManagedKeyHandler.js
  22. 1
    2
      modules/e2ee/Worker.js
  23. 2
    2
      modules/e2ee/crypto-utils.js
  24. 1
    1
      modules/flags/FeatureFlags.ts
  25. 0
    1
      modules/litemode/LiteModeContext.js
  26. 1
    1
      modules/proxyconnection/ProxyConnectionService.js
  27. 1
    1
      modules/proxyconnection/constants.ts
  28. 7
    1
      modules/qualitycontrol/MockClasses.ts
  29. 59
    36
      modules/qualitycontrol/QualityController.ts
  30. 24
    25
      modules/sdp/SdpSimulcast.ts
  31. 25
    15
      modules/statistics/PreCallTest.ts
  32. 1
    1
      modules/version/ComponentsVersions.ts
  33. 19
    16
      modules/videosipgw/VideoSIPGWConstants.ts
  34. 3
    1
      modules/watchRTC/WatchRTC.ts
  35. 3
    0
      modules/watchRTC/functions.ts
  36. 8
    7
      modules/xmpp/JingleSessionState.ts
  37. 1
    1
      modules/xmpp/Lobby.js
  38. 3
    2
      modules/xmpp/MediaSessionEvents.ts
  39. 6083
    3599
      package-lock.json
  40. 11
    7
      package.json
  41. 1
    0
      service/RTC/BridgeVideoType.ts
  42. 1
    0
      service/RTC/CameraFacingMode.ts
  43. 1
    0
      service/RTC/CodecMimeType.ts
  44. 1
    0
      service/RTC/MediaDirection.ts
  45. 7
    6
      service/RTC/MediaType.ts
  46. 57
    51
      service/RTC/RTCEvents.ts
  47. 1
    0
      service/RTC/SignalingEvents.ts
  48. 11
    8
      service/RTC/StandardVideoQualitySettings.ts
  49. 1
    0
      service/RTC/VideoEncoderScalabilityMode.ts
  50. 1
    0
      service/RTC/VideoType.ts
  51. 2
    1
      service/connectivity/ConnectionQualityEvents.ts
  52. 2
    1
      service/e2eping/E2ePingEvents.ts
  53. 183
    143
      service/statistics/AnalyticsEvents.ts
  54. 2
    1
      service/statistics/Events.ts
  55. 1
    1
      service/statistics/constants.ts
  56. 144
    127
      service/xmpp/XMPPEvents.ts
  57. 7
    6
      service/xmpp/XMPPExtensioProtocols.ts
  58. 3
    5
      webpack.config.js

+ 4
- 0
.eslintignore 파일 보기

11
 # not seem to be a reason why we will want to risk being inconsistent with our
11
 # not seem to be a reason why we will want to risk being inconsistent with our
12
 # remaining JavaScript source code.
12
 # remaining JavaScript source code.
13
 !.eslintrc.js
13
 !.eslintrc.js
14
+
15
+*.d.ts
16
+*.spec.ts
17
+*.spec.js

+ 13
- 0
.eslintrc.js 파일 보기

4
     },
4
     },
5
     'extends': [
5
     'extends': [
6
         '@jitsi/eslint-config'
6
         '@jitsi/eslint-config'
7
+    ],
8
+    'overrides': [
9
+        {
10
+            'files': [ '*.ts' ],
11
+            extends: [ '@jitsi/eslint-config/typescript' ],
12
+            parserOptions: {
13
+                sourceType: 'module',
14
+                project: [ 'tsconfig.json' ]
15
+            },
16
+            rules: {
17
+                'no-continue': 0
18
+            }
19
+        }
7
     ]
20
     ]
8
 };
21
 };

+ 23
- 22
JitsiConferenceErrors.ts 파일 보기

3
  */
3
  */
4
 
4
 
5
 export enum JitsiConferenceErrors {
5
 export enum JitsiConferenceErrors {
6
+
6
     /**
7
     /**
7
      * Indicates that client must be authenticated to create the conference.
8
      * Indicates that client must be authenticated to create the conference.
8
      */
9
      */
14
     CHAT_ERROR = 'conference.chatError',
15
     CHAT_ERROR = 'conference.chatError',
15
 
16
 
16
     /**
17
     /**
17
-     * Indicates that a settings error occurred.
18
+     * Indicates that a connection error is due to denied access to the room,
19
+     * occurred after joining a lobby room and access is denied by the room moderators.
18
      */
20
      */
19
-    SETTINGS_ERROR = 'conference.settingsError',
21
+    CONFERENCE_ACCESS_DENIED = 'conference.connectionError.accessDenied',
20
 
22
 
21
     /**
23
     /**
22
      * Indicates that conference has been destroyed.
24
      * Indicates that conference has been destroyed.
28
      */
30
      */
29
     CONFERENCE_MAX_USERS = 'conference.max_users',
31
     CONFERENCE_MAX_USERS = 'conference.max_users',
30
 
32
 
31
-    /**
32
-     * Indicates that a connection error occurred when trying to join a conference.
33
-     */
34
-    CONNECTION_ERROR = 'conference.connectionError',
35
-
36
     /**
33
     /**
37
      * Indicates that the client has been forced to restart by jicofo when the
34
      * Indicates that the client has been forced to restart by jicofo when the
38
      * conference was migrated from one bridge to another.
35
      * conference was migrated from one bridge to another.
40
     CONFERENCE_RESTARTED = 'conference.restarted',
37
     CONFERENCE_RESTARTED = 'conference.restarted',
41
 
38
 
42
     /**
39
     /**
43
-     * Indicates that a connection error is due to not allowed,
44
-     * occurred when trying to join a conference.
45
-     */
46
-    NOT_ALLOWED_ERROR = 'conference.connectionError.notAllowed',
47
-
48
-    /**
49
-     * Indicates that a connection error is due to not allowed,
50
-     * occurred when trying to join a conference, only approved members are allowed to join.
51
-     */
52
-    MEMBERS_ONLY_ERROR = 'conference.connectionError.membersOnly',
53
-
54
-    /**
55
-     * Indicates that a connection error is due to denied access to the room,
56
-     * occurred after joining a lobby room and access is denied by the room moderators.
40
+     * Indicates that a connection error occurred when trying to join a conference.
57
      */
41
      */
58
-    CONFERENCE_ACCESS_DENIED = 'conference.connectionError.accessDenied',
42
+    CONNECTION_ERROR = 'conference.connectionError',
59
 
43
 
60
     /**
44
     /**
61
      * Indicates that the display name is required when joining the room.
45
      * Indicates that the display name is required when joining the room.
90
      */
74
      */
91
     INCOMPATIBLE_SERVER_VERSIONS = 'conference.incompatible_server_versions',
75
     INCOMPATIBLE_SERVER_VERSIONS = 'conference.incompatible_server_versions',
92
 
76
 
77
+    /**
78
+     * Indicates that a connection error is due to not allowed,
79
+     * occurred when trying to join a conference, only approved members are allowed to join.
80
+     */
81
+    MEMBERS_ONLY_ERROR = 'conference.connectionError.membersOnly',
82
+
83
+    /**
84
+     * Indicates that a connection error is due to not allowed,
85
+     * occurred when trying to join a conference.
86
+     */
87
+    NOT_ALLOWED_ERROR = 'conference.connectionError.notAllowed',
88
+
93
     /**
89
     /**
94
      * Indicates that offer/answer had failed.
90
      * Indicates that offer/answer had failed.
95
      */
91
      */
110
      */
106
      */
111
     RESERVATION_ERROR = 'conference.reservationError',
107
     RESERVATION_ERROR = 'conference.reservationError',
112
 
108
 
109
+    /**
110
+     * Indicates that a settings error occurred.
111
+     */
112
+    SETTINGS_ERROR = 'conference.settingsError',
113
+
113
     /**
114
     /**
114
      * Indicates that there is no available videobridge.
115
      * Indicates that there is no available videobridge.
115
      */
116
      */

+ 43
- 41
JitsiConferenceEvents.ts 파일 보기

2
  * The events for the conference.
2
  * The events for the conference.
3
  */
3
  */
4
 export enum JitsiConferenceEvents {
4
 export enum JitsiConferenceEvents {
5
-    /**
6
-     * An event(library-private) fired when the conference switches the currently active media session.
7
-     * @type {string}
8
-     * @private
9
-     */
10
-    _MEDIA_SESSION_ACTIVE_CHANGED = 'conference.media_session.active_changed',
11
-
12
-    /**
13
-     * An event(library-private) fired when a new media session is added to the conference.
14
-     * @type {string}
15
-     * @private
16
-     */
17
-    _MEDIA_SESSION_STARTED = 'conference.media_session.started',
18
 
5
 
19
     /**
6
     /**
20
      * Event indicates that the current conference audio input switched between audio
7
      * Event indicates that the current conference audio input switched between audio
23
     AUDIO_INPUT_STATE_CHANGE = 'conference.audio_input_state_changed',
10
     AUDIO_INPUT_STATE_CHANGE = 'conference.audio_input_state_changed',
24
 
11
 
25
     /**
12
     /**
26
-     * Event indicates that the permission for unmuting audio has changed based on the number of audio senders in the call
27
-     * and the audio sender limit configured in Jicofo.
13
+     * Event indicates that the permission for unmuting audio has changed based on the number of audio senders in the
14
+     * call and the audio sender limit configured in Jicofo.
28
      */
15
      */
29
     AUDIO_UNMUTE_PERMISSIONS_CHANGED = 'conference.audio_unmute_permissions_changed',
16
     AUDIO_UNMUTE_PERMISSIONS_CHANGED = 'conference.audio_unmute_permissions_changed',
30
 
17
 
115
      */
102
      */
116
     CONFERENCE_FAILED = 'conference.failed',
103
     CONFERENCE_FAILED = 'conference.failed',
117
 
104
 
118
-    /**
119
-     * Indicates that conference is in progress of joining.
120
-     */
121
-    CONFERENCE_JOIN_IN_PROGRESS = 'conference.join_in_progress',
122
-
123
     /**
105
     /**
124
      * Indicates that conference has been joined. The event does NOT provide any
106
      * Indicates that conference has been joined. The event does NOT provide any
125
      * parameters to its listeners.
107
      * parameters to its listeners.
126
      */
108
      */
127
     CONFERENCE_JOINED = 'conference.joined',
109
     CONFERENCE_JOINED = 'conference.joined',
128
 
110
 
111
+    /**
112
+     * Indicates that conference is in progress of joining.
113
+     */
114
+    CONFERENCE_JOIN_IN_PROGRESS = 'conference.join_in_progress',
115
+
129
     /**
116
     /**
130
      * Indicates that conference has been left.
117
      * Indicates that conference has been left.
131
      */
118
      */
163
 
150
 
164
     /**
151
     /**
165
      * A connection to the video bridge's data channel has been closed.
152
      * A connection to the video bridge's data channel has been closed.
166
-     * This event is only emitted in 
153
+     * This event is only emitted in
167
      */
154
      */
168
     DATA_CHANNEL_CLOSED = 'conference.dataChannelClosed',
155
     DATA_CHANNEL_CLOSED = 'conference.dataChannelClosed',
169
 
156
 
284
      */
271
      */
285
     MESSAGE_RECEIVED = 'conference.messageReceived',
272
     MESSAGE_RECEIVED = 'conference.messageReceived',
286
 
273
 
287
-    /**
288
-     * New reaction was received.
289
-     */
290
-    REACTION_RECEIVED = 'conference.reactionReceived',
291
-
292
     /**
274
     /**
293
      * Event fired when the conference metadata is updated.
275
      * Event fired when the conference metadata is updated.
294
      */
276
      */
295
     METADATA_UPDATED = 'conference.metadata.updated',
277
     METADATA_UPDATED = 'conference.metadata.updated',
296
 
278
 
297
-    /**
298
-     * Event indicates that the current selected input device has no signal
299
-     */
300
-    NO_AUDIO_INPUT = 'conference.no_audio_input',
301
-
302
     /**
279
     /**
303
      * Event indicates that the current microphone used by the conference is noisy.
280
      * Event indicates that the current microphone used by the conference is noisy.
304
      */
281
      */
310
      */
287
      */
311
     NON_PARTICIPANT_MESSAGE_RECEIVED = 'conference.non_participant_message_received',
288
     NON_PARTICIPANT_MESSAGE_RECEIVED = 'conference.non_participant_message_received',
312
 
289
 
290
+    /**
291
+     * Event indicates that the current selected input device has no signal
292
+     */
293
+    NO_AUDIO_INPUT = 'conference.no_audio_input',
294
+
313
     /**
295
     /**
314
      * Indicates that the conference has switched between JVB and P2P connections.
296
      * Indicates that the conference has switched between JVB and P2P connections.
315
      * The first argument of this event is a <tt>boolean</tt> which when set to
297
      * The first argument of this event is a <tt>boolean</tt> which when set to
350
      * New private text message was received.
332
      * New private text message was received.
351
      */
333
      */
352
     PRIVATE_MESSAGE_RECEIVED = 'conference.privateMessageReceived',
334
     PRIVATE_MESSAGE_RECEIVED = 'conference.privateMessageReceived',
335
+
353
     /**
336
     /**
354
      * The conference properties changed.
337
      * The conference properties changed.
355
      * @type {string}
338
      * @type {string}
356
      */
339
      */
357
     PROPERTIES_CHANGED = 'conference.propertiesChanged',
340
     PROPERTIES_CHANGED = 'conference.propertiesChanged',
358
 
341
 
342
+    /**
343
+     * New reaction was received.
344
+     */
345
+    REACTION_RECEIVED = 'conference.reactionReceived',
346
+
359
     /**
347
     /**
360
      * Indicates that recording state changed.
348
      * Indicates that recording state changed.
361
      */
349
      */
374
     SILENT_STATUS_CHANGED = 'conference.silentStatusChanged',
362
     SILENT_STATUS_CHANGED = 'conference.silentStatusChanged',
375
 
363
 
376
     /**
364
     /**
377
-     * Indicates that start muted settings changed.
365
+     * Indicates that the local user has started muted.
378
      */
366
      */
379
-    START_MUTED_POLICY_CHANGED = 'conference.start_muted_policy_changed',
367
+    STARTED_MUTED = 'conference.started_muted',
380
 
368
 
381
     /**
369
     /**
382
-     * Indicates that the local user has started muted.
370
+     * Indicates that start muted settings changed.
383
      */
371
      */
384
-    STARTED_MUTED = 'conference.started_muted',
372
+    START_MUTED_POLICY_CHANGED = 'conference.start_muted_policy_changed',
385
 
373
 
386
     /**
374
     /**
387
      * Indicates that subject of the conference has changed.
375
      * Indicates that subject of the conference has changed.
478
     VIDEO_SIP_GW_SESSION_STATE_CHANGED = 'conference.videoSIPGWSessionStateChanged',
466
     VIDEO_SIP_GW_SESSION_STATE_CHANGED = 'conference.videoSIPGWSessionStateChanged',
479
 
467
 
480
     /**
468
     /**
481
-     * Event indicates that the permission for unmuting video has changed based on the number of video senders in the call
482
-     * and the video sender limit configured in Jicofo.
469
+     * Event indicates that the permission for unmuting video has changed based on the number of video senders in the
470
+     * call and the video sender limit configured in Jicofo.
483
      */
471
      */
484
     VIDEO_UNMUTE_PERMISSIONS_CHANGED = 'conference.video_unmute_permissions_changed',
472
     VIDEO_UNMUTE_PERMISSIONS_CHANGED = 'conference.video_unmute_permissions_changed',
485
 
473
 
474
+    /**
475
+     * Event indicating we have received a message from the visitors component.
476
+     */
477
+    VISITORS_MESSAGE = 'conference.visitors_message',
478
+
479
+    /**
480
+     * Event indicating that our request for promotion was rejected.
481
+     */
482
+    VISITORS_REJECTION = 'conference.visitors_rejection',
483
+
486
     /**
484
     /**
487
      * Indicates that the conference has support for visitors.
485
      * Indicates that the conference has support for visitors.
488
      */
486
      */
489
     VISITORS_SUPPORTED_CHANGED = 'conference.visitorsSupported',
487
     VISITORS_SUPPORTED_CHANGED = 'conference.visitorsSupported',
490
 
488
 
491
     /**
489
     /**
492
-     * Event indicating we have received a message from the visitors component.
490
+     * An event(library-private) fired when the conference switches the currently active media session.
491
+     * @type {string}
492
+     * @private
493
      */
493
      */
494
-    VISITORS_MESSAGE = 'conference.visitors_message',
494
+    _MEDIA_SESSION_ACTIVE_CHANGED = 'conference.media_session.active_changed',
495
 
495
 
496
     /**
496
     /**
497
-     * Event indicating that our request for promotion was rejected.
497
+     * An event(library-private) fired when a new media session is added to the conference.
498
+     * @type {string}
499
+     * @private
498
      */
500
      */
499
-    VISITORS_REJECTION = 'conference.visitors_rejection'
501
+    _MEDIA_SESSION_STARTED = 'conference.media_session.started'
500
 }
502
 }
501
 
503
 
502
 // exported for backward compatibility
504
 // exported for backward compatibility

+ 3
- 2
JitsiConnectionErrors.ts 파일 보기

3
  */
3
  */
4
 
4
 
5
 export enum JitsiConnectionErrors {
5
 export enum JitsiConnectionErrors {
6
+
6
     /**
7
     /**
7
      * When the conference-request to jicofo fails.
8
      * When the conference-request to jicofo fails.
8
      */
9
      */
9
-    CONFERENCE_REQUEST_FAILED = "connection.conferenceRequestFailed",
10
+    CONFERENCE_REQUEST_FAILED = 'connection.conferenceRequestFailed',
10
 
11
 
11
     /**
12
     /**
12
      * Indicates that the connection was dropped with an error which was most likely
13
      * Indicates that the connection was dropped with an error which was most likely
41
      * errors on BOSH requests.
42
      * errors on BOSH requests.
42
      */
43
      */
43
     SERVER_ERROR = 'connection.serverError'
44
     SERVER_ERROR = 'connection.serverError'
44
-};
45
+}
45
 
46
 
46
 // exported for backward compatibility
47
 // exported for backward compatibility
47
 export const CONFERENCE_REQUEST_FAILED = JitsiConnectionErrors.CONFERENCE_REQUEST_FAILED;
48
 export const CONFERENCE_REQUEST_FAILED = JitsiConnectionErrors.CONFERENCE_REQUEST_FAILED;

+ 8
- 7
JitsiConnectionEvents.ts 파일 보기

3
  */
3
  */
4
 
4
 
5
 export enum JitsiConnectionEvents {
5
 export enum JitsiConnectionEvents {
6
+
6
     /**
7
     /**
7
      * Indicates that the connection has been disconnected. The event provides
8
      * Indicates that the connection has been disconnected. The event provides
8
      * the following parameters to its listeners:
9
      * the following parameters to its listeners:
39
      */
40
      */
40
     CONNECTION_REDIRECTED = 'connection.redirected',
41
     CONNECTION_REDIRECTED = 'connection.redirected',
41
 
42
 
42
-    /**
43
-     * Indicates that the performed action cannot be executed because the
44
-     * connection is not in the correct state(connected, disconnected, etc.)
45
-     */
46
-    WRONG_STATE = 'connection.wrongState',
47
-
48
     /**
43
     /**
49
      * Indicates that the display name is required over this connection and need to be supplied when
44
      * Indicates that the display name is required over this connection and need to be supplied when
50
      * joining the room.
45
      * joining the room.
56
      * Indicates that the connection properties have been updated.
51
      * Indicates that the connection properties have been updated.
57
      * @param properties {object} - All available connection properties (e.g. shard, region).
52
      * @param properties {object} - All available connection properties (e.g. shard, region).
58
      */
53
      */
59
-    PROPERTIES_UPDATED = 'connection.propertiesUpdated'
54
+    PROPERTIES_UPDATED = 'connection.propertiesUpdated',
55
+
56
+    /**
57
+     * Indicates that the performed action cannot be executed because the
58
+     * connection is not in the correct state(connected, disconnected, etc.)
59
+     */
60
+    WRONG_STATE = 'connection.wrongState'
60
 }
61
 }
61
 
62
 
62
 // exported for backward compatibility
63
 // exported for backward compatibility

+ 2
- 1
JitsiMediaDevicesEvents.ts 파일 보기

3
  */
3
  */
4
 
4
 
5
 export enum JitsiMediaDevicesEvents {
5
 export enum JitsiMediaDevicesEvents {
6
+
6
     /**
7
     /**
7
      * Indicates that the list of available media devices has been changed. The
8
      * Indicates that the list of available media devices has been changed. The
8
      * event provides the following parameters to its listeners:
9
      * event provides the following parameters to its listeners:
30
      *  other execution environment.
31
      *  other execution environment.
31
      */
32
      */
32
     PERMISSION_PROMPT_IS_SHOWN = 'mediaDevices.permissionPromptIsShown'
33
     PERMISSION_PROMPT_IS_SHOWN = 'mediaDevices.permissionPromptIsShown'
33
-};
34
+}
34
 
35
 
35
 // exported for backward compatibility
36
 // exported for backward compatibility
36
 export const DEVICE_LIST_CHANGED = JitsiMediaDevicesEvents.DEVICE_LIST_CHANGED;
37
 export const DEVICE_LIST_CHANGED = JitsiMediaDevicesEvents.DEVICE_LIST_CHANGED;

+ 27
- 19
JitsiMeetJS.ts 파일 보기

13
 import * as JitsiTranscriptionStatus from './JitsiTranscriptionStatus';
13
 import * as JitsiTranscriptionStatus from './JitsiTranscriptionStatus';
14
 import RTC from './modules/RTC/RTC';
14
 import RTC from './modules/RTC/RTC';
15
 import RTCStats from './modules/RTCStats/RTCStats';
15
 import RTCStats from './modules/RTCStats/RTCStats';
16
+import * as RTCStatsEvents from './modules/RTCStats/RTCStatsEvents';
16
 import browser from './modules/browser';
17
 import browser from './modules/browser';
17
 import NetworkInfo from './modules/connectivity/NetworkInfo';
18
 import NetworkInfo from './modules/connectivity/NetworkInfo';
18
 import { TrackStreamingStatus } from './modules/connectivity/TrackStreamingStatus';
19
 import { TrackStreamingStatus } from './modules/connectivity/TrackStreamingStatus';
24
 import recordingConstants from './modules/recording/recordingConstants';
25
 import recordingConstants from './modules/recording/recordingConstants';
25
 import Settings from './modules/settings/Settings';
26
 import Settings from './modules/settings/Settings';
26
 import LocalStatsCollector from './modules/statistics/LocalStatsCollector';
27
 import LocalStatsCollector from './modules/statistics/LocalStatsCollector';
28
+import runPreCallTest, { IIceServer, IPreCallResult } from './modules/statistics/PreCallTest';
27
 import Statistics from './modules/statistics/statistics';
29
 import Statistics from './modules/statistics/statistics';
28
 import ScriptUtil from './modules/util/ScriptUtil';
30
 import ScriptUtil from './modules/util/ScriptUtil';
29
 import * as VideoSIPGWConstants from './modules/videosipgw/VideoSIPGWConstants';
31
 import * as VideoSIPGWConstants from './modules/videosipgw/VideoSIPGWConstants';
30
 import AudioMixer from './modules/webaudio/AudioMixer';
32
 import AudioMixer from './modules/webaudio/AudioMixer';
31
 import { MediaType } from './service/RTC/MediaType';
33
 import { MediaType } from './service/RTC/MediaType';
34
+import { VideoType } from './service/RTC/VideoType';
32
 import * as ConnectionQualityEvents
35
 import * as ConnectionQualityEvents
33
     from './service/connectivity/ConnectionQualityEvents';
36
     from './service/connectivity/ConnectionQualityEvents';
34
 import * as E2ePingEvents from './service/e2eping/E2ePingEvents';
37
 import * as E2ePingEvents from './service/e2eping/E2ePingEvents';
35
 import { createGetUserMediaEvent } from './service/statistics/AnalyticsEvents';
38
 import { createGetUserMediaEvent } from './service/statistics/AnalyticsEvents';
36
-import *  as RTCStatsEvents from './modules/RTCStats/RTCStatsEvents';
37
-import { VideoType } from './service/RTC/VideoType';
38
-import runPreCallTest, { IceServer, PreCallResult } from './modules/statistics/PreCallTest';
39
 
39
 
40
 const logger = Logger.getLogger(__filename);
40
 const logger = Logger.getLogger(__filename);
41
 
41
 
57
 function getAnalyticsAttributesFromOptions(options) {
57
 function getAnalyticsAttributesFromOptions(options) {
58
     const attributes: any = {};
58
     const attributes: any = {};
59
 
59
 
60
-    attributes['audio_requested'] = options.devices.includes('audio');
61
-    attributes['video_requested'] = options.devices.includes('video');
62
-    attributes['screen_sharing_requested'] = options.devices.includes('desktop');
60
+    /* eslint-disable */
61
+
62
+    attributes.audio_requested = options.devices.includes(MediaType.AUDIO);
63
+    attributes.video_requested = options.devices.includes(MediaType.VIDEO);
64
+    attributes.screen_sharing_requested = options.devices.includes(VideoType.DESKTOP);
63
 
65
 
64
     if (attributes.video_requested) {
66
     if (attributes.video_requested) {
65
         attributes.resolution = options.resolution;
67
         attributes.resolution = options.resolution;
66
     }
68
     }
67
 
69
 
70
+    /* eslint-enable */
71
+
68
     return attributes;
72
     return attributes;
69
 }
73
 }
70
 
74
 
89
     flags?: {
93
     flags?: {
90
         runInLiteMode?: boolean;
94
         runInLiteMode?: boolean;
91
         ssrcRewritingEnabled?: boolean;
95
         ssrcRewritingEnabled?: boolean;
92
-    }
96
+    };
93
 }
97
 }
94
 
98
 
95
 interface ICreateLocalTrackFromMediaStreamOptions {
99
 interface ICreateLocalTrackFromMediaStreamOptions {
96
-    stream: MediaStream,
97
-    sourceType: string,
98
-    mediaType: MediaType,
99
-    videoType?: VideoType
100
+    mediaType: MediaType;
101
+    sourceType: string;
102
+    stream: MediaStream;
103
+    track: any;
104
+    videoType?: VideoType;
100
 }
105
 }
101
 
106
 
102
 /**
107
 /**
293
      */
298
      */
294
     createLocalTracks(options: ICreateLocalTrackOptions = {}) {
299
     createLocalTracks(options: ICreateLocalTrackOptions = {}) {
295
         let isFirstGUM = false;
300
         let isFirstGUM = false;
296
-        let startTS = window.performance.now();
301
+        const startTS = window.performance.now();
297
 
302
 
298
         if (!window.connectionTimes) {
303
         if (!window.connectionTimes) {
299
             window.connectionTimes = {};
304
             window.connectionTimes = {};
308
 
313
 
309
         return RTC.obtainAudioAndVideoPermissions(options)
314
         return RTC.obtainAudioAndVideoPermissions(options)
310
             .then(tracks => {
315
             .then(tracks => {
311
-                let endTS = window.performance.now();
316
+                const endTS = window.performance.now();
312
 
317
 
313
                 window.connectionTimes['obtainPermissions.end'] = endTS;
318
                 window.connectionTimes['obtainPermissions.end'] = endTS;
314
 
319
 
372
                         createGetUserMediaEvent('error', attributes));
377
                         createGetUserMediaEvent('error', attributes));
373
                 }
378
                 }
374
 
379
 
375
-                let endTS = window.performance.now();
380
+                const endTS = window.performance.now();
376
 
381
 
377
                 window.connectionTimes['obtainPermissions.end'] = endTS;
382
                 window.connectionTimes['obtainPermissions.end'] = endTS;
378
 
383
 
390
      * @param {Array<ICreateLocalTrackFromMediaStreamOptions>} tracksInfo - array of track information
395
      * @param {Array<ICreateLocalTrackFromMediaStreamOptions>} tracksInfo - array of track information
391
      * @returns {Array<JitsiLocalTrack>} - created local tracks
396
      * @returns {Array<JitsiLocalTrack>} - created local tracks
392
      */
397
      */
393
-    createLocalTracksFromMediaStreams(tracksInfo) {
394
-        return RTC.createLocalTracks(tracksInfo.map((trackInfo) => {
398
+    createLocalTracksFromMediaStreams(tracksInfo: ICreateLocalTrackFromMediaStreamOptions[]) {
399
+        return RTC.createLocalTracks(tracksInfo.map(trackInfo => {
395
             const tracks = trackInfo.stream.getTracks()
400
             const tracks = trackInfo.stream.getTracks()
396
                 .filter(track => track.kind === trackInfo.mediaType);
401
                 .filter(track => track.kind === trackInfo.mediaType);
397
 
402
 
398
             if (!tracks || tracks.length === 0) {
403
             if (!tracks || tracks.length === 0) {
404
+                // eslint-disable-next-line @typescript-eslint/only-throw-error
399
                 throw new JitsiTrackError(JitsiTrackErrors.TRACK_NO_STREAM_TRACKS_FOUND, null, null);
405
                 throw new JitsiTrackError(JitsiTrackErrors.TRACK_NO_STREAM_TRACKS_FOUND, null, null);
400
             }
406
             }
401
 
407
 
402
             if (tracks.length > 1) {
408
             if (tracks.length > 1) {
409
+                // eslint-disable-next-line @typescript-eslint/only-throw-error
403
                 throw new JitsiTrackError(JitsiTrackErrors.TRACK_TOO_MANY_TRACKS_IN_STREAM, null, null);
410
                 throw new JitsiTrackError(JitsiTrackErrors.TRACK_TOO_MANY_TRACKS_IN_STREAM, null, null);
404
             }
411
             }
405
 
412
 
481
     /**
488
     /**
482
      * Run a pre-call test to check the network conditions.
489
      * Run a pre-call test to check the network conditions.
483
      *
490
      *
484
-     * @param {IceServer} iceServers  - The ICE servers to use for the test,
485
-     * @returns {Promise<PreCallResult | any>} - A Promise that resolves with the test results or rejects with an error message.
491
+     * @param {IIceServer} iceServers  - The ICE servers to use for the test,
492
+     * @returns {Promise<PreCallResult | any>} - A Promise that resolves with the test results or rejects with an error
493
+     * message.
486
      */
494
      */
487
-    runPreCallTest(iceServers) {
495
+    runPreCallTest(iceServers: IIceServer[]): Promise<IPreCallResult | any> {
488
         return runPreCallTest(iceServers);
496
         return runPreCallTest(iceServers);
489
     },
497
     },
490
 
498
 

+ 6
- 5
JitsiTrackErrors.ts 파일 보기

3
  */
3
  */
4
 
4
 
5
 export enum JitsiTrackErrors {
5
 export enum JitsiTrackErrors {
6
+
6
     /**
7
     /**
7
      * An error which indicates that some of requested constraints in
8
      * An error which indicates that some of requested constraints in
8
      * getUserMedia call were not satisfied.
9
      * getUserMedia call were not satisfied.
71
     TRACK_NO_STREAM_FOUND = 'track.no_stream_found',
72
     TRACK_NO_STREAM_FOUND = 'track.no_stream_found',
72
 
73
 
73
     /**
74
     /**
74
-     * An error which indicates that requested video resolution is not supported
75
-     * by a webcam.
75
+     * An error which indicates that no tracks were found in the media stream
76
      */
76
      */
77
-    UNSUPPORTED_RESOLUTION = 'gum.unsupported_resolution',
77
+    TRACK_NO_STREAM_TRACKS_FOUND = 'track.no_stream_tracks_found',
78
 
78
 
79
     /**
79
     /**
80
      * An error which indicates that there are too many tracks in the provided media stream
80
      * An error which indicates that there are too many tracks in the provided media stream
82
     TRACK_TOO_MANY_TRACKS_IN_STREAM = 'track.too_many_tracks_in_stream',
82
     TRACK_TOO_MANY_TRACKS_IN_STREAM = 'track.too_many_tracks_in_stream',
83
 
83
 
84
     /**
84
     /**
85
-     * An error which indicates that no tracks were found in the media stream
85
+     * An error which indicates that requested video resolution is not supported
86
+     * by a webcam.
86
      */
87
      */
87
-    TRACK_NO_STREAM_TRACKS_FOUND = 'track.no_stream_tracks_found',
88
+    UNSUPPORTED_RESOLUTION = 'gum.unsupported_resolution'
88
 }
89
 }
89
 
90
 
90
 // exported for backward compatibility
91
 // exported for backward compatibility

+ 23
- 21
JitsiTrackEvents.ts 파일 보기

1
 export enum JitsiTrackEvents {
1
 export enum JitsiTrackEvents {
2
+
2
     /**
3
     /**
3
      * The media track was removed to the conference.
4
      * The media track was removed to the conference.
4
      */
5
      */
5
     LOCAL_TRACK_STOPPED = 'track.stopped',
6
     LOCAL_TRACK_STOPPED = 'track.stopped',
6
 
7
 
8
+    /**
9
+     * Indicates that the local audio track is not receiving any audio input from
10
+     * the microphone that is currently selected.
11
+     */
12
+    NO_AUDIO_INPUT = 'track.no_audio_input',
13
+
14
+    /**
15
+     * Indicates that the track is not receiving any data even though we expect it
16
+     * to receive data (i.e. the stream is not stopped).
17
+     */
18
+    NO_DATA_FROM_SOURCE = 'track.no_data_from_source',
19
+
7
     /**
20
     /**
8
      * Audio levels of a this track was changed.
21
      * Audio levels of a this track was changed.
9
      * The first argument is a number with audio level value in range [0, 1].
22
      * The first argument is a number with audio level value in range [0, 1].
28
      */
41
      */
29
     TRACK_MUTE_CHANGED = 'track.trackMuteChanged',
42
     TRACK_MUTE_CHANGED = 'track.trackMuteChanged',
30
 
43
 
31
-    /**
32
-     * The video type("camera" or "desktop") of the track was changed.
33
-     */
34
-    TRACK_VIDEOTYPE_CHANGED = 'track.videoTypeChanged',
35
-
36
-    /**
37
-     * Indicates that the track is not receiving any data even though we expect it
38
-     * to receive data (i.e. the stream is not stopped).
39
-     */
40
-    NO_DATA_FROM_SOURCE = 'track.no_data_from_source',
41
-
42
-    /**
43
-     * Indicates that the local audio track is not receiving any audio input from
44
-     * the microphone that is currently selected.
45
-     */
46
-    NO_AUDIO_INPUT = 'track.no_audio_input',
47
-
48
     /**
44
     /**
49
      * Indicates that a new owner has been assigned to a remote track when SSRC rewriting is enabled.
45
      * Indicates that a new owner has been assigned to a remote track when SSRC rewriting is enabled.
50
      */
46
      */
52
 
48
 
53
     /**
49
     /**
54
      * Event fired whenever video track's streaming changes.
50
      * Event fired whenever video track's streaming changes.
55
-     * First argument is the sourceName of the track and the second is a string indicating if the connection is currently
51
+     * First argument is the sourceName of the track and the second is a string indicating if the connection is
52
+     * currently
56
      * - active - the connection is active.
53
      * - active - the connection is active.
57
-     * - inactive - the connection is inactive, was intentionally interrupted by the bridge because of low BWE or because
58
-     *   of the endpoint falling out of last N.
54
+     * - inactive - the connection is inactive, was intentionally interrupted by the bridge because of low BWE or
55
+     *   because of the endpoint falling out of last N.
59
      * - interrupted - a network problem occurred.
56
      * - interrupted - a network problem occurred.
60
      * - restoring - the connection was inactive and is restoring now.
57
      * - restoring - the connection was inactive and is restoring now.
61
      *
58
      *
62
      * The current status value can be obtained by calling JitsiRemoteTrack.getTrackStreamingStatus().
59
      * The current status value can be obtained by calling JitsiRemoteTrack.getTrackStreamingStatus().
63
      */
60
      */
64
     TRACK_STREAMING_STATUS_CHANGED = 'track.streaming_status_changed',
61
     TRACK_STREAMING_STATUS_CHANGED = 'track.streaming_status_changed',
65
-};
62
+
63
+    /**
64
+     * The video type("camera" or "desktop") of the track was changed.
65
+     */
66
+    TRACK_VIDEOTYPE_CHANGED = 'track.videoTypeChanged'
67
+}
66
 
68
 
67
 // exported for backward compatibility
69
 // exported for backward compatibility
68
 export const LOCAL_TRACK_STOPPED = JitsiTrackEvents.LOCAL_TRACK_STOPPED;
70
 export const LOCAL_TRACK_STOPPED = JitsiTrackEvents.LOCAL_TRACK_STOPPED;

+ 5
- 4
JitsiTranscriptionStatus.ts 파일 보기

1
 export enum JitsiTranscriptionStatus {
1
 export enum JitsiTranscriptionStatus {
2
+
2
     /**
3
     /**
3
-     * The transcription is on.
4
+     * The transcription is off.
4
      */
5
      */
5
-    ON = 'ON',
6
+    OFF = 'OFF',
6
 
7
 
7
     /**
8
     /**
8
-     * The transcription is off.
9
+     * The transcription is on.
9
      */
10
      */
10
-    OFF = 'OFF'
11
+    ON = 'ON'
11
 }
12
 }
12
 
13
 
13
 // exported for backward compatibility
14
 // exported for backward compatibility

+ 2
- 1
index.js 파일 보기

23
 function _mergeNamespaceAndModule(module) {
23
 function _mergeNamespaceAndModule(module) {
24
     return (
24
     return (
25
         typeof window.JitsiMeetJS === 'object'
25
         typeof window.JitsiMeetJS === 'object'
26
-            ? Object.assign({}, window.JitsiMeetJS, module)
26
+            ? { ...window.JitsiMeetJS,
27
+                ...module }
27
             : module);
28
             : module);
28
 }
29
 }
29
 
30
 

+ 4
- 4
modules/RTC/JitsiLocalTrack.js 파일 보기

437
             };
437
             };
438
 
438
 
439
             promise
439
             promise
440
-                = RTCUtils.obtainAudioAndVideoPermissions(Object.assign(
441
-                    {},
442
-                    streamOptions,
443
-                    { constraints: { video: this._constraints } }));
440
+                = RTCUtils.obtainAudioAndVideoPermissions({
441
+
442
+                    ...streamOptions,
443
+                    constraints: { video: this._constraints } });
444
 
444
 
445
             promise = promise.then(streamsInfo => {
445
             promise = promise.then(streamsInfo => {
446
                 const streamInfo = streamsInfo.find(info => info.track.kind === this.getType());
446
                 const streamInfo = streamsInfo.find(info => info.track.kind === this.getType());

+ 6
- 0
modules/RTCStats/DefaulLogStorage.ts 파일 보기

6
 export default class DefaultLogStorage {
6
 export default class DefaultLogStorage {
7
     private rtcStats: any;
7
     private rtcStats: any;
8
 
8
 
9
+    /**
10
+     * Creates new instance of <tt>DefaultLogStorage</tt>.
11
+     * @param rtcStats - The RTCStats instance.
12
+     */
9
     constructor(rtcStats: any) {
13
     constructor(rtcStats: any) {
10
         this.rtcStats = rtcStats;
14
         this.rtcStats = rtcStats;
11
     }
15
     }
16
+
17
+
12
     /**
18
     /**
13
      * The DefaultLogStorage is ready when the RTCStats is ready.
19
      * The DefaultLogStorage is ready when the RTCStats is ready.
14
      *
20
      *

+ 24
- 20
modules/RTCStats/RTCStats.ts 파일 보기

1
 import Logger, { getLogger } from '@jitsi/logger';
1
 import Logger, { getLogger } from '@jitsi/logger';
2
-
3
 import rtcstatsInit from '@jitsi/rtcstats/rtcstats';
2
 import rtcstatsInit from '@jitsi/rtcstats/rtcstats';
4
 import traceInit from '@jitsi/rtcstats/trace-ws';
3
 import traceInit from '@jitsi/rtcstats/trace-ws';
5
 
4
 
5
+import JitsiConference from '../../JitsiConference';
6
 import {
6
 import {
7
     BEFORE_STATISTICS_DISPOSED,
7
     BEFORE_STATISTICS_DISPOSED,
8
     CONFERENCE_CREATED_TIMESTAMP,
8
     CONFERENCE_CREATED_TIMESTAMP,
10
     CONFERENCE_LEFT,
10
     CONFERENCE_LEFT,
11
     CONFERENCE_UNIQUE_ID_SET
11
     CONFERENCE_UNIQUE_ID_SET
12
 } from '../../JitsiConferenceEvents';
12
 } from '../../JitsiConferenceEvents';
13
-import JitsiConference from '../../JitsiConference';
14
-import { IRTCStatsConfiguration } from './interfaces';
15
-import { RTC_STATS_PC_EVENT, RTC_STATS_WC_DISCONNECTED } from './RTCStatsEvents';
16
-import EventEmitter from '../util/EventEmitter';
17
 import Settings from '../settings/Settings';
13
 import Settings from '../settings/Settings';
14
+import EventEmitter from '../util/EventEmitter';
15
+
18
 import DefaultLogStorage from './DefaulLogStorage';
16
 import DefaultLogStorage from './DefaulLogStorage';
17
+import { RTC_STATS_PC_EVENT, RTC_STATS_WC_DISCONNECTED } from './RTCStatsEvents';
18
+import { IRTCStatsConfiguration } from './interfaces';
19
 
19
 
20
 const logger = getLogger(__filename);
20
 const logger = getLogger(__filename);
21
 
21
 
22
 /**
22
 /**
23
- * RTCStats Singleton that is initialized only once for the lifetime of the app, subsequent calls to init will be ignored.
24
- * Config and conference changes are handled by the start method.
23
+ * RTCStats Singleton that is initialized only once for the lifetime of the app, subsequent calls to init will be
24
+ * ignored. Config and conference changes are handled by the start method.
25
  */
25
  */
26
 class RTCStats {
26
 class RTCStats {
27
     private _initialized: boolean = false;
27
     private _initialized: boolean = false;
41
         const {
41
         const {
42
             analytics: {
42
             analytics: {
43
                 rtcstatsUseLegacy: useLegacy = false,
43
                 rtcstatsUseLegacy: useLegacy = false,
44
-                rtcstatsPollInterval: pollInterval= 10000,
44
+                rtcstatsPollInterval: pollInterval = 10000,
45
                 rtcstatsSendSdp: sendSdp = false,
45
                 rtcstatsSendSdp: sendSdp = false,
46
                 rtcstatsEnabled = false
46
                 rtcstatsEnabled = false
47
             } = {}
47
             } = {}
50
         // If rtcstats is not enabled or already initialized, do nothing.
50
         // If rtcstats is not enabled or already initialized, do nothing.
51
         // Calling rtcsatsInit multiple times will cause the global objects to be rewritten multiple times,
51
         // Calling rtcsatsInit multiple times will cause the global objects to be rewritten multiple times,
52
         // with unforeseen consequences.
52
         // with unforeseen consequences.
53
-        if (!rtcstatsEnabled || this._initialized) return;
53
+        if (!rtcstatsEnabled || this._initialized) {
54
+            return;
55
+        }
54
 
56
 
55
         rtcstatsInit(
57
         rtcstatsInit(
56
             { statsEntry: this.sendStatsEntry.bind(this) },
58
             { statsEntry: this.sendStatsEntry.bind(this) },
57
             { pollInterval,
59
             { pollInterval,
58
-              useLegacy,
59
-              sendSdp,
60
-              eventCallback: (event) => this.events.emit(RTC_STATS_PC_EVENT, event)}
60
+                useLegacy,
61
+                sendSdp,
62
+                eventCallback: event => this.events.emit(RTC_STATS_PC_EVENT, event) }
61
         );
63
         );
62
 
64
 
63
         this._initialized = true;
65
         this._initialized = true;
75
     start(conference: JitsiConference) {
77
     start(conference: JitsiConference) {
76
         const {
78
         const {
77
             options: {
79
             options: {
78
-                config : confConfig = {},
80
+                config: confConfig = {},
79
                 name: confName = ''
81
                 name: confName = ''
80
             } = {},
82
             } = {},
81
-            _statsCurrentId : displayName = ''
83
+            _statsCurrentId: displayName = ''
82
         } = conference;
84
         } = conference;
83
 
85
 
84
         const {
86
         const {
104
         this.reset();
106
         this.reset();
105
 
107
 
106
         // The new conference config might have rtcstats disabled, so we need to check again.
108
         // The new conference config might have rtcstats disabled, so we need to check again.
107
-        if (!rtcstatsEnabled) return;
109
+        if (!rtcstatsEnabled) {
110
+            return;
111
+        }
108
 
112
 
109
         // If rtcstats proxy module is not initialized, do nothing.
113
         // If rtcstats proxy module is not initialized, do nothing.
110
         if (!this._initialized) {
114
         if (!this._initialized) {
122
             const traceOptions = {
126
             const traceOptions = {
123
                 endpoint,
127
                 endpoint,
124
                 meetingFqn: confName,
128
                 meetingFqn: confName,
125
-                onCloseCallback: (event) => this.events.emit(RTC_STATS_WC_DISCONNECTED, event),
129
+                onCloseCallback: event => this.events.emit(RTC_STATS_WC_DISCONNECTED, event),
126
                 useLegacy
130
                 useLegacy
127
             };
131
             };
128
 
132
 
145
                 meetingUniqueId,
149
                 meetingUniqueId,
146
                 isBreakoutRoom,
150
                 isBreakoutRoom,
147
                 localId
151
                 localId
148
-            }
152
+            };
149
 
153
 
150
             this.sendIdentity(identityData);
154
             this.sendIdentity(identityData);
151
         });
155
         });
152
 
156
 
153
         // Note, this will only be called for normal rooms, not breakout rooms.
157
         // Note, this will only be called for normal rooms, not breakout rooms.
154
-        conference.once(CONFERENCE_UNIQUE_ID_SET, (meetingUniqueId) => {
155
-            this.sendIdentity({meetingUniqueId});
158
+        conference.once(CONFERENCE_UNIQUE_ID_SET, meetingUniqueId => {
159
+            this.sendIdentity({ meetingUniqueId });
156
         });
160
         });
157
 
161
 
158
         conference.once(CONFERENCE_LEFT, () => {
162
         conference.once(CONFERENCE_LEFT, () => {
161
 
165
 
162
         conference.once(CONFERENCE_CREATED_TIMESTAMP, (timestamp: number) => {
166
         conference.once(CONFERENCE_CREATED_TIMESTAMP, (timestamp: number) => {
163
             this.sendStatsEntry('conferenceStartTimestamp', null, timestamp);
167
             this.sendStatsEntry('conferenceStartTimestamp', null, timestamp);
164
-        })
168
+        });
165
 
169
 
166
         conference.once(
170
         conference.once(
167
             BEFORE_STATISTICS_DISPOSED,
171
             BEFORE_STATISTICS_DISPOSED,

+ 7
- 6
modules/RTCStats/RTCStatsEvents.ts 파일 보기

2
  * Events emitted by the RTCStats module.
2
  * Events emitted by the RTCStats module.
3
  */
3
  */
4
 export enum RTCStatsEvents {
4
 export enum RTCStatsEvents {
5
-    /**
6
-     * Event emitted when the websocket connection to the rtcstats server is disconnected.
7
-     */
8
-    RTC_STATS_WC_DISCONNECTED = 'rtcstats_ws_disconnected',
9
 
5
 
10
     /**
6
     /**
11
      * Event emitted when any PeerConnection event is triggered.
7
      * Event emitted when any PeerConnection event is triggered.
12
-     * 
8
+     *
13
      * @param {object} event - The PeerConnection event.
9
      * @param {object} event - The PeerConnection event.
14
      * @param {string} event.type - The event type.
10
      * @param {string} event.type - The event type.
15
      * @param {object} event.body - Event body.
11
      * @param {object} event.body - Event body.
17
      * @param {string} event.body.state - PeerConnection state change which triggered the event.
13
      * @param {string} event.body.state - PeerConnection state change which triggered the event.
18
      */
14
      */
19
     RTC_STATS_PC_EVENT = 'rtstats_pc_event',
15
     RTC_STATS_PC_EVENT = 'rtstats_pc_event',
20
-};
16
+
17
+    /**
18
+     * Event emitted when the websocket connection to the rtcstats server is disconnected.
19
+     */
20
+    RTC_STATS_WC_DISCONNECTED = 'rtcstats_ws_disconnected'
21
+}
21
 
22
 
22
 // exported for backward compatibility
23
 // exported for backward compatibility
23
 export const RTC_STATS_WC_DISCONNECTED = RTCStatsEvents.RTC_STATS_WC_DISCONNECTED;
24
 export const RTC_STATS_WC_DISCONNECTED = RTCStatsEvents.RTC_STATS_WC_DISCONNECTED;

+ 3
- 3
modules/connectivity/IceFailedHandling.ts 파일 보기

1
 import { getLogger } from '@jitsi/logger';
1
 import { getLogger } from '@jitsi/logger';
2
 
2
 
3
+import JitsiConference from '../../JitsiConference';
3
 import * as JitsiConferenceErrors from '../../JitsiConferenceErrors';
4
 import * as JitsiConferenceErrors from '../../JitsiConferenceErrors';
4
 import * as JitsiConferenceEvents from '../../JitsiConferenceEvents';
5
 import * as JitsiConferenceEvents from '../../JitsiConferenceEvents';
5
-import JitsiConference from '../../JitsiConference';
6
 
6
 
7
 const logger = getLogger(__filename);
7
 const logger = getLogger(__filename);
8
 
8
 
23
      * Creates new {@code DelayedIceFailed} task.
23
      * Creates new {@code DelayedIceFailed} task.
24
      * @param {JitsiConference} conference
24
      * @param {JitsiConference} conference
25
      */
25
      */
26
-    constructor(conference:JitsiConference) {
26
+    constructor(conference: JitsiConference) {
27
         this._conference = conference;
27
         this._conference = conference;
28
     }
28
     }
29
 
29
 
52
         }
52
         }
53
 
53
 
54
         const jvbConnection = this._conference.jvbJingleSession;
54
         const jvbConnection = this._conference.jvbJingleSession;
55
-        const jvbConnIceState = jvbConnection && jvbConnection.getIceConnectionState();
55
+        const jvbConnIceState = jvbConnection?.getIceConnectionState();
56
 
56
 
57
         if (!jvbConnection) {
57
         if (!jvbConnection) {
58
             logger.warn('Not sending ICE failed - no JVB connection');
58
             logger.warn('Not sending ICE failed - no JVB connection');

+ 14
- 16
modules/connectivity/TrackStreamingStatus.ts 파일 보기

3
 import { JitsiConferenceEvents } from '../../JitsiConferenceEvents';
3
 import { JitsiConferenceEvents } from '../../JitsiConferenceEvents';
4
 import * as JitsiTrackEvents from '../../JitsiTrackEvents';
4
 import * as JitsiTrackEvents from '../../JitsiTrackEvents';
5
 import RTCEvents from '../../service/RTC/RTCEvents';
5
 import RTCEvents from '../../service/RTC/RTCEvents';
6
+import { VideoType } from '../../service/RTC/VideoType';
6
 import { createTrackStreamingStatusEvent } from '../../service/statistics/AnalyticsEvents';
7
 import { createTrackStreamingStatusEvent } from '../../service/statistics/AnalyticsEvents';
7
-import browser from '../browser';
8
-import Statistics from '../statistics/statistics';
9
 import JitsiRemoteTrack from '../RTC/JitsiRemoteTrack';
8
 import JitsiRemoteTrack from '../RTC/JitsiRemoteTrack';
10
-import { VideoType } from '../../service/RTC/VideoType';
11
 import RTC from '../RTC/RTC';
9
 import RTC from '../RTC/RTC';
10
+import browser from '../browser';
11
+import Statistics from '../statistics/statistics';
12
 
12
 
13
 /** Track streaming statuses. */
13
 /** Track streaming statuses. */
14
 export enum TrackStreamingStatus {
14
 export enum TrackStreamingStatus {
34
      * Status indicating that streaming is currently restoring.
34
      * Status indicating that streaming is currently restoring.
35
      */
35
      */
36
     RESTORING = 'restoring',
36
     RESTORING = 'restoring',
37
-  }
37
+}
38
 
38
 
39
 type StreamingStatusMap = {
39
 type StreamingStatusMap = {
40
-    videoType?: VideoType,
41
-    startedMs?: number,
42
-    p2p?: boolean,
43
-    streamingStatus?: string,
44
-    value?: number
40
+    p2p?: boolean;
41
+    startedMs?: number;
42
+    streamingStatus?: string;
43
+    value?: number;
44
+    videoType?: VideoType;
45
 };
45
 };
46
 
46
 
47
 const logger = getLogger(__filename);
47
 const logger = getLogger(__filename);
135
     _onLastNValueChanged: () => void;
135
     _onLastNValueChanged: () => void;
136
     _onForwardedSourcesChanged: () => void;
136
     _onForwardedSourcesChanged: () => void;
137
 
137
 
138
-    /* eslint-disable max-params*/
138
+    /* eslint-disable max-params */
139
     /**
139
     /**
140
      * Calculates the new {@link TrackStreamingStatus} based on the values given for some specific remote track. It is
140
      * Calculates the new {@link TrackStreamingStatus} based on the values given for some specific remote track. It is
141
      * assumed that the conference is currently in the JVB mode (in contrary to the P2P mode)
141
      * assumed that the conference is currently in the JVB mode (in contrary to the P2P mode)
179
         return isInForwardedSources ? TrackStreamingStatus.ACTIVE : TrackStreamingStatus.INACTIVE;
179
         return isInForwardedSources ? TrackStreamingStatus.ACTIVE : TrackStreamingStatus.INACTIVE;
180
     }
180
     }
181
 
181
 
182
-    /* eslint-enable max-params*/
182
+    /* eslint-enable max-params */
183
 
183
 
184
     /**
184
     /**
185
      * In P2P mode we don't care about any values coming from the JVB and the streaming status can be only active or
185
      * In P2P mode we don't care about any values coming from the JVB and the streaming status can be only active or
215
      * {@link TrackStreamingStatusImpl.outOfForwardedSourcesTimeout}.
215
      * {@link TrackStreamingStatusImpl.outOfForwardedSourcesTimeout}.
216
      */
216
      */
217
     constructor(rtc: RTC, conference: any, track: JitsiRemoteTrack, options: {
217
     constructor(rtc: RTC, conference: any, track: JitsiRemoteTrack, options: {
218
-        outOfForwardedSourcesTimeout: number,
219
-        p2pRtcMuteTimeout: number,
220
-        rtcMuteTimeout: number
218
+        outOfForwardedSourcesTimeout: number;
219
+        p2pRtcMuteTimeout: number;
220
+        rtcMuteTimeout: number;
221
     }) {
221
     }) {
222
         this.rtc = rtc;
222
         this.rtc = rtc;
223
         this.conference = conference;
223
         this.conference = conference;
609
             return;
609
             return;
610
         }
610
         }
611
 
611
 
612
-        const sourceName = this.track.getSourceName();
613
-
614
         this.figureOutStreamingStatus();
612
         this.figureOutStreamingStatus();
615
     }
613
     }
616
 
614
 

+ 11
- 10
modules/detection/DetectionEvents.ts 파일 보기

1
 export enum DetectionEvents {
1
 export enum DetectionEvents {
2
-    /**
3
-     * Event triggered by a audio detector indicating that its active state has changed from active to inactive or vice
4
-     * versa.
5
-     * @event
6
-     * @type {boolean} - true when service has changed to active false otherwise.
7
-     */
8
-    DETECTOR_STATE_CHANGE = 'detector_state_change',
9
 
2
 
10
     /** Event triggered by {@link NoAudioSignalDetector} when the local audio device associated with a JitsiConference
3
     /** Event triggered by {@link NoAudioSignalDetector} when the local audio device associated with a JitsiConference
11
      * starts receiving audio levels with the value of 0 meaning no audio is being captured on that device, or when
4
      * starts receiving audio levels with the value of 0 meaning no audio is being captured on that device, or when
15
      */
8
      */
16
     AUDIO_INPUT_STATE_CHANGE = 'audio_input_state_changed',
9
     AUDIO_INPUT_STATE_CHANGE = 'audio_input_state_changed',
17
 
10
 
18
-    /** Event triggered by NoAudioSignalDetector when the local audio device associated with a JitsiConference goes silent
19
-     * for a period of time, meaning that the device is either broken or hardware/software muted.
11
+    /**
12
+     * Event triggered by a audio detector indicating that its active state has changed from active to inactive or vice
13
+     * versa.
14
+     * @event
15
+     * @type {boolean} - true when service has changed to active false otherwise.
16
+     */
17
+    DETECTOR_STATE_CHANGE = 'detector_state_change',
18
+
19
+    /** Event triggered by NoAudioSignalDetector when the local audio device associated with a JitsiConference goes
20
+     * silent for a period of time, meaning that the device is either broken or hardware/software muted.
20
      * @event
21
      * @event
21
      * @type {void}
22
      * @type {void}
22
      */
23
      */
59
      *  @type {Object}
60
      *  @type {Object}
60
      */
61
      */
61
     VAD_TALK_WHILE_MUTED = 'detection.vad_talk_while_muted'
62
     VAD_TALK_WHILE_MUTED = 'detection.vad_talk_while_muted'
62
-};
63
+}
63
 
64
 
64
 // exported for backward compatibility
65
 // exported for backward compatibility
65
 export const DETECTOR_STATE_CHANGE = DetectionEvents.DETECTOR_STATE_CHANGE;
66
 export const DETECTOR_STATE_CHANGE = DetectionEvents.DETECTOR_STATE_CHANGE;

+ 4
- 4
modules/e2ee/E2EEErrors.ts 파일 보기

1
 export enum E2EEErrors {
1
 export enum E2EEErrors {
2
+    E2EE_SAS_CHANNEL_VERIFICATION_FAILED = 'e2ee.sas.channel-verification-failed',
3
+    E2EE_SAS_COMMITMENT_MISMATCHED = 'e2ee.sas.commitment-mismatched',
4
+    E2EE_SAS_INVALID_SAS_VERIFICATION = 'e2ee.sas.invalid-sas-verification',
2
     E2EE_SAS_KEYS_MAC_MISMATCH = 'e2ee.sas.keys-mac-mismatch',
5
     E2EE_SAS_KEYS_MAC_MISMATCH = 'e2ee.sas.keys-mac-mismatch',
3
     E2EE_SAS_MAC_MISMATCH = 'e2ee.sas.mac-mismatch',
6
     E2EE_SAS_MAC_MISMATCH = 'e2ee.sas.mac-mismatch',
4
-    E2EE_SAS_MISSING_KEY =  'e2ee.sas.missing-key',
5
-    E2EE_SAS_COMMITMENT_MISMATCHED =  'e2ee.sas.commitment-mismatched',
6
-    E2EE_SAS_CHANNEL_VERIFICATION_FAILED = 'e2ee.sas.channel-verification-failed',
7
-    E2EE_SAS_INVALID_SAS_VERIFICATION =  'e2ee.sas.invalid-sas-verification',
7
+    E2EE_SAS_MISSING_KEY = 'e2ee.sas.missing-key'
8
 }
8
 }

+ 1
- 1
modules/e2ee/ManagedKeyHandler.js 파일 보기

106
      * @param {*} newValue - The property's new value.
106
      * @param {*} newValue - The property's new value.
107
      * @private
107
      * @private
108
      */
108
      */
109
-    async _onParticipantPropertyChanged(participant, name, oldValue, newValue) {
109
+    _onParticipantPropertyChanged(participant, name, oldValue, newValue) {
110
         switch (name) {
110
         switch (name) {
111
         case 'e2ee.idKey':
111
         case 'e2ee.idKey':
112
             logger.debug(`Participant ${participant.getId()} updated their id key: ${newValue}`);
112
             logger.debug(`Participant ${participant.getId()} updated their id key: ${newValue}`);

+ 1
- 2
modules/e2ee/Worker.js 파일 보기

1
-/* global TransformStream */
2
 /* eslint-disable no-bitwise */
1
 /* eslint-disable no-bitwise */
3
 
2
 
4
 // Worker for E2EE/Insertable streams.
3
 // Worker for E2EE/Insertable streams.
50
     }
49
     }
51
 }
50
 }
52
 
51
 
53
-onmessage = async event => {
52
+onmessage = event => {
54
     const { operation } = event.data;
53
     const { operation } = event.data;
55
 
54
 
56
     if (operation === 'initialize') {
55
     if (operation === 'initialize') {

+ 2
- 2
modules/e2ee/crypto-utils.js 파일 보기

36
     const textEncoder = new TextEncoder();
36
     const textEncoder = new TextEncoder();
37
 
37
 
38
     // https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/deriveBits
38
     // https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/deriveBits
39
-    return crypto.subtle.deriveBits({
39
+    return await crypto.subtle.deriveBits({
40
         name: 'HKDF',
40
         name: 'HKDF',
41
         salt: textEncoder.encode('JFrameRatchetKey'),
41
         salt: textEncoder.encode('JFrameRatchetKey'),
42
         hash: 'SHA-256',
42
         hash: 'SHA-256',
53
  */
53
  */
54
 export async function importKey(keyBytes) {
54
 export async function importKey(keyBytes) {
55
     // https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey
55
     // https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey
56
-    return crypto.subtle.importKey('raw', keyBytes, 'HKDF', false, [ 'deriveBits', 'deriveKey' ]);
56
+    return await crypto.subtle.importKey('raw', keyBytes, 'HKDF', false, [ 'deriveBits', 'deriveKey' ]);
57
 }
57
 }

+ 1
- 1
modules/flags/FeatureFlags.ts 파일 보기

6
 class FeatureFlags {
6
 class FeatureFlags {
7
     private _runInLiteMode: boolean;
7
     private _runInLiteMode: boolean;
8
     private _ssrcRewriting: boolean;
8
     private _ssrcRewriting: boolean;
9
-    
9
+
10
     /**
10
     /**
11
      * Configures the module.
11
      * Configures the module.
12
      *
12
      *

+ 0
- 1
modules/litemode/LiteModeContext.js 파일 보기

1
-/* global TransformStream */
2
 import { getLogger } from '@jitsi/logger';
1
 import { getLogger } from '@jitsi/logger';
3
 
2
 
4
 import RTCEvents from '../../service/RTC/RTCEvents';
3
 import RTCEvents from '../../service/RTC/RTCEvents';

+ 1
- 1
modules/proxyconnection/ProxyConnectionService.js 파일 보기

121
             this._selfCloseConnection();
121
             this._selfCloseConnection();
122
         }
122
         }
123
 
123
 
124
-        return;
124
+
125
     }
125
     }
126
 
126
 
127
     /**
127
     /**

+ 1
- 1
modules/proxyconnection/constants.ts 파일 보기

9
     TERMINATE = 'session-terminate',
9
     TERMINATE = 'session-terminate',
10
     TRANSPORT_INFO = 'transport-info',
10
     TRANSPORT_INFO = 'transport-info',
11
     UNAVAILABLE = 'unavailable'
11
     UNAVAILABLE = 'unavailable'
12
-};
12
+}

+ 7
- 1
modules/qualitycontrol/MockClasses.ts 파일 보기

47
         this.videoType = videoType;
47
         this.videoType = videoType;
48
     }
48
     }
49
 
49
 
50
+    /**
51
+     * Gets the capture resolution of the mock local track.
52
+     * @returns - The capture resolution.
53
+     */
50
     getCaptureResolution(): number {
54
     getCaptureResolution(): number {
51
         return this.captureResolution;
55
         return this.captureResolution;
52
     }
56
     }
57
+
58
+
53
     /**
59
     /**
54
      * Returns the video type of the mock local track.
60
      * Returns the video type of the mock local track.
55
      * @returns {VideoType}
61
      * @returns {VideoType}
120
      * Returns the list of participants.
126
      * Returns the list of participants.
121
      * @returns Array<MockParticipant>
127
      * @returns Array<MockParticipant>
122
      */
128
      */
123
-    getParticipants(): Array<MockParticipant>  {
129
+    getParticipants(): Array<MockParticipant> {
124
         return this.participants;
130
         return this.participants;
125
     }
131
     }
126
 
132
 

+ 59
- 36
modules/qualitycontrol/QualityController.ts 파일 보기

1
 import { getLogger } from '@jitsi/logger';
1
 import { getLogger } from '@jitsi/logger';
2
 
2
 
3
-import JitsiConference from "../../JitsiConference";
4
-import { JitsiConferenceEvents } from "../../JitsiConferenceEvents";
5
-import { CodecMimeType } from "../../service/RTC/CodecMimeType";
6
-import RTCEvents from "../../service/RTC/RTCEvents";
7
-import JitsiLocalTrack from "../RTC/JitsiLocalTrack";
8
-import TraceablePeerConnection from "../RTC/TraceablePeerConnection";
9
-import JingleSessionPC from "../xmpp/JingleSessionPC";
10
-import { CodecSelection } from "./CodecSelection";
11
-import ReceiveVideoController from "./ReceiveVideoController";
12
-import SendVideoController from "./SendVideoController";
3
+import JitsiConference from '../../JitsiConference';
4
+import { JitsiConferenceEvents } from '../../JitsiConferenceEvents';
5
+import { CodecMimeType } from '../../service/RTC/CodecMimeType';
6
+import RTCEvents from '../../service/RTC/RTCEvents';
13
 import {
7
 import {
14
     DEFAULT_LAST_N,
8
     DEFAULT_LAST_N,
15
     LAST_N_UNLIMITED,
9
     LAST_N_UNLIMITED,
16
     VIDEO_CODECS_BY_COMPLEXITY,
10
     VIDEO_CODECS_BY_COMPLEXITY,
17
     VIDEO_QUALITY_LEVELS
11
     VIDEO_QUALITY_LEVELS
18
 } from '../../service/RTC/StandardVideoQualitySettings';
12
 } from '../../service/RTC/StandardVideoQualitySettings';
13
+import JitsiLocalTrack from '../RTC/JitsiLocalTrack';
14
+import TraceablePeerConnection from '../RTC/TraceablePeerConnection';
15
+import JingleSessionPC from '../xmpp/JingleSessionPC';
16
+
17
+import { CodecSelection } from './CodecSelection';
18
+import ReceiveVideoController from './ReceiveVideoController';
19
+import SendVideoController from './SendVideoController';
19
 
20
 
20
 const logger = getLogger(__filename);
21
 const logger = getLogger(__filename);
21
 
22
 
30
     BANDWIDTH = 'bandwidth',
31
     BANDWIDTH = 'bandwidth',
31
     CPU = 'cpu',
32
     CPU = 'cpu',
32
     NONE = 'none'
33
     NONE = 'none'
33
-};
34
+}
34
 
35
 
35
 interface IResolution {
36
 interface IResolution {
36
     height: number;
37
     height: number;
53
     qualityLimitationReason: QualityLimitationReason;
54
     qualityLimitationReason: QualityLimitationReason;
54
     timestamp: number;
55
     timestamp: number;
55
     tpc: TraceablePeerConnection;
56
     tpc: TraceablePeerConnection;
56
-};
57
+}
57
 
58
 
58
 interface ITrackStats {
59
 interface ITrackStats {
59
-    encodeResolution: number
60
+    encodeResolution: number;
60
     encodeTime: number;
61
     encodeTime: number;
61
     qualityLimitationReason: QualityLimitationReason;
62
     qualityLimitationReason: QualityLimitationReason;
62
 }
63
 }
66
     sourceName: string;
67
     sourceName: string;
67
 }
68
 }
68
 
69
 
70
+/* eslint-disable require-jsdoc */
69
 export class FixedSizeArray {
71
 export class FixedSizeArray {
70
     private _data: ISourceStats[];
72
     private _data: ISourceStats[];
71
     private _maxSize: number;
73
     private _maxSize: number;
72
-  
74
+
73
     constructor(size: number) {
75
     constructor(size: number) {
74
-      this._maxSize = size;
75
-      this._data = [];
76
+        this._maxSize = size;
77
+        this._data = [];
76
     }
78
     }
77
-  
79
+
78
     add(item: ISourceStats): void {
80
     add(item: ISourceStats): void {
79
-      if (this._data.length >= this._maxSize) {
80
-        this._data.shift();
81
-      }
82
-      this._data.push(item);
81
+        if (this._data.length >= this._maxSize) {
82
+            this._data.shift();
83
+        }
84
+        this._data.push(item);
83
     }
85
     }
84
-  
86
+
85
     get(index: number): ISourceStats | undefined {
87
     get(index: number): ISourceStats | undefined {
86
-      if (index < 0 || index >= this._data.length) {
87
-        throw new Error("Index out of bounds");
88
-      }
89
-      return this._data[index];
88
+        if (index < 0 || index >= this._data.length) {
89
+            throw new Error('Index out of bounds');
90
+        }
91
+
92
+        return this._data[index];
90
     }
93
     }
91
 
94
 
92
     size(): number {
95
     size(): number {
93
         return this._data.length;
96
         return this._data.length;
94
     }
97
     }
95
 }
98
 }
99
+/* eslint-enable require-jsdoc */
96
 
100
 
97
 /**
101
 /**
98
  * QualityController class that is responsible for maintaining optimal video quality experience on the local endpoint
102
  * QualityController class that is responsible for maintaining optimal video quality experience on the local endpoint
112
     private _sendVideoController: SendVideoController;
116
     private _sendVideoController: SendVideoController;
113
 
117
 
114
     /**
118
     /**
115
-     * 
119
+     *
116
      * @param {JitsiConference} conference - The JitsiConference instance.
120
      * @param {JitsiConference} conference - The JitsiConference instance.
117
      * @param {Object} options - video quality settings passed through config.js.
121
      * @param {Object} options - video quality settings passed through config.js.
118
      */
122
      */
119
     constructor(conference: JitsiConference, options: {
123
     constructor(conference: JitsiConference, options: {
120
         enableAdaptiveMode: boolean;
124
         enableAdaptiveMode: boolean;
121
-        jvb: Object;
125
+        jvb: object;
122
         lastNRampupTime: number;
126
         lastNRampupTime: number;
123
-        p2p: Object;
127
+        p2p: object;
124
     }) {
128
     }) {
125
         this._conference = conference;
129
         this._conference = conference;
126
         const { jvb, p2p } = options;
130
         const { jvb, p2p } = options;
127
-        this._codecController = new CodecSelection(conference, { jvb, p2p });
131
+
132
+        this._codecController = new CodecSelection(conference, { jvb,
133
+            p2p });
128
         this._enableAdaptiveMode = options.enableAdaptiveMode;
134
         this._enableAdaptiveMode = options.enableAdaptiveMode;
129
         this._encodeTimeStats = new Map();
135
         this._encodeTimeStats = new Map();
130
         this._isLastNRampupBlocked = false;
136
         this._isLastNRampupBlocked = false;
150
         const debouncedSelectCodec = this._debounce(
156
         const debouncedSelectCodec = this._debounce(
151
             () => this._codecController.selectPreferredCodec(this._conference.jvbJingleSession),
157
             () => this._codecController.selectPreferredCodec(this._conference.jvbJingleSession),
152
             1000);
158
             1000);
159
+
153
         this._conference.on(JitsiConferenceEvents.USER_JOINED, debouncedSelectCodec.bind(this));
160
         this._conference.on(JitsiConferenceEvents.USER_JOINED, debouncedSelectCodec.bind(this));
154
         this._conference.on(JitsiConferenceEvents.USER_LEFT, debouncedSelectCodec.bind(this));
161
         this._conference.on(JitsiConferenceEvents.USER_LEFT, debouncedSelectCodec.bind(this));
155
         this._conference.rtc.on(
162
         this._conference.rtc.on(
156
             RTCEvents.SENDER_VIDEO_CONSTRAINTS_CHANGED,
163
             RTCEvents.SENDER_VIDEO_CONSTRAINTS_CHANGED,
157
-            (videoConstraints: IVideoConstraints) => this._sendVideoController.onSenderConstraintsReceived(videoConstraints));
164
+            (videoConstraints: IVideoConstraints) =>
165
+                this._sendVideoController.onSenderConstraintsReceived(videoConstraints));
158
         this._conference.on(
166
         this._conference.on(
159
             JitsiConferenceEvents.ENCODE_TIME_STATS_RECEIVED,
167
             JitsiConferenceEvents.ENCODE_TIME_STATS_RECEIVED,
160
-            (tpc: TraceablePeerConnection, stats: Map<number, IOutboundRtpStats>) => this._processOutboundRtpStats(tpc, stats));
168
+            (tpc: TraceablePeerConnection, stats: Map<number, IOutboundRtpStats>) =>
169
+                this._processOutboundRtpStats(tpc, stats));
161
     }
170
     }
162
 
171
 
163
     /**
172
     /**
169
      * @param {number} delay - The delay in milliseconds.
178
      * @param {number} delay - The delay in milliseconds.
170
      * @returns {Function} - The debounced function.
179
      * @returns {Function} - The debounced function.
171
      */
180
      */
172
-    _debounce(func: Function, delay: number) {
173
-        return function (...args) {
181
+    _debounce(func: Function, delay: number) { // eslint-disable-line @typescript-eslint/no-unsafe-function-type
182
+        return function(...args: any) {
183
+            /* eslint-disable @typescript-eslint/no-invalid-this */
174
             if (!this._timer) {
184
             if (!this._timer) {
175
                 this._timer = setTimeout(() => {
185
                 this._timer = setTimeout(() => {
176
                     this._timer = null;
186
                     this._timer = null;
177
                     func.apply(this, args);
187
                     func.apply(this, args);
178
                 }, delay);
188
                 }, delay);
179
             }
189
             }
190
+            /* eslint-enable @typescript-eslint/no-invalid-this */
180
         };
191
         };
181
     }
192
     }
182
 
193
 
239
         if (individualConstraints && Object.keys(individualConstraints).length) {
250
         if (individualConstraints && Object.keys(individualConstraints).length) {
240
             for (const value of Object.values(individualConstraints)) {
251
             for (const value of Object.values(individualConstraints)) {
241
                 const v: any = value;
252
                 const v: any = value;
253
+
242
                 maxHeight = Math.max(maxHeight, v.maxHeight);
254
                 maxHeight = Math.max(maxHeight, v.maxHeight);
243
             }
255
             }
244
         }
256
         }
276
                 this._limitedByCpuTimeout = undefined;
288
                 this._limitedByCpuTimeout = undefined;
277
                 const updatedStats = this._encodeTimeStats.get(trackId);
289
                 const updatedStats = this._encodeTimeStats.get(trackId);
278
                 const latestSourceStats: ISourceStats = updatedStats.get(updatedStats.size() - 1);
290
                 const latestSourceStats: ISourceStats = updatedStats.get(updatedStats.size() - 1);
291
+                const expectedSendResolution
292
+                    = Math.min(localTrack.maxEnabledResolution, localTrack.getCaptureResolution());
279
 
293
 
280
                 // If the encoder is still limited by CPU, switch to a lower complexity codec.
294
                 // If the encoder is still limited by CPU, switch to a lower complexity codec.
281
                 if (latestSourceStats.qualityLimitationReason === QualityLimitationReason.CPU
295
                 if (latestSourceStats.qualityLimitationReason === QualityLimitationReason.CPU
282
-                    || encodeResolution <  Math.min(localTrack.maxEnabledResolution, localTrack.getCaptureResolution())) {
283
-                        return this.codecController.changeCodecPreferenceOrder(localTrack, codec)
296
+                        || encodeResolution < expectedSendResolution) {
297
+                    return this.codecController.changeCodecPreferenceOrder(localTrack, codec);
284
                 }
298
                 }
285
             }, LIMITED_BY_CPU_TIMEOUT);
299
             }, LIMITED_BY_CPU_TIMEOUT);
286
         }
300
         }
451
         }
465
         }
452
     }
466
     }
453
 
467
 
468
+    /**
469
+     * Gets the codec controller instance.
470
+     */
454
     get codecController() {
471
     get codecController() {
455
         return this._codecController;
472
         return this._codecController;
456
     }
473
     }
457
 
474
 
475
+    /**
476
+     * Gets the receive video controller instance.
477
+     */
458
     get receiveVideoController() {
478
     get receiveVideoController() {
459
         return this._receiveVideoController;
479
         return this._receiveVideoController;
460
     }
480
     }
461
 
481
 
482
+    /**
483
+     * Gets the send video controller instance.
484
+     */
462
     get sendVideoController() {
485
     get sendVideoController() {
463
         return this._sendVideoController;
486
         return this._sendVideoController;
464
     }
487
     }

+ 24
- 25
modules/sdp/SdpSimulcast.ts 파일 보기

1
+import * as transform from 'sdp-transform';
2
+
1
 import { MediaDirection } from '../../service/RTC/MediaDirection';
3
 import { MediaDirection } from '../../service/RTC/MediaDirection';
2
 import { MediaType } from '../../service/RTC/MediaType';
4
 import { MediaType } from '../../service/RTC/MediaType';
3
 import { SIM_LAYERS, SSRC_GROUP_SEMANTICS } from '../../service/RTC/StandardVideoQualitySettings';
5
 import { SIM_LAYERS, SSRC_GROUP_SEMANTICS } from '../../service/RTC/StandardVideoQualitySettings';
4
 
6
 
5
-import * as transform from 'sdp-transform';
6
 
7
 
7
-interface Description {
8
-    type: RTCSdpType;
8
+interface IDescription {
9
     sdp: string;
9
     sdp: string;
10
+    type: RTCSdpType;
10
 }
11
 }
11
 
12
 
12
 /**
13
 /**
37
      * @param mLine
38
      * @param mLine
38
      * @returns
39
      * @returns
39
      */
40
      */
40
-     _fillSsrcsFromCache(mLine: transform.MediaDescription) : any {
41
+    _fillSsrcsFromCache(mLine: transform.MediaDescription): any {
41
         const mid = mLine.mid;
42
         const mid = mLine.mid;
42
         const cachedSsrcs = this._ssrcCache.get(mid);
43
         const cachedSsrcs = this._ssrcCache.get(mid);
43
         const newSsrcs = this._parseSimLayers(mLine);
44
         const newSsrcs = this._parseSimLayers(mLine);
76
      * @param primarySsrc
77
      * @param primarySsrc
77
      * @returns
78
      * @returns
78
      */
79
      */
79
-    _generateNewSsrcsForSimulcast(mLine: transform.MediaDescription, primarySsrc: number) : any {
80
+    _generateNewSsrcsForSimulcast(mLine: transform.MediaDescription, primarySsrc: number): any {
80
         const cname = this._getSsrcAttribute(mLine, primarySsrc, 'cname');
81
         const cname = this._getSsrcAttribute(mLine, primarySsrc, 'cname');
81
         let msid = this._getSsrcAttribute(mLine, primarySsrc, 'msid');
82
         let msid = this._getSsrcAttribute(mLine, primarySsrc, 'msid');
82
-        const addAssociatedAttributes = (mLine: transform.MediaDescription, ssrc: number) => {
83
-            mLine.ssrcs.push({
84
-                id: ssrc,
85
-                attribute: 'cname',
86
-                value: cname
87
-            });
88
-            mLine.ssrcs.push({
89
-                id: ssrc,
90
-                attribute: 'msid',
91
-                value: msid
92
-            });
93
-        }
94
 
83
 
95
         // In Unified-plan mode, the a=ssrc lines with the msid attribute are not present (only cname attributes are
84
         // In Unified-plan mode, the a=ssrc lines with the msid attribute are not present (only cname attributes are
96
         // present) in the answers that Chrome and Safari generate for an offer received from Jicofo. Generate these
85
         // present) in the answers that Chrome and Safari generate for an offer received from Jicofo. Generate these
105
                     attribute: 'msid',
94
                     attribute: 'msid',
106
                     value: msid
95
                     value: msid
107
                 });
96
                 });
108
-            })
97
+            });
109
         }
98
         }
110
 
99
 
111
         // Generate SIM layers.
100
         // Generate SIM layers.
114
         for (let i = 0; i < this._numOfLayers - 1; ++i) {
103
         for (let i = 0; i < this._numOfLayers - 1; ++i) {
115
             const simSsrc = this._generateSsrc();
104
             const simSsrc = this._generateSsrc();
116
 
105
 
117
-            addAssociatedAttributes(mLine, simSsrc);
106
+            mLine.ssrcs.push({
107
+                id: simSsrc,
108
+                attribute: 'cname',
109
+                value: cname
110
+            });
111
+            mLine.ssrcs.push({
112
+                id: simSsrc,
113
+                attribute: 'msid',
114
+                value: msid
115
+            });
116
+
118
             simSsrcs.push(simSsrc);
117
             simSsrcs.push(simSsrc);
119
         }
118
         }
120
 
119
 
121
         mLine.ssrcGroups = mLine.ssrcGroups || [];
120
         mLine.ssrcGroups = mLine.ssrcGroups || [];
122
         mLine.ssrcGroups.push({
121
         mLine.ssrcGroups.push({
123
             semantics: SSRC_GROUP_SEMANTICS.SIM,
122
             semantics: SSRC_GROUP_SEMANTICS.SIM,
124
-            ssrcs: primarySsrc + ' ' + simSsrcs.join(' ')
123
+            ssrcs: `${primarySsrc} ${simSsrcs.join(' ')}`
125
         });
124
         });
126
 
125
 
127
         return mLine;
126
         return mLine;
132
      *
131
      *
133
      * @returns
132
      * @returns
134
      */
133
      */
135
-    _generateSsrc() : number {
134
+    _generateSsrc(): number {
136
         const max = 0xffffffff;
135
         const max = 0xffffffff;
137
 
136
 
138
         return Math.floor(Math.random() * max);
137
         return Math.floor(Math.random() * max);
146
      * @param attributeName
145
      * @param attributeName
147
      * @returns
146
      * @returns
148
      */
147
      */
149
-    _getSsrcAttribute(mLine: transform.MediaDescription, ssrc: number, attributeName: string) : string | undefined {
148
+    _getSsrcAttribute(mLine: transform.MediaDescription, ssrc: number, attributeName: string): string | undefined {
150
         return mLine.ssrcs?.find(
149
         return mLine.ssrcs?.find(
151
             ssrcInfo => Number(ssrcInfo.id) === ssrc
150
             ssrcInfo => Number(ssrcInfo.id) === ssrc
152
             && ssrcInfo.attribute === attributeName)?.value;
151
             && ssrcInfo.attribute === attributeName)?.value;
158
      * @param mLine
157
      * @param mLine
159
      * @returns
158
      * @returns
160
      */
159
      */
161
-    _parseSimLayers(mLine: transform.MediaDescription) : Array<number> | null {
160
+    _parseSimLayers(mLine: transform.MediaDescription): Array<number> | null {
162
         const simGroup = mLine.ssrcGroups?.find(group => group.semantics === SSRC_GROUP_SEMANTICS.SIM);
161
         const simGroup = mLine.ssrcGroups?.find(group => group.semantics === SSRC_GROUP_SEMANTICS.SIM);
163
 
162
 
164
         if (simGroup) {
163
         if (simGroup) {
181
      * @param description
180
      * @param description
182
      * @returns
181
      * @returns
183
      */
182
      */
184
-    mungeLocalDescription(description: Description) : Description {
185
-        if (!description || !description.sdp) {
183
+    mungeLocalDescription(description: IDescription): IDescription {
184
+        if (!description?.sdp) {
186
             return description;
185
             return description;
187
         }
186
         }
188
         const session = transform.parse(description.sdp);
187
         const session = transform.parse(description.sdp);

+ 25
- 15
modules/statistics/PreCallTest.ts 파일 보기

1
 import PreCallTest from '@jitsi/precall-test';
1
 import PreCallTest from '@jitsi/precall-test';
2
 
2
 
3
 
3
 
4
-export interface PreCallResult {
5
-    throughput: number; // Maximum bandwidth reached in kbps  (kilo bits per second).
6
-    fractionalLoss: number; // Packet loss percentage over all the test traffic.
7
-    rtt: number;  // Round trip time in milliseconds.
8
-    jitter: number;  // Variation in packet arrival times during the transmission of media.
9
-    mediaConnectivity: boolean; // Whether the data channel was able to send data or not.
4
+export interface IPreCallResult {
5
+
6
+    // Maximum bandwidth reached in kbps  (kilo bits per second).
7
+    fractionalLoss: number;
8
+
9
+    // Round trip time in milliseconds.
10
+    jitter: number;
11
+
12
+    // Variation in packet arrival times during the transmission of media.
13
+    mediaConnectivity: boolean;
14
+
15
+    // Packet loss percentage over all the test traffic.
16
+    rtt: number;
17
+    throughput: number; // Whether the data channel was able to send data or not.
10
 }
18
 }
11
 
19
 
12
 // Same interface as a PeerConnection configuration object.
20
 // Same interface as a PeerConnection configuration object.
13
-export interface IceServer {
21
+export interface IIceServer {
22
+    credential?: string;
14
     urls: Array<string> | string;
23
     urls: Array<string> | string;
15
     username?: string;
24
     username?: string;
16
-    credential?: string;
17
 }
25
 }
18
 
26
 
19
 /**
27
 /**
20
  * Run a pre-call test to check the network conditions. It uses a TURN server to establish
28
  * Run a pre-call test to check the network conditions. It uses a TURN server to establish
21
- * a connection between two PeerConnections using the server as a relay. Afterwards it sends 
22
- * some test traffic through a data channel to measure the network conditions, these are 
29
+ * a connection between two PeerConnections using the server as a relay. Afterwards it sends
30
+ * some test traffic through a data channel to measure the network conditions, these are
23
  * recorded and returned through a Promise.
31
  * recorded and returned through a Promise.
24
- * 
25
- * @param {Array<IceServer>} - The ICE servers to use for the test, these are passes to the PeerConnection constructor. 
26
- * @returns {Promise<PreCallResult | any>} - A Promise that resolves with the test results or rejects with an error.
32
+ *
33
+ * @param {Array<IIceServer>} - The ICE servers to use for the test, these are passes to the PeerConnection constructor.
34
+ * @returns {Promise<IPreCallResult | any>} - A Promise that resolves with the test results or rejects with an error.
27
  */
35
  */
28
-export default async function runPreCallTest(iceServers: Array<IceServer>): Promise<PreCallResult | string> {
29
-    return new PreCallTest().start(iceServers);
36
+export default async function runPreCallTest(iceServers: Array<IIceServer>): Promise<IPreCallResult | string> {
37
+    const test = new PreCallTest();
38
+
39
+    return await test.start(iceServers);
30
 }
40
 }

+ 1
- 1
modules/version/ComponentsVersions.ts 파일 보기

6
  * Discovers component versions in a conference.
6
  * Discovers component versions in a conference.
7
  */
7
  */
8
 export default class ComponentsVersions {
8
 export default class ComponentsVersions {
9
-    versions: {[key: string]: string};
9
+    versions: { [key: string]: string; };
10
     conference: any;
10
     conference: any;
11
 
11
 
12
     /**
12
     /**

+ 19
- 16
modules/videosipgw/VideoSIPGWConstants.ts 파일 보기

1
 export enum VideoSIPGWStatusConstants {
1
 export enum VideoSIPGWStatusConstants {
2
+
2
     /**
3
     /**
3
      * Status that video SIP GW service is available.
4
      * Status that video SIP GW service is available.
4
      */
5
      */
5
     STATUS_AVAILABLE = 'available',
6
     STATUS_AVAILABLE = 'available',
6
 
7
 
7
     /**
8
     /**
8
-     * Status that video SIP GW service is not available.
9
+     * Status that video SIP GW service is available but there are no free nodes
10
+     * at the moment to serve new requests.
9
      */
11
      */
10
-    STATUS_UNDEFINED = 'undefined',
12
+    STATUS_BUSY = 'busy',
11
 
13
 
12
     /**
14
     /**
13
-     * Status that video SIP GW service is available but there are no free nodes
14
-     * at the moment to serve new requests.
15
+     * Status that video SIP GW service is not available.
15
      */
16
      */
16
-    STATUS_BUSY = 'busy'
17
-};
17
+    STATUS_UNDEFINED = 'undefined'
18
+}
18
 
19
 
19
 export enum VideoSIPGWStateConstants {
20
 export enum VideoSIPGWStateConstants {
21
+
20
     /**
22
     /**
21
-     * Video SIP GW session state, currently running.
23
+     * Video SIP GW session state, tried to start but it failed.
22
      */
24
      */
23
-    STATE_ON = 'on',
25
+    STATE_FAILED = 'failed',
24
 
26
 
25
     /**
27
     /**
26
      * Video SIP GW session state, currently stopped and not running.
28
      * Video SIP GW session state, currently stopped and not running.
27
      */
29
      */
28
     STATE_OFF = 'off',
30
     STATE_OFF = 'off',
29
 
31
 
32
+    /**
33
+     * Video SIP GW session state, currently running.
34
+     */
35
+    STATE_ON = 'on',
36
+
30
     /**
37
     /**
31
      * Video SIP GW session state, currently is starting.
38
      * Video SIP GW session state, currently is starting.
32
      */
39
      */
36
      * Video SIP GW session state, has observed some issues and is retrying at the
43
      * Video SIP GW session state, has observed some issues and is retrying at the
37
      * moment.
44
      * moment.
38
      */
45
      */
39
-    STATE_RETRYING = 'retrying',
40
-
41
-    /**
42
-     * Video SIP GW session state, tried to start but it failed.
43
-     */
44
-    STATE_FAILED = 'failed'
45
-};
46
+    STATE_RETRYING = 'retrying'
47
+}
46
 
48
 
47
 export enum VideoSIPGWErrorConstants {
49
 export enum VideoSIPGWErrorConstants {
50
+
48
     /**
51
     /**
49
      * Error on trying to create video SIP GW session in conference where
52
      * Error on trying to create video SIP GW session in conference where
50
      * there is no room connection (hasn't joined or has left the room).
53
      * there is no room connection (hasn't joined or has left the room).
56
      * there is an already created session.
59
      * there is an already created session.
57
      */
60
      */
58
     ERROR_SESSION_EXISTS = 'error_session_already_exists'
61
     ERROR_SESSION_EXISTS = 'error_session_already_exists'
59
-};
62
+}
60
 
63
 
61
 // exported for backward compatibility
64
 // exported for backward compatibility
62
 export const STATUS_AVAILABLE = VideoSIPGWStatusConstants.STATUS_AVAILABLE;
65
 export const STATUS_AVAILABLE = VideoSIPGWStatusConstants.STATUS_AVAILABLE;

+ 3
- 1
modules/watchRTC/WatchRTC.ts 파일 보기

29
             // @ts-ignore
29
             // @ts-ignore
30
             if (browser.isReactNative()) {
30
             if (browser.isReactNative()) {
31
                 logger.warn('Cannot initialize WatchRTC in a react native environment!');
31
                 logger.warn('Cannot initialize WatchRTC in a react native environment!');
32
+
32
                 return;
33
                 return;
33
             }
34
             }
34
 
35
 
35
             if (!isAnalyticsEnabled(options)) {
36
             if (!isAnalyticsEnabled(options)) {
36
                 logger.error('Cannot initialize WatchRTC when analytics or third party requests are disabled.');
37
                 logger.error('Cannot initialize WatchRTC when analytics or third party requests are disabled.');
38
+
37
                 return;
39
                 return;
38
             }
40
             }
39
 
41
 
75
     }
77
     }
76
 }
78
 }
77
 
79
 
78
-export default new WatchRTCHandler();
80
+export default new WatchRTCHandler();

+ 3
- 0
modules/watchRTC/functions.ts 파일 보기

6
  */
6
  */
7
 export function isAnalyticsEnabled(options): boolean {
7
 export function isAnalyticsEnabled(options): boolean {
8
     const { analytics, disableThirdPartyRequests } = options;
8
     const { analytics, disableThirdPartyRequests } = options;
9
+
9
     return !(analytics?.disabled || disableThirdPartyRequests);
10
     return !(analytics?.disabled || disableThirdPartyRequests);
10
 }
11
 }
11
 
12
 
17
  */
18
  */
18
 export function isRtcstatsEnabled(options): boolean {
19
 export function isRtcstatsEnabled(options): boolean {
19
     const { analytics } = options;
20
     const { analytics } = options;
21
+
20
     return analytics?.rtcstatsEnabled ?? false;
22
     return analytics?.rtcstatsEnabled ?? false;
21
 }
23
 }
22
 
24
 
28
  */
30
  */
29
 export function isWatchRTCEnabled(options): boolean {
31
 export function isWatchRTCEnabled(options): boolean {
30
     const { analytics } = options;
32
     const { analytics } = options;
33
+
31
     return analytics?.watchRTCEnabled ?? false;
34
     return analytics?.watchRTCEnabled ?? false;
32
 }
35
 }

+ 8
- 7
modules/xmpp/JingleSessionState.ts 파일 보기

1
 export enum JingleSessionState {
1
 export enum JingleSessionState {
2
-    /**
3
-     * The pending Jingle session state which means the session as defined in
4
-     * XEP-0166(before 'session-invite/session-accept' took place).
5
-     */
6
-    PENDING = 'pending',
7
 
2
 
8
     /**
3
     /**
9
      * The active Jingle session state as defined in XEP-0166
4
      * The active Jingle session state as defined in XEP-0166
15
      * The ended Jingle session state as defined in XEP-0166
10
      * The ended Jingle session state as defined in XEP-0166
16
      * (after 'session-terminate').
11
      * (after 'session-terminate').
17
      */
12
      */
18
-    ENDED = 'ended'
19
-};
13
+    ENDED = 'ended',
14
+
15
+    /**
16
+     * The pending Jingle session state which means the session as defined in
17
+     * XEP-0166(before 'session-invite/session-accept' took place).
18
+     */
19
+    PENDING = 'pending'
20
+}
20
 
21
 
21
 // exported for backward compatibility
22
 // exported for backward compatibility
22
 export const PENDING = JingleSessionState.PENDING;
23
 export const PENDING = JingleSessionState.PENDING;

+ 1
- 1
modules/xmpp/Lobby.js 파일 보기

324
 
324
 
325
                     this.lobbyRoom.clean();
325
                     this.lobbyRoom.clean();
326
 
326
 
327
-                    return;
327
+
328
                 }
328
                 }
329
             });
329
             });
330
 
330
 

+ 3
- 2
modules/xmpp/MediaSessionEvents.ts 파일 보기

1
 enum MediaSessionEvents {
1
 enum MediaSessionEvents {
2
+
2
     /**
3
     /**
3
      * Event triggered when the remote party signals video max frame heights for its local sources.
4
      * Event triggered when the remote party signals video max frame heights for its local sources.
4
      */
5
      */
5
     REMOTE_SOURCE_CONSTRAINTS_CHANGED = 'media_session.REMOTE_SOURCE_CONSTRAINTS_CHANGED'
6
     REMOTE_SOURCE_CONSTRAINTS_CHANGED = 'media_session.REMOTE_SOURCE_CONSTRAINTS_CHANGED'
6
-};
7
+}
7
 
8
 
8
-export default MediaSessionEvents;
9
+export default MediaSessionEvents;

+ 6083
- 3599
package-lock.json
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


+ 11
- 7
package.json 파일 보기

35
     "webrtc-adapter": "8.1.1"
35
     "webrtc-adapter": "8.1.1"
36
   },
36
   },
37
   "devDependencies": {
37
   "devDependencies": {
38
-    "@babel/core": "7.16.0",
39
-    "@babel/eslint-parser": "7.16.0",
40
-    "@babel/preset-env": "7.16.0",
41
-    "@babel/preset-typescript": "7.16.7",
42
-    "@jitsi/eslint-config": "4.1.4",
38
+    "@babel/core": "7.25.9",
39
+    "@babel/eslint-parser": "7.25.9",
40
+    "@babel/preset-env": "7.25.9",
41
+    "@babel/preset-typescript": "7.25.9",
42
+    "@jitsi/eslint-config": "5.0.10",
43
+    "@stylistic/eslint-plugin": "2.12.1",
43
     "@types/async": "3.2.12",
44
     "@types/async": "3.2.12",
44
     "@types/jasmine": "4.0.3",
45
     "@types/jasmine": "4.0.3",
45
     "@types/lodash-es": "4.17.12",
46
     "@types/lodash-es": "4.17.12",
46
     "@types/sdp-transform": "2.4.5",
47
     "@types/sdp-transform": "2.4.5",
48
+    "@typescript-eslint/eslint-plugin": "8.19.1",
49
+    "@typescript-eslint/parser": "8.19.1",
47
     "babel-loader": "8.2.3",
50
     "babel-loader": "8.2.3",
48
     "core-js": "3.19.1",
51
     "core-js": "3.19.1",
49
-    "eslint": "8.1.0",
50
-    "eslint-plugin-import": "2.25.2",
52
+    "eslint": "8.57.0",
53
+    "eslint-plugin-import": "2.31.0",
54
+    "eslint-plugin-typescript-sort-keys": "3.3.0",
51
     "jasmine-core": "4.2.0",
55
     "jasmine-core": "4.2.0",
52
     "karma": "6.4.0",
56
     "karma": "6.4.0",
53
     "karma-chrome-launcher": "3.1.1",
57
     "karma-chrome-launcher": "3.1.1",

+ 1
- 0
service/RTC/BridgeVideoType.ts 파일 보기

3
  * @type {{CAMERA: string, DESKTOP: string, DESKTOP_HIGH_FPS: string, NONE: string}}
3
  * @type {{CAMERA: string, DESKTOP: string, DESKTOP_HIGH_FPS: string, NONE: string}}
4
  */
4
  */
5
 export enum BridgeVideoType {
5
 export enum BridgeVideoType {
6
+
6
     /**
7
     /**
7
      * The camera video type.
8
      * The camera video type.
8
      */
9
      */

+ 1
- 0
service/RTC/CameraFacingMode.ts 파일 보기

8
  * @enum {string}
8
  * @enum {string}
9
  */
9
  */
10
 export enum CameraFacingMode {
10
 export enum CameraFacingMode {
11
+
11
     /**
12
     /**
12
      * The mode which specifies the environment-facing camera.
13
      * The mode which specifies the environment-facing camera.
13
      */
14
      */

+ 1
- 0
service/RTC/CodecMimeType.ts 파일 보기

3
  * @type {{AV1: string, H264: string, OPUS: string, RED: string, ULPFEC: string, VP8: string, VP9: string}}
3
  * @type {{AV1: string, H264: string, OPUS: string, RED: string, ULPFEC: string, VP8: string, VP9: string}}
4
  */
4
  */
5
 export enum CodecMimeType {
5
 export enum CodecMimeType {
6
+
6
     /**
7
     /**
7
      * AV1 codec mime type.
8
      * AV1 codec mime type.
8
      */
9
      */

+ 1
- 0
service/RTC/MediaDirection.ts 파일 보기

2
  * Enumeration of the media direction types.
2
  * Enumeration of the media direction types.
3
  */
3
  */
4
 export enum MediaDirection {
4
 export enum MediaDirection {
5
+
5
     /**
6
     /**
6
      * Media is send and receive is suspended.
7
      * Media is send and receive is suspended.
7
      */
8
      */

+ 7
- 6
service/RTC/MediaType.ts 파일 보기

1
 export enum MediaType {
1
 export enum MediaType {
2
+
2
     /**
3
     /**
3
-     * The audio type.
4
+     * The application type (data over bridge channel).
4
      */
5
      */
5
-    AUDIO = 'audio',
6
+    APPLICATION = 'application',
6
 
7
 
7
     /**
8
     /**
8
-     * The video type.
9
+     * The audio type.
9
      */
10
      */
10
-    VIDEO = 'video',
11
+    AUDIO = 'audio',
11
 
12
 
12
     /**
13
     /**
13
-     * The application type (data over bridge channel).
14
+     * The video type.
14
      */
15
      */
15
-    APPLICATION = 'application'
16
+    VIDEO = 'video'
16
 }
17
 }

+ 57
- 51
service/RTC/RTCEvents.ts 파일 보기

1
 export enum RTCEvents {
1
 export enum RTCEvents {
2
+
3
+    AUDIO_OUTPUT_DEVICE_CHANGED = 'rtc.audio_output_device_changed',
4
+
5
+    /**
6
+     * Designates an event indicating that some received audio SSRCs will now map to
7
+     * new remote sources.
8
+     */
9
+    AUDIO_SSRCS_REMAPPED = 'rtc.audio_ssrcs_remapped',
10
+
2
     /**
11
     /**
3
      * Indicates error while create answer call.
12
      * Indicates error while create answer call.
4
      */
13
      */
8
      * Indicates error while create offer call.
17
      * Indicates error while create offer call.
9
      */
18
      */
10
     CREATE_OFFER_FAILED = 'rtc.create_offer_failed',
19
     CREATE_OFFER_FAILED = 'rtc.create_offer_failed',
11
-    DATA_CHANNEL_OPEN = 'rtc.data_channel_open',
12
     DATA_CHANNEL_CLOSED = 'rtc.data_channel_closed',
20
     DATA_CHANNEL_CLOSED = 'rtc.data_channel_closed',
13
-    ENDPOINT_CONN_STATUS_CHANGED = 'rtc.endpoint_conn_status_changed',
21
+    DATA_CHANNEL_OPEN = 'rtc.data_channel_open',
22
+    DEVICE_LIST_AVAILABLE = 'rtc.device_list_available',
23
+
24
+    DEVICE_LIST_CHANGED = 'rtc.device_list_changed',
25
+
26
+    /**
27
+     * Indicates that the list with available devices will change.
28
+     */
29
+    DEVICE_LIST_WILL_CHANGE = 'rtc.device_list_will_change',
30
+
14
     DOMINANT_SPEAKER_CHANGED = 'rtc.dominant_speaker_changed',
31
     DOMINANT_SPEAKER_CHANGED = 'rtc.dominant_speaker_changed',
15
-    FORWARDED_SOURCES_CHANGED = 'rtc.forwarded_sources_changed',
32
+
33
+    ENDPOINT_CONN_STATUS_CHANGED = 'rtc.endpoint_conn_status_changed',
16
 
34
 
17
     /**
35
     /**
18
-     * Event emitted when the user granted/blocked a permission for the camera / mic.
19
-     * Used to keep track of the granted permissions on browsers which don't
20
-     * support the Permissions API.
36
+     * Indicates that a message from another participant is received on
37
+     * data channel.
21
      */
38
      */
22
-    PERMISSIONS_CHANGED = 'rtc.permissions_changed',
39
+    ENDPOINT_MESSAGE_RECEIVED = 'rtc.endpoint_message_received',
23
 
40
 
24
-    SENDER_VIDEO_CONSTRAINTS_CHANGED = 'rtc.sender_video_constraints_changed',
41
+    /**
42
+     * Indicates that the remote endpoint stats have been received on data channel.
43
+     */
44
+    ENDPOINT_STATS_RECEIVED = 'rtc.endpoint_stats_received',
45
+
46
+    FORWARDED_SOURCES_CHANGED = 'rtc.forwarded_sources_changed',
25
 
47
 
26
     /**
48
     /**
27
      * Event emitted when {@link RTC.setLastN} method is called to update with
49
      * Event emitted when {@link RTC.setLastN} method is called to update with
35
      */
57
      */
36
     LOCAL_TRACK_MAX_ENABLED_RESOLUTION_CHANGED = 'rtc.local_track_max_enabled_resolution_changed',
58
     LOCAL_TRACK_MAX_ENABLED_RESOLUTION_CHANGED = 'rtc.local_track_max_enabled_resolution_changed',
37
 
59
 
38
-    TRACK_ATTACHED = 'rtc.track_attached',
60
+    /**
61
+     * Designates an event indicating that the local ICE username fragment of
62
+     * the jingle session has changed.
63
+     * The first argument of the vent is <tt>TraceablePeerConnection</tt> which
64
+     * is the source of the event.
65
+     * The second argument is the actual "ufrag" string.
66
+     */
67
+    LOCAL_UFRAG_CHANGED = 'rtc.local_ufrag_changed',
68
+
69
+    /**
70
+     * Event emitted when the user granted/blocked a permission for the camera / mic.
71
+     * Used to keep track of the granted permissions on browsers which don't
72
+     * support the Permissions API.
73
+     */
74
+    PERMISSIONS_CHANGED = 'rtc.permissions_changed',
39
 
75
 
40
     /**
76
     /**
41
      * Event fired when we remote track is added to the conference.
77
      * Event fired when we remote track is added to the conference.
57
     // (currently implemented for local tracks only)
93
     // (currently implemented for local tracks only)
58
     REMOTE_TRACK_UNMUTE = 'rtc.remote_track_unmute',
94
     REMOTE_TRACK_UNMUTE = 'rtc.remote_track_unmute',
59
 
95
 
60
-    /**
61
-     * Indicates error while set local description.
62
-     */
63
-    SET_LOCAL_DESCRIPTION_FAILED = 'rtc.set_local_description_failed',
64
-
65
-    /**
66
-     * Indicates error while set remote description.
67
-     */
68
-    SET_REMOTE_DESCRIPTION_FAILED = 'rtc.set_remote_description_failed',
69
-    AUDIO_OUTPUT_DEVICE_CHANGED = 'rtc.audio_output_device_changed',
70
-    DEVICE_LIST_CHANGED = 'rtc.device_list_changed',
71
-
72
-    /**
73
-     * Indicates that the list with available devices will change.
74
-     */
75
-    DEVICE_LIST_WILL_CHANGE = 'rtc.device_list_will_change',
76
-    DEVICE_LIST_AVAILABLE = 'rtc.device_list_available',
77
-
78
-    /**
79
-     * Indicates that a message from another participant is received on
80
-     * data channel.
81
-     */
82
-    ENDPOINT_MESSAGE_RECEIVED = 'rtc.endpoint_message_received',
83
-
84
-    /**
85
-     * Indicates that the remote endpoint stats have been received on data channel.
86
-     */
87
-    ENDPOINT_STATS_RECEIVED = 'rtc.endpoint_stats_received',
88
-
89
     /**
96
     /**
90
      * Designates an event indicating that the local ICE username fragment of
97
      * Designates an event indicating that the local ICE username fragment of
91
      * the jingle session has changed.
98
      * the jingle session has changed.
93
      * is the source of the event.
100
      * is the source of the event.
94
      * The second argument is the actual "ufrag" string.
101
      * The second argument is the actual "ufrag" string.
95
      */
102
      */
96
-    LOCAL_UFRAG_CHANGED = 'rtc.local_ufrag_changed',
103
+    REMOTE_UFRAG_CHANGED = 'rtc.remote_ufrag_changed',
104
+
105
+    SENDER_VIDEO_CONSTRAINTS_CHANGED = 'rtc.sender_video_constraints_changed',
97
 
106
 
98
     /**
107
     /**
99
-     * Designates an event indicating that the local ICE username fragment of
100
-     * the jingle session has changed.
101
-     * The first argument of the vent is <tt>TraceablePeerConnection</tt> which
102
-     * is the source of the event.
103
-     * The second argument is the actual "ufrag" string.
108
+     * Indicates error while set local description.
104
      */
109
      */
105
-    REMOTE_UFRAG_CHANGED = 'rtc.remote_ufrag_changed',
110
+    SET_LOCAL_DESCRIPTION_FAILED = 'rtc.set_local_description_failed',
106
 
111
 
107
     /**
112
     /**
108
-     * Designates an event indicating that some received video SSRCs will now map to
109
-     * new remote sources.
113
+     * Indicates error while set remote description.
110
      */
114
      */
111
-    VIDEO_SSRCS_REMAPPED = 'rtc.video_ssrcs_remapped',
115
+    SET_REMOTE_DESCRIPTION_FAILED = 'rtc.set_remote_description_failed',
116
+
117
+    TRACK_ATTACHED = 'rtc.track_attached',
112
 
118
 
113
     /**
119
     /**
114
-     * Designates an event indicating that some received audio SSRCs will now map to
120
+     * Designates an event indicating that some received video SSRCs will now map to
115
      * new remote sources.
121
      * new remote sources.
116
      */
122
      */
117
-    AUDIO_SSRCS_REMAPPED = 'rtc.audio_ssrcs_remapped'
123
+    VIDEO_SSRCS_REMAPPED = 'rtc.video_ssrcs_remapped'
118
 }
124
 }
119
 
125
 
120
 export const CREATE_ANSWER_FAILED = RTCEvents.CREATE_ANSWER_FAILED;
126
 export const CREATE_ANSWER_FAILED = RTCEvents.CREATE_ANSWER_FAILED;
149
 // TODO: this was a pre-ES6 module using module.exports = RTCEvents which doesn't translate well
155
 // TODO: this was a pre-ES6 module using module.exports = RTCEvents which doesn't translate well
150
 // it is used in a number of places and should be updated to use the named export
156
 // it is used in a number of places and should be updated to use the named export
151
 
157
 
152
-export default RTCEvents;
158
+export default RTCEvents;

+ 1
- 0
service/RTC/SignalingEvents.ts 파일 보기

1
 export enum SignalingEvents {
1
 export enum SignalingEvents {
2
+
2
     /**
3
     /**
3
      * Event triggered when participant's muted status changes.
4
      * Event triggered when participant's muted status changes.
4
      *
5
      *

+ 11
- 8
service/RTC/StandardVideoQualitySettings.ts 파일 보기

1
 import browser from '../../modules/browser';
1
 import browser from '../../modules/browser';
2
+
2
 import { CodecMimeType } from './CodecMimeType';
3
 import { CodecMimeType } from './CodecMimeType';
3
 
4
 
4
 // Default value for assumed downlink bandwidth for the local endpoint which tells the bridge to use its own calculated
5
 // Default value for assumed downlink bandwidth for the local endpoint which tells the bridge to use its own calculated
33
  * The ssrc-group semantics for SSRCs related to the video streams.
34
  * The ssrc-group semantics for SSRCs related to the video streams.
34
  */
35
  */
35
 export enum SSRC_GROUP_SEMANTICS {
36
 export enum SSRC_GROUP_SEMANTICS {
37
+
36
     // The semantics for group of SSRCs belonging to the same stream, primary and RTX.
38
     // The semantics for group of SSRCs belonging to the same stream, primary and RTX.
37
     FID = 'FID',
39
     FID = 'FID',
38
 
40
 
104
  * next codec in the list.
106
  * next codec in the list.
105
  */
107
  */
106
 export const VIDEO_CODECS_BY_COMPLEXITY = {
108
 export const VIDEO_CODECS_BY_COMPLEXITY = {
107
-    'camera' : [
109
+    'camera': [
108
         CodecMimeType.AV1,
110
         CodecMimeType.AV1,
109
         CodecMimeType.VP9,
111
         CodecMimeType.VP9,
110
         CodecMimeType.VP8
112
         CodecMimeType.VP8
111
     ],
113
     ],
112
-    'desktop' : [
114
+    'desktop': [
113
         CodecMimeType.VP9,
115
         CodecMimeType.VP9,
114
         CodecMimeType.VP8,
116
         CodecMimeType.VP8,
115
         CodecMimeType.AV1
117
         CodecMimeType.AV1
172
  * Enumerate the supported video resolutions.
174
  * Enumerate the supported video resolutions.
173
  */
175
  */
174
 export enum VIDEO_QUALITY_SETTINGS {
176
 export enum VIDEO_QUALITY_SETTINGS {
175
-    // 3840x2160 or 4k.
176
-    ULTRA = 'ultraHd',
177
 
177
 
178
     // 1920x1080 or full High Definition.
178
     // 1920x1080 or full High Definition.
179
     FULL = 'fullHd',
179
     FULL = 'fullHd',
181
     // 1280x720 or High Definition.
181
     // 1280x720 or High Definition.
182
     HIGH = 'high',
182
     HIGH = 'high',
183
 
183
 
184
-    // 640x360 or Standard Definition.
185
-    STANDARD = 'standard',
186
-
187
     // 320x180 or Low Definition.
184
     // 320x180 or Low Definition.
188
     LOW = 'low',
185
     LOW = 'low',
189
 
186
 
190
     // When the camera is turned off.
187
     // When the camera is turned off.
191
-    NONE = 'none'
188
+    NONE = 'none',
189
+
190
+    // 640x360 or Standard Definition.
191
+    STANDARD = 'standard',
192
+
193
+    // 3840x2160 or 4k.
194
+    ULTRA = 'ultraHd'
192
 }
195
 }

+ 1
- 0
service/RTC/VideoEncoderScalabilityMode.ts 파일 보기

11
  * }
11
  * }
12
  */
12
  */
13
 export enum VideoEncoderScalabilityMode {
13
 export enum VideoEncoderScalabilityMode {
14
+
14
     /**
15
     /**
15
      * L1T3 mode: 1-layer spatial and 3-layer temporal scalabilty encoding.
16
      * L1T3 mode: 1-layer spatial and 3-layer temporal scalabilty encoding.
16
      */
17
      */

+ 1
- 0
service/RTC/VideoType.ts 파일 보기

2
  * Enumeration of the video types
2
  * Enumeration of the video types
3
  */
3
  */
4
 export enum VideoType {
4
 export enum VideoType {
5
+
5
     /**
6
     /**
6
      * The camera video type.
7
      * The camera video type.
7
      */
8
      */

+ 2
- 1
service/connectivity/ConnectionQualityEvents.ts 파일 보기

1
 export enum ConnectionQualityEvents {
1
 export enum ConnectionQualityEvents {
2
+
2
     /**
3
     /**
3
      * Indicates that the local connection statistics were updated.
4
      * Indicates that the local connection statistics were updated.
4
      */
5
      */
9
      * were updated.
10
      * were updated.
10
      */
11
      */
11
     REMOTE_STATS_UPDATED = 'cq.remote_stats_updated'
12
     REMOTE_STATS_UPDATED = 'cq.remote_stats_updated'
12
-};
13
+}
13
 
14
 
14
 // exported for backward compatibility
15
 // exported for backward compatibility
15
 export const LOCAL_STATS_UPDATED = ConnectionQualityEvents.LOCAL_STATS_UPDATED;
16
 export const LOCAL_STATS_UPDATED = ConnectionQualityEvents.LOCAL_STATS_UPDATED;

+ 2
- 1
service/e2eping/E2ePingEvents.ts 파일 보기

1
 export enum E2ePingEvents {
1
 export enum E2ePingEvents {
2
+
2
     /**
3
     /**
3
      * Indicates that the end-to-end round-trip-time for a participant has changed.
4
      * Indicates that the end-to-end round-trip-time for a participant has changed.
4
      */
5
      */
5
     E2E_RTT_CHANGED = 'e2eping.e2e_rtt_changed'
6
     E2E_RTT_CHANGED = 'e2eping.e2e_rtt_changed'
6
-};
7
+}
7
 
8
 
8
 // exported for backward compatibility
9
 // exported for backward compatibility
9
 export const E2E_RTT_CHANGED = E2ePingEvents.E2E_RTT_CHANGED;
10
 export const E2E_RTT_CHANGED = E2ePingEvents.E2E_RTT_CHANGED;

+ 183
- 143
service/statistics/AnalyticsEvents.ts 파일 보기

23
  */
23
  */
24
 
24
 
25
 export enum AnalyticsEvents {
25
 export enum AnalyticsEvents {
26
-    /**
27
-     * The constant which identifies an event of type "operational".
28
-     */
29
-    TYPE_OPERATIONAL = 'operational',
30
-
31
-    /**
32
-     * The constant which identifies an event of type "page".
33
-     */
34
-    TYPE_PAGE = 'page',
35
-
36
-    /**
37
-     * The constant which identifies an event of type "track".
38
-     */
39
-    TYPE_TRACK = 'track',
40
-
41
-    /**
42
-     * The constant which identifies an event of type "ui".
43
-     */
44
-    TYPE_UI = 'ui',
45
 
26
 
46
     /**
27
     /**
47
      * The "action" value for Jingle events which indicates that the Jingle session
28
      * The "action" value for Jingle events which indicates that the Jingle session
80
     ACTION_JVB_ICE_FAILED = 'jvb.ice.failed',
61
     ACTION_JVB_ICE_FAILED = 'jvb.ice.failed',
81
 
62
 
82
     /**
63
     /**
83
-     * The "action" value for P2P events which indicates that P2P session initiate message has been rejected by the client
84
-     * because the mandatory requirements were not met.
64
+     * The "action" value for P2P events which indicates that P2P session initiate message has been rejected by the
65
+     * client because the mandatory requirements were not met.
85
      */
66
      */
86
     ACTION_P2P_DECLINED = 'decline',
67
     ACTION_P2P_DECLINED = 'decline',
87
 
68
 
206
      */
187
      */
207
     TRACK_UNMUTED = 'track.unmuted',
188
     TRACK_UNMUTED = 'track.unmuted',
208
 
189
 
190
+    /**
191
+     * The constant which identifies an event of type "operational".
192
+     */
193
+    TYPE_OPERATIONAL = 'operational',
194
+
195
+    /**
196
+     * The constant which identifies an event of type "page".
197
+     */
198
+    TYPE_PAGE = 'page',
199
+
200
+    /**
201
+     * The constant which identifies an event of type "track".
202
+     */
203
+    TYPE_TRACK = 'track',
204
+
205
+    /**
206
+     * The constant which identifies an event of type "ui".
207
+     */
208
+    TYPE_UI = 'ui',
209
+
209
     /**
210
     /**
210
      * Indicates that the video codec changed for a local track.
211
      * Indicates that the video codec changed for a local track.
211
      *
212
      *
245
  * Creates an operational event which indicates that we have received a
246
  * Creates an operational event which indicates that we have received a
246
  * "bridge down" event from jicofo.
247
  * "bridge down" event from jicofo.
247
  */
248
  */
248
-export const createBridgeDownEvent = () => ( {
249
-    action: 'bridge.down',
250
-    actionSubject: 'bridge.down',
251
-    type: TYPE_OPERATIONAL
252
-} );
249
+export const createBridgeDownEvent = () => {
250
+    return {
251
+        action: 'bridge.down',
252
+        actionSubject: 'bridge.down',
253
+        type: TYPE_OPERATIONAL
254
+    };
255
+};
253
 
256
 
254
 /**
257
 /**
255
  * Creates an event which indicates that the XMPP connection failed
258
  * Creates an event which indicates that the XMPP connection failed
257
  * @param errorMessage TODO
260
  * @param errorMessage TODO
258
  * @param detail connection failed details.
261
  * @param detail connection failed details.
259
  */
262
  */
260
-export const createConnectionFailedEvent = ( errorType: unknown, errorMessage: unknown, details: object ) => ( {
261
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
262
-    action: 'connection.failed',
263
-    attributes: {
264
-        'error_type': errorType,
265
-        'error_message': errorMessage,
266
-        ...details
267
-    }
268
-} );
263
+export const createConnectionFailedEvent = (errorType: unknown, errorMessage: unknown, details: object) => {
264
+    return {
265
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
266
+        action: 'connection.failed',
267
+        attributes: {
268
+            'error_type': errorType,
269
+            'error_message': errorMessage,
270
+            ...details
271
+        }
272
+    };
273
+};
269
 
274
 
270
 /**
275
 /**
271
  * Creates a conference event.
276
  * Creates a conference event.
273
  * @param action - The action of the event.
278
  * @param action - The action of the event.
274
  * @param attributes - The attributes to be added to the event.
279
  * @param attributes - The attributes to be added to the event.
275
  */
280
  */
276
-export const createConferenceEvent = ( action: string, attributes: object ) => ( {
277
-    action,
278
-    attributes,
279
-    source: 'conference',
280
-    type: AnalyticsEvents.TYPE_OPERATIONAL
281
-} );
281
+export const createConferenceEvent = (action: string, attributes: object) => {
282
+    return {
283
+        action,
284
+        attributes,
285
+        source: 'conference',
286
+        type: AnalyticsEvents.TYPE_OPERATIONAL
287
+    };
288
+};
282
 
289
 
283
 /**
290
 /**
284
  * Creates an operational event which indicates that a particular connection
291
  * Creates an operational event which indicates that a particular connection
291
  * relative to the beginning of the document's lifetime.
298
  * relative to the beginning of the document's lifetime.
292
  *
299
  *
293
  */
300
  */
294
-export const createConnectionStageReachedEvent = ( stage: unknown, attributes: object ) => ( {
295
-    action: 'connection.stage.reached',
296
-    actionSubject: stage,
297
-    attributes,
298
-    source: 'connection.stage.reached',
299
-    type: AnalyticsEvents.TYPE_OPERATIONAL
300
-} );
301
+export const createConnectionStageReachedEvent = (stage: unknown, attributes: object) => {
302
+    return {
303
+        action: 'connection.stage.reached',
304
+        actionSubject: stage,
305
+        attributes,
306
+        source: 'connection.stage.reached',
307
+        type: AnalyticsEvents.TYPE_OPERATIONAL
308
+    };
309
+};
301
 
310
 
302
 /**
311
 /**
303
  * Creates an operational event for the end-to-end round trip time to a
312
  * Creates an operational event for the end-to-end round trip time to a
306
  * @param region the region of the remote participant
315
  * @param region the region of the remote participant
307
  * @param rtt the rtt
316
  * @param rtt the rtt
308
  */
317
  */
309
-export const createE2eRttEvent = ( participantId: unknown, region: unknown, rtt: unknown ) => ( {
310
-    attributes: {
311
-        'participant_id': participantId,
312
-        region,
313
-        rtt
314
-    },
315
-    name: 'e2e_rtt',
316
-    type: AnalyticsEvents.TYPE_OPERATIONAL
317
-} );
318
+export const createE2eRttEvent = (participantId: unknown, region: unknown, rtt: unknown) => {
319
+    return {
320
+        attributes: {
321
+            'participant_id': participantId,
322
+            region,
323
+            rtt
324
+        },
325
+        name: 'e2e_rtt',
326
+        type: AnalyticsEvents.TYPE_OPERATIONAL
327
+    };
328
+};
318
 
329
 
319
 /**
330
 /**
320
  * Creates an event which indicates that the focus has left the MUC.
331
  * Creates an event which indicates that the focus has left the MUC.
321
  */
332
  */
322
-export const createFocusLeftEvent = () => ( {
323
-    action: 'focus.left',
324
-    actionSubject: 'focus.left',
325
-    type: AnalyticsEvents.TYPE_OPERATIONAL
326
-} );
333
+export const createFocusLeftEvent = () => {
334
+    return {
335
+        action: 'focus.left',
336
+        actionSubject: 'focus.left',
337
+        type: AnalyticsEvents.TYPE_OPERATIONAL
338
+    };
339
+};
327
 
340
 
328
 /**
341
 /**
329
  * Creates an event related to a getUserMedia call.
342
  * Creates an event related to a getUserMedia call.
332
  * 'success', 'warning', etc.
345
  * 'success', 'warning', etc.
333
  * @param attributes the attributes to attach to the event.
346
  * @param attributes the attributes to attach to the event.
334
  */
347
  */
335
-export const createGetUserMediaEvent = ( action: 'error' | 'success' | 'warning' | string, attributes: object = {} ) => ( {
336
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
337
-    source: 'get.user.media',
338
-    action,
339
-    attributes
340
-} );
348
+export const createGetUserMediaEvent = (action: 'error' | 'success' | 'warning' | string, attributes: object = {}) => {
349
+    return {
350
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
351
+        source: 'get.user.media',
352
+        action,
353
+        attributes
354
+    };
355
+};
341
 
356
 
342
 /**
357
 /**
343
  * Creates an event which indicates that the JVB ICE connection has failed event after 3 retries.
358
  * Creates an event which indicates that the JVB ICE connection has failed event after 3 retries.
346
  * @param attributes - The attributes to be added to the event.
361
  * @param attributes - The attributes to be added to the event.
347
  * @returns - The event object.
362
  * @returns - The event object.
348
  */
363
  */
349
-export const createJvbIceFailedEvent = ( action: unknown, attributes: object = {} ) => ( {
350
-    action,
351
-    attributes,
352
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
353
-} );
364
+export const createJvbIceFailedEvent = (action: unknown, attributes: object = {}) => {
365
+    return {
366
+        action,
367
+        attributes,
368
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
369
+    };
370
+};
354
 
371
 
355
 /**
372
 /**
356
  * Creates an event related to remote participant connection status changes.
373
  * Creates an event related to remote participant connection status changes.
357
  *
374
  *
358
  * @param attributes the attributes to attach to the event.
375
  * @param attributes the attributes to attach to the event.
359
  */
376
  */
360
-export const createParticipantConnectionStatusEvent = ( attributes: object = {} ) => ( {
361
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
362
-    source: 'peer.conn.status',
363
-    action: 'duration',
364
-    attributes
365
-} );
377
+export const createParticipantConnectionStatusEvent = (attributes: object = {}) => {
378
+    return {
379
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
380
+        source: 'peer.conn.status',
381
+        action: 'duration',
382
+        attributes
383
+    };
384
+};
366
 
385
 
367
 /**
386
 /**
368
  * Creates an event related to remote track streaming status changes.
387
  * Creates an event related to remote track streaming status changes.
369
  *
388
  *
370
  * @param attributes the attributes to attach to the event.
389
  * @param attributes the attributes to attach to the event.
371
  */
390
  */
372
-export const createTrackStreamingStatusEvent = ( attributes: object = {} ) => ( {
373
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
374
-    source: 'track.streaming.status',
375
-    action: 'duration',
376
-    attributes
377
-} );
391
+export const createTrackStreamingStatusEvent = (attributes: object = {}) => {
392
+    return {
393
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
394
+        source: 'track.streaming.status',
395
+        action: 'duration',
396
+        attributes
397
+    };
398
+};
378
 
399
 
379
 /**
400
 /**
380
  * Creates an event for a Jingle-related event.
401
  * Creates an event for a Jingle-related event.
381
  * @param action the action of the event
402
  * @param action the action of the event
382
  * @param attributes attributes to add to the event.
403
  * @param attributes attributes to add to the event.
383
  */
404
  */
384
-export const createJingleEvent = ( action: unknown, attributes: object = {} ) => ( {
385
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
386
-    action,
387
-    source: 'jingle',
388
-    attributes
389
-} );
405
+export const createJingleEvent = (action: unknown, attributes: object = {}) => {
406
+    return {
407
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
408
+        action,
409
+        source: 'jingle',
410
+        attributes
411
+    };
412
+};
390
 
413
 
391
 /**
414
 /**
392
  * Creates an event which indicates that a local track was not able to read
415
  * Creates an event which indicates that a local track was not able to read
395
  * @param mediaType the media type of the local track ('audio' or
418
  * @param mediaType the media type of the local track ('audio' or
396
  * 'video').
419
  * 'video').
397
  */
420
  */
398
-export const createNoDataFromSourceEvent = ( mediaType: 'audio' | 'video' | string, value: unknown ) => ( {
399
-    attributes: {
400
-        'media_type': mediaType,
401
-        value
402
-    },
403
-    action: 'track.no.data.from.source',
404
-    type: AnalyticsEvents.TYPE_OPERATIONAL
405
-} );
421
+export const createNoDataFromSourceEvent = (mediaType: 'audio' | 'video' | string, value: unknown) => {
422
+    return {
423
+        attributes: {
424
+            'media_type': mediaType,
425
+            value
426
+        },
427
+        action: 'track.no.data.from.source',
428
+        type: AnalyticsEvents.TYPE_OPERATIONAL
429
+    };
430
+};
406
 
431
 
407
 /**
432
 /**
408
  * Creates an event for a p2p-related event.
433
  * Creates an event for a p2p-related event.
409
  * @param action the action of the event
434
  * @param action the action of the event
410
  * @param attributes attributes to add to the event.
435
  * @param attributes attributes to add to the event.
411
  */
436
  */
412
-export const createP2PEvent = ( action: unknown, attributes: object = {} ) => ( {
413
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
414
-    action,
415
-    source: 'p2p',
416
-    attributes
417
-} )
437
+export const createP2PEvent = (action: unknown, attributes: object = {}) => {
438
+    return {
439
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
440
+        action,
441
+        source: 'p2p',
442
+        attributes
443
+    };
444
+};
418
 
445
 
419
 /**
446
 /**
420
  * Indicates that we received a remote command to mute.
447
  * Indicates that we received a remote command to mute.
421
  */
448
  */
422
-export const createRemotelyMutedEvent = ( mediaType: unknown ) => ( {
423
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
424
-    action: 'remotely.muted',
425
-    mediaType
426
-} );
449
+export const createRemotelyMutedEvent = (mediaType: unknown) => {
450
+    return {
451
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
452
+        action: 'remotely.muted',
453
+        mediaType
454
+    };
455
+};
427
 
456
 
428
 /**
457
 /**
429
  * Creates an event which contains RTP statistics such as RTT and packet loss.
458
  * Creates an event which contains RTP statistics such as RTT and packet loss.
468
  * {@link TraceablePeerConnection} and work independently from the main stats
497
  * {@link TraceablePeerConnection} and work independently from the main stats
469
  * pipe.
498
  * pipe.
470
  */
499
  */
471
-export const createRtpStatsEvent = ( attributes: object ) => ( {
472
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
473
-    action: 'rtp.stats',
474
-    attributes
475
-} );
500
+export const createRtpStatsEvent = (attributes: object) => {
501
+    return {
502
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
503
+        action: 'rtp.stats',
504
+        attributes
505
+    };
506
+};
476
 
507
 
477
 /**
508
 /**
478
  * Creates an event which contains the round trip time (RTT) to a set of
509
  * Creates an event which contains the round trip time (RTT) to a set of
480
  *
511
  *
481
  * @param attributes
512
  * @param attributes
482
  */
513
  */
483
-export const createRttByRegionEvent = ( attributes: object ) => ( {
484
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
485
-    action: 'rtt.by.region',
486
-    attributes
487
-} );
514
+export const createRttByRegionEvent = (attributes: object) => {
515
+    return {
516
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
517
+        action: 'rtt.by.region',
518
+        attributes
519
+    };
520
+};
488
 
521
 
489
 /**
522
 /**
490
  * Creates an event which contains the local and remote ICE candidate types
523
  * Creates an event which contains the local and remote ICE candidate types
492
  *
525
  *
493
  * @param attributes
526
  * @param attributes
494
  */
527
  */
495
-export const createTransportStatsEvent = ( attributes: object ) => ( {
496
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
497
-    action: 'transport.stats',
498
-    attributes
499
-} );
528
+export const createTransportStatsEvent = (attributes: object) => {
529
+    return {
530
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
531
+        action: 'transport.stats',
532
+        attributes
533
+    };
534
+};
500
 
535
 
501
 /**
536
 /**
502
  * Creates an event which contains information about the audio output problem (the user id of the affected participant,
537
  * Creates an event which contains information about the audio output problem (the user id of the affected participant,
506
  * @param localAudioLevels - The local audio levels.
541
  * @param localAudioLevels - The local audio levels.
507
  * @param remoteAudioLevels - The audio levels received from the participant.
542
  * @param remoteAudioLevels - The audio levels received from the participant.
508
  */
543
  */
509
-export const createAudioOutputProblemEvent = ( userID: string, localAudioLevels: unknown, remoteAudioLevels: unknown ) => ( {
510
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
511
-    action: 'audio.output.problem',
512
-    attributes: {
513
-        userID,
514
-        localAudioLevels,
515
-        remoteAudioLevels
516
-    }
517
-} );
544
+export const createAudioOutputProblemEvent
545
+    = (userID: string, localAudioLevels: unknown, remoteAudioLevels: unknown) => {
546
+        return {
547
+            type: AnalyticsEvents.TYPE_OPERATIONAL,
548
+            action: 'audio.output.problem',
549
+            attributes: {
550
+                userID,
551
+                localAudioLevels,
552
+                remoteAudioLevels
553
+            }
554
+        };
555
+    };
518
 
556
 
519
 /**
557
 /**
520
  * Creates an event which contains an information related to the bridge channel close event.
558
  * Creates an event which contains an information related to the bridge channel close event.
522
  * @param code - A code from {@link https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent}
560
  * @param code - A code from {@link https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent}
523
  * @param reason - A string which describes the reason for closing the bridge channel.
561
  * @param reason - A string which describes the reason for closing the bridge channel.
524
  */
562
  */
525
-export const createBridgeChannelClosedEvent = ( code: string, reason: string ) => ( {
526
-    type: AnalyticsEvents.TYPE_OPERATIONAL,
527
-    action: 'bridge-channel.error',
528
-    attributes: {
529
-        code,
530
-        reason
531
-    }
532
-} );
563
+export const createBridgeChannelClosedEvent = (code: string, reason: string) => {
564
+    return {
565
+        type: AnalyticsEvents.TYPE_OPERATIONAL,
566
+        action: 'bridge-channel.error',
567
+        attributes: {
568
+            code,
569
+            reason
570
+        }
571
+    };
572
+};
533
 
573
 
534
 /**
574
 /**
535
  * Creates an event which indicates the Time To First Media (TTFM).
575
  * Creates an event which indicates the Time To First Media (TTFM).
546
  *      muted: whether the track has ever been muted (?)
586
  *      muted: whether the track has ever been muted (?)
547
  *      value: the TTMF in milliseconds.
587
  *      value: the TTMF in milliseconds.
548
  */
588
  */
549
-export const createTtfmEvent = ( attributes: object ) => createConnectionStageReachedEvent( 'ttfm', attributes );
589
+export const createTtfmEvent = (attributes: object) => createConnectionStageReachedEvent('ttfm', attributes);

+ 2
- 1
service/statistics/Events.ts 파일 보기

1
 export enum Events {
1
 export enum Events {
2
+
2
     /**
3
     /**
3
      * Notifies about audio level in RTP statistics by SSRC.
4
      * Notifies about audio level in RTP statistics by SSRC.
4
      *
5
      *
40
      * An event carrying performance stats.
41
      * An event carrying performance stats.
41
      */
42
      */
42
     LONG_TASKS_STATS = 'statistics.long_tasks_stats'
43
     LONG_TASKS_STATS = 'statistics.long_tasks_stats'
43
-};
44
+}
44
 
45
 
45
 // exported for backward compatibility
46
 // exported for backward compatibility
46
 export const AUDIO_LEVEL = Events.AUDIO_LEVEL;
47
 export const AUDIO_LEVEL = Events.AUDIO_LEVEL;

+ 1
- 1
service/statistics/constants.ts 파일 보기

1
-export const LOCAL_JID = 'local'
1
+export const LOCAL_JID = 'local';

+ 144
- 127
service/xmpp/XMPPEvents.ts 파일 보기

1
 export enum XMPPEvents {
1
 export enum XMPPEvents {
2
+
2
     /**
3
     /**
3
      * Indicates error while adding ice candidate.
4
      * Indicates error while adding ice candidate.
4
      */
5
      */
8
     // audio.
9
     // audio.
9
     AUDIO_MUTED_BY_FOCUS = 'xmpp.audio_muted_by_focus',
10
     AUDIO_MUTED_BY_FOCUS = 'xmpp.audio_muted_by_focus',
10
 
11
 
11
-    // Designates an event indicating that the focus has asked us to disable our
12
-    // camera.
13
-    VIDEO_MUTED_BY_FOCUS = 'xmpp.video_muted_by_focus',
14
     AUTHENTICATION_REQUIRED = 'xmpp.authentication_required',
12
     AUTHENTICATION_REQUIRED = 'xmpp.authentication_required',
13
+
14
+    /**
15
+     * Event fired when we receive a message for AV moderation approved for the local participant.
16
+     */
17
+    AV_MODERATION_APPROVED = 'xmpp.av_moderation.approved',
18
+
19
+    /**
20
+     * Event fired when the moderation enable/disable changes.
21
+     */
22
+    AV_MODERATION_CHANGED = 'xmpp.av_moderation.changed',
23
+
24
+    /**
25
+     * Event fired when we receive message that a new jid was approved.
26
+     */
27
+    AV_MODERATION_PARTICIPANT_APPROVED = 'xmpp.av_moderation.participant.approved',
28
+
29
+    /**
30
+     * Event fired when we receive message that a new jid was approved.
31
+     */
32
+    AV_MODERATION_PARTICIPANT_REJECTED = 'xmpp.av_moderation.participant.rejected',
33
+
34
+    /**
35
+     * Event fired when we receive a message for AV moderation.
36
+     */
37
+    AV_MODERATION_RECEIVED = 'xmpp.av_moderation.received',
38
+
39
+    /**
40
+    * Event fired when we receive a message for AV moderation rejected for the local participant.
41
+    */
42
+    AV_MODERATION_REJECTED = 'xmpp.av_moderation.rejected',
43
+
44
+    /**
45
+     * Event fired when we receive a message for breakout rooms.
46
+     */
47
+    BREAKOUT_ROOMS_EVENT = 'xmpp.breakout-rooms.event',
48
+
49
+    /**
50
+     * Event fired when a participant is requested to join a given (breakout) room.
51
+     */
52
+    BREAKOUT_ROOMS_MOVE_TO_ROOM = 'xmpp.breakout-rooms.move-to-room',
53
+
54
+    /**
55
+     * Event fired when the breakout rooms data was updated.
56
+     */
57
+    BREAKOUT_ROOMS_UPDATED = 'xmpp.breakout-rooms.updated',
58
+
15
     BRIDGE_DOWN = 'xmpp.bridge_down',
59
     BRIDGE_DOWN = 'xmpp.bridge_down',
16
 
60
 
17
     /**
61
     /**
19
      */
63
      */
20
     CALL_ACCEPTED = 'xmpp.callaccepted.jingle',
64
     CALL_ACCEPTED = 'xmpp.callaccepted.jingle',
21
 
65
 
22
-    // Designates an event indicating that an offer (e.g. Jingle
23
-    // session-initiate) was received.
24
-    CALL_INCOMING = 'xmpp.callincoming.jingle',
25
-
26
     // Triggered when Jicofo kills our media session, this can happen while
66
     // Triggered when Jicofo kills our media session, this can happen while
27
     // we're still in the MUC, when it decides to terminate the media session.
67
     // we're still in the MUC, when it decides to terminate the media session.
28
     // For example when the session is idle for too long, because we're the only
68
     // For example when the session is idle for too long, because we're the only
29
     // person in the conference room.
69
     // person in the conference room.
30
     CALL_ENDED = 'xmpp.callended.jingle',
70
     CALL_ENDED = 'xmpp.callended.jingle',
71
+
72
+    // Designates an event indicating that an offer (e.g. Jingle
73
+    // session-initiate) was received.
74
+    CALL_INCOMING = 'xmpp.callincoming.jingle',
75
+
31
     CHAT_ERROR_RECEIVED = 'xmpp.chat_error_received',
76
     CHAT_ERROR_RECEIVED = 'xmpp.chat_error_received',
32
-    SETTINGS_ERROR_RECEIVED = 'xmpp.settings_error_received',
33
 
77
 
34
     // The conference properties (as advertised by jicofo) have changed
78
     // The conference properties (as advertised by jicofo) have changed
35
     CONFERENCE_PROPERTIES_CHANGED = 'xmpp.conference_properties_changed',
79
     CONFERENCE_PROPERTIES_CHANGED = 'xmpp.conference_properties_changed',
36
 
80
 
81
+    /**
82
+     * Event fired when conference creation timestamp is received.
83
+     */
84
+    CONFERENCE_TIMESTAMP_RECEIVED = 'xmpp.conference_timestamp_received',
85
+
37
     /**
86
     /**
38
      * This event is triggered when the ICE connects for the first time.
87
      * This event is triggered when the ICE connects for the first time.
39
      */
88
      */
43
     // failed.
92
     // failed.
44
     CONNECTION_FAILED = 'xmpp.connection.failed',
93
     CONNECTION_FAILED = 'xmpp.connection.failed',
45
 
94
 
46
-    // Designates an event indicating that the media (ICE) connection was
47
-    // interrupted. This should go to the RTC module.
48
-    CONNECTION_INTERRUPTED = 'xmpp.connection.interrupted',
49
-
50
-    // Designates an event indicating that the media (ICE) connection was
51
-    // restored. This should go to the RTC module.
52
-    CONNECTION_RESTORED = 'xmpp.connection.restored',
53
-
54
     // Designates an event indicating that the media (ICE) connection failed.
95
     // Designates an event indicating that the media (ICE) connection failed.
55
     // This should go to the RTC module.
96
     // This should go to the RTC module.
56
     CONNECTION_ICE_FAILED = 'xmpp.connection.ice.failed',
97
     CONNECTION_ICE_FAILED = 'xmpp.connection.ice.failed',
57
 
98
 
99
+    // Designates an event indicating that the media (ICE) connection was
100
+    // interrupted. This should go to the RTC module.
101
+    CONNECTION_INTERRUPTED = 'xmpp.connection.interrupted',
102
+
58
     // Designates an event indicating that the call has been migrated to a different
103
     // Designates an event indicating that the call has been migrated to a different
59
     // bridge and that the client needs to be restarted for a successful transition.
104
     // bridge and that the client needs to be restarted for a successful transition.
60
     CONNECTION_RESTARTED = 'xmpp.connection.restart',
105
     CONNECTION_RESTARTED = 'xmpp.connection.restart',
61
 
106
 
107
+    // Designates an event indicating that the media (ICE) connection was
108
+    // restored. This should go to the RTC module.
109
+    CONNECTION_RESTORED = 'xmpp.connection.restored',
110
+
62
     /**
111
     /**
63
      * Designates an event indicating connection status changes.
112
      * Designates an event indicating connection status changes.
64
      */
113
      */
82
      * Chat room instance have been removed from Strophe.emuc plugin.
131
      * Chat room instance have been removed from Strophe.emuc plugin.
83
      */
132
      */
84
     EMUC_ROOM_REMOVED = 'xmpp.emuc_room_removed',
133
     EMUC_ROOM_REMOVED = 'xmpp.emuc_room_removed',
134
+
85
     ETHERPAD = 'xmpp.etherpad',
135
     ETHERPAD = 'xmpp.etherpad',
136
+
86
     FOCUS_DISCONNECTED = 'xmpp.focus_disconnected',
137
     FOCUS_DISCONNECTED = 'xmpp.focus_disconnected',
138
+
87
     FOCUS_LEFT = 'xmpp.focus_left',
139
     FOCUS_LEFT = 'xmpp.focus_left',
140
+
88
     GRACEFUL_SHUTDOWN = 'xmpp.graceful_shutdown',
141
     GRACEFUL_SHUTDOWN = 'xmpp.graceful_shutdown',
89
 
142
 
143
+    // Designates an event indicating that the local ICE connection state has
144
+    // changed.
145
+    ICE_CONNECTION_STATE_CHANGED = 'xmpp.ice_connection_state_changed',
146
+
147
+    // Designates an event indicating that an invite XMPP message in the MUC was
148
+    // received.
149
+    INVITE_MESSAGE_RECEIVED = 'xmpp.invite_message_received',
150
+
151
+    /**
152
+     * Event which is emitted when the body in an XMPP message in the MUC
153
+     * contains JSON
154
+     * TODO: this event contains a typo (xmmp vs xmpp) but it's unlikely this can be changed now
155
+     */
156
+    JSON_MESSAGE_RECEIVED = 'xmmp.json_message_received',
157
+
90
     /**
158
     /**
91
      * Designates an event indicating that we were kicked from the XMPP MUC.
159
      * Designates an event indicating that we were kicked from the XMPP MUC.
92
      * @param {boolean} isSelfPresence - whether it is for local participant
160
      * @param {boolean} isSelfPresence - whether it is for local participant
110
     // received.
178
     // received.
111
     MESSAGE_RECEIVED = 'xmpp.message_received',
179
     MESSAGE_RECEIVED = 'xmpp.message_received',
112
 
180
 
113
-    // Designates an event indicating that a reaction XMPP message in the MUC
114
-    // was received.
115
-    REACTION_RECEIVED = "xmpp.reaction_received",
116
-
117
-    // Designates an event indicating that an invite XMPP message in the MUC was
118
-    // received.
119
-    INVITE_MESSAGE_RECEIVED = 'xmpp.invite_message_received',
120
-
121
-    // Designates an event indicating that a private XMPP message in the MUC was
122
-    // received.
123
-    PRIVATE_MESSAGE_RECEIVED = 'xmpp.private_message_received',
124
-
125
-    // Designates an event indicating that a bot participant type had changed
126
-    MUC_MEMBER_BOT_TYPE_CHANGED = 'xmpp.muc_member_bot_type_changed',
181
+    // Designates an event indicating that a participant was denied access to a conference from the lobby XMPP MUC.
182
+    MUC_DENIED_ACCESS = 'xmpp.muc_denied access',
127
 
183
 
128
     // Designates an event indicating that the XMPP MUC was destroyed.
184
     // Designates an event indicating that the XMPP MUC was destroyed.
129
     MUC_DESTROYED = 'xmpp.muc_destroyed',
185
     MUC_DESTROYED = 'xmpp.muc_destroyed',
130
 
186
 
131
-    // Designates an event indicating that we are currently in process of joining the XMPP MUC.
132
-    MUC_JOIN_IN_PROGRESS = 'xmpp.muc_join_in_progress',
133
-
134
     // Designates an event indicating that we have joined the XMPP MUC.
187
     // Designates an event indicating that we have joined the XMPP MUC.
135
     MUC_JOINED = 'xmpp.muc_joined',
188
     MUC_JOINED = 'xmpp.muc_joined',
136
 
189
 
137
-    // Designates an event indicating that a participant joined the XMPP MUC.
138
-    MUC_MEMBER_JOINED = 'xmpp.muc_member_joined',
190
+    // Designates an event indicating that we are currently in process of joining the XMPP MUC.
191
+    MUC_JOIN_IN_PROGRESS = 'xmpp.muc_join_in_progress',
139
 
192
 
140
-    // Designates an event indicating that a participant left the XMPP MUC.
141
-    MUC_MEMBER_LEFT = 'xmpp.muc_member_left',
193
+    // Designates an event indicating that local participant left the muc
194
+    MUC_LEFT = 'xmpp.muc_left',
142
 
195
 
143
     // Designates an event indicating that a participant joined the lobby XMPP MUC.
196
     // Designates an event indicating that a participant joined the lobby XMPP MUC.
144
     MUC_LOBBY_MEMBER_JOINED = 'xmpp.muc_lobby_member_joined',
197
     MUC_LOBBY_MEMBER_JOINED = 'xmpp.muc_lobby_member_joined',
145
 
198
 
146
-    // Designates an event indicating that a participant in the lobby XMPP MUC has been updated
147
-    MUC_LOBBY_MEMBER_UPDATED = 'xmpp.muc_lobby_member_updated',
148
-
149
     // Designates an event indicating that a participant left the XMPP MUC.
199
     // Designates an event indicating that a participant left the XMPP MUC.
150
     MUC_LOBBY_MEMBER_LEFT = 'xmpp.muc_lobby_member_left',
200
     MUC_LOBBY_MEMBER_LEFT = 'xmpp.muc_lobby_member_left',
151
 
201
 
152
-    // Designates an event indicating that a participant was denied access to a conference from the lobby XMPP MUC.
153
-    MUC_DENIED_ACCESS = 'xmpp.muc_denied access',
154
-
155
-    // Designates an event indicating that local participant left the muc
156
-    MUC_LEFT = 'xmpp.muc_left',
157
-
158
-    // Designates an event indicating that the MUC role of a participant has
159
-    // changed.
160
-    MUC_ROLE_CHANGED = 'xmpp.muc_role_changed',
202
+    // Designates an event indicating that a participant in the lobby XMPP MUC has been updated
203
+    MUC_LOBBY_MEMBER_UPDATED = 'xmpp.muc_lobby_member_updated',
161
 
204
 
162
     // Designates an event indicating that the MUC has been locked or unlocked.
205
     // Designates an event indicating that the MUC has been locked or unlocked.
163
     MUC_LOCK_CHANGED = 'xmpp.muc_lock_changed',
206
     MUC_LOCK_CHANGED = 'xmpp.muc_lock_changed',
165
     // Designates an event indicating that the MUC members only config has changed.
208
     // Designates an event indicating that the MUC members only config has changed.
166
     MUC_MEMBERS_ONLY_CHANGED = 'xmpp.muc_members_only_changed',
209
     MUC_MEMBERS_ONLY_CHANGED = 'xmpp.muc_members_only_changed',
167
 
210
 
211
+    // Designates an event indicating that a bot participant type had changed
212
+    MUC_MEMBER_BOT_TYPE_CHANGED = 'xmpp.muc_member_bot_type_changed',
213
+
214
+    // Designates an event indicating that a participant joined the XMPP MUC.
215
+    MUC_MEMBER_JOINED = 'xmpp.muc_member_joined',
216
+
217
+    // Designates an event indicating that a participant left the XMPP MUC.
218
+    MUC_MEMBER_LEFT = 'xmpp.muc_member_left',
219
+
220
+    // Designates an event indicating that the MUC role of a participant has
221
+    // changed.
222
+    MUC_ROLE_CHANGED = 'xmpp.muc_role_changed',
223
+
168
     // Designates an event indicating that the MUC visitors support has changed.
224
     // Designates an event indicating that the MUC visitors support has changed.
169
     MUC_VISITORS_SUPPORTED_CHANGED = 'xmpp.muc_visitors_supported_changed',
225
     MUC_VISITORS_SUPPORTED_CHANGED = 'xmpp.muc_visitors_supported_changed',
170
 
226
 
172
     // advertised that they have audio muted (or unmuted).
228
     // advertised that they have audio muted (or unmuted).
173
     PARTICIPANT_AUDIO_MUTED = 'xmpp.audio_muted',
229
     PARTICIPANT_AUDIO_MUTED = 'xmpp.audio_muted',
174
 
230
 
231
+    /**
232
+     * Indicates that the features of the participant has been changed.
233
+     */
234
+    PARTICIPANT_FEATURES_CHANGED = 'xmpp.participant_features_changed',
235
+
175
     // Designates an event indicating that a participant in the XMPP MUC has
236
     // Designates an event indicating that a participant in the XMPP MUC has
176
     // advertised that they have video muted (or unmuted).
237
     // advertised that they have video muted (or unmuted).
177
     PARTICIPANT_VIDEO_MUTED = 'xmpp.video_muted',
238
     PARTICIPANT_VIDEO_MUTED = 'xmpp.video_muted',
182
     // someone (regardless of whether or not the "video type" changed).
243
     // someone (regardless of whether or not the "video type" changed).
183
     PARTICIPANT_VIDEO_TYPE_CHANGED = 'xmpp.video_type',
244
     PARTICIPANT_VIDEO_TYPE_CHANGED = 'xmpp.video_type',
184
 
245
 
185
-    /**
186
-     * Indicates that the features of the participant has been changed.
187
-     */
188
-    PARTICIPANT_FEATURES_CHANGED = 'xmpp.participant_features_changed',
189
     PASSWORD_REQUIRED = 'xmpp.password_required',
246
     PASSWORD_REQUIRED = 'xmpp.password_required',
190
 
247
 
191
     /**
248
     /**
194
     PHONE_NUMBER_CHANGED = 'conference.phoneNumberChanged',
251
     PHONE_NUMBER_CHANGED = 'conference.phoneNumberChanged',
195
     PRESENCE_RECEIVED = 'xmpp.presence_received',
252
     PRESENCE_RECEIVED = 'xmpp.presence_received',
196
     PRESENCE_STATUS = 'xmpp.presence_status',
253
     PRESENCE_STATUS = 'xmpp.presence_status',
254
+
255
+    // Designates an event indicating that a private XMPP message in the MUC was
256
+    // received.
257
+    PRIVATE_MESSAGE_RECEIVED = 'xmpp.private_message_received',
197
     PROMPT_FOR_LOGIN = 'xmpp.prompt_for_login',
258
     PROMPT_FOR_LOGIN = 'xmpp.prompt_for_login',
198
 
259
 
260
+    // Designates an event indicating that a reaction XMPP message in the MUC
261
+    // was received.
262
+    REACTION_RECEIVED = 'xmpp.reaction_received',
263
+
199
     // xmpp is connected and obtained user media
264
     // xmpp is connected and obtained user media
200
     READY_TO_JOIN = 'xmpp.ready_to_join',
265
     READY_TO_JOIN = 'xmpp.ready_to_join',
201
 
266
 
212
      * Indicates that the offer / answer renegotiation has failed.
277
      * Indicates that the offer / answer renegotiation has failed.
213
      */
278
      */
214
     RENEGOTIATION_FAILED = 'xmpp.renegotiation_failed',
279
     RENEGOTIATION_FAILED = 'xmpp.renegotiation_failed',
280
+
215
     RESERVATION_ERROR = 'xmpp.room_reservation_error',
281
     RESERVATION_ERROR = 'xmpp.room_reservation_error',
282
+
216
     ROOM_CONNECT_ERROR = 'xmpp.room_connect_error',
283
     ROOM_CONNECT_ERROR = 'xmpp.room_connect_error',
217
-    ROOM_CONNECT_NOT_ALLOWED_ERROR = 'xmpp.room_connect_error.not_allowed',
218
-    ROOM_JOIN_ERROR = 'xmpp.room_join_error',
284
+
219
     ROOM_CONNECT_MEMBERS_ONLY_ERROR = 'xmpp.room_connect_error.members_only',
285
     ROOM_CONNECT_MEMBERS_ONLY_ERROR = 'xmpp.room_connect_error.members_only',
220
 
286
 
287
+    ROOM_CONNECT_NOT_ALLOWED_ERROR = 'xmpp.room_connect_error.not_allowed',
288
+
289
+    ROOM_DISCO_INFO_FAILED = 'xmpp.room_disco_info_failed',
290
+
221
     /**
291
     /**
222
      * Indicates that we have received a reply to our disco-info request for the room.
292
      * Indicates that we have received a reply to our disco-info request for the room.
223
      */
293
      */
224
     ROOM_DISCO_INFO_UPDATED = 'xmpp.room_disco_info_updated',
294
     ROOM_DISCO_INFO_UPDATED = 'xmpp.room_disco_info_updated',
225
-    ROOM_DISCO_INFO_FAILED = 'xmpp.room_disco_info_failed',
295
+
296
+    ROOM_JOIN_ERROR = 'xmpp.room_join_error',
226
 
297
 
227
     /**
298
     /**
228
      * Indicates that max users limit has been reached.
299
      * Indicates that max users limit has been reached.
229
      */
300
      */
230
     ROOM_MAX_USERS_ERROR = 'xmpp.room_max_users_error',
301
     ROOM_MAX_USERS_ERROR = 'xmpp.room_max_users_error',
231
 
302
 
303
+    /**
304
+     * Event fired when we receive a message related to room metadata.
305
+     */
306
+    ROOM_METADATA_EVENT = 'xmpp.room-metadata.event',
307
+
308
+    /**
309
+     * Event fired when we receive a message related to room metadata.
310
+     */
311
+    ROOM_METADATA_UPDATED = 'xmpp.room-metadata.updated',
312
+
232
     // Designates an event indicating that we sent an XMPP message to the MUC.
313
     // Designates an event indicating that we sent an XMPP message to the MUC.
233
     SENDING_CHAT_MESSAGE = 'xmpp.sending_chat_message',
314
     SENDING_CHAT_MESSAGE = 'xmpp.sending_chat_message',
234
 
315
 
258
      */
339
      */
259
     SESSION_ACCEPT_TIMEOUT = 'xmpp.session_accept_timeout',
340
     SESSION_ACCEPT_TIMEOUT = 'xmpp.session_accept_timeout',
260
 
341
 
342
+    SETTINGS_ERROR_RECEIVED = 'xmpp.settings_error_received',
343
+
261
     /**
344
     /**
262
      * Event fired when participant joins a meeting without audio.
345
      * Event fired when participant joins a meeting without audio.
263
      */
346
      */
288
      */
371
      */
289
     SPEAKER_STATS_RECEIVED = 'xmpp.speaker_stats_received',
372
     SPEAKER_STATS_RECEIVED = 'xmpp.speaker_stats_received',
290
 
373
 
291
-    /**
292
-     * Event fired when conference creation timestamp is received.
293
-     */
294
-    CONFERENCE_TIMESTAMP_RECEIVED = 'xmpp.conference_timestamp_received',
295
-
296
-    /**
297
-     * Event fired when we receive a message for AV moderation approved for the local participant.
298
-     */
299
-    AV_MODERATION_APPROVED = 'xmpp.av_moderation.approved',
300
-
301
-    /**
302
-    * Event fired when we receive a message for AV moderation rejected for the local participant.
303
-    */
304
-    AV_MODERATION_REJECTED = 'xmpp.av_moderation.rejected',
305
-
306
-    /**
307
-     * Event fired when we receive a message for AV moderation.
308
-     */
309
-    AV_MODERATION_RECEIVED = 'xmpp.av_moderation.received',
310
-
311
-    /**
312
-     * Event fired when the moderation enable/disable changes.
313
-     */
314
-    AV_MODERATION_CHANGED = 'xmpp.av_moderation.changed',
315
-
316
-    /**
317
-     * Event fired when we receive message that a new jid was approved.
318
-     */
319
-    AV_MODERATION_PARTICIPANT_APPROVED = 'xmpp.av_moderation.participant.approved',
320
-
321
-    /**
322
-     * Event fired when we receive message that a new jid was approved.
323
-     */
324
-    AV_MODERATION_PARTICIPANT_REJECTED = 'xmpp.av_moderation.participant.rejected',
325
-
326
-    /**
327
-     * Event fired when a participant is requested to join a given (breakout) room.
328
-     */
329
-    BREAKOUT_ROOMS_MOVE_TO_ROOM = 'xmpp.breakout-rooms.move-to-room',
330
-
331
-    /**
332
-     * Event fired when we receive a message for breakout rooms.
333
-     */
334
-    BREAKOUT_ROOMS_EVENT = 'xmpp.breakout-rooms.event',
335
-
336
-    /**
337
-     * Event fired when the breakout rooms data was updated.
338
-     */
339
-    BREAKOUT_ROOMS_UPDATED = 'xmpp.breakout-rooms.updated',
340
-
341
-    /**
342
-     * Event fired when we receive a message related to room metadata.
343
-     */
344
-    ROOM_METADATA_EVENT = 'xmpp.room-metadata.event',
345
-
346
-    /**
347
-     * Event fired when we receive a message related to room metadata.
348
-     */
349
-    ROOM_METADATA_UPDATED = 'xmpp.room-metadata.updated',
350
-
351
     // Designates an event indicating that we should join the conference with
374
     // Designates an event indicating that we should join the conference with
352
     // audio and/or video muted.
375
     // audio and/or video muted.
353
     START_MUTED_FROM_FOCUS = 'xmpp.start_muted_from_focus',
376
     START_MUTED_FROM_FOCUS = 'xmpp.start_muted_from_focus',
373
      */
396
      */
374
     TRANSPORT_INFO = 'xmpp.transportinfo.jingle',
397
     TRANSPORT_INFO = 'xmpp.transportinfo.jingle',
375
 
398
 
399
+    // Designates an event indicating that the focus has asked us to disable our
400
+    // camera.
401
+    VIDEO_MUTED_BY_FOCUS = 'xmpp.video_muted_by_focus',
402
+
376
     /**
403
     /**
377
      * Indicates that video SIP GW state changed.
404
      * Indicates that video SIP GW state changed.
378
      *
405
      *
401
      */
428
      */
402
     VISITORS_REJECTION = 'xmpp.visitors_rejection',
429
     VISITORS_REJECTION = 'xmpp.visitors_rejection',
403
 
430
 
404
-    // Designates an event indicating that the local ICE connection state has
405
-    // changed.
406
-    ICE_CONNECTION_STATE_CHANGED = 'xmpp.ice_connection_state_changed',
407
-
408
-    /**
409
-     * Event which is emitted when the body in an XMPP message in the MUC
410
-     * contains JSON
411
-     * TODO: this event contains a typo (xmmp vs xmpp) but it's unlikely this can be changed now
412
-     */
413
-    JSON_MESSAGE_RECEIVED = 'xmmp.json_message_received'
414
-};
431
+}

+ 7
- 6
service/xmpp/XMPPExtensioProtocols.ts 파일 보기

1
 
1
 
2
 export enum XEP {
2
 export enum XEP {
3
+
3
     /**
4
     /**
4
      * XEP-0338 - Signals the usage of bundled media, i.e., allows the use of a single set of ICE candidates for
5
      * XEP-0338 - Signals the usage of bundled media, i.e., allows the use of a single set of ICE candidates for
5
      * multiple media descriptions.
6
      * multiple media descriptions.
42
      */
43
      */
43
     RTP_FEEDBACK = 'urn:xmpp:jingle:apps:rtp:rtcp-fb:0',
44
     RTP_FEEDBACK = 'urn:xmpp:jingle:apps:rtp:rtcp-fb:0',
44
 
45
 
45
-    /**
46
-     * XEP-0167 - Signals support for RTP video.
47
-     * https://xmpp.org/extensions/xep-0167.html#support
48
-     */
49
-    RTP_VIDEO = 'urn:xmpp:jingle:apps:rtp:video',
50
-
51
     /**
46
     /**
52
      * XEP-0294 - Signals the use of RTP Header Extensions.
47
      * XEP-0294 - Signals the use of RTP Header Extensions.
53
      * https://xmpp.org/extensions/xep-0294.html
48
      * https://xmpp.org/extensions/xep-0294.html
60
      */
55
      */
61
     RTP_MEDIA = 'urn:xmpp:jingle:apps:rtp:1',
56
     RTP_MEDIA = 'urn:xmpp:jingle:apps:rtp:1',
62
 
57
 
58
+    /**
59
+     * XEP-0167 - Signals support for RTP video.
60
+     * https://xmpp.org/extensions/xep-0167.html#support
61
+     */
62
+    RTP_VIDEO = 'urn:xmpp:jingle:apps:rtp:video',
63
+
63
     /**
64
     /**
64
      * XEP-0343 - Signaling WebRTC datachannels (bridge channel) in Jingle that uses DTLS/SCTP on top of ICE.
65
      * XEP-0343 - Signaling WebRTC datachannels (bridge channel) in Jingle that uses DTLS/SCTP on top of ICE.
65
      * https://xmpp.org/extensions/xep-0343.html
66
      * https://xmpp.org/extensions/xep-0343.html

+ 3
- 5
webpack.config.js 파일 보기

10
         = sharedConfig(mode === 'production' /* minimize */, Boolean(process.env.ANALYZE_BUNDLE) /* analyzeBundle */);
10
         = sharedConfig(mode === 'production' /* minimize */, Boolean(process.env.ANALYZE_BUNDLE) /* analyzeBundle */);
11
 
11
 
12
     return [
12
     return [
13
-        Object.assign({}, config, {
13
+        { ...config,
14
             entry: {
14
             entry: {
15
                 'lib-jitsi-meet': './index.js'
15
                 'lib-jitsi-meet': './index.js'
16
             },
16
             },
17
-            output: Object.assign({}, config.output, {
17
+            output: { ...config.output,
18
                 library: 'JitsiMeetJS',
18
                 library: 'JitsiMeetJS',
19
                 libraryTarget: 'umd',
19
                 libraryTarget: 'umd',
20
-                path: path.join(process.cwd(), 'dist', 'umd')
21
-            })
22
-        }),
20
+                path: path.join(process.cwd(), 'dist', 'umd') } },
23
         {
21
         {
24
             entry: {
22
             entry: {
25
                 worker: './modules/e2ee/Worker.js'
23
                 worker: './modules/e2ee/Worker.js'

Loading…
취소
저장