@vkontakte/calls-sdk 2.8.11-dev.fa0dcb9d.0 → 2.8.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/CallsSDK.d.ts +46 -23
  2. package/abstract/BaseApi.d.ts +5 -8
  3. package/abstract/BaseSignaling.d.ts +2 -3
  4. package/calls-sdk.cjs.js +9 -9
  5. package/calls-sdk.esm.js +6038 -5138
  6. package/classes/AudioFix.d.ts +5 -1
  7. package/classes/AudioOutput.d.ts +5 -1
  8. package/classes/CallRegistry.d.ts +5 -1
  9. package/classes/Conversation.d.ts +35 -7
  10. package/classes/ConversationResponseValidator.d.ts +3 -0
  11. package/classes/DebugInfo.d.ts +3 -0
  12. package/classes/DisplayLayoutRequester.d.ts +39 -0
  13. package/classes/ExternalIdCache.d.ts +19 -0
  14. package/classes/MediaSource.d.ts +6 -2
  15. package/classes/ParticipantIdRegistry.d.ts +3 -0
  16. package/classes/ProducerCommandSerializationService.d.ts +3 -0
  17. package/classes/SignalingActor.d.ts +3 -1
  18. package/classes/SpeakerDetector.d.ts +2 -1
  19. package/classes/SpecListener.d.ts +10 -1
  20. package/classes/{Logger.d.ts → StatsLogger.d.ts} +3 -13
  21. package/classes/VideoEffectsFpsLimiter.d.ts +3 -0
  22. package/classes/asr/AsrReceiver.d.ts +3 -1
  23. package/classes/codec/LibVPxDecoder.d.ts +3 -0
  24. package/classes/codec/LibVPxEncoder.d.ts +3 -1
  25. package/classes/codec/WebCodecsDecoder.d.ts +3 -0
  26. package/classes/codec/WebCodecsEncoder.d.ts +3 -1
  27. package/classes/codec/WorkerBase.d.ts +7 -0
  28. package/classes/screenshare/BaseStreamBuilder.d.ts +4 -1
  29. package/classes/screenshare/CanvasRenderer.d.ts +3 -1
  30. package/classes/screenshare/ScreenCaptureReceiver.d.ts +7 -1
  31. package/classes/screenshare/ScreenCaptureSender.d.ts +5 -1
  32. package/classes/screenshare/ScreenCongestionControl.d.ts +3 -1
  33. package/classes/screenshare/StreamBuilder.d.ts +5 -1
  34. package/classes/screenshare/TrackGeneratorRenderer.d.ts +3 -1
  35. package/classes/screenshare/WebmBuilder.d.ts +3 -1
  36. package/classes/stat/CodecStatsAggregator.d.ts +7 -7
  37. package/classes/stat/ConversationStats.d.ts +21 -0
  38. package/classes/stat/StatAggregator.d.ts +6 -6
  39. package/classes/stat/StatFirstMediaReceived.d.ts +6 -2
  40. package/classes/stat/StatPings.d.ts +9 -9
  41. package/classes/stat/StatScreenShareFirstFrame.d.ts +3 -1
  42. package/classes/stat/StatSignalingCommands.d.ts +8 -8
  43. package/classes/transport/BaseTransport.d.ts +1 -1
  44. package/classes/transport/DirectStatReporter.d.ts +3 -1
  45. package/classes/transport/DirectTransport.d.ts +14 -1
  46. package/classes/transport/PerfStatReporter.d.ts +5 -1
  47. package/classes/transport/ServerTransport.d.ts +10 -2
  48. package/classes/transport/Transport.d.ts +13 -14
  49. package/default/Api.d.ts +12 -19
  50. package/default/Signaling.d.ts +41 -45
  51. package/default/SignalingTransport.d.ts +68 -0
  52. package/enums/HangupType.d.ts +2 -1
  53. package/enums/SignalingNotification.d.ts +1 -0
  54. package/enums/TransportState.d.ts +10 -0
  55. package/enums/TransportTopology.d.ts +5 -0
  56. package/package.json +1 -1
  57. package/static/Debug.d.ts +27 -8
  58. package/static/External.d.ts +3 -0
  59. package/static/Params.d.ts +32 -8
  60. package/static/ParticipantConnectionStatusUtils.d.ts +16 -0
  61. package/static/Utils.d.ts +3 -2
  62. package/static/WebRTCUtils.d.ts +6 -4
  63. package/types/Conversation.d.ts +1 -1
  64. package/types/ExternalId.d.ts +1 -1
  65. package/types/FastStart.d.ts +1 -0
  66. package/types/Participant.d.ts +12 -1
  67. package/types/ParticipantLayout.d.ts +33 -0
  68. package/types/PushData.d.ts +3 -0
  69. package/types/SignalingMessage.d.ts +12 -2
  70. package/types/Statistics.d.ts +1 -1
  71. package/types/WebTransport.d.ts +4 -0
  72. package/utils/DebugStorage.d.ts +100 -1
  73. package/classes/stat/EventMetricsService.d.ts +0 -9
  74. package/static/ConversationDebugLogger.d.ts +0 -13
