@vkontakte/calls-sdk 2.8.11-dev.20d9452d.0 → 2.8.11-dev.273c92c2.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.
@@ -0,0 +1,22 @@
1
+ import Conversation from './Conversation';
2
+ export interface HoldableConversation extends Conversation {
3
+ id: string;
4
+ hold(hold: boolean): Promise<void>;
5
+ }
6
+ export declare class CallRegistry {
7
+ private _conversations;
8
+ private _activeId;
9
+ private _mutex;
10
+ add(conversation: HoldableConversation): void;
11
+ remove(id: string | null): void;
12
+ get(id: string): HoldableConversation | undefined;
13
+ getActive(): HoldableConversation | null;
14
+ getActiveId(): string | null;
15
+ has(id: string): boolean;
16
+ getAll(): HoldableConversation[];
17
+ get callsLength(): number;
18
+ setActive(id: string): Promise<void>;
19
+ clear(): void;
20
+ }
21
+ declare const callRegistry: CallRegistry;
22
+ export { callRegistry };
@@ -16,7 +16,7 @@ import { ConversationData, ConversationOnStartParams } from '../types/Conversati
16
16
  import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalUserId } from '../types/ExternalId';
17
17
  import type { FastJoinHandler } from '../types/FastJoin';
18
18
  import MediaModifiers from '../types/MediaModifiers';
19
- import { IVideoDimentions } from '../types/MediaSettings';
19
+ import MediaSettings, { IVideoDimentions } from '../types/MediaSettings';
20
20
  import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
21
21
  import MuteStates from '../types/MuteStates';
22
22
  import { CompositeUserId, IGetParticipantsParameters, ParticipantId, ParticipantStateData } from '../types/Participant';
