@vkontakte/calls-sdk 2.5.3-dev.6fa8b9b.0 → 2.5.3-dev.80ed530.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.
@@ -12,12 +12,13 @@ import UpdateDisplayLayoutErrorReason from '../enums/UpdateDisplayLayoutErrorRea
12
12
  import UserRole from '../enums/UserRole';
13
13
  import UserType from '../enums/UserType';
14
14
  import { JSONObject } from '../static/Json';
15
- import { ExternalParticipantId, ExternalUserId } from '../types/ExternalId';
15
+ import { ExternalParticipantId, ExternalParticipantListChunk, ExternalUserId } from '../types/ExternalId';
16
16
  import MediaModifiers from '../types/MediaModifiers';
17
17
  import { IVideoDimentions } from '../types/MediaSettings';
18
18
  import MuteStates from '../types/MuteStates';
19
19
  import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
20
20
  import { ParticipantLayout } from '../types/ParticipantLayout';
21
+ import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
21
22
  import ParticipantPriority from '../types/ParticipantPriority';
22
23
  import { ParticipantStreamDescription } from '../types/ParticipantStreamDescription';
23
24
  import SignalingMessage, { RecordInfo } from '../types/SignalingMessage';
@@ -128,6 +129,7 @@ export default class Conversation extends EventEmitter {
128
129
  private _close;
129
130
  destroy(): void;
130
131
  private _getConversationParams;
132
+ private _addGeoParamsToEndpoint;
131
133
  /**
132
134
  * @throws ErrorEvent
133
135
  */
@@ -146,7 +148,19 @@ export default class Conversation extends EventEmitter {
146
148
  private _updateConversation;
147
149
  private _createMediaSource;
148
150
  private _connectSignaling;
151
+ private _processConnection;
152
+ private _prepareParticipants;
153
+ private _onConversationParticipantListChunk;
154
+ private _participantListChunkToExternalChunk;
155
+ private _registerConnectionParticipants;
149
156
  private _registerParticipants;
157
+ private _registerParticipantInCache;
158
+ private _getExistedParticipantByIdOrCreate;
159
+ private _getExternalIdByParticipantId;
160
+ private _registerParticipantAndSetMarkersIfChunkEnabled;
161
+ private _warnParticipantNotInConversation;
162
+ private _setParticipantMarkers;
163
+ private _denormalizeMarkers;
150
164
  /**
151
165
  * Обрабатывает данные connection из сигналинга. Должен вызываться после `_registerParticipants`
152
166
  *
@@ -231,6 +245,7 @@ export default class Conversation extends EventEmitter {
231
245
  effect: IVideoDimentions;
232
246
  }): Promise<void>;
233
247
  videoEffect(effect: IEffect | null): Promise<void>;
248
+ getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<ExternalParticipantListChunk>;
234
249
  private _onLocalMediaStreamChanged;
235
250
  private _onScreenSharingStatus;
236
251
  private _changeRemoteMediaSettings;
@@ -278,7 +293,6 @@ export default class Conversation extends EventEmitter {
278
293
  private _onRemoteTrackRemoved;
279
294
  private _removeAudioTrack;
280
295
  private _removeVideoTrack;
281
- private _onRemoteActivityNoSignal;
282
296
  private _onTopologyChanged;
283
297
  private _onRemoteAllStall;
284
298
  private _onRemoteSignalledStall;
@@ -0,0 +1 @@
1
+ import 'jasmine-ajax';
@@ -1,6 +1,6 @@
1
1
  import { ParticipantId } from '../types/Participant';
2
2
  import EventEmitter from './EventEmitter';
3
- import { Transport } from './transport/Transport';
3
+ import { Transport, TransportTopology } from './transport/Transport';
4
4
  import { VolumeLevel } from './VolumeDetector';
5
5
  import { VolumesDetector } from './VolumesDetector';
6
6
  export declare const enum SpeakerDetectorEvent {
@@ -8,13 +8,12 @@ export declare const enum SpeakerDetectorEvent {
8
8
  }
9
9
  export declare class SpeakerDetector extends EventEmitter {
10
10
  private _speakerId;
11
- private _serverAudioActivityAvailable;
12
- constructor(volumesDetector: VolumesDetector, transport: Transport);
11
+ private _serverSideSpeakerDetection;
12
+ constructor(volumesDetector: VolumesDetector, transport: Transport, topology: TransportTopology);
13
13
  destroy(): void;
14
14
  _onVolumesDetected(volumes: {
15
15
  [key: string]: VolumeLevel;
16
16
  }): void;
17
17
  _onServerSpeakerChanged(speakerId: ParticipantId): void;
18
- _onReceivedServerAudioActivity(): void;
19
- _onStoppedReceivingServerAudioActivity(): void;
18
+ private _onTopologyChanged;
20
19
  }
@@ -13,5 +13,5 @@ export declare class VolumesDetector extends EventEmitter {
13
13
  private _onRemoteTrackRemoved;
14
14
  private _collectVolumes;
15
15
  private _onSignalledActiveParticipants;
16
- private _onActiveParticipantsNoSignal;
16
+ private _onTopologyChanged;
17
17
  }
@@ -1,5 +1,5 @@
1
1
  export default interface IDecoder {
2
- init(onFrameImage: (image: ImageBitmap | ImageData) => void): Promise<void>;
2
+ init(onFrameImage: (image: VideoFrame | ImageBitmap | ImageData) => void): Promise<void>;
3
3
  decodeFrame(timestamp: number, data: Uint8Array, isVP9: boolean, keyFrame?: boolean): void;
4
4
  destroy(): void;
5
5
  }
@@ -1,7 +1,7 @@
1
1
  import IDecoder from './IDecoder';
2
2
  import WorkerBase from './WorkerBase';
3
3
  export default class WebCodecsDecoder extends WorkerBase implements IDecoder {
4
- init(onFrameImage: (image: ImageBitmap) => void): Promise<void>;
4
+ init(onFrameImage: (frame: VideoFrame) => void): Promise<void>;
5
5
  decodeFrame(timestamp: number, data: Uint8Array, isVP9: boolean, keyFrame?: boolean): void;
6
6
  destroy(): void;
7
7
  static isBrowserSupported(): boolean;
@@ -0,0 +1,8 @@
1
+ export default abstract class BaseRenderer {
2
+ protected readonly _onStream: (stream: MediaStream) => void;
3
+ protected constructor(onStream: (stream: MediaStream) => void);
4
+ drawFrame(frame: VideoFrame): Promise<void>;
5
+ drawImage(image: ImageBitmap | ImageData): void;
6
+ abstract destroy(): void;
7
+ static isBrowserSupported(): boolean;
8
+ }
@@ -0,0 +1,16 @@
1
+ import BaseRenderer from './BaseRenderer';
2
+ export default class CanvasRenderer extends BaseRenderer {
3
+ private readonly _useImageBitmap;
4
+ private _canvas;
5
+ private _canvasContext;
6
+ private _stream;
7
+ private _track;
8
+ constructor(onStream: (stream: MediaStream) => void);
9
+ private _createStream;
10
+ private _removeStream;
11
+ private _requestCanvasFrame;
12
+ drawFrame(frame: VideoFrame): Promise<void>;
13
+ drawImage(image: ImageBitmap | ImageData): void;
14
+ destroy(): void;
15
+ static isBrowserSupported(): boolean;
16
+ }
@@ -1,19 +1,11 @@
1
1
  import { ParticipantId } from '../../types/Participant';
2
2
  import { BaseStreamBuilder, FrameData } from './BaseStreamBuilder';
3
3
  export default class StreamBuilder extends BaseStreamBuilder {
4
+ private readonly _renderer;
4
5
  private readonly _decoder;
5
6
  private _decoderReady;
6
7
  private _decoderQueue;
7
- private readonly _useImageBitmap;
8
- private _canvas;
9
- private _canvasContext;
10
- private _stream;
11
- private _track;
12
8
  constructor(participantId: ParticipantId, onStream: (stream: MediaStream) => void);
13
- private _createStream;
14
- private _removeStream;
15
- private _requestCanvasFrame;
16
- private _drawImage;
17
9
  protected _processFrame(frame: FrameData): void;
18
10
  private _decodeQueue;
19
11
  destroy(): void;
@@ -0,0 +1,10 @@
1
+ import BaseRenderer from './BaseRenderer';
2
+ export default class TrackGeneratorRenderer extends BaseRenderer {
3
+ private readonly _generator;
4
+ private readonly _writer;
5
+ private readonly _stream;
6
+ constructor(onStream: (stream: MediaStream) => void);
7
+ drawFrame(frame: VideoFrame): Promise<void>;
8
+ destroy(): void;
9
+ static isBrowserSupported(): boolean;
10
+ }
@@ -12,7 +12,6 @@ export declare const enum TransportEvent {
12
12
  STATE_CHANGED = "STATE_CHANGED",
13
13
  LOCAL_STATE_CHANGED = "LOCAL_STATE_CHANGED",
14
14
  SIGNALLED_ACTIVE_PARTICIPANTS = "SIGNALLED_ACTIVE_PARTICIPANTS",
15
- ACTIVE_PARTICIPANTS_NO_SIGNAL = "ACTIVE_PARTICIPANTS_NO_SIGNAL",
16
15
  SIGNALLED_SPEAKER_CHANGED = "SIGNALLED_SPEAKER_CHANGED",
17
16
  SIGNALLED_STALLED_PARTICIPANTS = "SIGNALLED_STALLED_PARTICIPANTS",
18
17
  TOPOLOGY_CHANGED = "TOPOLOGY_CHANGED",
@@ -69,7 +68,6 @@ export declare class Transport extends EventEmitter {
69
68
  private _setLocalNoiseSuppression;
70
69
  private _onDirectTransportChanged;
71
70
  private _onServerTransportChanged;
72
- private _onTransportActiveParticipantsNoSignal;
73
71
  private _onTransportActiveParticipants;
74
72
  private _onTransportStalledParticipants;
75
73
  private _onTransportSpeakerChanged;
@@ -13,6 +13,7 @@ import MediaModifiers from '../types/MediaModifiers';
13
13
  import MediaSettings from '../types/MediaSettings';
14
14
  import MuteStates from '../types/MuteStates';
15
15
  import { CompositeUserId, ParticipantId } from '../types/Participant';
16
+ import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
16
17
  import SignalingMessage from '../types/SignalingMessage';
17
18
  import { WaitingParticipantId } from '../types/WaitingHall';
18
19
  export default class Signaling extends BaseSignaling {
@@ -124,6 +125,7 @@ export default class Signaling extends BaseSignaling {
124
125
  * что все подписчики готовы принимать сообщения от сигналинга.
125
126
  */
126
127
  readyToSend(): void;
128
+ getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<SignalingMessage>;
127
129
  protected _connect(connectionType: SignalingConnectionType): void;
128
130
  protected _disconnect(): void;
129
131
  private _onOpen;
@@ -22,6 +22,7 @@ declare enum HangupType {
22
22
  SERVICE_DISABLED = "SERVICE_DISABLED",
23
23
  EXTERNAL_API_ERROR = "EXTERNAL_API_ERROR",
24
24
  SOCKET_CLOSED = "SOCKET_CLOSED",
25
- ENDED = "ENDED"
25
+ ENDED = "ENDED",
26
+ KILLED_WITHOUT_DELETE = "KILLED_WITHOUT_DELETE"
26
27
  }
27
28
  export default HangupType;
@@ -28,6 +28,7 @@ declare enum SignalingCommandType {
28
28
  UPDATE_MEDIA_MODIFIERS = "update-media-modifiers",
29
29
  CHANGE_OPTIONS = "change-options",
30
30
  GET_WAITING_HALL = "get-waiting-hall",
31
+ GET_PARTICIPANT_LIST_CHUNK = "get-participant-list-chunk",
31
32
  PROMOTE_PARTICIPANT = "promote-participant",
32
33
  REQUEST_TEST_MODE = "request-test-mode",
33
34
  ADD_MOVIE = "add-movie",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.5.3-dev.6fa8b9b.0",
3
+ "version": "2.5.3-dev.80ed530.0",
4
4
  "author": "vk.com",
5
5
  "description": "Library for video calls based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
@@ -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, ExternalParticipantId } from '../types/ExternalId';
10
+ import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalParticipantListMarkers } from '../types/ExternalId';
11
11
  import MediaModifiers from '../types/MediaModifiers';
12
12
  import MediaSettings from '../types/MediaSettings';
13
13
  import MuteStates from '../types/MuteStates';
@@ -93,20 +93,41 @@ declare namespace External {
93
93
  * @param participants Список участников звонка (при `Params.batchParticipantsOnStart = true`)
94
94
  */
95
95
  function onConversation(userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants?: ExternalParticipant[]): void;
96
+ /**
97
+ * Постраничные данные про участников при начале звонка
98
+ * @param chunk
99
+ */
100
+ function onConversationParticipantListChunk(chunk: ExternalParticipantListChunk): void;
96
101
  /**
97
102
  * Изменились данные стрима собеседника
98
103
  *
99
104
  * @param userId
100
105
  * @param mediaSettings
106
+ * @param markers
101
107
  */
102
- function onRemoteMediaSettings(userId: ExternalParticipantId, mediaSettings: MediaSettings): void;
108
+ function onRemoteMediaSettings(userId: ExternalParticipantId, mediaSettings: MediaSettings, markers?: ExternalParticipantListMarkers): void;
109
+ /**
110
+ * Добавили участника
111
+ *
112
+ * @param userId
113
+ * @param markers
114
+ */
115
+ function onParticipantAdded(userId: ExternalId, markers?: ExternalParticipantListMarkers): void;
116
+ /**
117
+ * Участник подключился
118
+ *
119
+ * @param userId
120
+ * @param markers
121
+ */
122
+ function onParticipantJoined(userId: ExternalId, markers?: ExternalParticipantListMarkers): void;
103
123
  /**
104
124
  * Изменились данные состояний собеседника
105
125
  *
106
126
  * @param userId
107
127
  * @param participantState
128
+ * @param markers
108
129
  */
109
- function onRemoteParticipantState(userId: ExternalParticipantId, participantState: ParticipantStateMapped): void;
130
+ function onRemoteParticipantState(userId: ExternalParticipantId, participantState: ParticipantStateMapped, markers?: ExternalParticipantListMarkers): void;
110
131
  /**
111
132
  * Изменился статус соединения собеседников
112
133
  *
@@ -138,8 +159,9 @@ declare namespace External {
138
159
  * Пользователь отключился от звонка
139
160
  *
140
161
  * @param userId
162
+ * @param markers
141
163
  */
142
- function onRemoteRemoved(userId: ExternalParticipantId): void;
164
+ function onRemoteRemoved(userId: ExternalParticipantId, markers?: ExternalParticipantListMarkers): void;
143
165
  /**
144
166
  * Изменилось состояние звонка
145
167
  *
@@ -185,8 +207,9 @@ declare namespace External {
185
207
  *
186
208
  * @param userId Внешний ID пользователя
187
209
  * @param unpin Открепить или закрепить
210
+ * @param markers
188
211
  */
189
- function onPinnedParticipant(userId: ExternalParticipantId, unpin: boolean): void;
212
+ function onPinnedParticipant(userId: ExternalParticipantId, unpin: boolean, markers?: ExternalParticipantListMarkers): void;
190
213
  /**
191
214
  * Закрепляет/открепляет текущего пользователя у других собеседников
192
215
  *
@@ -319,5 +342,11 @@ declare namespace External {
319
342
  * @param firstParticipants Первые несколько ожидающих в зале
320
343
  */
321
344
  function onChatRoomUpdated(eventType: ChatRoomEventType, totalCount: number, firstParticipants: ExternalId[]): void;
345
+ /**
346
+ * Получен микшированный аудио стрим.
347
+ *
348
+ * @param stream стрим от WebRTC
349
+ */
350
+ function onRemoteMixedAudioStream(stream: MediaStream): void;
322
351
  }
323
352
  export default External;
@@ -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, ExternalParticipantId } from '../types/ExternalId';
10
+ import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalParticipantListMarkers } from '../types/ExternalId';
11
11
  import IceServer from '../types/IceServer';
