@vkontakte/calls-sdk 2.8.11-dev.5500645b.0 → 2.8.11-dev.882b025a.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,20 @@
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
+ add(conversation: HoldableConversation): void;
10
+ remove(id: string | null): void;
11
+ get(id: string): HoldableConversation | undefined;
12
+ getActive(): HoldableConversation | null;
13
+ getActiveId(): string | null;
14
+ has(id: string): boolean;
15
+ getAll(): HoldableConversation[];
16
+ setActive(id: string): Promise<void>;
17
+ clear(): void;
18
+ }
19
+ declare const callRegistry: CallRegistry;
20
+ 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;
@@ -60,7 +58,6 @@ export default class Conversation extends EventEmitter {
60
58
  private _audioFix;
61
59
  private _streamByStreamId;
62
60
  private _streamIdByStreamDescription;
63
- private _participantIdByDebugStreamId;
64
61
  private _streamWaitTimerByStreamDescription;
65
62
  private _sequenceNumberByStreamDescription;
66
63
  private _cooldownTimestampByStreamDescription;
@@ -70,6 +67,10 @@ export default class Conversation extends EventEmitter {
70
67
  static current(): Conversation | null;
71
68
  static hangupAfterInit(): void;
72
69
  static id(): string | null;
70
+ get id(): string;
71
+ get externalId(): ExternalParticipantId | undefined;
72
+ get mediaSettings(): MediaSettings | undefined;
73
+ get isCallHeld(): boolean;
73
74
  onStart({ opponentIds, opponentType, mediaOptions, payload, joiningAllowed, requireAuthToJoin, onlyAdminCanShareMovie, externalIds, onFastStart, conversationId, }: ConversationOnStartParams): Promise<ConversationData>;
74
75
  onJoin(joinArgs: {
75
76
  conversationId?: string;
@@ -217,7 +218,6 @@ export default class Conversation extends EventEmitter {
217
218
  private _sendUpdateDisplayLayout;
218
219
  private _cleanupCooldownQueue;
219
220
  private _onParticipantSourcesUpdate;
220
- private _registerVideoStreamDebugParticipant;
221
221
  private _onParticipantPromoted;
222
222
  private _onChatRoomUpdated;
223
223
  private _onSharedMovieUpdate;
@@ -374,8 +374,6 @@ export default class Conversation extends EventEmitter {
374
374
  private _onAudioMixStall;
375
375
  private _onRemoteSignalledStall;
376
376
  private _onRemoteDataStats;
377
- private _onVideoStreamDebug;
378
- private _resolveVideoStreamDebugParticipantId;
379
377
  private _fixAudioDevice;
380
378
  private _fixVideoDevice;
381
379
  private _toggleJoinAvailability;
@@ -406,6 +404,8 @@ export default class Conversation extends EventEmitter {
406
404
  private _getParticipants;
407
405
  private _getParticipant;
408
406
  }
407
+ declare function _resetPendingInstance(): void;
408
+ export { _resetPendingInstance };
409
409
  export declare class UpdateDisplayLayoutError extends Error {
410
410
  readonly participantErrors: {
411
411
  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
13
  static logClientStats(params: Record<string, string | number | undefined | null>, immediately?: boolean): void;
15
14
  static logClientEvent(params: Record<string, string | number | 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
25
  logClientStats(data: Record<string, string | number | undefined | null>, immediately?: boolean): void;
29
26
  logClientEvent(data: Record<string, string | number | 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
  }
@@ -7,9 +7,6 @@ import BaseTransport from './BaseTransport';
7
7
  export default class DirectTransport extends BaseTransport {
8
8
  private readonly _participantId;
9
9
  private readonly _isMaster;
10
- private _hasOutboundVideoDebug;
11
- private _hasInboundVideoDebug;
12
- private _videoDebugBytes;
13
10
  private _remoteSDP;
14
11
  private _remoteCandidates;
15
12
  private _lastRemoteSDP;
@@ -70,8 +67,6 @@ export default class DirectTransport extends BaseTransport {
70
67
  private static _patchRemoteDescription;
71
68
  private _onReplacedTrack;
72
69
  private _startStatInterval;
73
- private _reportVideoStreamDebug;
74
- private _getVideoDebugBitrate;
75
70
  /**
76
71
  * Check SVC support
77
72
  * @see https://webrtc.internaut.com/mc/
@@ -5,9 +5,6 @@ import ServerSettings from '../../types/ServerSettings';
5
5
  import { MediaSource } from '../MediaSource';
6
6
  import BaseTransport from './BaseTransport';
7
7
  export default class ServerTransport extends BaseTransport {
8
- private _hasOutboundVideoDebug;
9
- private _inboundVideoDebugParticipants;
10
- private _videoDebugBytes;
11
8
  private _producerNotification;
12
9
  private _producerCommand;
13
10
  private _producerScreen;
@@ -39,7 +36,6 @@ export default class ServerTransport extends BaseTransport {
39
36
  private _participantIdRegistry;
40
37
  private _disabledSenders;
41
38
  private _rtpReceiversByStreamId;
42
- private _participantIdByVideoTrackId;
43
39
  private _producerSessionId;
44
40
  private _newAudioShareTrack;
45
41
  private _simulcastInfo;
@@ -78,10 +74,6 @@ export default class ServerTransport extends BaseTransport {
78
74
  private _stopSettingsInterval;
79
75
  private _collectStat;
80
76
  private _reportStats;
81
- private _reportVideoStreamDebug;
82
- private _getVideoDebugStreamId;
83
- private _getVideoDebugTrackId;
84
- private _getVideoDebugBitrate;
85
77
  private _detectStaleTracks;
86
78
  private _allocateConsumer;
87
79
  private _processOffer;
@@ -1,6 +1,5 @@
1
1
  import type { AnimojiSvgData, RGBTuple } from '@vkontakte/calls-vmoji';
2
2
  import BaseSignaling from '../../abstract/BaseSignaling';
3
- import { VideoStreamDebugDirection } from '../../static/DebugVideoStats';
4
3
  import { ParticipantId } from '../../types/Participant';
5
4
  import ServerSettings from '../../types/ServerSettings';
6
5
  import EventEmitter from '../EventEmitter';
@@ -22,8 +21,7 @@ export declare const enum TransportEvent {
22
21
  ASR_TRANSCRIPTION = "ASR_TRANSCRIPTION",
23
22
  ANIMOJI_STREAM = "ANIMOJI_STREAM",
24
23
  ANIMOJI_ERROR = "ANIMOJI_ERROR",
25
- SCREEN_SHARING_STAT = "SCREEN_SHARING_STAT",
26
- VIDEO_STREAM_DEBUG = "VIDEO_STREAM_DEBUG"
24
+ SCREEN_SHARING_STAT = "SCREEN_SHARING_STAT"
27
25
  }
28
26
  export declare const enum TransportState {
29
27
  IDLE = "IDLE",
@@ -38,18 +36,6 @@ export declare const enum TransportTopology {
38
36
  DIRECT = "DIRECT",
39
37
  SERVER = "SERVER"
40
38
  }
41
- export type VideoStreamDebugEvent = {
42
- direction: VideoStreamDebugDirection;
43
- streamId?: ParticipantId;
44
- trackId?: string;
45
- mimeType?: string;
46
- width?: number;
47
- height?: number;
48
- frameRate?: number;
49
- bitrate?: number;
50
- packetsLost?: number;
51
- clear?: boolean;
52
- };
53
39
  export declare class Transport extends EventEmitter {
54
40
  private readonly _signaling;
55
41
  private readonly _mediaSource;
@@ -99,7 +85,6 @@ export declare class Transport extends EventEmitter {
99
85
  private _onPeerConnectionClosed;
100
86
  private _onServerAudioMixStall;
101
87
  private _onRemoteDataStats;
102
- private _onVideoStreamDebug;
103
88
  private _onRemoteTrackAdded;
104
89
  private _onRemoteTrackRemoved;
105
90
  private _onAsrTranscription;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.8.11-dev.5500645b.0",
3
+ "version": "2.8.11-dev.882b025a.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;
@@ -47,8 +47,9 @@ declare namespace External {
47
47
  *
48
48
  * @param stream
49
49
  * @param mediaSettings
50
+ * @param conversationId ID звонка
50
51
  */
51
- function onLocalStream(stream: MediaStream | null, mediaSettings: MediaSettings): void;
52
+ function onLocalStream(stream: MediaStream | null, mediaSettings: MediaSettings, conversationId?: string): void;
52
53
  /**
53
54
  * Локальный стрим с экрана добавлен/удалён
54
55
  *
@@ -80,16 +81,18 @@ declare namespace External {
80
81
  * Изменился статус локального соединения
81
82
  *
82
83
  * @param status
84
+ * @param conversationId ID звонка
83
85
  */
84
- function onLocalStatus(status: ParticipantStatus): void;
86
+ function onLocalStatus(status: ParticipantStatus, conversationId?: string): void;
85
87
  /**
86
88
  * Получен стрим собеседника.
87
89
  * Если сервер закончил стримить собеседника, вместо стрима будет передан null
88
90
  *
89
91
  * @param userId
90
92
  * @param stream
93
+ * @param conversationId ID звонка
91
94
  */
92
- function onRemoteStream(userId: ExternalParticipantId, stream: MediaStream | null): void;
95
+ function onRemoteStream(userId: ExternalParticipantId, stream: MediaStream | null, conversationId?: string): void;
93
96
  /**
94
97
  * Получен стрим лайв от собеседника.
95
98
  * Если сервер закончил стримить собеседника, вместо стрима будет передан null
@@ -126,8 +129,9 @@ declare namespace External {
126
129
  *
127
130
  * @param userId
128
131
  * @param stream
132
+ * @param conversationId ID звонка
129
133
  */
130
- function onRemoteScreenStream(userId: ExternalParticipantId, stream: MediaStream | null): void;
134
+ function onRemoteScreenStream(userId: ExternalParticipantId, stream: MediaStream | null, conversationId?: string): void;
131
135
  /**
132
136
  * Получен стрим вимоджи собеседника.
133
137
  * Если сервер закончил стримить собеседника, вместо стрима будет передан null
@@ -152,8 +156,9 @@ declare namespace External {
152
156
  * @param muteStates Состояние устройств при входе в звонок
153
157
  * @param participants Список участников звонка
154
158
  * @param rooms Список сессионных залов в звонке
159
+ * @param conversationId ID звонка
155
160
  */
156
- function onConversation(userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants: ExternalParticipant[], rooms?: Rooms): void;
161
+ function onConversation(userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants: ExternalParticipant[], rooms?: Rooms, conversationId?: string): void;
157
162
  /**
158
163
  * Постраничные данные про участников при начале звонка
159
164
  * @param chunk
@@ -219,15 +224,17 @@ declare namespace External {
219
224
  *
220
225
  * @param userId
221
226
  * @param markers
227
+ * @param conversationId ID звонка
222
228
  */
223
- function onParticipantAdded(userId: ExternalId, markers: ExternalParticipantListMarkers | null): void;
229
+ function onParticipantAdded(userId: ExternalId, markers: ExternalParticipantListMarkers | null, conversationId?: string): void;
224
230
  /**
225
231
  * Участник подключился
226
232
  *
227
233
  * @param userId
228
234
  * @param markers
235
+ * @param conversationId ID звонка
229
236
  */
230
- function onParticipantJoined(userId: ExternalId, markers: ExternalParticipantListMarkers | null): void;
237
+ function onParticipantJoined(userId: ExternalId, markers: ExternalParticipantListMarkers | null, conversationId?: string): void;
231
238
  function onLocalParticipantState(participantState: ParticipantStateMapped, global?: boolean): void;
232
239
  /**
233
240
  * Изменились данные состояний собеседника
@@ -250,8 +257,9 @@ declare namespace External {
250
257
  * @param userIds
251
258
  * @param status
252
259
  * @param data
260
+ * @param conversationId ID звонка
253
261
  */
254
- function onRemoteStatus(userIds: ExternalParticipantId[], status: ParticipantStatus, data?: any): void;
262
+ function onRemoteStatus(userIds: ExternalParticipantId[], status: ParticipantStatus, data?: any, conversationId?: string): void;
255
263
  /**
256
264
  * Разрешения на доступы были запрошены в браузере
257
265
  */
@@ -268,23 +276,26 @@ declare namespace External {
268
276
  *
269
277
  * @param userId
270
278
  * @param markers
279
+ * @param conversationId ID звонка
271
280
  */
272
- function onRemoteRemoved(userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null): void;
281
+ function onRemoteRemoved(userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null, conversationId?: string): void;
273
282
  /**
274
283
  * Изменилось состояние звонка
275
284
  *
276
285
  * @param isCallActive Активен ли сейчас звонок
277
286
  * @param canAddParticipants Можно ли добавлять собеседников
278
287
  * @param conversation Информация о звонке
288
+ * @param conversationId ID звонка
279
289
  */
280
- function onCallState(isCallActive: boolean, canAddParticipants: boolean, conversation: ConversationData): void;
290
+ function onCallState(isCallActive: boolean, canAddParticipants: boolean, conversation: ConversationData, conversationId?: string): void;
281
291
  /**
282
292
  * Изменилось состояние камеры или микрофона
283
293
  *
284
294
  * @param mediaOption Тип устройства
285
295
  * @param enabled Включено или выключено
296
+ * @param conversationId ID звонка
286
297
  */
287
- function onDeviceSwitched(mediaOption: MediaOption, enabled: boolean): void;
298
+ function onDeviceSwitched(mediaOption: MediaOption, enabled: boolean, conversationId?: string): void;
288
299
  /**
289
300
  * Изменились состояния устройств пользователя или разрешения включать камеру/микрофон
290
301
  *
@@ -339,21 +350,34 @@ declare namespace External {
339
350
  function onOptionsChanged(options: ConversationOption[]): void;
340
351
  /**
341
352
  * Входящий звонок был принят мной
353
+ *
354
+ * @param conversationId ID звонка
355
+ */
356
+ function onCallAccepted(conversationId?: string): void;
357
+ /**
358
+ * Входящий звонок получен во время активного звонка
359
+ *
360
+ * @param conversationId ID звонка
361
+ * @param externalId
362
+ * @param mediaSettings
342
363
  */
343
- function onCallAccepted(): void;
364
+ function onIncomingCall(conversationId: string, externalId: ExternalParticipantId | undefined, mediaSettings: MediaSettings | undefined): void;
344
365
  /**
345
366
  * Исходящий звонок был принят кем-то
367
+ *
346
368
  * @param userId
347
369
  * @param capabilities
370
+ * @param conversationId ID звонка
348
371
  */
349
- function onAcceptedCall(userId: ExternalId, capabilities: ParticipantCapabilities): void;
372
+ function onAcceptedCall(userId: ExternalId, capabilities: ParticipantCapabilities, conversationId?: string): void;
350
373
  function onRateNeeded(): void;
351
374
  /**
352
375
  * Изменился говорящий в звонке
353
376
  *
354
377
  * @param userId
378
+ * @param conversationId ID звонка
355
379
  */
356
- function onSpeakerChanged(userId: ExternalParticipantId): void;
380
+ function onSpeakerChanged(userId: ExternalParticipantId, conversationId?: string): void;
357
381
  /**
358
382
  * Громкость собеседников
359
383
  *
@@ -563,9 +587,5 @@ declare namespace External {
563
587
  * Собеседник подключился к сигналлингу
564
588
  */
565
589
  function onPeerRegistered(): void;
566
- /**
567
- * Дебаг информация по видеопотоку, отформатированная SDK для отображения в клиенте.
568
- */
569
- function onVideoStreamDebug(externalParticipantId: ExternalParticipantId, debug: string): void;
570
590
  }
571
591
  export default External;
@@ -104,13 +104,6 @@ export type ParamsObject = {
104
104
  debugLog: boolean;
105
105
  /** @hidden */
106
106
  debug: boolean;
107
- /**
108
- * Вкчлючает отправку на клиент статы по входящим/исходящим видео-потокам
109
- * @hidden
110
- *
111
- * _По умолчанию: `false`_
112
- */
113
- debugVideoStreams: boolean;
114
107
  /**
115
108
  * Выставляет таймаут в ms для fetch запросов от sdk
116
109
  * По умолчанию 5000 ms
@@ -497,7 +490,7 @@ export type ParamsObject = {
497
490
  /**
498
491
  * Получен локальный стрим с камеры/микрофона
499
492
  */
500
- onLocalStream?: (stream: MediaStream | null, mediaSettings: MediaSettings) => void;
493
+ onLocalStream?: (stream: MediaStream | null, mediaSettings: MediaSettings, conversationId?: string) => void;
501
494
  /**
502
495
  * Локальный стрим изменился
503
496
  */
@@ -517,12 +510,12 @@ export type ParamsObject = {
517
510
  /**
518
511
  * Изменился статус локального соединения
519
512
  */
520
- onLocalStatus?: (status: ParticipantStatus) => void;
513
+ onLocalStatus?: (status: ParticipantStatus, conversationId?: string) => void;
521
514
  /**
522
515
  * Получен стрим собеседника.
523
516
  * Если сервер закончил стримить собеседника, вместо стрима будет передан null
524
517
  */
525
- onRemoteStream?: (userId: ExternalParticipantId, stream: MediaStream | null) => void;
518
+ onRemoteStream?: (userId: ExternalParticipantId, stream: MediaStream | null, conversationId?: string) => void;
526
519
  /**
527
520
  * Cтрим собеседника приостановлен/возобновлен.
528
521
  */
@@ -531,7 +524,7 @@ export type ParamsObject = {
531
524
  * Получен стрим с экрана собеседника.
532
525
  * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
533
526
  */
534
- onRemoteScreenStream?: (userId: ExternalParticipantId, stream: MediaStream | null) => void;
527
+ onRemoteScreenStream?: (userId: ExternalParticipantId, stream: MediaStream | null, conversationId?: string) => void;
535
528
  /**
536
529
  * Получен стрим вимоджи собеседника.
537
530
  * Если сервер закончил стримить вимоджи собеседника, вместо стрима будет передан null
@@ -558,7 +551,7 @@ export type ParamsObject = {
558
551
  /**
559
552
  * Начат звонок
560
553
  */
561
- onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants: ExternalParticipant[], rooms?: Rooms) => void;
554
+ onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants: ExternalParticipant[], rooms?: Rooms, conversationId?: string) => void;
562
555
  /**
563
556
  * Начальный список участников для постраничного звонка
564
557
  */
@@ -590,11 +583,11 @@ export type ParamsObject = {
590
583
  /**
591
584
  * Добавили участника
592
585
  */
593
- onParticipantAdded?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null) => void;
586
+ onParticipantAdded?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null, conversationId?: string) => void;
594
587
  /**
595
588
  * Участник присоединился к звонку
596
589
  */
597
- onParticipantJoined?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers) => void;
590
+ onParticipantJoined?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers, conversationId?: string) => void;
598
591
  /**
599
592
  * Получены данные по изменению локальных состояний со стороны админа
600
593
  * Например, принудительно опущена рука
@@ -614,7 +607,7 @@ export type ParamsObject = {
614
607
  /**
615
608
  * Изменился статус соединения собеседников
616
609
  */
617
- onRemoteStatus?: (userIds: ExternalParticipantId[], status: ParticipantStatus, data: any) => void;
610
+ onRemoteStatus?: (userIds: ExternalParticipantId[], status: ParticipantStatus, data: any, conversationId?: string) => void;
618
611
  /**
619
612
  * Разрешения на доступы были запрошены в браузере
620
613
  */
@@ -626,15 +619,15 @@ export type ParamsObject = {
626
619
  /**
627
620
  * Пользователь отключился от звонка
628
621
  */
629
- onRemoteRemoved?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null) => void;
622
+ onRemoteRemoved?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null, conversationId?: string) => void;
630
623
  /**
631
624
  * Изменилось состояние звонка
632
625
  */
633
- onCallState?: (isCallActive: boolean, canAddParticipants: boolean, conversation: ConversationData) => void;
626
+ onCallState?: (isCallActive: boolean, canAddParticipants: boolean, conversation: ConversationData, conversationId?: string) => void;
634
627
  /**
635
628
  * Изменилось состояние камеры или микрофона
636
629
  */
637
- onDeviceSwitched?: (mediaOption: MediaOption, enabled: boolean) => void;
630
+ onDeviceSwitched?: (mediaOption: MediaOption, enabled: boolean, conversationId?: string) => void;
638
631
  /**
639
632
  * Изменились состояния устройств пользователя или разрешения включать камеру/микрофон
640
633
  */
@@ -663,7 +656,7 @@ export type ParamsObject = {
663
656
  /**
664
657
  * Изменился говорящий в звонке
665
658
  */
666
- onSpeakerChanged?: (userId: ExternalParticipantId) => void;
659
+ onSpeakerChanged?: (userId: ExternalParticipantId, conversationId?: string) => void;
667
660
  /**
668
661
  * Громкость собеседников
669
662
  */
@@ -683,12 +676,12 @@ export type ParamsObject = {
683
676
  /**
684
677
  * Входящий звонок был принят мной
685
678
  */
686
- onCallAccepted?: () => void;
679
+ onCallAccepted?: (conversationId?: string) => void;
687
680
  /**
688
681
  * Исходящий звонок был принят кем-то
689
682
  * @param userId
690
683
  */
691
- onAcceptedCall?: (userId: ExternalParticipantId, capabilities: ParticipantCapabilities) => void;
684
+ onAcceptedCall?: (userId: ExternalParticipantId, capabilities: ParticipantCapabilities, conversationId?: string) => void;
692
685
  /**
693
686
  * Список устройств изменился
694
687
  */
@@ -867,18 +860,17 @@ export type ParamsObject = {
867
860
  */
868
861
  onPromoted?: (demoted: boolean) => void;
869
862
  /**
870
- * Собеседник подключился к сигналлингу
863
+ * Входящий звонок получен во время активного звонка
864
+ *
865
+ * @param conversationId ID звонка
866
+ * @param externalId Внешний ID вызывающего
867
+ * @param mediaSettings Настройки медиа
871
868
  */
872
- onPeerRegistered?: () => void;
869
+ onIncomingCall?: (conversationId: string, externalId: ExternalParticipantId | undefined, mediaSettings: MediaSettings | undefined) => void;
873
870
  /**
874
- * Дебаг информация по видеопотоку, отформатированная SDK для отображения в клиенте.
875
- *
876
- * Работает только если включен `debugVideoStreams`.
877
- *
878
- * @param externalParticipantId Id участника, к которому относится видеопоток
879
- * @param debug Отформатированный текст для отображения
871
+ * Собеседник подключился к сигналлингу
880
872
  */
881
- onVideoStreamDebug?: (externalParticipantId: ExternalParticipantId, debug: string) => void;
873
+ onPeerRegistered?: () => void;
882
874
  };
883
875
  export default abstract class Params {
884
876
  private static _params;
@@ -930,7 +922,6 @@ export default abstract class Params {
930
922
  static get waitMessageDelay(): number;
931
923
  static get waitAnotherTabDelay(): number;
932
924
  static get debugLog(): boolean;
933
- static get debugVideoStreams(): false | ((externalParticipantId: ExternalParticipantId, debug: string) => void) | undefined;
934
925
  static get forceRelayPolicy(): boolean;
935
926
  static set forceRelayPolicy(value: boolean);
936
927
  static get videoMinWidth(): number;
@@ -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
+ };
@@ -113,10 +113,6 @@ export interface StatRtp extends StatRtpOutboundVideo {
113
113
  * Идентификатор пользователя, связанный с этим потоком
114
114
  */
115
115
  userId?: string;
116
- /**
117
- * Идентификатор media track, связанный с этим RTP потоком
118
- */
119
- trackId?: string;
120
116
  /**
121
117
  * Пропускная способность в битах в секунду
122
118
  */