@@ -1,3 +1,5 @@
1
+ import { type DebugLogger } from '../static/Debug';
2
+ import StatsLogger from './StatsLogger';
1
3
  import { MediaSource } from './MediaSource';
2
4
  export default class AudioFix {
3
5
  private _fixNoPacketsApplied;
@@ -7,11 +9,13 @@ export default class AudioFix {
7
9
  private _fixTooManyPacketsFailed;
8
10
  private _fixTooManyPacketsTime;
9
11
  private _mediaSource;
12
+ private readonly _debug;
13
+ private readonly _logger;
10
14
  private _lastPacketsSent;
11
15
  private _lastPacketsSentTime;
12
16
  private _toggleAudioPromise;
13
17
  private _fixNoPacketsAppliedVideo;
14
- constructor(mediaSource: MediaSource);
18
+ constructor(mediaSource: MediaSource, debug?: DebugLogger, logger?: StatsLogger | null);
15
19
  private _fixAudioDeviceNoPackets;
16
20
  private _fixAudioDeviceTooManyPackets;
17
21
  fix(rtps: any[]): void;
@@ -1,4 +1,6 @@
1
+ import { type DebugLogger } from '../static/Debug';
1
2
  import { ParticipantId } from '../types/Participant';
3
+ import StatsLogger from './StatsLogger';
2
4
  import { StatFirstMediaReceived } from './stat/StatFirstMediaReceived';
3
5
  /**
4
6
  * Единый AudioOutput поддерживающий p2p, audioMix и transparent-audio
@@ -10,7 +12,9 @@ export default class AudioOutput {
10
12
  private _volume;
11
13
  private readonly _features;
12
14
  private readonly _statFirstMediaReceived;
13
- constructor(statFirstMediaReceived: StatFirstMediaReceived, allowMultipleTracks?: boolean);
15
+ protected readonly _debug: DebugLogger;
16
+ private readonly _logger;
17
+ constructor(statFirstMediaReceived: StatFirstMediaReceived, allowMultipleTracks?: boolean, debug?: DebugLogger, logger?: StatsLogger | null);
14
18
  add(participantId: ParticipantId, track: MediaStreamTrack): void;
15
19
  remove(participantId: ParticipantId, track: MediaStreamTrack): void;
16
20
  get volume(): number;
@@ -1,7 +1,8 @@
1
1
  import Conversation from './Conversation';
2
+ import MediaSettings from '../types/MediaSettings';
2
3
  export interface HoldableConversation extends Conversation {
3
4
  id: string;
4
- hold(hold: boolean): Promise<void>;
5
+ hold(hold: boolean, lastActiveMediaSettings?: MediaSettings): Promise<void>;
5
6
  }
6
7
  export declare class CallRegistry {
7
8
  private _conversations;
@@ -11,11 +12,14 @@ export declare class CallRegistry {
11
12
  remove(id: string | null): void;
12
13
  get(id: string): HoldableConversation | undefined;
13
14
  getActive(): HoldableConversation | null;
15
+ getFirst(): HoldableConversation | null;
14
16
  getActiveId(): string | null;
15
17
  has(id: string): boolean;
16
18
  getAll(): HoldableConversation[];
17
19
  get callsLength(): number;
18
20
  setActive(id: string): Promise<void>;
21
+ setHold(id: string): Promise<void>;
22
+ switchCall(id: string): Promise<void>;
19
23
  clear(): void;
20
24
  }
21
25
  declare const callRegistry: CallRegistry;
@@ -20,7 +20,7 @@ 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';
23
- import { ParticipantLayout } from '../types/ParticipantLayout';
23
+ import { DisplayLayoutRequest, ParticipantLayout } from '../types/ParticipantLayout';
24
24
  import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
25
25
  import ParticipantPriority from '../types/ParticipantPriority';
26
26
  import { ParticipantStreamDescription } from '../types/ParticipantStreamDescription';
@@ -32,16 +32,21 @@ export default class Conversation extends EventEmitter {
32
32
  private readonly _api;
33
33
  private readonly _signaling;
34
34
  private readonly _signalingActor;
35
+ private readonly _displayLayoutRequester;
35
36
  private _mediaSource;
36
37
  private _conversation;
37
38
  private _myLastRequestedLayouts;
38
39
  private _state;
39
40
  private _previousState;
41
+ /** Если пользователь в зале ожидания, холд должен вызываться после промоута */
42
+ private _waitingHallHoldPending;
40
43
  private _participantState;
41
44
  private _participants;
42
45
  private _pendingParticipants;
46
+ private _directTransportIsMaster?;
43
47
  private _transport;
44
48
  private _debugInfo;
49
+ private readonly _debug;
45
50
  private _volumesDetector;
46
51
  private _speakerDetector;
47
52
  private _localVolumeDetector;
@@ -55,6 +60,7 @@ export default class Conversation extends EventEmitter {
55
60
  private _abortController;
56
61
  private readonly _onUnload;
57
62
  private readonly _audioOutput;
63
+ private readonly _stats;
58
64
  private _lastStalled;
59
65
  private _audioMixStalled;
60
66
  private _audioFix;
@@ -73,7 +79,9 @@ export default class Conversation extends EventEmitter {
73
79
  get externalId(): ExternalParticipantId | undefined;
74
80
  get mediaSettings(): MediaSettings | undefined;
75
81
  get isCallHeld(): boolean;
82
+ static debugSessionId(): string | null;
76
83
  static getSyncedTime(): number;
84
+ get debugSessionId(): string | null;
77
85
  onStart({ opponentIds, opponentType, mediaOptions, payload, joiningAllowed, requireAuthToJoin, onlyAdminCanShareMovie, externalIds, onFastStart, conversationId, }: ConversationOnStartParams): Promise<ConversationData>;
78
86
  onJoin(joinArgs: {
79
87
  conversationId?: string;
@@ -106,11 +114,12 @@ export default class Conversation extends EventEmitter {
106
114
  setVolume(volume: number): void;
107
115
  updateStatisticsInterval(): void;
108
116
  private _openTransport;
117
+ private _allocateParticipantTransport;
109
118
  private _close;
110
119
  destroy(): Promise<void>;
111
120
  private _getConversationParams;
112
121
  private _setConversationParams;
113
- private _addGeoParamsToEndpoint;
122
+ private _buildSignalingEndpoint;
114
123
  /**
115
124
  * @throws ErrorEvent
116
125
  */
@@ -125,6 +134,7 @@ export default class Conversation extends EventEmitter {
125
134
  private _prepareConversation;
126
135
  private _createParticipant;
127
136
  private _getParticipantId;
137
+ private _cacheParticipantExternalIds;
128
138
  private _setConversation;
129
139
  private _updateConversation;
130
140
  private _createMediaSource;
@@ -137,10 +147,16 @@ export default class Conversation extends EventEmitter {
137
147
  private _registerParticipants;
138
148
  /** Установим состояние локальных мьютов */
139
149
  private _registerParticipantLocalMuteState;
140
- private _getStatusByTransportState;
150
+ private _remoteParticipantSessionState;
151
+ private _buildConnectionStatus;
152
+ private _isParticipantSessionStateApplicable;
153
+ private _setTransportStatus;
154
+ private _setSessionState;
155
+ private _emitParticipantTransition;
141
156
  private _registerParticipantInCache;
142
157
  private _getExistedParticipantByIdOrCreate;
143
158
  private _getExternalIdByParticipantId;
159
+ private _getExternalIdsByOkIdsFromCache;
144
160
  private _registerParticipantAndSetMarkersIfChunkEnabled;
145
161
  private _warnParticipantNotInConversation;
146
162
  private _denormalizeMarkers;
@@ -177,6 +193,7 @@ export default class Conversation extends EventEmitter {
177
193
  private _cleanupParticipants;
178
194
  private _cleanupParticipantAgnosticStreams;
179
195
  private _cleanupTransport;
196
+ private _cleanupTransportForHold;
180
197
  private _cleanupSpeakerDetector;
181
198
  private _cleanupSpecListener;
182
199
  private _cleanupSignaling;
@@ -204,14 +221,18 @@ export default class Conversation extends EventEmitter {
204
221
  */
205
222
  changePriorities(priorities: ParticipantPriority[]): Promise<void>;
206
223
  changeParticipantState(state: ParticipantStateData, compositeUserId?: CompositeUserId): Promise<void>;
207
- hold(hold: boolean): Promise<void>;
224
+ hold(hold: boolean, lastActiveMediaSettings?: MediaSettings): Promise<void>;
225
+ private _holdLocally;
226
+ private _resumeLocalMedia;
227
+ private _restoreStateAfterHold;
228
+ private _isWaitingForPromotion;
229
+ private _getWaitingForPromotionStatus;
208
230
  putHandsDown(): Promise<void>;
209
231
  requestKeyFrame(participantStreamDescription: ParticipantStreamDescription): Promise<void | SignalingMessage>;
210
232
  requestTestMode(consumerCommand: string, producerCommand: string): Promise<void>;
211
233
  updateDisplayLayout(layouts: ParticipantLayout[]): Promise<void>;
234
+ requestDisplayLayout(requests: DisplayLayoutRequest[]): Promise<void>;
212
235
  feedback(key: string): Promise<SignalingMessage>;
213
- userFeedbackStats(userResponse: number, reason?: string, groupCallUsersCount?: number): void;
214
- sendClientEvent(eventType: string, eventData?: Record<string, string | number | boolean>, immediately?: boolean): void;
215
236
  private _changeMediaSettings;
216
237
  private _stopStreaming;
217
238
  /**
@@ -284,7 +305,6 @@ export default class Conversation extends EventEmitter {
284
305
  startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null, roomId?: number | null): Promise<undefined>;
285
306
  stopStream(roomId?: number | null, remove?: boolean): Promise<undefined>;
286
307
  publishStream(roomId?: number | null): Promise<undefined>;
287
- recordSetConf(king?: ParticipantId, pawns?: ParticipantId[], hideParticipantCount?: boolean, roomId?: number | null): Promise<void>;
288
308
  getStreamInfo(): Promise<{
289
309
  movieId: any;
290
310
  preview: any;
@@ -308,11 +328,17 @@ export default class Conversation extends EventEmitter {
308
328
  private _changeMultipleParticipantState;
309
329
  private _invokeRolesChangedCallbackIfNeeded;
310
330
  private _onSignalingNotification;
331
+ private _onSignalingTopologyChanged;
311
332
  private _onPromotionApproved;
312
333
  private _onSignalingReconnect;
313
334
  private _onSignalingFailed;
314
335
  private _onAcceptedCall;
315
336
  private _onHungup;
337
+ private _onSessionState;
338
+ private _reconcileParticipantSessionStates;
339
+ private _updateParticipantExternalId;
340
+ private _updateParticipantSessionState;
341
+ private _emitParticipantEffectiveStatusIfSessionOverridesTransport;
316
342
  private _onAddedParticipant;
317
343
  private _onJoinedParticipant;
318
344
  private _onClosedConversation;
@@ -349,6 +375,7 @@ export default class Conversation extends EventEmitter {
349
375
  private _onPinParticipant;
350
376
  private _onOptionsChanged;
351
377
  private _onNetworkStatus;
378
+ private _emitHeldParticipantsStatus;
352
379
  private _onRemoteStreamSecond;
353
380
  /**
354
381
  * Коллбек, вызывающийся при получении/остановке стрима от AnimojiReceiver
@@ -369,6 +396,7 @@ export default class Conversation extends EventEmitter {
369
396
  private _onSpeakerChanged;
370
397
  private _onTransportStateChanged;
371
398
  private _onTransportLocalStateChanged;
399
+ private _areTransportParticipantsOnHold;
372
400
  private _onRemoteTrackAdded;
373
401
  private _onRemoteTrackRemoved;
374
402
  private _removeAudioTrack;
@@ -0,0 +1,3 @@
1
+ import ConversationResponse from '../types/ConversationResponse';
2
+ export type ConversationResponseSource = 'startConversation' | 'joinConversation' | 'joinConversationByLink' | 'fastStart' | 'fastJoin';
3
+ export declare function assertValidConversationResponse(response: ConversationResponse | null | undefined, source: ConversationResponseSource): void;
@@ -1,8 +1,11 @@
1
+ import { type DebugLogger } from '../static/Debug';
1
2
  import { Participant, ParticipantId } from '../types/Participant';
2
3
  import { StatResult } from '../types/Statistics';
3
4
  import EventEmitter from './EventEmitter';
4
5
  export default class DebugInfo extends EventEmitter {
5
6
  private _lastMemoryStat;
7
+ private readonly _debug;
8
+ constructor(debug?: DebugLogger);
6
9
  onRemoteDataStats(stats: StatResult, participants: Record<ParticipantId, Participant>): void;
7
10
  _calcMemory(): void;
8
11
  }
@@ -0,0 +1,39 @@
1
+ import BaseApi from '../abstract/BaseApi';
2
+ import type { DebugLogger } from '../static/Debug';
3
+ import { DisplayLayoutRequest, ParticipantLayout } from '../types/ParticipantLayout';
4
+ import { Participant, ParticipantId } from '../types/Participant';
5
+ type DisplayLayoutRequesterParams = {
6
+ api: BaseApi;
7
+ debug: DebugLogger;
8
+ getParticipants: () => Promise<Record<ParticipantId, Participant>>;
9
+ isMe: (participantId: ParticipantId) => boolean;
10
+ updateDisplayLayout: (layouts: ParticipantLayout[]) => Promise<void>;
11
+ };
12
+ export default class DisplayLayoutRequester {
13
+ private readonly _api;
14
+ private readonly _debug;
15
+ private readonly _getParticipants;
16
+ private readonly _isMe;
17
+ private readonly _updateDisplayLayout;
18
+ private _requestedLayouts;
19
+ private _uncertainLayouts;
20
+ private _pendingRequests;
21
+ private _pendingPromises;
22
+ private _lastRequests;
23
+ private _timer;
24
+ private _inFlight;
25
+ private _lastFlushAt;
26
+ private _generation;
27
+ private _forceNextFlush;
28
+ constructor({ api, debug, getParticipants, isMe, updateDisplayLayout }: DisplayLayoutRequesterParams);
29
+ request(requests: DisplayLayoutRequest[]): Promise<void>;
30
+ resend(): void;
31
+ cleanupParticipant(participantId: ParticipantId): void;
32
+ clear(): void;
33
+ private _schedule;
34
+ private _flush;
35
+ private _getRequestLayouts;
36
+ private _getDiff;
37
+ private _isChanged;
38
+ }
39
+ export {};
@@ -0,0 +1,19 @@
1
+ import { ExternalId, ExternalParticipantId } from '../types/ExternalId';
2
+ import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
3
+ export declare class ExternalIdCache {
4
+ private _okIdToExternalId;
5
+ private _externalIdToOkId;
6
+ private _decorativeIdToInitialId;
7
+ private _initialIdToDecorativeId;
8
+ getOkId(externalId: ExternalId): OkUserId | null;
9
+ getExternalId(okId: OkUserId): ExternalParticipantId | null;
10
+ hasByExternalId(externalId: ExternalId): boolean;
11
+ hasByOkId(okId: OkUserId): boolean;
12
+ cache(participantId: OkUserId | CompositeUserId | ParticipantId, externalId: ExternalParticipantId): void;
13
+ mapDecorativeId(decorativeId: OkUserId | CompositeUserId | ParticipantId, initialId: OkUserId | CompositeUserId | ParticipantId): void;
14
+ unmapDecorativeId(initialId: OkUserId | CompositeUserId | ParticipantId): void;
15
+ getDecorativeIdByInitialId(initialId: OkUserId | CompositeUserId | ParticipantId): OkUserId | undefined;
16
+ replaceByInitialIdIdIfExists(id: OkUserId | CompositeUserId | ParticipantId): OkUserId;
17
+ getParticipantIdByExternalId(externalId: ExternalId): ParticipantId | null;
18
+ clear(): void;
19
+ }
@@ -1,8 +1,10 @@
1
1
  import type { IEffect } from '@vkontakte/calls-video-effects';
2
2
  import EventEmitter from '../classes/EventEmitter';
3
3
  import MediaOption from '../enums/MediaOption';
4
+ import { type DebugLogger } from '../static/Debug';
4
5
  import MediaSettings, { IVideoDimentions } from '../types/MediaSettings';
5
6
  import { ScreenCaptureSettings } from '../types/ScreenCaptureSettings';
7
+ import StatsLogger from './StatsLogger';
6
8
  export declare const enum MediaSourceEvent {
7
9
  SOURCE_CHANGED = "SOURCE_CHANGED",
8
10
  SOURCE_READY = "SOURCE_READY",
@@ -54,7 +56,9 @@ export declare class MediaSource extends EventEmitter {
54
56
  private _animojiEnabled;
55
57
  /** вычисляем низкую производительность видео эффектов */
56
58
  private readonly _videoEffectsFpsLimiter?;
57
- constructor();
59
+ private readonly _debug;
60
+ private readonly _logger;
61
+ constructor(debug?: DebugLogger, logger?: StatsLogger | null);
58
62
  get cameraVideoTrack(): MediaStreamTrack | null;
59
63
  set cameraVideoTrack(track: MediaStreamTrack | null);
60
64
  request(mediaOptions?: MediaOption[], needEmptyTracks?: boolean): Promise<void>;
@@ -97,7 +101,7 @@ export declare class MediaSource extends EventEmitter {
97
101
  private _stopEffect;
98
102
  destroy(): void;
99
103
  stopLocalMedia(): Promise<void>;
100
- resumeLocalMedia(): Promise<void>;
104
+ resumeLocalMedia(lastActiveMediaSettings?: MediaSettings): Promise<void>;
101
105
  toggleScreenCapturing(settings: ScreenCaptureSettings): Promise<void>;
102
106
  disableScreenCapturing(): Promise<void>;
103
107
  private videoTrackMuteHandler;
@@ -1,8 +1,11 @@
1
+ import { type DebugLogger } from '../static/Debug';
1
2
  import { ParticipantStreamDescription } from '../types/ParticipantStreamDescription';
2
3
  import SignalingMessage from '../types/SignalingMessage';
3
4
  export declare class ParticipantIdRegistry {
4
5
  private streamDescriptionByCompactId;
5
6
  private compactIdByStreamDescription;
7
+ private readonly _debug;
8
+ constructor(debug?: DebugLogger);
6
9
  getStreamDescription(compactedId: number): ParticipantStreamDescription | undefined;
7
10
  getCompactId(streamDescription: string): number | undefined;
8
11
  handleMessage(data: ArrayBuffer): SignalingMessage | null;
@@ -1,3 +1,4 @@
1
+ import { type DebugLogger } from '../static/Debug';
1
2
  import { NetworkStatReport } from '../types/NetworkStatReport';
2
3
  import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
3
4
  import { RequestAsr } from '../types/RequestAsr';
@@ -10,6 +11,8 @@ import { SharingStatReport } from './screenshare/SharingStatReport';
10
11
  import { ParticipantIdRegistry } from './ParticipantIdRegistry';
11
12
  export declare class ProducerCommandSerializationService {
12
13
  private participantIdRegistry;
14
+ private readonly _debug;
15
+ constructor(debug?: DebugLogger);
13
16
  setParticipantIdRegistry(participantIdRegistry: ParticipantIdRegistry): void;
14
17
  serializeUpdateDisplayLayout(sequenceNumber: number, layouts: {
15
18
  [key: string]: ParticipantLayout | StopStream | RequestKeyFrame;
@@ -1,9 +1,11 @@
1
+ import { type DebugLogger } from '../static/Debug';
1
2
  import SignalingMessage from '../types/SignalingMessage';
2
3
  export declare class SignalingActor {
3
4
  private processor;
4
5
  private queue;
5
6
  private isProcessing;
6
- constructor(processor: (message: SignalingMessage) => Promise<unknown> | unknown);
7
+ private readonly _debug;
8
+ constructor(processor: (message: SignalingMessage) => Promise<unknown> | unknown, debug?: DebugLogger);
7
9
  add(message: SignalingMessage): void;
8
10
  private processQueue;
9
11
  }
@@ -1,6 +1,7 @@
1
1
  import { ParticipantId } from '../types/Participant';
2
2
  import EventEmitter from './EventEmitter';
3
- import { Transport, TransportTopology } from './transport/Transport';
3
+ import TransportTopology from '../enums/TransportTopology';
4
+ import { Transport } from './transport/Transport';
4
5
  import { VolumeLevel } from './VolumeDetector';
5
6
  import { VolumesDetector } from './VolumesDetector';
6
7
  export declare const enum SpeakerDetectorEvent {
@@ -1,19 +1,28 @@
1
+ import { type DebugLogger } from '../static/Debug';
1
2
  import MediaSettings from '../types/MediaSettings';
2
3
  import { Participant, ParticipantId } from '../types/Participant';
3
4
  import EventEmitter from './EventEmitter';
5
+ import StatsLogger from './StatsLogger';
4
6
  import { Transport } from './transport/Transport';
5
7
  import { VolumesDetector } from './VolumesDetector';
6
8
  export default class SpecListener extends EventEmitter {
7
9
  private _transport;
8
10
  private _volumes;
9
11
  private readonly _participants;
12
+ private readonly _debug;
13
+ private readonly _logger;
10
14
  private _connectionTimeout;
15
+ private _connectionTimeoutSuppressed;
11
16
  private _volumeTimeout;
12
- constructor(transport: Transport, volumesDetector: VolumesDetector, participants: Record<ParticipantId, Participant>);
17
+ constructor(transport: Transport, volumesDetector: VolumesDetector, participants: Record<ParticipantId, Participant>, debug?: DebugLogger, logger?: StatsLogger | null);
13
18
  destroy(): void;
14
19
  onChangeRemoteMediaSettings(participantId: ParticipantId, mediaSettings: MediaSettings): void;
20
+ onParticipantHoldChanged(): void;
21
+ private _getConnectionTimeout;
22
+ private _getVolumeTimeout;
15
23
  private _onTransportStateChanged;
16
24
  private _onVolumesDetected;
17
25
  private _onConnectionTimeout;
26
+ private _reportConnectionTimeout;
18
27
  private _onVolumeTimeout;
19
28
  }
@@ -4,33 +4,23 @@ import StatLog from '../enums/StatLog';
4
4
  /**
5
5
  * Класс отвечает за отправку различной информации в сервис статистики (события, статистика и подобное)
6
6
  */
7
- export default class Logger extends BaseLogger {
8
- private static _instance;
9
- private static _conversationIdProvider;
10
- static setConversationIdProvider(provider: () => string | null): void;
11
- static create(api: BaseApi, externalLogger: BaseLogger | null): void;
12
- static log(name: StatLog, value?: string, 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;
15
- static destroy(): void;
7
+ export default class StatsLogger extends BaseLogger {
16
8
  private readonly _externalLogger;
17
9
  private readonly _api;
10
+ private readonly _conversationIdProvider;
18
11
  private readonly _batchInterval;
19
12
  private _batchedClientStats;
20
- private _batchedClientEvents;
21
13
  private _batchTimeout;
22
14
  private _serverTimeDelta;
23
- constructor(api: BaseApi, externalLogger: BaseLogger | null);
15
+ constructor(api: BaseApi, externalLogger: BaseLogger | null, conversationIdProvider: () => string | null);
24
16
  log(name: StatLog, value?: string, immediately?: boolean): void;
25
17
  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;
27
18
  destroy(): void;
28
19
  private _getConversationId;
29
20
  private _sendBatch;
30
21
  private _startTimeout;
31
22
  private _stopTimeout;
32
23
  private _sendClientStats;
33
- private _sendClientEvents;
34
24
  private _calculateServerTimeDelta;
35
25
  private _now;
36
26
  }
@@ -1,4 +1,5 @@
1
1
  import type { VideoEffects } from '@vkontakte/calls-video-effects';
2
+ import { type DebugLogger } from '../static/Debug';
2
3
  import EventEmitter from './EventEmitter';
3
4
  export declare enum VideoEffectsFpsLimiterEvent {
4
5
  FpsLimit = "fps-limit"
@@ -10,6 +11,8 @@ export declare class VideoEffectsFpsLimiter extends EventEmitter {
10
11
  private _fpsMeterUnsubscribe;
11
12
  private readonly _fpsHistory;
12
13
  private _fpsLimitCursor;
14
+ private readonly _debug;
15
+ constructor(debug?: DebugLogger);
13
16
  get fpsLimit(): number;
14
17
  watch(videoEffect: VideoEffects | null): void;
15
18
  private _handleFpsMeter;
@@ -1,3 +1,4 @@
1
+ import { type DebugLogger } from '../../static/Debug';
1
2
  import { AsrTranscription } from '../../types/Asr';
2
3
  import { ParticipantIdRegistry } from '../ParticipantIdRegistry';
3
4
  export declare class AsrReceiver {
@@ -5,7 +6,8 @@ export declare class AsrReceiver {
5
6
  private readonly _participantIdRegistry;
6
7
  private readonly _asrCallback;
7
8
  private readonly _textDecoder;
8
- constructor(datachannel: RTCDataChannel, participantIdRegistry: ParticipantIdRegistry, callback: (asr: AsrTranscription) => void);
9
+ private readonly _debug;
10
+ constructor(datachannel: RTCDataChannel, participantIdRegistry: ParticipantIdRegistry, callback: (asr: AsrTranscription) => void, debug?: DebugLogger);
9
11
  private static parse;
10
12
  private _onDataChannelMessage;
11
13
  destroy(): void;
@@ -1,6 +1,9 @@
1
+ import { type DebugLogger } from '../../static/Debug';
2
+ import StatsLogger from '../StatsLogger';
1
3
  import IDecoder from './IDecoder';
2
4
  import WorkerBase from './WorkerBase';
3
5
  export default class LibVPxDecoder extends WorkerBase implements IDecoder {
6
+ constructor(debug?: DebugLogger, logger?: StatsLogger | null);
4
7
  init(onFrameImage: (image: ImageData) => void, onFrameError: (error: unknown) => void, onKeyFrameRequested: () => void): Promise<void>;
5
8
  decodeFrame(timestamp: number, data: Uint8Array, isVP9: boolean, keyFrame?: boolean): void;
6
9
  destroy(): void;
@@ -1,3 +1,5 @@
1
+ import { type DebugLogger } from '../../static/Debug';
2
+ import StatsLogger from '../StatsLogger';
1
3
  import IEncoder from './IEncoder';
2
4
  import { OnFrameCallback } from './Types';
3
5
  import WorkerBase from './WorkerBase';
@@ -13,7 +15,7 @@ export default class LibVPxEncoder extends WorkerBase implements IEncoder {
13
15
  private _canvasCtx;
14
16
  private _frameReadTimeout;
15
17
  private _lastFrame;
16
- constructor(sourceTrack: MediaStreamTrack, onFrame: OnFrameCallback, useCongestionControl: boolean, maxBitrate: number);
18
+ constructor(sourceTrack: MediaStreamTrack, onFrame: OnFrameCallback, useCongestionControl: boolean, maxBitrate: number, debug?: DebugLogger, logger?: StatsLogger | null);
17
19
  private _createDom;
18
20
  private _removeDom;
19
21
  private _createStream;
@@ -1,6 +1,9 @@
1
+ import { type DebugLogger } from '../../static/Debug';
2
+ import StatsLogger from '../StatsLogger';
1
3
  import IDecoder from './IDecoder';
2
4
  import WorkerBase from './WorkerBase';
3
5
  export default class WebCodecsDecoder extends WorkerBase implements IDecoder {
6
+ constructor(debug?: DebugLogger, logger?: StatsLogger | null);
4
7
  init(onFrameImage: (frame: VideoFrame) => void, onFrameError: (error: unknown) => void, onKeyFrameRequested: () => void): Promise<void>;
5
8
  decodeFrame(timestamp: number, data: Uint8Array, isVP9: boolean, keyFrame?: boolean): void;
6
9
  destroy(): void;
@@ -1,3 +1,5 @@
1
+ import { type DebugLogger } from '../../static/Debug';
2
+ import StatsLogger from '../StatsLogger';
1
3
  import IEncoder from './IEncoder';
2
4
  import { OnFrameCallback } from './Types';
3
5
  import WorkerBase from './WorkerBase';
@@ -9,7 +11,7 @@ export default class WebCodecsEncoder extends WorkerBase implements IEncoder {
9
11
  private readonly _maxBitrate;
10
12
  private readonly _useCbr;
11
13
  private readonly _frameRate;
12
- constructor(sourceTrack: MediaStreamTrack, onFrame: OnFrameCallback, useCongestionControl: boolean, maxBitrate: number, useCbr: boolean, frameRate: number);
14
+ constructor(sourceTrack: MediaStreamTrack, onFrame: OnFrameCallback, useCongestionControl: boolean, maxBitrate: number, useCbr: boolean, frameRate: number, debug?: DebugLogger, logger?: StatsLogger | null);
13
15
  init(): Promise<void>;
14
16
  requestFrame(keyFrame?: boolean): void;
15
17
  setBitrate(bitrate: number, useCbr: boolean, fps: number): void;
@@ -1,5 +1,10 @@
1
+ import { type DebugLogger } from '../../static/Debug';
2
+ import StatsLogger from '../StatsLogger';
1
3
  export default abstract class WorkerBase {
2
4
  protected _worker: Worker | null;
5
+ protected readonly _debug: DebugLogger;
6
+ protected readonly _logger: StatsLogger | null;
7
+ protected constructor(debug?: DebugLogger, logger?: StatsLogger | null);
3
8
  protected _createWorker(workerFunctionData: string, onFrame: (data: any) => void, workerArgs?: any[], initArgs?: {
4
9
  [key: string]: any;
5
10
  }, transfer?: any[]): Promise<void>;
@@ -7,5 +12,7 @@ export default abstract class WorkerBase {
7
12
  protected _sendToWorker(type: string, data?: {
8
13
  [key: string]: any;
9
14
  }, transfer?: any[]): void;
15
+ private _formatWorkerError;
16
+ private _formatWorkerMessageError;
10
17
  static isBrowserSupported(): boolean;
11
18
  }
@@ -1,6 +1,8 @@
1
+ import { type DebugLogger } from '../../static/Debug';
1
2
  import { ParticipantId } from '../../types/Participant';
2
3
  import { IScreenShareStat } from '../../types/ScreenSharingStat';
3
4
  import { StatScreenShareFirstFrame } from '../stat/StatScreenShareFirstFrame';
5
+ import { StatAggregator } from '../stat/StatAggregator';
4
6
  import { FrameChunk } from './Utils';
5
7
  export type IOnStat = (stat: IScreenShareStat) => void;
6
8
  export type IOnStream = (stream: MediaStream) => void;
@@ -10,8 +12,9 @@ export declare abstract class BaseStreamBuilder {
10
12
  protected readonly _onStat: IOnStat;
11
13
  protected readonly _onKeyFrameRequested?: VoidFunction;
12
14
  protected readonly _statScreenShareFirstFrame: StatScreenShareFirstFrame;
15
+ protected readonly _debug: DebugLogger;
13
16
  protected _chunks: FrameChunk[];
14
- protected constructor(participantId: ParticipantId, onStream: IOnStream, onStat: IOnStat, onKeyFrameRequested?: VoidFunction);
17
+ protected constructor(participantId: ParticipantId, onStream: IOnStream, onStat: IOnStat, statAggregator: StatAggregator | null, onKeyFrameRequested?: VoidFunction, debug?: DebugLogger);
15
18
  appendChunk(chunk: FrameChunk): void;
16
19
  destroy(): void;
17
20
  protected abstract _processFrame(frame: FrameData): void;
@@ -1,3 +1,4 @@
1
+ import { type DebugLogger } from '../../static/Debug';
1
2
  import BaseRenderer from './BaseRenderer';
2
3
  export default class CanvasRenderer extends BaseRenderer {
3
4
  private readonly _useImageBitmap;
@@ -5,7 +6,8 @@ export default class CanvasRenderer extends BaseRenderer {
5
6
  private _canvasContext;
6
7
  private _stream;
7
8
  private _track;
8
- constructor(onStream: (stream: MediaStream) => void);
9
+ private readonly _debug;
10
+ constructor(onStream: (stream: MediaStream) => void, debug?: DebugLogger);
9
11
  private _createStream;
10
12
  private _removeStream;
11
13
  private _requestCanvasFrame;
@@ -1,5 +1,8 @@
1
+ import { type DebugLogger } from '../../static/Debug';
1
2
  import { ParticipantId } from '../../types/Participant';
3
+ import StatsLogger from '../StatsLogger';
2
4
  import { ParticipantIdRegistry } from '../ParticipantIdRegistry';
5
+ import { StatAggregator } from '../stat/StatAggregator';
3
6
  import { IOnStat } from './BaseStreamBuilder';
4
7
  export default class ScreenCaptureReceiver {
5
8
  private readonly _datachannel;
@@ -8,7 +11,10 @@ export default class ScreenCaptureReceiver {
8
11
  private _onStream;
9
12
  private _onEos;
10
13
  private _onStat;
11
- constructor(datachannel: RTCDataChannel, participantIdRegistry: ParticipantIdRegistry, onStream: (streamId: string, stream: MediaStream) => void, onEos: (streamId: string) => void, onStat: IOnStat);
14
+ private readonly _debug;
15
+ private readonly _logger;
16
+ private readonly _statAggregator;
17
+ constructor(datachannel: RTCDataChannel, participantIdRegistry: ParticipantIdRegistry, onStream: (streamId: string, stream: MediaStream) => void, onEos: (streamId: string) => void, onStat: IOnStat, statAggregator?: StatAggregator | null, debug?: DebugLogger, logger?: StatsLogger | null);
12
18
  private _onDataChannelMessage;
13
19
  /**
14
20
  * Отправить запрос ключевого кадра в datachannel.
@@ -1,4 +1,6 @@
1
1
  import BaseSignaling from '../../abstract/BaseSignaling';
2
+ import { type DebugLogger } from '../../static/Debug';
3
+ import StatsLogger from '../StatsLogger';
2
4
  export default class ScreenCaptureSender {
3
5
  private readonly _encoder;
4
6
  private readonly _datachannel;
@@ -21,7 +23,9 @@ export default class ScreenCaptureSender {
21
23
  private readonly _queue;
22
24
  private readonly _fpsMeter;
23
25
  private readonly _maxFrameDelay;
24
- constructor(track: MediaStreamTrack, datachannel: RTCDataChannel, signaling: BaseSignaling, fastSharing: boolean);
26
+ private readonly _debug;
27
+ private readonly _logger;
28
+ constructor(track: MediaStreamTrack, datachannel: RTCDataChannel, signaling: BaseSignaling, fastSharing: boolean, debug?: DebugLogger, logger?: StatsLogger | null);
25
29
  private _handleQueue;
26
30
  /**
27
31
  * Очищает очередь до опорного кадра