12
12
  import MediaModifiers from '../types/MediaModifiers';
13
13
  import MediaSettings from '../types/MediaSettings';
@@ -218,6 +218,19 @@ export declare type ParamsObject = {
218
218
  movieShare: boolean;
219
219
  filteredMessages: boolean;
220
220
  breakVideoPayloadTypes: boolean;
221
+ /**
222
+ * Включить постраничный вывод участников. Работает только если включено videoTracksCount (слоты)
223
+ */
224
+ useParticipantListChunk: boolean;
225
+ /**
226
+ * Индекс участника для первого chunk'а который придет при установки соединения с сервером
227
+ */
228
+ participantListChunkInitIndex: number;
229
+ /**
230
+ * Количество участников которые придут в первом chunk'е при установки соединения с сервером
231
+ * если параметр не проставлен то будет использоваться значение по умолчанию установленное на сервере
232
+ */
233
+ participantListChunkInitCount: number | null;
221
234
  /**
222
235
  * Включать RED-extension (redundancy) для групповых звонков
223
236
  */
@@ -242,6 +255,13 @@ export declare type ParamsObject = {
242
255
  * @hidden
243
256
  */
244
257
  muteMode: boolean;
258
+ /**
259
+ * Сохранять (не удалять) аудио дорожки в стримах, поступающих клиенту
260
+ * Позволяет клиенту получать и сохранять аудио данные
261
+ * Внимание: может привести к "двойному" звуку при проигрывании
262
+ * @hidden
263
+ */
264
+ preserveAudioTracks: boolean;
245
265
  /**
246
266
  * Получен локальный стрим с камеры/микрофона
247
267
  */
@@ -277,14 +297,26 @@ export declare type ParamsObject = {
277
297
  * Начат звонок
278
298
  */
279
299
  onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants?: ExternalParticipant[]) => void;
300
+ /**
301
+ * Начальный список участников для постраничного звонка
302
+ */
303
+ onConversationParticipantListChunk?: (chunk: ExternalParticipantListChunk) => void;
280
304
  /**
281
305
  * Изменились данные стрима собеседника
282
306
  */
283
- onRemoteMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings) => void;
307
+ onRemoteMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings, markers?: ExternalParticipantListMarkers) => void;
308
+ /**
309
+ * Добавили участника
310
+ */
311
+ onParticipantAdded?: (userId: ExternalParticipantId, markers?: ExternalParticipantListMarkers) => void;
312
+ /**
313
+ * Участник присоединился к звонку
314
+ */
315
+ onParticipantJoined?: (userId: ExternalParticipantId, markers?: ExternalParticipantListMarkers) => void;
284
316
  /**
285
317
  * Изменились данные состояний собеседника
286
318
  */