@@ -49,10 +49,8 @@ export default class Conversation extends EventEmitter {
49
49
  private _lastSignalledActiveSpeakerId;
50
50
  private _isRealTimeAsrRequested;
51
51
  private _serverSettings;
52
- private static _current;
53
- private static _activationMutex;
54
- private static _delayedHangup;
55
- private static _abortController;
52
+ private _delayedHangup;
53
+ private _abortController;
56
54
  private readonly _onUnload;
57
55
  private readonly _audioOutput;
58
56
  private _lastStalled;
@@ -69,6 +67,10 @@ export default class Conversation extends EventEmitter {
69
67
  static current(): Conversation | null;
70
68
  static hangupAfterInit(): void;
71
69
  static id(): string | null;
70
+ get id(): string;
71
+ get externalId(): ExternalParticipantId | undefined;
72
+ get mediaSettings(): MediaSettings | undefined;
73
+ get isCallHeld(): boolean;
72
74
  onStart({ opponentIds, opponentType, mediaOptions, payload, joiningAllowed, requireAuthToJoin, onlyAdminCanShareMovie, externalIds, onFastStart, conversationId, }: ConversationOnStartParams): Promise<ConversationData>;
73
75
  onJoin(joinArgs: {
74
76
  conversationId?: string;
@@ -393,6 +395,7 @@ export default class Conversation extends EventEmitter {
393
395
  private _onFeedback;
394
396
  private _onDecorativeParticipantIdChanged;
395
397
  private _onVideoSuspendSuggest;
398
+ private _onParticipantHold;
396
399
  private _isMe;
397
400
  private _getMuteStatesForRoomId;
398
401
  private _getMuteStatesForCurrentRoom;
@@ -402,6 +405,8 @@ export default class Conversation extends EventEmitter {
402
405
  private _getParticipants;
403
406
  private _getParticipant;
404
407
  }
408
+ declare function _resetPendingInstance(): void;
409
+ export { _resetPendingInstance };
405
410
  export declare class UpdateDisplayLayoutError extends Error {
406
411
  readonly participantErrors: {
407
412
  externalId: ExternalParticipantId;
@@ -10,30 +10,25 @@ export default class Logger extends BaseLogger {
10
10
  static setConversationIdProvider(provider: () => string | null): void;
11
11
  static create(api: BaseApi, externalLogger: BaseLogger | null): void;
12
12
  static log(name: StatLog, value?: string, immediately?: boolean): void;
13
- static logCustom(name: StatLog, params: Record<string, string | number>, immediately?: boolean): void;
14
- static logClientStats(params: Record<string, string | number | undefined | null>, immediately?: boolean): void;
15
- static logClientEvent(params: Record<string, string | number | undefined | null>, immediately?: boolean): void;
13
+ static logClientStats(params: Record<string, string | number | boolean | undefined | null>, immediately?: boolean): void;
14
+ static logClientEvent(params: Record<string, string | number | boolean | undefined | null>, immediately?: boolean): void;
16
15
  static destroy(): void;
17
16
  private readonly _externalLogger;
18
17
  private readonly _api;
19
18
  private readonly _batchInterval;
20
- private _batchedLogItems;
21
19
  private _batchedClientStats;
22
20
  private _batchedClientEvents;
23
21
  private _batchTimeout;
24
22
  private _serverTimeDelta;
25
23
  constructor(api: BaseApi, externalLogger: BaseLogger | null);
26
24
  log(name: StatLog, value?: string, immediately?: boolean): void;
27
- logCustom(name: string, params: Record<string, string | number>, immediately?: boolean): void;
28
- logClientStats(data: Record<string, string | number | undefined | null>, immediately?: boolean): void;
29
- logClientEvent(data: Record<string, string | number | undefined | null>, immediately?: boolean): void;
25
+ logClientStats(data: Record<string, string | number | boolean | undefined | null>, immediately?: boolean): void;
26
+ logClientEvent(data: Record<string, string | number | boolean | undefined | null>, immediately?: boolean): void;
30
27
  destroy(): void;
31
- private _logInternal;
32
28
  private _getConversationId;
33
29
  private _sendBatch;
34
30
  private _startTimeout;
35
31
  private _stopTimeout;
36
- private _sendLogItems;
37
32
  private _sendClientStats;
38
33
  private _sendClientEvents;
39
34
  private _calculateServerTimeDelta;
@@ -45,6 +45,7 @@ export declare class MediaSource extends EventEmitter {
45
45
  /** Трек аудио эффектов. Не изменяется на протяжении всего времени */
46
46
  private _audioEffectsTrack;
47
47
  private _mediaSettings;
48
+ private _lastMediaSettings;
48
49
  private _videoStatusOnScreenCapturingEnabled;
49
50
  private _effect;
50
51
  private _audioEffectParams;
@@ -63,7 +64,11 @@ export declare class MediaSource extends EventEmitter {
63
64
  getSendAudioTrack(): MediaStreamTrack | null;
64
65
  get isAnimojiRequested(): boolean;
65
66
  addTrackToPeerConnection(pc: RTCPeerConnection, observer: boolean, noDataChannel: boolean): void;
67
+ /**
68
+ * @deprecated Используйте гетер mediaSettings
69
+ */
66
70
  getMediaSettings(): MediaSettings;
71
+ get mediaSettings(): MediaSettings;
67
72
  changeDevice(kind: MediaDeviceKind): Promise<void>;
68
73
  /**
69
74
  * Установка кастомного стрима для видео, например внешний шаринг экрана
@@ -91,6 +96,8 @@ export declare class MediaSource extends EventEmitter {
91
96
  private _setEffect;
92
97
  private _stopEffect;
93
98
  destroy(): void;
99
+ stopLocalMedia(): Promise<void>;
100
+ resumeLocalMedia(): Promise<void>;
94
101
  toggleScreenCapturing(settings: ScreenCaptureSettings): Promise<void>;
95
102
  disableScreenCapturing(): Promise<void>;
96
103
  private videoTrackMuteHandler;
@@ -3,7 +3,12 @@ export declare class SignalingActor {
3
3
  private processor;
4
4
  private queue;
5
5
  private isProcessing;
6
+ private isHeld;
7
+ private isDestroyed;
6
8
  constructor(processor: (message: SignalingMessage) => Promise<unknown> | unknown);
7
9
  add(message: SignalingMessage): void;
10
+ hold(): void;
11
+ unhold(): void;
12
+ destroy(): void;
8
13
  private processQueue;
9
14
  }
@@ -59,6 +59,8 @@ export declare class Transport extends EventEmitter {
59
59
  close(participantId: ParticipantId): void;
60
60
  destroy(): void;
61
61
  getTopology(): TransportTopology;
62
+ preventRestart(): void;
63
+ allowRestart(): void;
62
64
  isAllocated(participantId: ParticipantId): boolean;
63
65
  allocated(): string[];
64
66
  opened(): string[];
package/default/Api.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import BaseApi, { ClientEvent, ClientStats, LogItem } from '../abstract/BaseApi';
1
+ import BaseApi, { ClientEvent, ClientStats } from '../abstract/BaseApi';
2
2
  import CallType from '../enums/CallType';
3
3
  import HangupType from '../enums/HangupType';
4
4
  import ConversationParams from '../types/ConversationParams';
@@ -15,7 +15,6 @@ export default class Api extends BaseApi {
15
15
  protected _call(method: string, data?: any, noSession?: boolean): Promise<any>;
16
16
  userId(participantId: ParticipantId): Promise<ExternalParticipantId>;
17
17
  authorize(): Promise<void>;
18
- log(items: LogItem[]): void;
19
18
  logClientStats(items: ClientStats[]): void;
20
19
  logClientEvents(items: ClientEvent[]): void;
21
20
  uploadDebugLogs(conversationId: string, startTime: number, endTime: number, log: string): Promise<void>;
@@ -65,7 +64,6 @@ export default class Api extends BaseApi {
65
64
  getUserId(): OkUserId | null;
66
65
  setUserId(userId: OkUserId): void;
67
66
  hangupConversation(conversationId: string, reason?: HangupType): void;
68
- sendUserFeedbackStats(conversationId: string, userResponse: number, reason?: string, groupCallUsersCount?: number): void;
69
67
  removeHistoryRecords(recordIds: number[]): Promise<void>;
70
68
  cleanup(): void;
71
69
  private _getExternalIdsByOkIds;
@@ -39,7 +39,6 @@ export default class Signaling extends BaseSignaling {
39
39
  protected conversationReject: Function | null;
40
40
  private connected;
41
41
  private listenersReady;
42
- private postfix;
43
42
  protected peerId: number | null;
44
43
  protected conversationId: string | null;
45
44
  private reconnectTimer;
@@ -164,6 +163,7 @@ export default class Signaling extends BaseSignaling {
164
163
  startAsr(params: IAsrStartParams): Promise<SignalingMessage>;
165
164
  stopAsr(params?: IAsrStopParams): Promise<SignalingMessage>;
166
165
  requestAsr(request: boolean): Promise<SignalingMessage>;
166
+ private _buildUrl;
167
167
  protected _connect(connectionType: SignalingConnectionType, useWebTransport: boolean): void;
168
168
  protected _disconnect(code?: number): void;
169
169
  private _onOpen;
@@ -173,6 +173,7 @@ export default class Signaling extends BaseSignaling {
173
173
  protected _handleCachedMessages(): void;
174
174
  private _throwError;
175
175
  private _onError;
176
+ private _serializeErrorEvent;
176
177
  protected _onClose(event: CloseEvent): void;
177
178
  protected _closeSocket(error?: Error | null): void;
178
179
  protected _reconnect(): void;
@@ -50,6 +50,7 @@ declare enum SignalingNotification {
50
50
  ASR_STARTED = "asr-started",
51
51
  ASR_STOPPED = "asr-stopped",
52
52
  DECORATIVE_PARTICIPANT_ID_CHANGED = "decorative-participant-id-changed",
53
- VIDEO_SUSPEND_SUGGEST = "video-suspend-suggest"
53
+ VIDEO_SUSPEND_SUGGEST = "video-suspend-suggest",
54
+ HOLD = "hold"
54
55
  }
55
56
  export default SignalingNotification;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.8.11-dev.20d9452d.0",
3
+ "version": "2.8.11-dev.273c92c2.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",
@@ -0,0 +1,5 @@
1
+ import { TCapabilities } from '../types/Capabilities';
2
+ declare namespace Capabilities {
3
+ function get(): TCapabilities;
4
+ }
5
+ export default Capabilities;
package/static/Debug.d.ts CHANGED
@@ -8,10 +8,10 @@ export declare enum DebugMessageType {
8
8
  ERROR = "ERROR"
9
9
  }
10
10
  declare namespace Debug {
11
- let debug: Function;
12
- let log: Function;
13
- let warn: Function;
14
- let error: Function;
11
+ function debug(...args: any[]): void;
12
+ function log(...args: any[]): void;
13
+ function warn(...args: any[]): void;
14
+ function error(...args: any[]): void;
15
15
  function enabled(): boolean;
16
16
  function toggle(enable: boolean): void;
17
17
  function send(type: DebugMessageType, ...args: any[]): void;
@@ -35,7 +35,8 @@ export declare enum ParticipantStatus {
35
35
  RECONNECT = "RECONNECT",
36
36
  ERROR = "ERROR",
37
37
  HANGUP = "HANGUP",
38
- PERMISSIONS = "PERMISSIONS"
38
+ PERMISSIONS = "PERMISSIONS",
39
+ ONHOLD = "ONHOLD"
39
40
  }
40
41
  /**
41
42
  * Функции обратного вызова для передачи в параметрах инициализации
@@ -47,8 +48,9 @@ declare namespace External {
47
48
  *
48
49
  * @param stream
49
50
  * @param mediaSettings
51
+ * @param conversationId ID звонка
50
52
  */
51
- function onLocalStream(stream: MediaStream | null, mediaSettings: MediaSettings): void;
53
+ function onLocalStream(stream: MediaStream | null, mediaSettings: MediaSettings, conversationId?: string): void;
52
54
  /**
53
55
  * Локальный стрим с экрана добавлен/удалён
54
56
  *
@@ -80,16 +82,18 @@ declare namespace External {
80
82
  * Изменился статус локального соединения
81
83
  *
82
84
  * @param status
85
+ * @param conversationId ID звонка
83
86
  */
84
- function onLocalStatus(status: ParticipantStatus): void;
87
+ function onLocalStatus(status: ParticipantStatus, conversationId?: string): void;
85
88
  /**
86
89
  * Получен стрим собеседника.
87
90
  * Если сервер закончил стримить собеседника, вместо стрима будет передан null
88
91
  *
89
92
  * @param userId
90
93
  * @param stream
94
+ * @param conversationId ID звонка
91
95
  */
92
- function onRemoteStream(userId: ExternalParticipantId, stream: MediaStream | null): void;
96
+ function onRemoteStream(userId: ExternalParticipantId, stream: MediaStream | null, conversationId?: string): void;
93
97
  /**
94
98
  * Получен стрим лайв от собеседника.
95
99
  * Если сервер закончил стримить собеседника, вместо стрима будет передан null
@@ -126,8 +130,9 @@ declare namespace External {
126
130
  *
127
131
  * @param userId
128
132
  * @param stream
133
+ * @param conversationId ID звонка
129
134
  */
130
- function onRemoteScreenStream(userId: ExternalParticipantId, stream: MediaStream | null): void;
135
+ function onRemoteScreenStream(userId: ExternalParticipantId, stream: MediaStream | null, conversationId?: string): void;
131
136
  /**
132
137
  * Получен стрим вимоджи собеседника.
133
138
  * Если сервер закончил стримить собеседника, вместо стрима будет передан null
@@ -152,8 +157,9 @@ declare namespace External {
152
157
  * @param muteStates Состояние устройств при входе в звонок
153
158
  * @param participants Список участников звонка
154
159
  * @param rooms Список сессионных залов в звонке
160
+ * @param conversationId ID звонка
155
161
  */
156
- function onConversation(userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants: ExternalParticipant[], rooms?: Rooms): void;
162
+ function onConversation(userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants: ExternalParticipant[], rooms?: Rooms, conversationId?: string): void;
157
163
  /**
158
164
  * Постраничные данные про участников при начале звонка
159
165
  * @param chunk
@@ -219,15 +225,17 @@ declare namespace External {
219
225
  *
220
226
  * @param userId
221
227
  * @param markers
228
+ * @param conversationId ID звонка
222
229
  */
223
- function onParticipantAdded(userId: ExternalId, markers: ExternalParticipantListMarkers | null): void;
230
+ function onParticipantAdded(userId: ExternalId, markers: ExternalParticipantListMarkers | null, conversationId?: string): void;
224
231
  /**
225
232
  * Участник подключился
226
233
  *
227
234
  * @param userId
228
235
  * @param markers
236
+ * @param conversationId ID звонка
229
237
  */
230
- function onParticipantJoined(userId: ExternalId, markers: ExternalParticipantListMarkers | null): void;
238
+ function onParticipantJoined(userId: ExternalId, markers: ExternalParticipantListMarkers | null, conversationId?: string): void;
231
239
  function onLocalParticipantState(participantState: ParticipantStateMapped, global?: boolean): void;
232
240
  /**
233
241
  * Изменились данные состояний собеседника
@@ -250,8 +258,9 @@ declare namespace External {
250
258
  * @param userIds
251
259
  * @param status
252
260
  * @param data
261
+ * @param conversationId ID звонка
253
262
  */
254
- function onRemoteStatus(userIds: ExternalParticipantId[], status: ParticipantStatus, data?: any): void;
263
+ function onRemoteStatus(userIds: ExternalParticipantId[], status: ParticipantStatus, data?: any, conversationId?: string): void;
255
264
  /**
256
265
  * Разрешения на доступы были запрошены в браузере
257
266
  */
@@ -268,23 +277,26 @@ declare namespace External {
268
277
  *
269
278
  * @param userId
270
279
  * @param markers
280
+ * @param conversationId ID звонка
271
281
  */
272
- function onRemoteRemoved(userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null): void;
282
+ function onRemoteRemoved(userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null, conversationId?: string): void;
273
283
  /**
274
284
  * Изменилось состояние звонка
275
285
  *
276
286
  * @param isCallActive Активен ли сейчас звонок
277
287
  * @param canAddParticipants Можно ли добавлять собеседников
278
288
  * @param conversation Информация о звонке
289
+ * @param conversationId ID звонка
279
290
  */
280
- function onCallState(isCallActive: boolean, canAddParticipants: boolean, conversation: ConversationData): void;
291
+ function onCallState(isCallActive: boolean, canAddParticipants: boolean, conversation: ConversationData, conversationId?: string): void;
281
292
  /**
282
293
  * Изменилось состояние камеры или микрофона
283
294
  *
284
295
  * @param mediaOption Тип устройства
285
296
  * @param enabled Включено или выключено
297
+ * @param conversationId ID звонка
286
298
  */
287
- function onDeviceSwitched(mediaOption: MediaOption, enabled: boolean): void;
299
+ function onDeviceSwitched(mediaOption: MediaOption, enabled: boolean, conversationId?: string): void;
288
300
  /**
289
301
  * Изменились состояния устройств пользователя или разрешения включать камеру/микрофон
290
302
  *
@@ -339,21 +351,32 @@ declare namespace External {
339
351
  function onOptionsChanged(options: ConversationOption[]): void;
340
352
  /**
341
353
  * Входящий звонок был принят мной
354
+ *
355
+ * @param conversationId ID звонка
356
+ */
357
+ function onCallAccepted(conversationId?: string): void;
358
+ /**
359
+ * Установление определенного звонка как активного
360
+ *
361
+ * @param conversationId ID звонка
342
362
  */
343
- function onCallAccepted(): void;
363
+ function onCallActive(conversationId: string): void;
344
364
  /**
345
365
  * Исходящий звонок был принят кем-то
366
+ *
346
367
  * @param userId
347
368
  * @param capabilities
369
+ * @param conversationId ID звонка
348
370
  */
349
- function onAcceptedCall(userId: ExternalId, capabilities: ParticipantCapabilities): void;
371
+ function onAcceptedCall(userId: ExternalId, capabilities: ParticipantCapabilities, conversationId?: string): void;
350
372
  function onRateNeeded(): void;
351
373
  /**
352
374
  * Изменился говорящий в звонке
353
375
  *
354
376
  * @param userId
377
+ * @param conversationId ID звонка
355
378
  */
356
- function onSpeakerChanged(userId: ExternalParticipantId): void;
379
+ function onSpeakerChanged(userId: ExternalParticipantId, conversationId?: string): void;
357
380
  /**
358
381
  * Громкость собеседников
359
382
  *
@@ -343,7 +343,14 @@ export type ParamsObject = {
343
343
  * Включает поддержку режима WAIT_FOR_ADMIN в звонках.
344
344
  */
345
345
  waitForAdminInGroupCalls: boolean;
346
+ /**
347
+ * Включает поддержку удержания звонка
348
+ */
346
349
  hold: boolean;
350
+ /**
351
+ * Максимальное количество параллельных звонков
352
+ */
353
+ maxParallelCalls: number;
347
354
  /**
348
355
  * Индекс участника для первого chunk'а который придет при установке соединения с сервером
349
356
  *
@@ -490,7 +497,7 @@ export type ParamsObject = {
490
497
  /**
491
498
  * Получен локальный стрим с камеры/микрофона
492
499
  */
493
- onLocalStream?: (stream: MediaStream | null, mediaSettings: MediaSettings) => void;
500
+ onLocalStream?: (stream: MediaStream | null, mediaSettings: MediaSettings, conversationId?: string) => void;
494
501
  /**
495
502
  * Локальный стрим изменился
496
503
  */
@@ -510,12 +517,12 @@ export type ParamsObject = {
510
517
  /**
511
518
  * Изменился статус локального соединения
512
519
  */
513
- onLocalStatus?: (status: ParticipantStatus) => void;
520
+ onLocalStatus?: (status: ParticipantStatus, conversationId?: string) => void;
514
521
  /**
515
522
  * Получен стрим собеседника.
516
523
  * Если сервер закончил стримить собеседника, вместо стрима будет передан null
517
524
  */
518
- onRemoteStream?: (userId: ExternalParticipantId, stream: MediaStream | null) => void;
525
+ onRemoteStream?: (userId: ExternalParticipantId, stream: MediaStream | null, conversationId?: string) => void;
519
526
  /**
520
527
  * Cтрим собеседника приостановлен/возобновлен.
521
528
  */
@@ -524,7 +531,7 @@ export type ParamsObject = {
524
531
  * Получен стрим с экрана собеседника.
525
532
  * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
526
533
  */
527
- onRemoteScreenStream?: (userId: ExternalParticipantId, stream: MediaStream | null) => void;
534
+ onRemoteScreenStream?: (userId: ExternalParticipantId, stream: MediaStream | null, conversationId?: string) => void;
528
535
  /**
529
536
  * Получен стрим вимоджи собеседника.
530
537
  * Если сервер закончил стримить вимоджи собеседника, вместо стрима будет передан null
@@ -551,7 +558,7 @@ export type ParamsObject = {
551
558
  /**
552
559
  * Начат звонок
553
560
  */
554
- onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants: ExternalParticipant[], rooms?: Rooms) => void;
561
+ onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants: ExternalParticipant[], rooms?: Rooms, conversationId?: string) => void;
555
562
  /**
556
563
  * Начальный список участников для постраничного звонка
557
564
  */
@@ -583,11 +590,11 @@ export type ParamsObject = {
583
590
  /**
584
591
  * Добавили участника
585
592
  */
586
- onParticipantAdded?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null) => void;
593
+ onParticipantAdded?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null, conversationId?: string) => void;
587
594
  /**
588
595
  * Участник присоединился к звонку
589
596
  */
590
- onParticipantJoined?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers) => void;
597
+ onParticipantJoined?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers, conversationId?: string) => void;
591
598
  /**
592
599
  * Получены данные по изменению локальных состояний со стороны админа
593
600
  * Например, принудительно опущена рука
@@ -607,7 +614,7 @@ export type ParamsObject = {
607
614
  /**
608
615
  * Изменился статус соединения собеседников
609
616
  */
610
- onRemoteStatus?: (userIds: ExternalParticipantId[], status: ParticipantStatus, data: any) => void;
617
+ onRemoteStatus?: (userIds: ExternalParticipantId[], status: ParticipantStatus, data: any, conversationId?: string) => void;
611
618
  /**
612
619
  * Разрешения на доступы были запрошены в браузере
613
620
  */
@@ -619,15 +626,15 @@ export type ParamsObject = {
619
626
  /**
620
627
  * Пользователь отключился от звонка
621
628
  */
622
- onRemoteRemoved?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null) => void;
629
+ onRemoteRemoved?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null, conversationId?: string) => void;
623
630
  /**
624
631
  * Изменилось состояние звонка
625
632
  */
626
- onCallState?: (isCallActive: boolean, canAddParticipants: boolean, conversation: ConversationData) => void;
633
+ onCallState?: (isCallActive: boolean, canAddParticipants: boolean, conversation: ConversationData, conversationId?: string) => void;
627
634
  /**
628
635
  * Изменилось состояние камеры или микрофона
629
636
  */
630
- onDeviceSwitched?: (mediaOption: MediaOption, enabled: boolean) => void;
637
+ onDeviceSwitched?: (mediaOption: MediaOption, enabled: boolean, conversationId?: string) => void;
631
638
  /**
632
639
  * Изменились состояния устройств пользователя или разрешения включать камеру/микрофон
633
640
  */
@@ -656,7 +663,7 @@ export type ParamsObject = {
656
663
  /**
657
664
  * Изменился говорящий в звонке
658
665
  */
659
- onSpeakerChanged?: (userId: ExternalParticipantId) => void;
666
+ onSpeakerChanged?: (userId: ExternalParticipantId, conversationId?: string) => void;
660
667
  /**
661
668
  * Громкость собеседников
662
669
  */
@@ -676,12 +683,12 @@ export type ParamsObject = {
676
683
  /**
677
684
  * Входящий звонок был принят мной
678
685
  */
679
- onCallAccepted?: () => void;
686
+ onCallAccepted?: (conversationId?: string) => void;
680
687
  /**
681
688
  * Исходящий звонок был принят кем-то
682
689
  * @param userId
683
690
  */
684
- onAcceptedCall?: (userId: ExternalParticipantId, capabilities: ParticipantCapabilities) => void;
691
+ onAcceptedCall?: (userId: ExternalParticipantId, capabilities: ParticipantCapabilities, conversationId?: string) => void;
685
692
  /**
686
693
  * Список устройств изменился
687
694
  */
@@ -859,6 +866,12 @@ export type ParamsObject = {
859
866
  * @param demoted участник разжалован
860
867
  */
861
868
  onPromoted?: (demoted: boolean) => void;
869
+ /**
870
+ * Активным установлен определенный звонок
871
+ *
872
+ * @param conversationId ID звонка
873
+ */
874
+ onCallActive?: (conversationId: string) => void;
862
875
  /**
863
876
  * Собеседник подключился к сигналлингу
864
877
  */
@@ -971,6 +984,7 @@ export default abstract class Params {
971
984
  static get addParticipant(): boolean;
972
985
  static get waitForAdminInGroupCalls(): boolean;
973
986
  static get hold(): boolean;
987
+ static get maxParallelCalls(): number;
974
988
  static get participantListChunkInitIndex(): number;
975
989
  static get participantListChunkInitCount(): number | null;
976
990
  static get filterObservers(): boolean;
@@ -75,6 +75,7 @@ declare namespace WebRTCUtils {
75
75
  * Проверяет получены ли разрешения, необходимые для текущего звонка
76
76
  */
77
77
  function hasPermissions(needVideo?: boolean): boolean;
78
+ function releaseFirefoxMicrophonePermissionWarmup(): void;
78
79
  /**
79
80
  * Запрашивает камеру и микрофон пользователя
80
81
  *
@@ -0,0 +1,24 @@
1
+ export type TCapabilities = {
2
+ estimatedPerformanceIndex: number;
3
+ audioMix: boolean;
4
+ consumerUpdate: boolean;
5
+ producerNotificationDataChannelVersion: number;
6
+ producerCommandDataChannelVersion: number;
7
+ consumerScreenDataChannelVersion: number;
8
+ producerScreenDataChannelVersion: number;
9
+ asrDataChannelVersion: number;
10
+ animojiDataChannelVersion: number;
11
+ animojiBackendRender: boolean;
12
+ onDemandTracks: boolean;
13
+ unifiedPlan: boolean;
14
+ singleSession: boolean;
15
+ videoTracksCount: number;
16
+ red: boolean;
17
+ audioShare: boolean;
18
+ fastScreenShare: boolean;
19
+ videoSuspend: boolean;
20
+ simulcast: boolean;
21
+ consumerFastScreenShare: boolean;
22
+ consumerFastScreenShareQualityOnDemand: boolean;
23
+ transparentAudio: boolean;
24
+ };
@@ -41,10 +41,11 @@ export interface CallStatReport {
41
41
  remote_connection_type?: RTCIceCandidateType;
42
42
  }
43
43
  export interface ICallStatLog extends Pick<CallStatReport, 'call_topology' | 'nack_sent' | 'nack_received' | 'pli_sent' | 'pli_received' | 'fir_sent' | 'fir_received' | 'frames_dropped' | 'stat_time_delta'>, Pick<Partial<CallStatReport>, 'rtt' | 'jitter_video' | 'jitter_audio' | 'interframe_delay_variance' | 'freeze_count' | 'total_freezes_duration' | 'ss_freeze_count' | 'ss_total_freezes_duration' | 'inserted_audio_samples_for_deceleration' | 'removed_audio_samples_for_acceleration' | 'concealed_audio_samples' | 'total_audio_energy' | 'local_address' | 'local_connection_type' | 'network_type' | 'transport' | 'remote_address' | 'remote_connection_type'> {
44
+ is_simulcast?: boolean;
44
45
  concealed_silent_audio_samples?: number;
45
46
  concealment_audio_avg_size?: number;
46
47
  video_loss?: number;
47
48
  audio_loss?: number;
48
49
  cpu_hardware_concurrency?: number;
49
- [k: string]: string | number | undefined;
50
+ [k: string]: string | number | boolean | undefined;
50
51
  }
@@ -452,6 +452,10 @@ declare namespace SignalingMessage {
452
452
  export interface VideoSuspendSuggest extends Notification {
453
453
  bandwidth: number;
454
454
  }
455
+ export interface Hold extends Notification {
456
+ participantId: ParticipantId;
457
+ hold: boolean;
458
+ }
455
459
  export {};
456
460
  }
457
461
  export default SignalingMessage;
@@ -20,6 +20,7 @@ declare class WebTransportEventual {
20
20
  private readChunks;
21
21
  private readLoop;
22
22
  send(data: string): Promise<void>;
23
+ private createErrorEvent;
23
24
  close(code?: number, reason?: string): void;
24
25
  static isBrowserSupported(): boolean;
25
26
  }