@vkontakte/calls-sdk 2.5.2-dev.dd3b9a2.0 → 2.5.3-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CallsSDK.d.ts +11 -11
  2. package/abstract/BaseApi.d.ts +2 -2
  3. package/abstract/BaseSignaling.d.ts +7 -7
  4. package/calls-sdk.cjs.js +9 -9
  5. package/calls-sdk.esm.js +9 -9
  6. package/classes/Conversation.d.ts +16 -12
  7. package/classes/DebugInfo.d.ts +2 -2
  8. package/classes/MediaSource.d.ts +4 -2
  9. package/classes/SpeakerDetector.d.ts +2 -2
  10. package/classes/SpecListener.d.ts +3 -3
  11. package/classes/TabsChannel.d.ts +11 -0
  12. package/classes/screenshare/BaseStreamBuilder.d.ts +3 -3
  13. package/classes/screenshare/ScreenCaptureReceiver.d.ts +2 -2
  14. package/classes/screenshare/StreamBuilder.d.ts +2 -2
  15. package/classes/screenshare/WebmBuilder.d.ts +2 -2
  16. package/classes/transport/DirectTransport.d.ts +2 -2
  17. package/classes/transport/ServerTransport.d.ts +4 -3
  18. package/classes/transport/Statistics.d.ts +2 -2
  19. package/classes/transport/Transport.d.ts +5 -5
  20. package/default/Api.d.ts +3 -3
  21. package/default/Signaling.d.ts +7 -7
  22. package/enums/HangupType.d.ts +1 -0
  23. package/package.json +3 -3
  24. package/static/External.d.ts +18 -18
  25. package/static/Params.d.ts +41 -27
  26. package/static/Utils.d.ts +12 -4
  27. package/static/WebRTCUtils.d.ts +2 -2
  28. package/types/ConversationParams.d.ts +1 -0
  29. package/types/ConversationResponse.d.ts +4 -0
  30. package/types/ExternalId.d.ts +24 -2
  31. package/types/MuteStates.d.ts +1 -1
  32. package/types/Participant.d.ts +12 -3
  33. package/types/ParticipantLayout.d.ts +2 -6
  34. package/types/ParticipantPriority.d.ts +3 -3
  35. package/types/ParticipantStreamDescription.d.ts +2 -2
  36. package/types/SignalingMessage.d.ts +33 -17
@@ -7,7 +7,7 @@ import ConversationOption from '../enums/ConversationOption';
7
7
  import FatalError from '../enums/FatalError';
8
8
  import MediaOption from '../enums/MediaOption';
9
9
  import UserRole from '../enums/UserRole';
10
- import { ExternalId, ExternalParticipant } from '../types/ExternalId';
10
+ import { ExternalId, ExternalParticipant, ExternalParticipantId } from '../types/ExternalId';
11
11
  import IceServer from '../types/IceServer';
12
12
  import MediaModifiers from '../types/MediaModifiers';
13
13
  import MediaSettings from '../types/MediaSettings';