287
- onRemoteParticipantState?: (userId: ExternalParticipantId, participantState: ParticipantStateMapped) => void;
319
+ onRemoteParticipantState?: (userId: ExternalParticipantId, participantState: ParticipantStateMapped, markers?: ExternalParticipantListMarkers) => void;
288
320
  /**
289
321
  * Изменился статус соединения собеседников
290
322
  */
@@ -305,7 +337,7 @@ export declare type ParamsObject = {
305
337
  /**
306
338
  * Пользователь отключился от звонка
307
339
  */
308
- onRemoteRemoved?: (userId: ExternalParticipantId) => void;
340
+ onRemoteRemoved?: (userId: ExternalParticipantId, markers?: ExternalParticipantListMarkers) => void;
309
341
  /**
310
342
  * Изменилось состояние звонка
311
343
  */
@@ -329,7 +361,7 @@ export declare type ParamsObject = {
329
361
  /**
330
362
  * Закрепляет/открепляет собеседника для всех
331
363
  */
332
- onPinnedParticipant?: (userId: ExternalParticipantId, unpin: boolean) => void;
364
+ onPinnedParticipant?: (userId: ExternalParticipantId, unpin: boolean, markers?: ExternalParticipantListMarkers) => void;
333
365
  /**
334
366
  * Закрепляет/открепляет текущего пользователя у других собеседников
335
367
  */
@@ -427,6 +459,12 @@ export declare type ParamsObject = {
427
459
  * @param firstParticipants Первые несколько ожидающих в зале
428
460
  */
429
461
  onChatRoomUpdated?: (eventType: ChatRoomEventType, totalCount: number, firstParticipants: ExternalId[]) => void;
462
+ /**
463
+ * Получен микшированный аудио стрим.
464
+ * @hidden
465
+ * @param stream стрим от WebRTC
466
+ */
467
+ onRemoteMixedAudioStream?: (stream: MediaStream) => void;
430
468
  };
431
469
  export default abstract class Params {
432
470
  private static _params;
@@ -514,9 +552,13 @@ export default abstract class Params {
514
552
  static get videoTracksCount(): number;
515
553
  static get breakVideoPayloadTypes(): boolean;
516
554
  static get filteredMessages(): boolean;
555
+ static get useParticipantListChunk(): boolean;
556
+ static get participantListChunkInitIndex(): number;
557
+ static get participantListChunkInitCount(): number;
517
558
  static get serverAudioRed(): boolean;
518
559
  static get p2pAudioRed(): boolean;
519
560
  static get batchParticipantsOnStart(): boolean;
520
561
  static get filterObservers(): boolean;
521
562
  static get muteMode(): boolean;
563
+ static get preserveAudioTracks(): boolean;
522
564
  }
@@ -6,5 +6,9 @@ declare type ConversationParams = {
6
6
  stun_server?: IceServer;
7
7
  client_type?: string;
8
8
  device_idx?: number;
9
+ isp_as_no?: number;
10
+ isp_as_org?: string;
11
+ loc_cc?: string;
12
+ loc_reg?: string;
9
13
  };
10
14
  export default ConversationParams;
@@ -2,7 +2,7 @@ import MediaOption from '../enums/MediaOption';
2
2
  import { ParticipantStatus } from '../static/External';
3
3
  import MediaSettings from './MediaSettings';
4
4
  import MuteStates from './MuteStates';
5
- import { ParticipantStateMapped } from './Participant';
5
+ import { ParticipantListMarker, ParticipantListType, ParticipantStateMapped } from './Participant';
6
6
  import SignalingMessage from './SignalingMessage';
7
7
  /**
8
8
  * Тип внешнего пользователя
@@ -57,6 +57,14 @@ export interface ExternalParticipantId extends ExternalId {
57
57
  */
58
58
  deviceIdx: number;
59
59
  }
60
+ /**
61
+ * Маркер определяющий положение участника в списке
62
+ */
63
+ export declare type ExternalParticipantListMarker = Required<ParticipantListMarker>;
64
+ /**
65
+ * Словарь сопоставляющий тип списка участников с маркером (положением участника в списке)
66
+ */
67
+ export declare type ExternalParticipantListMarkers = Record<ParticipantListType, ExternalParticipantListMarker>;
60
68
  /**
61
69
  * Участник звонка
62
70
  */
@@ -85,4 +93,11 @@ export interface ExternalParticipant {
85
93
  * Разрешения на включение устройств
86
94
  */
87
95
  unmuteOptions: MediaOption[];
96
+ markers?: ExternalParticipantListMarkers;
97
+ }
98
+ export interface ExternalParticipantListChunk {
99
+ participants: ExternalParticipant[];
100
+ countBefore: number;
101
+ countAfter: number;
102
+ markerFound: boolean;
88
103
  }
@@ -3,7 +3,7 @@ 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 { ExternalParticipantId } from './ExternalId';
6
+ import { ExternalParticipantId, ExternalParticipantListMarkers } from './ExternalId';
7
7
  import MuteStates from './MuteStates';
8
8
  import ParticipantLayout from './ParticipantLayout';
9
9
  /**
@@ -16,6 +16,13 @@ export declare type CompositeUserId = string;
16
16
  */
17
17
  export declare type ParticipantId = string;
18
18
  export declare type OkUserId = number;
19
+ export declare type ParticipantListType = 'GRID' | 'SIDE' | 'ADMIN';
20
+ export interface ParticipantListMarker {
21
+ rank?: number;
22
+ ts?: number;
23
+ id?: CompositeUserId;
24
+ }
25
+ export declare type ParticipantListMarkers = Record<ParticipantListType, ParticipantListMarker>;
19
26
  /**
20
27
  * Стейт участника звонка
21
28
  */
@@ -47,4 +54,5 @@ export interface Participant {
47
54
  muteStates: MuteStates;
48
55
  unmuteOptions: MediaOption[];
49
56
  observedIds: CompositeUserId[];
57
+ markers?: ExternalParticipantListMarkers;
50
58
  }
@@ -0,0 +1,13 @@
1
+ import { ParticipantListMarker, ParticipantListType } from './Participant';
2
+ export interface ParticipantListChunkParameters {
3
+ listType: ParticipantListType;
4
+ count: number;
5
+ /** Anchor in sorted list to start from. Mutually exclusive with "fromIdx" */
6
+ fromMarker?: ParticipantListMarker;
7
+ /** Position in sorted list to start from (0-based). Mutually exclusive with "fromMarker" */
8
+ fromIdx?: number;
9
+ /** If true then list is to be iterated in reverse order */
10
+ backward?: boolean;
11
+ /** If true then resulting chunk will start from Participant with specified marker, if such Participant (still) exists */
12
+ includeMarker?: boolean;
13
+ }
@@ -10,7 +10,7 @@ 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, ParticipantId } from './Participant';
13
+ import { CompositeUserId, OkUserId, ParticipantId, ParticipantListMarker as ParticipantParticipantListMarker, ParticipantListMarkers, ParticipantListType as ParticipantParticipantListType } from './Participant';
14
14
  import VideoSettings from './VideoSettings';
15
15
  import { WaitingParticipant } from './WaitingHall';
16
16
  declare type SignalingMessage = Record<string, any>;
@@ -31,12 +31,8 @@ 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
+ export type ParticipantListType = ParticipantParticipantListType;
35
+ export type ParticipantListMarker = ParticipantParticipantListMarker;
40
36
  export interface Participant {
41
37
  id: OkUserId;
42
38
  idType?: UserType;
@@ -56,9 +52,15 @@ declare namespace SignalingMessage {
56
52
  restricted?: boolean;
57
53
  muteStates?: MuteStates;
58
54
  unmuteOptions?: MediaOption[];
59
- markers?: Record<ParticipantListType, ParticipantListMarker>;
55
+ markers?: ParticipantListMarkers;
60
56
  observedIds?: CompositeUserId[];
61
57
  }
58
+ export interface ParticipantListChunk extends Notification {
59
+ participants: (Participant & Required<Pick<Participant, 'markers'>>)[];
60
+ countBefore: number;
61
+ countAfter: number;
62
+ markerFound: boolean;
63
+ }
62
64
  interface Conversation {
63
65
  id: string;
64
66
  state: string;
@@ -107,6 +109,7 @@ declare namespace SignalingMessage {
107
109
  deviceIdx?: number;
108
110
  peerId: PeerId;
109
111
  reason: HangupType;
112
+ markers?: ParticipantListMarkers;
110
113
  }
111
114
  export interface ClosedConversation extends Notification {
112
115
  reason: HangupType;
@@ -117,6 +120,7 @@ declare namespace SignalingMessage {
117
120
  deviceIdx?: number;
118
121
  peerId: PeerId;
119
122
  mediaSettings: Partial<MediaSettings>;
123
+ markers?: ParticipantListMarkers;
120
124
  }
121
125
  export interface ParticipantStateChanged extends Notification {
122
126
  participantId: OkUserId;
@@ -128,6 +132,7 @@ declare namespace SignalingMessage {
128
132
  state: Record<string, string>;
129
133
  stateUpdateTs: Record<string, number>;
130
134
  };
135
+ markers?: ParticipantListMarkers;
131
136
  }
132
137
  export interface RolesChanged extends Notification {
133
138
  adminId: ParticipantId;
@@ -262,6 +267,7 @@ declare namespace SignalingMessage {
262
267
  isConcurrent: boolean;
263
268
  peerId: PeerId;
264
269
  mediaModifiers: MediaModifiers;
270
+ participants?: ParticipantListChunk;
265
271
  }
266
272
  export {};
267
273
  }