@vkontakte/calls-sdk 2.5.3-dev.dbb762f.0 → 2.6.2-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.
@@ -12,13 +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 { ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalUserId } from '../types/ExternalId';
16
16
  import MediaModifiers from '../types/MediaModifiers';
17
17
  import { IVideoDimentions } from '../types/MediaSettings';
18
- import { IAddMovieParams } from '../types/MovieShare';
19
18
  import MuteStates from '../types/MuteStates';
20
- import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
19
+ import { CompositeUserId, IGetParticipantsParameters, OkUserId, ParticipantId } from '../types/Participant';
21
20
  import { ParticipantLayout } from '../types/ParticipantLayout';
21
+ import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
22
22
  import ParticipantPriority from '../types/ParticipantPriority';
23
23
  import { ParticipantStreamDescription } from '../types/ParticipantStreamDescription';
24
24
  import SignalingMessage, { RecordInfo } from '../types/SignalingMessage';
@@ -148,7 +148,21 @@ export default class Conversation extends EventEmitter {
148
148
  private _updateConversation;
149
149
  private _createMediaSource;
150
150
  private _connectSignaling;
151
+ private _processConnection;
152
+ private _prepareParticipants;
153
+ private _onConversationParticipantListChunk;
154
+ private _participantListChunkToExternalChunk;
155
+ private _registerConnectionParticipants;
151
156
  private _registerParticipants;
157
+ private _getClientType;
158
+ private _getStatusByTransportState;
159
+ private _registerParticipantInCache;
160
+ private _getExistedParticipantByIdOrCreate;
161
+ private _getExternalIdByParticipantId;
162
+ private _registerParticipantAndSetMarkersIfChunkEnabled;
163
+ private _warnParticipantNotInConversation;
164
+ private _setParticipantMarkers;
165
+ private _denormalizeMarkers;
152
166
  /**
153
167
  * Обрабатывает данные connection из сигналинга. Должен вызываться после `_registerParticipants`
154
168
  *
@@ -184,6 +198,7 @@ export default class Conversation extends EventEmitter {
184
198
  [key: string]: string;
185
199
  }): Promise<void>;
186
200
  requestKeyFrame(participantStreamDescription: ParticipantStreamDescription): Promise<void | SignalingMessage>;
201
+ requestTestMode(consumerCommand: string, producerCommand: string): Promise<void>;
187
202
  updateDisplayLayout(layouts: ParticipantLayout[]): Promise<void>;
188
203
  private _stopStreaming;
189
204
  private _sendUpdateDisplayLayout;
@@ -193,7 +208,6 @@ export default class Conversation extends EventEmitter {
193
208
  private _onParticipantSourcesUpdate;
194
209
  private _onParticipantPromoted;
195
210
  private _onChatRoomUpdated;
196
- private _onSharedMovieUpdate;
197
211
  private _waitForStreamIfNeeded;
198
212
  private _matchStreamDescription;
199
213
  private _getWaitingTime;
@@ -217,11 +231,11 @@ export default class Conversation extends EventEmitter {
217
231
  customData(data: JSONObject, participantId?: ParticipantId | null): Promise<void>;
218
232
  createJoinLink(): Promise<string>;
219
233
  removeJoinLink(): Promise<never>;
220
- addMovie({ movieId, gain }: IAddMovieParams): Promise<{
234
+ addMovie(movieId: string): Promise<{
221
235
  movieId: string;
222
236
  streamType: string;
223
237
  }>;
224
- updateMovie(movieId: string, gain?: number, offset?: number, pause?: boolean): Promise<void>;
238
+ updateMovie(movieId: string, gain?: number, offset?: string, pause?: boolean): Promise<void>;
225
239
  removeMovie(movieId: string): Promise<void>;
226
240
  startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null): Promise<SignalingMessage>;
227
241
  stopStream(): Promise<SignalingMessage>;
@@ -234,6 +248,8 @@ export default class Conversation extends EventEmitter {
234
248
  effect: IVideoDimentions;
235
249
  }): Promise<void>;
236
250
  videoEffect(effect: IEffect | null): Promise<void>;
251
+ getParticipants(parameters: IGetParticipantsParameters): Promise<ExternalParticipant[]>;
252
+ getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<ExternalParticipantListChunk>;
237
253
  private _onLocalMediaStreamChanged;
238
254
  private _onScreenSharingStatus;
239
255
  private _changeRemoteMediaSettings;
@@ -289,6 +305,7 @@ export default class Conversation extends EventEmitter {
289
305
  private _toggleJoinAvailability;
290
306
  private _updateDisplayLayoutFromCache;
291
307
  private _setParticipantsStatus;
308
+ private _onJoinLinkChanged;
292
309
  }
293
310
  export declare class UpdateDisplayLayoutError extends Error {
294
311
  readonly participantErrors: {
@@ -0,0 +1 @@
1
+ import 'jasmine-ajax';
@@ -44,7 +44,7 @@ export default class DirectTransport extends EventEmitter {
44
44
  private _handleTransmittedData;
45
45
  private _addIceCandidate;
46
46
  private _setRemoteCandidates;
47
- _setRemoteDescription(peerId: string, sdp: any): Promise<void>;
47
+ _setRemoteDescription(peerId: string, sdp: RTCSessionDescriptionInit): Promise<void>;
48
48
  private _onAddTrack;
49
49
  private _handleIceCandidate;
50
50
  private _onSignalingStateChange;
@@ -48,19 +48,19 @@ export declare class Transport extends EventEmitter {
48
48
  updateSettings(settings: ServerSettings): void;
49
49
  updateStatisticsInterval(): void;
50
50
  allocate(participantId: ParticipantId, isMaster?: boolean): void;
51
- open(participantIds: ParticipantId[], peerId?: string | null, observer?: boolean): void;
51
+ open(participantIds: ParticipantId[], peerId?: string | null, observer?: boolean, force?: boolean): void;
52
52
  close(participantId: ParticipantId): void;
53
53
  destroy(): void;
54
54
  getTopology(): TransportTopology;
55
55
  isAllocated(participantId: ParticipantId): boolean;
56
56
  allocated(): string[];
57
57
  opened(): string[];
58
+ getState(): TransportState;
58
59
  private _setStates;
59
60
  private _setState;
60
61
  private _setLocalState;
61
62
  private _onSignalingNotification;
62
63
  private _onTopologyChanged;
63
- private _onRecordStarted;
64
64
  private _createDirectTransport;
65
65
  private _createServerTransport;
66
66
  private _releaseDirectTransport;
@@ -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 {
@@ -72,7 +73,7 @@ export default class Signaling extends BaseSignaling {
72
73
  getNextCommandSequenceNumber(): number;
73
74
  hangup(reason: string): Promise<SignalingMessage | void>;
74
75
  sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidate): Promise<SignalingMessage>;
75
- requestTestMode(command: string): Promise<SignalingMessage>;
76
+ requestTestMode(consumerCommand: string, producerCommand: string): Promise<SignalingMessage>;
76
77
  sendSdp(participantId: ParticipantId, sdp: RTCSessionDescription): Promise<SignalingMessage>;
77
78
  acceptCall(mediaSettings: MediaSettings): Promise<SignalingMessage>;
78
79
  changeMediaSettings(mediaSettings: MediaSettings): Promise<SignalingMessage>;
@@ -124,6 +125,8 @@ export default class Signaling extends BaseSignaling {
124
125
  * что все подписчики готовы принимать сообщения от сигналинга.
125
126
  */
126
127
  readyToSend(): void;
128
+ getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<SignalingMessage>;
129
+ getParticipants(externalIds: SignalingMessage.ExternalId[]): Promise<SignalingMessage>;
127
130
  protected _connect(connectionType: SignalingConnectionType): void;
128
131
  protected _disconnect(): void;
129
132
  private _onOpen;
@@ -28,6 +28,8 @@ 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",
32
+ GET_PARTICIPANTS = "get-participants",
31
33
  PROMOTE_PARTICIPANT = "promote-participant",
32
34
  REQUEST_TEST_MODE = "request-test-mode",
33
35
  ADD_MOVIE = "add-movie",
@@ -35,7 +35,6 @@ declare enum SignalingNotification {
35
35
  PROMOTE_PARTICIPANT = "promote-participant",
36
36
  CHAT_ROOM_UPDATED = "chat-room-updated",
37
37
  PROMOTION_APPROVED = "promotion-approved",
38
- JOIN_LINK_CHANGED = "join-link-changed",
39
- MOVIE_UPDATE_NOTIFICATION = "movie-update-notification"
38
+ JOIN_LINK_CHANGED = "join-link-changed"
40
39
  }
41
40
  export default SignalingNotification;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.5.3-dev.dbb762f.0",
3
+ "version": "2.6.2-beta.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,10 +7,9 @@ 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
- import { ISharedMovieState } from '../types/MovieShare';
14
13
  import MuteStates from '../types/MuteStates';
15
14
  import { ParticipantStateMapped } from '../types/Participant';
16
15
  import { DebugMessageType } from './Debug';
@@ -77,29 +76,6 @@ declare namespace External {
77
76
  * @param stream
78
77
  */
79
78
  function onRemoteLive(userId: ExternalParticipantId, streamName: string, stream: MediaStream | null): void;
80
- /**
81
- * Получен собственный стрим лайв.
82
- * Если сервер закончил стримить собеседника, вместо стрима будет передан null
83
- *
84
- * @param userId
85
- * @param streamName
86
- * @param stream
87
- */
88
- function onLocalLive(userId: ExternalParticipantId, streamName: string, stream: MediaStream | null): void;
89
- /**
90
- * Получено обновление стрима или лайва от собеседника.
91
- *
92
- * @param userId
93
- * @param data
94
- */
95
- function onRemoteLiveUpdate(userId: ExternalParticipantId, data: ISharedMovieState): void;
96
- /**
97
- * Получено обновление собственного стрима или лайва.
98
- *
99
- * @param userId
100
- * @param data
101
- */
102
- function onLocalLiveUpdate(userId: ExternalParticipantId, data: ISharedMovieState): void;
103
79
  /**
104
80
  * Получен стрим с экрана собеседника.
105
81
  * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
@@ -117,27 +93,41 @@ declare namespace External {
117
93
  * @param participants Список участников звонка (при `Params.batchParticipantsOnStart = true`)
118
94
  */
119
95
  function onConversation(userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants?: ExternalParticipant[]): void;
96
+ /**
97
+ * Постраничные данные про участников при начале звонка
98
+ * @param chunk
99
+ */
100
+ function onConversationParticipantListChunk(chunk: ExternalParticipantListChunk): void;
120
101
  /**
121
102
  * Изменились данные стрима собеседника
122
103
  *
123
104
  * @param userId
124
105
  * @param mediaSettings
106
+ * @param markers
125
107
  */
126
- function onRemoteMediaSettings(userId: ExternalParticipantId, mediaSettings: MediaSettings): void;
108
+ function onRemoteMediaSettings(userId: ExternalParticipantId, mediaSettings: MediaSettings, markers?: ExternalParticipantListMarkers): void;
127
109
  /**
128
- * Изменились данные собственного стрима
110
+ * Добавили участника
129
111
  *
130
112
  * @param userId
131
- * @param mediaSettings
113
+ * @param markers
132
114
  */
133
- function onLocalMediaSettings(userId: ExternalParticipantId, mediaSettings: MediaSettings): void;
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;
134
123
  /**
135
124
  * Изменились данные состояний собеседника
136
125
  *
137
126
  * @param userId
138
127
  * @param participantState
128
+ * @param markers
139
129
  */
140
- function onRemoteParticipantState(userId: ExternalParticipantId, participantState: ParticipantStateMapped): void;
130
+ function onRemoteParticipantState(userId: ExternalParticipantId, participantState: ParticipantStateMapped, markers?: ExternalParticipantListMarkers): void;
141
131
  /**
142
132
  * Изменился статус соединения собеседников
143
133
  *
@@ -169,8 +159,9 @@ declare namespace External {
169
159
  * Пользователь отключился от звонка
170
160
  *
171
161
  * @param userId
162
+ * @param markers
172
163
  */
173
- function onRemoteRemoved(userId: ExternalParticipantId): void;
164
+ function onRemoteRemoved(userId: ExternalParticipantId, markers?: ExternalParticipantListMarkers): void;
174
165
  /**
175
166
  * Изменилось состояние звонка
176
167
  *
@@ -216,8 +207,9 @@ declare namespace External {
216
207
  *
217
208
  * @param userId Внешний ID пользователя
218
209
  * @param unpin Открепить или закрепить
210
+ * @param markers
219
211
  */
220
- function onPinnedParticipant(userId: ExternalParticipantId, unpin: boolean): void;
212
+ function onPinnedParticipant(userId: ExternalParticipantId, unpin: boolean, markers?: ExternalParticipantListMarkers): void;
221
213
  /**
222
214
  * Закрепляет/открепляет текущего пользователя у других собеседников
223
215
  *
@@ -356,5 +348,10 @@ declare namespace External {
356
348
  * @param stream стрим от WebRTC
357
349
  */
358
350
  function onRemoteMixedAudioStream(stream: MediaStream): void;
351
+ /**
352
+ * Получена новая ссылка на звонок
353
+ * @param joinLink токен присоединения к звонку
354
+ */
355
+ function onJoinLinkChanged(joinLink: string): void;
359
356
  }
360
357
  export default External;
@@ -7,11 +7,10 @@ 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';
14
- import { ISharedMovieState } from '../types/MovieShare';
15
14
  import MuteStates from '../types/MuteStates';
16
15
  import { ParticipantStateMapped } from '../types/Participant';
17
16
  import AuthData from './AuthData';
@@ -219,6 +218,19 @@ export declare type ParamsObject = {
219
218
  movieShare: boolean;
220
219
  filteredMessages: boolean;
221
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;
222
234
  /**
223
235
  * Включать RED-extension (redundancy) для групповых звонков
224
236
  */
@@ -282,34 +294,29 @@ export declare type ParamsObject = {
282
294
  */
283
295
  onRemoteLive?: (userId: ExternalParticipantId, streamId: string, stream: MediaStream | null) => void;
284
296
  /**
285
- * Получен собственный стрим трансляция или мувик.
286
- * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
287
- */
288
- onLocalLive?: (userId: ExternalParticipantId, streamId: string, stream: MediaStream | null) => void;
289
- /**
290
- * Получено обновление стрима или лайва от собеседника.
297
+ * Начат звонок
291
298
  */
292
- onRemoteLiveUpdate?: (userId: ExternalParticipantId, data: ISharedMovieState) => void;
299
+ onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants?: ExternalParticipant[]) => void;
293
300
  /**
294
- * Получено обновление собственного стрима или лайва.
301
+ * Начальный список участников для постраничного звонка
295
302
  */
296
- onLocalLiveUpdate?: (userId: ExternalParticipantId, data: ISharedMovieState) => void;
303
+ onConversationParticipantListChunk?: (chunk: ExternalParticipantListChunk) => void;
297
304
  /**
298
- * Начат звонок
305
+ * Изменились данные стрима собеседника
299
306
  */
300
- onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants?: ExternalParticipant[]) => void;
307
+ onRemoteMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings, markers?: ExternalParticipantListMarkers) => void;
301
308
  /**
302
- * Изменились данные стрима собеседника
309
+ * Добавили участника
303
310
  */