@@ -28,7 +28,7 @@ export declare type ParamsObject = {
28
28
  * API ключ приложения
29
29
  */
30
30
  apiKey: string;
31
- apiEnv?: 'AUTO' | 'PROD' | 'TEST' | 'VIDEOTEST' | string;
31
+ apiEnv?: 'AUTO' | 'PROD' | 'PROD_OK' | 'TEST' | 'VIDEOTEST' | string;
32
32
  apiAuth?: typeof AuthData;
33
33
  /**
34
34
  * Токен авторизации
@@ -51,6 +51,7 @@ export declare type ParamsObject = {
51
51
  waitConnectionDelay: number;
52
52
  waitResponseDelay: number;
53
53
  waitMessageDelay: number;
54
+ waitAnotherTabDelay: number;
54
55
  debugLog: boolean;
55
56
  /**
56
57
  * Не использовать прямое P2P соединение, чтобы не отправлять в ICE-кандидатах персональные IP-адреса
@@ -168,14 +169,14 @@ export declare type ParamsObject = {
168
169
  /**
169
170
  * Отдавать приоритет кодеку H264 для исходящего видео
170
171
  *
171
- * _По умолчанию: `true`_
172
+ * _По умолчанию: `false`_
172
173
  */
173
174
  preferH264: boolean;
174
175
  /**
175
176
  * Отдавать приоритет кодеку VP9 для исходящего видео,
176
177
  * если preferH264 тоже выставлен в true то первый приоритет будет у VP9, второй у H264
177
178
  *
178
- * _По умолчанию: `false`_
179
+ * _По умолчанию: `true`_
179
180
  */
180
181
  preferVP9: boolean;
181
182
  audioNack: boolean;
@@ -183,14 +184,14 @@ export declare type ParamsObject = {
183
184
  * Принимать параллельно видео с камеры и трансляцию экрана от одного и того же участника.
184
185
  * Работает только при приёме экрана через дата-канал.
185
186
  *
186
- * _По умолчанию: `false`_
187
+ * _По умолчанию: `true`_
187
188
  */
188
189
  producerScreenTrack: boolean;
189
190
  /**
190
191
  * Отдавать трансляцию экрана отдельным стримом.
191
192
  * Работает только при отправке экрана через дата-канал.
192
193
  *
193
- * _По умолчанию: `false`_
194
+ * _По умолчанию: `true`_
194
195
  */
195
196
  consumerScreenTrack: boolean;
196
197
  producerNotificationDataChannel: boolean;
@@ -218,10 +219,21 @@ export declare type ParamsObject = {
218
219
  breakVideoPayloadTypes: boolean;
219
220
  /**
220
221
  * Получать список участников звонка третьим аргументом в `onConversation`
221
- * @deprecated
222
+ * @hidden
222
223
  */
223
224
  batchParticipantsOnStart: boolean;
224
225
  participantStateMapped: boolean;
226
+ joinFromMultipleDevices: boolean;
227
+ /**
228
+ * Фильтровать наблюдателей во всех колбэках
229
+ * @hidden
230
+ */
231
+ filterObservers: boolean;
232
+ /**
233
+ * Отключить звук собеседников
234
+ * @hidden
235
+ */
236
+ muteMode: boolean;
225
237
  /**
226
238
  * Получен локальный стрим с камеры/микрофона
227
239
  */
@@ -242,40 +254,40 @@ export declare type ParamsObject = {
242
254
  * Получен стрим собеседника.
243
255
  * Если сервер закончил стримить собеседника, вместо стрима будет передан null
244
256
  */
245
- onRemoteStream?: (userId: ExternalId, stream: MediaStream | null) => void;
257
+ onRemoteStream?: (userId: ExternalParticipantId, stream: MediaStream | null) => void;
246
258
  /**
247
259
  * Получен стрим с экрана собеседника.
248
260
  * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
249
261
  */
250
- onRemoteScreenStream?: (userId: ExternalId, stream: MediaStream | null) => void;
262
+ onRemoteScreenStream?: (userId: ExternalParticipantId, stream: MediaStream | null) => void;
251
263
  /**
252
264
  * Получен стрим трансляция или мувик от собеседника.
253
265
  * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
254
266
  */
255
- onRemoteLive?: (userId: ExternalId, streamId: string, stream: MediaStream | null) => void;
267
+ onRemoteLive?: (userId: ExternalParticipantId, streamId: string, stream: MediaStream | null) => void;
256
268
  /**
257
269
  * Начат звонок
258
270
  */
259
- onConversation?: (userId: ExternalId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants?: ExternalParticipant[]) => void;
271
+ onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants?: ExternalParticipant[]) => void;
260
272
  /**
261
273
  * Изменились данные стрима собеседника
262
274
  */
263
- onRemoteMediaSettings?: (userId: ExternalId, mediaSettings: MediaSettings) => void;
275
+ onRemoteMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings) => void;
264
276
  /**
265
277
  * Изменились данные состояний собеседника
266
278
  */
267
- onRemoteParticipantState?: (userId: ExternalId, participantState: {
279
+ onRemoteParticipantState?: (userId: ExternalParticipantId, participantState: {
268
280
  [key: string]: string;
269
281
  }) => void;
270
282
  /**
271
283
  * Изменился статус соединения собеседников
272
284
  */
273
- onRemoteStatus?: (userIds: ExternalId[], status: ParticipantStatus, data: any) => void;
285
+ onRemoteStatus?: (userIds: ExternalParticipantId[], status: ParticipantStatus, data: any) => void;
274
286
  /**
275
287
  * Изменился статус соединения собеседника
276
288
  * @deprecated
277
289
  */
278
- onParticipantStatus?: (userId: ExternalId, status: ParticipantStatus, data: any) => void;
290
+ onParticipantStatus?: (userId: ExternalParticipantId, status: ParticipantStatus, data: any) => void;
279
291
  /**
280
292
  * Разрешения на доступы были запрошены в браузере
281
293
  */
@@ -287,7 +299,7 @@ export declare type ParamsObject = {
287
299
  /**
288
300
  * Пользователь отключился от звонка
289
301
  */
290
- onRemoteRemoved?: (userId: ExternalId) => void;
302
+ onRemoteRemoved?: (userId: ExternalParticipantId) => void;
291
303
  /**
292
304
  * Изменилось состояние звонка
293
305
  */
@@ -299,11 +311,11 @@ export declare type ParamsObject = {
299
311
  /**
300
312
  * Изменились состояния устройств пользователя или разрешения включать камеру/микрофон
301
313
  */
302
- onMuteStates?: (muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll: boolean, unmute: boolean, userId: ExternalId | null, adminId: ExternalId | null) => void;
314
+ onMuteStates?: (muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll: boolean, unmute: boolean, userId: ExternalParticipantId | null, adminId: ExternalParticipantId | null) => void;
303
315
  /**
304
316
  * Изменились роли собеседника в звонке
305
317
  */
306
- onRolesChanged?: (userId: ExternalId, roles: UserRole[]) => void;
318
+ onRolesChanged?: (userId: ExternalParticipantId, roles: UserRole[]) => void;
307
319
  /**
308
320
  * Изменились свои роли в звонке
309
321
  */
@@ -311,7 +323,7 @@ export declare type ParamsObject = {
311
323
  /**
312
324
  * Закрепляет/открепляет собеседника для всех
313
325
  */
314
- onPinnedParticipant?: (userId: ExternalId, unpin: boolean) => void;
326
+ onPinnedParticipant?: (userId: ExternalParticipantId, unpin: boolean) => void;
315
327
  /**
316
328
  * Закрепляет/открепляет текущего пользователя у других собеседников
317
329
  */
@@ -324,12 +336,12 @@ export declare type ParamsObject = {
324
336
  /**
325
337
  * Изменился говорящий в звонке
326
338
  */
327
- onSpeakerChanged?: (userId: ExternalId) => void;
339
+ onSpeakerChanged?: (userId: ExternalParticipantId) => void;
328
340
  /**
329
341
  * Громкость собеседников
330
342
  */
331
343
  onVolumesDetected?: (volumes: {
332
- uid: ExternalId;
344
+ uid: ExternalParticipantId;
333
345
  volume: number;
334
346
  }[]) => void;
335
347
  /**
@@ -361,15 +373,15 @@ export declare type ParamsObject = {
361
373
  /**
362
374
  * Получено сообщение чата
363
375
  */
364
- onChatMessage?: (message: string, from: ExternalId, direct: boolean) => void;
376
+ onChatMessage?: (message: string, from: ExternalParticipantId, direct: boolean) => void;
365
377
  /**
366
378
  * Получены данные от собеседника
367
379
  */
368
- onCustomData?: (data: JSONObject, from: ExternalId, direct: boolean) => void;
380
+ onCustomData?: (data: JSONObject, from: ExternalParticipantId, direct: boolean) => void;
369
381
  /**
370
382
  * Начата трансляция/запись звонка
371
383
  */
372
- onRecordStarted?: (initiator: ExternalId, movieId: number, startTime: number, type: 'STREAM' | 'RECORD', externalMovieId?: string, externalOwnerId?: string) => void;
384
+ onRecordStarted?: (initiator: ExternalParticipantId, movieId: number, startTime: number, type: 'STREAM' | 'RECORD', externalMovieId?: string, externalOwnerId?: string) => void;
373
385
  /**
374
386
  * Закончена трансляция/запись звонка
375
387
  */
@@ -386,7 +398,7 @@ export declare type ParamsObject = {
386
398
  * @param status Оценки качества соединения участников от 0 до 1
387
399
  */
388
400
  onNetworkStatusChanged?: (status: {
389
- uid: ExternalId;
401
+ uid: ExternalParticipantId;
390
402
  rating: number;
391
403
  }[]) => void;
392
404
  /**
@@ -420,13 +432,12 @@ export default abstract class Params {
420
432
  static get appVersion(): number;
421
433
  static get sdkVersion(): string | number | boolean;
422
434
  static get debug(): string | number | boolean;
423
- static get protocolVersion(): number;
435
+ static get protocolVersion(): 5 | 6;
424
436
  static get platform(): string;
425
437
  static set platform(value: string);
426
438
  static get clientType(): string;
427
439
  static set clientType(value: string);
428
440
  static get device(): string;
429
- static get apiAppId(): number;
430
441
  static get apiKey(): string;
431
442
  static get apiEnv(): string;
432
443
  static get apiEndpoint(): string;
@@ -447,6 +458,7 @@ export default abstract class Params {
447
458
  static get waitConnectionDelay(): number;
448
459
  static get waitResponseDelay(): number;
449
460
  static get waitMessageDelay(): number;
461
+ static get waitAnotherTabDelay(): number;
450
462
  static get debugLog(): boolean;
451
463
  static get forceRelayPolicy(): boolean;
452
464
  static set forceRelayPolicy(value: boolean);
@@ -498,4 +510,6 @@ export default abstract class Params {
498
510
  static get filteredMessages(): boolean;
499
511
  static get batchParticipantsOnStart(): boolean;
500
512
  static get participantStateMapped(): boolean;
513
+ static get filterObservers(): boolean;
514
+ static get muteMode(): boolean;
501
515
  }
package/static/Utils.d.ts CHANGED
@@ -1,21 +1,29 @@
1
1
  import { BigInteger } from 'big-integer';
2
2
  import UserType from '../enums/UserType';
3
3
  import { ExternalParticipant } from '../types/ExternalId';
4
- import { CompositeUserId, OkUserId, Participant, ParticipantStateMapped } from '../types/Participant';
4
+ import { CompositeUserId, OkUserId, Participant, ParticipantId, ParticipantStateMapped } from '../types/Participant';
5
5
  import SignalingMessage from '../types/SignalingMessage';
6
6
  import VideoSettings from '../types/VideoSettings';
7
+ export declare const PARAMETERS_SEPARATOR = ":";
8
+ export declare const DEVICE_IDX_PARAMETER = "d";
7
9
  declare namespace Utils {
8
10
  function patchSDP(sdp: string, preferH264: boolean, brokenH264: boolean, preferVP9: boolean, isAudioNack?: boolean): string;
9
11
  function getPeerIdString(peerId: SignalingMessage.PeerId): string;
10
12
  function comparePeerId(peerId1: SignalingMessage.PeerId, peerId2: SignalingMessage.PeerId): boolean;
11
13
  function getPeerConnectionHostInfo(pc: RTCPeerConnection): Promise<any>;
12
- function composeId(id: CompositeUserId | OkUserId, type: UserType): CompositeUserId;
13
- function composeParticipantId(participant: SignalingMessage.Participant): CompositeUserId;
14
- function composeMessageId(message: SignalingMessage): CompositeUserId;
14
+ function composeUserId(id: CompositeUserId | OkUserId, type: UserType): CompositeUserId;
15
+ function composeParticipantId(id: CompositeUserId | OkUserId, type: UserType, deviceIdx: number): ParticipantId;
16
+ function compose(compositeId: CompositeUserId, deviceIdx: number): ParticipantId;
17
+ function composeId(participant: SignalingMessage.Participant): ParticipantId;
18
+ function composeMessageId(message: SignalingMessage): ParticipantId;
15
19
  function decomposeId(compositeId: CompositeUserId | OkUserId): {
16
20
  id: OkUserId;
17
21
  type: UserType;
18
22
  };
23
+ function decomposeParticipantId(participantId: ParticipantId): {
24
+ compositeUserId: CompositeUserId;
25
+ deviceIdx: number;
26
+ };
19
27
  function uuid(): string;
20
28
  function throttle(func: Function, ms: number): (this: any) => void;
21
29
  function sdpFingerprint(sdp: string): BigInteger;
@@ -62,7 +62,7 @@ declare namespace WebRTCUtils {
62
62
  /**
63
63
  * Запрашивает камеру и микрофон пользователя
64
64
  */
65
- function getUserMedia(needVideo?: boolean, needAudio?: boolean): Promise<MediaStream>;
65
+ function getUserMedia(needVideo?: boolean, needAudio?: boolean, needEmptyTracks?: boolean): Promise<MediaStream>;
66
66
  /**
67
67
  * Запрашивает трансляцию экрана пользователя
68
68
  */
@@ -132,7 +132,7 @@ declare namespace WebRTCUtils {
132
132
  /**
133
133
  * Версия браузера
134
134
  */
135
- function browserVersion(): number;
135
+ function browserVersion(): string;
136
136
  /**
137
137
  * Если браузер основан на хроме - возвращает версию
138
138
  */
@@ -5,5 +5,6 @@ declare type ConversationParams = {
5
5
  turn_server?: IceServer;
6
6
  stun_server?: IceServer;
7
7
  client_type?: string;
8
+ device_idx?: number;
8
9
  };
9
10
  export default ConversationParams;
@@ -23,5 +23,9 @@ declare type ConversationResponse = {
23
23
  status: HangupType;
24
24
  }[];
25
25
  peerId?: number;
26
+ /**
27
+ * Порядковый номер, присвоенный устройству при входе в звонок
28
+ */
29
+ device_idx?: number;
26
30
  };
27
31
  export default ConversationResponse;
@@ -12,6 +12,7 @@ export declare enum ExternalIdType {
12
12
  ANONYM = "ANONYM",
13
13
  GROUP = "GROUP"
14
14
  }
15
+ export declare type ExternalUserId = string;
15
16
  export declare namespace ExternalIdUtils {
16
17
  function fromIds(ids: (string | ExternalId)[]): ExternalId[];
17
18
  function fromId(id: string, type?: ExternalIdType): ExternalId;
@@ -22,6 +23,13 @@ export declare namespace ExternalIdUtils {
22
23
  function compare(id1: ExternalId, id2: ExternalId): boolean;
23
24
  }
24
25
  export declare type ExternalIdString = string;
26
+ export declare namespace ExternalParticipantIdUtils {
27
+ function fromId(id: string, type?: ExternalIdType, deviceIdx?: number): ExternalParticipantId;
28
+ function toString(externalId: ExternalParticipantId): ExternalParticipantIdString;
29
+ function fromSignaling(signalingId: SignalingMessage.ExternalId, deviceIdx: number): ExternalParticipantId;
30
+ function getDeviceIdx(externalId: string | ExternalParticipantId | null): number;
31
+ }
32
+ export declare type ExternalParticipantIdString = string;
25
33
  /**
26
34
  * Идентификатор внешнего пользователя
27
35
  */
@@ -34,6 +42,20 @@ export interface ExternalId {
34
42
  * Тип пользователя
35
43
  */
36
44
  type: ExternalIdType;
45
+ /**
46
+ * Пользователь является наблюдателем звонка
47
+ * @hidden
48
+ */
49
+ observer?: boolean;
50
+ }
51
+ /**
52
+ * Идентификатор участника звонка
53
+ */
54
+ export interface ExternalParticipantId extends ExternalId {
55
+ /**
56
+ * Индекс устройства (позволяет отличать участников, которые присоединяются к звонку под одной учётной записью с разных устройств)
57
+ */
58
+ deviceIdx: number;
37
59
  }
38
60
  /**
39
61
  * Участник звонка
@@ -42,7 +64,7 @@ export interface ExternalParticipant {
42
64
  /**
43
65
  * Идентификатор пользователя
44
66
  */
45
- uid: ExternalId;
67
+ uid: ExternalParticipantId;
46
68
  /**
47
69
  * Данные стрима
48
70
  */
@@ -56,7 +78,7 @@ export interface ExternalParticipant {
56
78
  */
57
79
  participantState?: ParticipantStateMapped;
58
80
  /**
59
- * Состояние устройств пользователя
81
+ * Состояние устройств пользователя установленное админом звонка
60
82
  */
61
83
  muteStates: MuteStates;
62
84
  /**
@@ -1,7 +1,7 @@
1
1
  import MediaOption from '../enums/MediaOption';
2
2
  import MuteState from '../enums/MuteState';
3
3
  /**
4
- * Состояние устройств пользователя
4
+ * Состояние устройств пользователя установленное админом звонка
5
5
  */
6
6
  declare type MuteStates = {
7
7
  [key in MediaOption]?: MuteState;
@@ -3,10 +3,18 @@ import ParticipantState from '../enums/ParticipantState';
3
3
  import UserRole from '../enums/UserRole';
4
4
  import { ParticipantStatus } from '../static/External';
5
5
  import MediaSettings from '../types/MediaSettings';
6
- import { ExternalId } from './ExternalId';
6
+ import { ExternalParticipantId } from './ExternalId';
7
7
  import MuteStates from './MuteStates';
8
8
  import ParticipantLayout from './ParticipantLayout';
9
+ /**
10
+ * Уникально идентифицирует пользователя или группу
11
+ */
9
12
  export declare type CompositeUserId = string;
13
+ /**
14
+ * Уникально идентифицирует участника звонка
15
+ * (одному пользователю могут соответствовать несколько участников, в случае если пользователь зашёл в звонок с нескольких устройств)
16
+ */
17
+ export declare type ParticipantId = string;
10
18
  export declare type OkUserId = number;
11
19
  /**
12
20
  * Стейт участника звонка
@@ -18,8 +26,8 @@ export interface ParticipantStateMapped {
18
26
  };
19
27
  }
20
28
  export interface Participant {
21
- id: CompositeUserId;
22
- externalId: ExternalId;
29
+ id: ParticipantId;
30
+ externalId: ExternalParticipantId;
23
31
  mediaSettings: MediaSettings;
24
32
  state: ParticipantState;
25
33
  status: ParticipantStatus | null;
@@ -38,4 +46,5 @@ export interface Participant {
38
46
  };
39
47
  muteStates: MuteStates;
40
48
  unmuteOptions: MediaOption[];
49
+ observedIds: CompositeUserId[];
41
50
  }
@@ -1,4 +1,4 @@
1
- import { ExternalId } from './ExternalId';
1
+ import { ExternalParticipantId } from './ExternalId';
2
2
  import { MediaType } from './ParticipantStreamDescription';
3
3
  /**
4
4
  * Лейаут собеседника в звонке
@@ -21,10 +21,6 @@ export declare type Layout = {
21
21
  * Поддерживаемые значения: `cv` и `cn`, что соответствует CSS `cover` и `contain`
22
22
  */
23
23
  fit: string;
24
- /**
25
- * Запрос опорного кадра, нужно не злоупотреблять, негативно влияет на качество видео
26
- */
27
- keyFrame: boolean;
28
24
  };
29
25
  /**
30
26
  * Запрос остановки стрима
@@ -42,7 +38,7 @@ export declare type ParticipantLayout = (Layout | StopStream) & {
42
38
  /**
43
39
  * Внешний ID пользователя
44
40
  */
45
- uid: ExternalId | string;
41
+ uid: ExternalParticipantId | string;
46
42
  /**
47
43
  * Тип медиа (видео с камеры, картинка с экрана, лайв или мувик)
48
44
  */
@@ -1,12 +1,12 @@
1
- import { ExternalId } from './ExternalId';
1
+ import { ExternalParticipantId } from './ExternalId';
2
2
  /**
3
3
  * Приоритет собеседника в звонке
4
4
  */
5
5
  declare type ParticipantPriority = {
6
6
  /**
7
- * Внешний ID пользователя
7
+ * Внешний ID участника звонка
8
8
  */
9
- uid: ExternalId | string;
9
+ uid: ExternalParticipantId | string;
10
10
  /**
11
11
  * Приоритет [-1..MAX_INT]
12
12
  */
@@ -1,4 +1,4 @@
1
- import { CompositeUserId } from './Participant';
1
+ import { ParticipantId } from './Participant';
2
2
  /**
3
3
  * Тип пользовательского медиа
4
4
  */
@@ -11,7 +11,7 @@ export declare enum MediaType {
11
11
  export declare function serializeParticipantStreamDescription(description: ParticipantStreamDescription): string;
12
12
  export declare function parseParticipantStreamDescription(descriptionString: string): ParticipantStreamDescription;
13
13
  export declare type ParticipantStreamDescription = {
14
- participantId: CompositeUserId;
14
+ participantId: ParticipantId;
15
15
  mediaType: MediaType | null;
16
16
  streamName?: string;
17
17
  };
@@ -10,12 +10,12 @@ import UserType from '../enums/UserType';
10
10
  import MediaModifiers from './MediaModifiers';
11
11
  import MediaSettings from './MediaSettings';
12
12
  import MuteStates from './MuteStates';
13
- import { CompositeUserId, OkUserId } from './Participant';
13
+ import { CompositeUserId, OkUserId, ParticipantId } from './Participant';
14
14
  import VideoSettings from './VideoSettings';
15
15
  import { WaitingParticipant } from './WaitingHall';
16
16
  declare type SignalingMessage = Record<string, any>;
17
17
  export declare type RecordInfo = {
18
- initiator: CompositeUserId;
18
+ initiator: ParticipantId;
19
19
  recordMovieId: number;
20
20
  recordStartTime: number;
21
21
  recordType: 'STREAM' | 'RECORD';
@@ -31,9 +31,16 @@ declare namespace SignalingMessage {
31
31
  id: number;
32
32
  type?: string;
33
33
  }
34
+ export type ParticipantListType = 'GRID' | 'SIDE' | 'ADMIN';
35
+ export interface ParticipantListMarker {
36
+ rank: number;
37
+ ts: number;
38
+ id?: CompositeUserId;
39
+ }
34
40
  export interface Participant {
35
41
  id: OkUserId;
36
42
  idType?: UserType;
43
+ deviceIdx?: number;
37
44
  externalId?: ExternalId;
38
45
  state: ParticipantState;
39
46
  responders?: OkUserId[];
@@ -49,6 +56,8 @@ declare namespace SignalingMessage {
49
56
  restricted?: boolean;
50
57
  muteStates?: MuteStates;
51
58
  unmuteOptions?: MediaOption[];
59
+ markers?: Record<ParticipantListType, ParticipantListMarker>;
60
+ observedIds?: CompositeUserId[];
52
61
  }
53
62
  interface Conversation {
54
63
  id: string;
@@ -61,7 +70,7 @@ declare namespace SignalingMessage {
61
70
  multichatId: string | null;
62
71
  tamtamMultichatId: string | null;
63
72
  recordInfo: RecordInfo | null;
64
- pinnedParticipantId: CompositeUserId | null;
73
+ pinnedParticipantId: ParticipantId | null;
65
74
  options: ConversationOption[];
66
75
  muteStates?: MuteStates;
67
76
  }
@@ -73,12 +82,14 @@ declare namespace SignalingMessage {
73
82
  export interface TransmittedData extends Notification {
74
83
  participantId: OkUserId;
75
84
  participantType: UserType;
85
+ deviceIdx?: number;
76
86
  peerId: PeerId;
77
87
  data: any;
78
88
  }
79
89
  export interface RegisteredPeer extends Notification {
80
90
  participantId: OkUserId;
81
91
  participantType: UserType;
92
+ deviceIdx?: number;
82
93
  peerId: PeerId;
83
94
  platform: string;
84
95
  clientType: string;
@@ -86,12 +97,14 @@ declare namespace SignalingMessage {
86
97
  export interface AcceptedCall extends Notification {
87
98
  participantId: OkUserId;
88
99
  participantType: UserType;
100
+ deviceIdx?: number;
89
101
  peerId: PeerId;
90
102
  mediaSettings: Partial<MediaSettings>;
91
103
  }
92
104
  export interface Hungup extends Notification {
93
105
  participantId: OkUserId;
94
106
  participantType: UserType;
107
+ deviceIdx?: number;
95
108
  peerId: PeerId;
96
109
  reason: HangupType;
97
110
  }
@@ -101,12 +114,14 @@ declare namespace SignalingMessage {
101
114
  export interface MediaSettingsChanged extends Notification {
102
115
  participantId: OkUserId;
103
116
  participantType: UserType;
117
+ deviceIdx?: number;
104
118
  peerId: PeerId;
105
119
  mediaSettings: Partial<MediaSettings>;
106
120
  }
107
121
  export interface ParticipantStateChanged extends Notification {
108
122
  participantId: OkUserId;
109
123
  participantType: UserType;
124
+ deviceIdx?: number;
110
125
  peerId: PeerId;
111
126
  mediaSettings: Partial<MediaSettings>;
112
127
  participantState: {
@@ -115,13 +130,13 @@ declare namespace SignalingMessage {
115
130
  };
116
131
  }
117
132
  export interface RolesChanged extends Notification {
118
- adminId: CompositeUserId;
119
- participantId: CompositeUserId;
133
+ adminId: ParticipantId;
134
+ participantId: ParticipantId;
120
135
  roles?: UserRole[];
121
136
  }
122
137
  export interface MuteParticipant extends Notification {
123
- adminId?: CompositeUserId;
124
- participantId?: CompositeUserId;
138
+ adminId?: ParticipantId;
139
+ participantId?: ParticipantId;
125
140
  muteStates: MuteStates;
126
141
  unmuteOptions?: MediaOption[];
127
142
  mediaOptions: MediaOption[];
@@ -129,7 +144,7 @@ declare namespace SignalingMessage {
129
144
  muteAll?: boolean;
130
145
  }
131
146
  export interface PinParticipant extends Notification {
132
- participantId: CompositeUserId;
147
+ participantId: ParticipantId;
133
148
  unpin?: boolean;
134
149
  }
135
150
  export interface ParticipantAdded extends Notification {
@@ -153,6 +168,7 @@ declare namespace SignalingMessage {
153
168
  topology: TransportTopology;
154
169
  offerTo: OkUserId[];
155
170
  offerToTypes: UserType[];
171
+ offerToDeviceIdxs: number[];
156
172
  }
157
173
  export interface RateCallData extends Notification {
158
174
  maxRateForQuestion: number;
@@ -169,12 +185,10 @@ declare namespace SignalingMessage {
169
185
  reason: string;
170
186
  }
171
187
  export interface RecordStarted extends Notification {
172
- idType: UserType;
173
- id: OkUserId;
174
188
  recordInfo: RecordInfo;
175
189
  }
176
190
  export interface RecordStopped extends Notification {
177
- participant: CompositeUserId;
191
+ participant: ParticipantId;
178
192
  recordMovieId: number;
179
193
  }
180
194
  export interface ReallocCon extends Notification {
@@ -184,6 +198,7 @@ declare namespace SignalingMessage {
184
198
  export interface ChatMessage extends Notification {
185
199
  participantId: OkUserId;
186
200
  participantType: UserType;
201
+ deviceIdx?: number;
187
202
  direct: boolean;
188
203
  message: string;
189
204
  }
@@ -196,13 +211,13 @@ declare namespace SignalingMessage {
196
211
  settings: Record<string, any>;
197
212
  }
198
213
  export interface StalledActivity extends Notification {
199
- stalledParticipants: CompositeUserId[];
214
+ stalledParticipants: ParticipantId[];
200
215
  }
201
216
  export interface AudioActivity extends Notification {
202
- activeParticipants: CompositeUserId[];
217
+ activeParticipants: ParticipantId[];
203
218
  }
204
219
  export interface SpeakerChanged extends Notification {
205
- speaker: CompositeUserId;
220
+ speaker: ParticipantId;
206
221
  }
207
222
  export interface OptionsChanged extends Notification {
208
223
  options: ConversationOption[];
@@ -211,7 +226,7 @@ declare namespace SignalingMessage {
211
226
  statuses: Record<string, number>;
212
227
  }
213
228
  export interface PromotionApproved extends Notification {
214
- adminId: CompositeUserId;
229
+ adminId: ParticipantId;
215
230
  }
216
231
  export interface PromoteParticipant extends Notification {
217
232
  demote: boolean;
@@ -222,8 +237,8 @@ declare namespace SignalingMessage {
222
237
  eventType: ChatRoomEventType;
223
238
  totalCount: number;
224
239
  firstParticipants: WaitingParticipant[];
225
- addedParticipantIds: CompositeUserId[];
226
- removedParticipantIds: CompositeUserId[];
240
+ addedParticipantIds: ParticipantId[];
241
+ removedParticipantIds: ParticipantId[];
227
242
  feedback: Record<string, any>[];
228
243
  }
229
244
  export interface VideoQualityUpdate extends Notification {
@@ -235,6 +250,7 @@ declare namespace SignalingMessage {
235
250
  export interface CustomData extends Notification {
236
251
  participantId: OkUserId;
237
252
  participantType: UserType;
253
+ deviceIdx?: number;
238
254
  data: Record<string, any>;
239
255
  }
240
256
  export interface SwitchMicro extends Notification {