304
- onRemoteMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings) => void;
311
+ onParticipantAdded?: (userId: ExternalParticipantId, markers?: ExternalParticipantListMarkers) => void;
305
312
  /**
306
- * Изменились данные стрима собеседника
313
+ * Участник присоединился к звонку
307
314
  */
308
- onLocalMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings) => void;
315
+ onParticipantJoined?: (userId: ExternalParticipantId, markers?: ExternalParticipantListMarkers) => void;
309
316
  /**
310
317
  * Изменились данные состояний собеседника
311
318
  */
312
- onRemoteParticipantState?: (userId: ExternalParticipantId, participantState: ParticipantStateMapped) => void;
319
+ onRemoteParticipantState?: (userId: ExternalParticipantId, participantState: ParticipantStateMapped, markers?: ExternalParticipantListMarkers) => void;
313
320
  /**
314
321
  * Изменился статус соединения собеседников
315
322
  */
@@ -330,7 +337,7 @@ export declare type ParamsObject = {
330
337
  /**
331
338
  * Пользователь отключился от звонка
332
339
  */
333
- onRemoteRemoved?: (userId: ExternalParticipantId) => void;
340
+ onRemoteRemoved?: (userId: ExternalParticipantId, markers?: ExternalParticipantListMarkers) => void;
334
341
  /**
335
342
  * Изменилось состояние звонка
336
343
  */
@@ -354,7 +361,7 @@ export declare type ParamsObject = {
354
361
  /**
355
362
  * Закрепляет/открепляет собеседника для всех
356
363
  */
357
- onPinnedParticipant?: (userId: ExternalParticipantId, unpin: boolean) => void;
364
+ onPinnedParticipant?: (userId: ExternalParticipantId, unpin: boolean, markers?: ExternalParticipantListMarkers) => void;
358
365
  /**
359
366
  * Закрепляет/открепляет текущего пользователя у других собеседников
360
367
  */
@@ -458,6 +465,11 @@ export declare type ParamsObject = {
458
465
  * @param stream стрим от WebRTC
459
466
  */
460
467
  onRemoteMixedAudioStream?: (stream: MediaStream) => void;
468
+ /**
469
+ * Получена новая ссылка на звонок
470
+ * @param joinLink токен присоединения к звонку
471
+ */
472
+ onJoinLinkChanged?: (joinLink: string) => void;
461
473
  };
462
474
  export default abstract class Params {
463
475
  private static _params;
@@ -467,7 +479,7 @@ export default abstract class Params {
467
479
  static get(name: string): any;
468
480
  static get appName(): string;
469
481
  static get appVersion(): number;
470
- static get sdkVersion(): string | number | boolean;
482
+ static get sdkVersion(): string;
471
483
  static get debug(): string | number | boolean;
472
484
  static get protocolVersion(): 5 | 6;
473
485
  static get platform(): string;
@@ -545,6 +557,9 @@ export default abstract class Params {
545
557
  static get videoTracksCount(): number;
546
558
  static get breakVideoPayloadTypes(): boolean;
547
559
  static get filteredMessages(): boolean;
560
+ static get useParticipantListChunk(): boolean;
561
+ static get participantListChunkInitIndex(): number;
562
+ static get participantListChunkInitCount(): number;
548
563
  static get serverAudioRed(): boolean;
549
564
  static get p2pAudioRed(): boolean;
550
565
  static get batchParticipantsOnStart(): boolean;
package/static/Utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import UserType from '../enums/UserType';
2
- import { ExternalParticipant } from '../types/ExternalId';
2
+ import { ExternalParticipant, ExternalParticipantListMarker } from '../types/ExternalId';
3
3
  import { CompositeUserId, OkUserId, Participant, ParticipantId, ParticipantStateMapped } from '../types/Participant';
4
4
  import SignalingMessage from '../types/SignalingMessage';
5
5
  import VideoSettings from '../types/VideoSettings';
@@ -55,5 +55,10 @@ declare namespace Utils {
55
55
  }): boolean;
56
56
  function isArraysEquals<T>(arr1: T[], arr2: T[]): boolean;
57
57
  function isEmptyObject(obj: object): boolean;
58
+ /**
59
+ * @see https://wiki.odkl.ru/pages/viewpage.action?spaceKey=VIDEO&title=Signaling+API#SignalingAPI-Постраничныйвыводпартисипантов
60
+ * https://stash.odkl.ru/projects/ODKL/repos/odnoklassniki-webrtc/browse/src/main/java/one/webrtc/domain/conversation/ParticipantIndex.java#67-78
61
+ */
62
+ function participantMarkerCompare(marker1: ExternalParticipantListMarker | undefined, marker2: ExternalParticipantListMarker | undefined): number;
58
63
  }
59
64
  export default Utils;
@@ -0,0 +1 @@
1
+ export {};
@@ -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
  }
@@ -19,7 +19,7 @@ export declare type MediaSettings = {
19
19
  export declare type VideoStreamInfo = {
20
20
  id: string;
21
21
  source: string;
22
- externalMovieId?: string;
22
+ vkMovieId?: string;
23
23
  };
24
24
  export default MediaSettings;
25
25
  export declare function compareMediaSettings(ms1: MediaSettings, ms2: MediaSettings): boolean;
@@ -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 { ExternalId, 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,8 @@ export interface Participant {
47
54
  muteStates: MuteStates;
48
55
  unmuteOptions: MediaOption[];
49
56
  observedIds: CompositeUserId[];
57
+ markers?: ExternalParticipantListMarkers;
58
+ }
59
+ export interface IGetParticipantsParameters {
60
+ externalIds: ExternalId[];
50
61
  }
@@ -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
+ }
@@ -9,11 +9,10 @@ import UserRole from '../enums/UserRole';
9
9
  import UserType from '../enums/UserType';
10
10
  import MediaModifiers from './MediaModifiers';
11
11
  import MediaSettings from './MediaSettings';
12
- import { ISharedMovieState } from './MovieShare';
13
12
  import MuteStates from './MuteStates';
14
- import { CompositeUserId, OkUserId, ParticipantId } from './Participant';
13
+ import { CompositeUserId, OkUserId, ParticipantId, ParticipantListMarker as ParticipantParticipantListMarker, ParticipantListMarkers, ParticipantListType as ParticipantParticipantListType } from './Participant';
15
14
  import VideoSettings from './VideoSettings';
16
- import { WaitingParticipant } from './WaitingHall';
15
+ import { ChatRoom } from './WaitingHall';
17
16
  declare type SignalingMessage = Record<string, any>;
18
17
  export declare type RecordInfo = {
19
18
  initiator: ParticipantId;
@@ -32,12 +31,8 @@ declare namespace SignalingMessage {
32
31
  id: number;
33
32
  type?: string;
34
33
  }
35
- export type ParticipantListType = 'GRID' | 'SIDE' | 'ADMIN';
36
- export interface ParticipantListMarker {
37
- rank: number;
38
- ts: number;
39
- id?: CompositeUserId;
40
- }
34
+ export type ParticipantListType = ParticipantParticipantListType;
35
+ export type ParticipantListMarker = ParticipantParticipantListMarker;
41
36
  export interface Participant {
42
37
  id: OkUserId;
43
38
  idType?: UserType;
@@ -57,9 +52,15 @@ declare namespace SignalingMessage {
57
52
  restricted?: boolean;
58
53
  muteStates?: MuteStates;
59
54
  unmuteOptions?: MediaOption[];
60
- markers?: Record<ParticipantListType, ParticipantListMarker>;
55
+ markers?: ParticipantListMarkers;
61
56
  observedIds?: CompositeUserId[];
62
57
  }
58
+ export interface ParticipantListChunk extends Notification {
59
+ participants: (Participant & Required<Pick<Participant, 'markers'>>)[];
60
+ countBefore: number;
61
+ countAfter: number;
62
+ markerFound: boolean;
63
+ }
63
64
  interface Conversation {
64
65
  id: string;
65
66
  state: string;
@@ -85,7 +86,10 @@ declare namespace SignalingMessage {
85
86
  participantType: UserType;
86
87
  deviceIdx?: number;
87
88
  peerId: PeerId;
88
- data: any;
89
+ data: {
90
+ candidate?: RTCIceCandidateInit;
91
+ sdp?: RTCSessionDescriptionInit;
92
+ };
89
93
  }
90
94
  export interface RegisteredPeer extends Notification {
91
95
  participantId: OkUserId;
@@ -108,6 +112,7 @@ declare namespace SignalingMessage {
108
112
  deviceIdx?: number;
109
113
  peerId: PeerId;
110
114
  reason: HangupType;
115
+ markers?: ParticipantListMarkers;
111
116
  }
112
117
  export interface ClosedConversation extends Notification {
113
118
  reason: HangupType;
@@ -118,6 +123,7 @@ declare namespace SignalingMessage {
118
123
  deviceIdx?: number;
119
124
  peerId: PeerId;
120
125
  mediaSettings: Partial<MediaSettings>;
126
+ markers?: ParticipantListMarkers;
121
127
  }
122
128
  export interface ParticipantStateChanged extends Notification {
123
129
  participantId: OkUserId;
@@ -129,6 +135,7 @@ declare namespace SignalingMessage {
129
135
  state: Record<string, string>;
130
136
  stateUpdateTs: Record<string, number>;
131
137
  };
138
+ markers?: ParticipantListMarkers;
132
139
  }
133
140
  export interface RolesChanged extends Notification {
134
141
  adminId: ParticipantId;
@@ -236,11 +243,11 @@ declare namespace SignalingMessage {
236
243
  }
237
244
  export interface ChatRoomUpdated extends Notification {
238
245
  eventType: ChatRoomEventType;
239
- totalCount: number;
240
- firstParticipants: WaitingParticipant[];
241
- addedParticipantIds: ParticipantId[];
242
- removedParticipantIds: ParticipantId[];
243
- feedback: Record<string, any>[];
246
+ totalCount: ChatRoom['totalCount'];
247
+ firstParticipants?: ChatRoom['firstParticipants'];
248
+ addedParticipantIds?: ParticipantId[];
249
+ removedParticipantIds?: ParticipantId[];
250
+ feedback?: ChatRoom['feedback'];
244
251
  }
245
252
  export interface VideoQualityUpdate extends Notification {
246
253
  quality: {
@@ -263,9 +270,11 @@ declare namespace SignalingMessage {
263
270
  isConcurrent: boolean;
264
271
  peerId: PeerId;
265
272
  mediaModifiers: MediaModifiers;
273
+ participants?: ParticipantListChunk;
274
+ chatRoom?: ChatRoom;
266
275
  }
267
- export interface SharedMovieState extends Notification {
268
- data: ISharedMovieState[];
276
+ export interface JoinLinkChanged extends Notification {
277
+ joinLink: string;
269
278
  }
270
279
  export {};
271
280
  }