@vkontakte/calls-sdk 2.8.11-dev.3d9bb708.0 → 2.8.11-dev.4bbae276.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.
@@ -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 MediaSettings, { IVideoDimentions } from '../types/MediaSettings';
19
+ import { 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';
@@ -27,7 +27,6 @@ import { ParticipantStreamDescription } from '../types/ParticipantStreamDescript
27
27
  import { ScreenCaptureSettings } from '../types/ScreenCaptureSettings';
28
28
  import SignalingMessage from '../types/SignalingMessage';
29
29
  import { WaitingHallResponse } from '../types/WaitingHall';
30
- import { CallRegistry } from './CallRegistry';
31
30
  import EventEmitter from './EventEmitter';
32
31
  export default class Conversation extends EventEmitter {
33
32
  private readonly _api;
@@ -50,8 +49,10 @@ export default class Conversation extends EventEmitter {
50
49
  private _lastSignalledActiveSpeakerId;
51
50
  private _isRealTimeAsrRequested;
52
51
  private _serverSettings;
53
- private _delayedHangup;
54
- private _abortController;
52
+ private static _current;
53
+ private static _activationMutex;
54
+ private static _delayedHangup;
55
+ private static _abortController;
55
56
  private readonly _onUnload;
56
57
  private readonly _audioOutput;
57
58
  private _lastStalled;
@@ -68,10 +69,6 @@ export default class Conversation extends EventEmitter {
68
69
  static current(): Conversation | null;
69
70
  static hangupAfterInit(): void;
70
71
  static id(): string | null;
71
- get id(): string;
72
- get externalId(): ExternalParticipantId | undefined;
73
- get mediaSettings(): MediaSettings | undefined;
74
- get isCallHeld(): boolean;
75
72
  onStart({ opponentIds, opponentType, mediaOptions, payload, joiningAllowed, requireAuthToJoin, onlyAdminCanShareMovie, externalIds, onFastStart, conversationId, }: ConversationOnStartParams): Promise<ConversationData>;
76
73
  onJoin(joinArgs: {
77
74
  conversationId?: string;
@@ -405,10 +402,6 @@ export default class Conversation extends EventEmitter {
405
402
  private _getParticipants;
406
403
  private _getParticipant;
407
404
  }
408
- declare const _callRegistry: CallRegistry;
409
- export { _callRegistry };
410
- declare function _resetPendingInstance(): void;
411
- export { _resetPendingInstance };
412
405
  export declare class UpdateDisplayLayoutError extends Error {
413
406
  readonly participantErrors: {
414
407
  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,7 +45,6 @@ export declare class MediaSource extends EventEmitter {
45
45
  /** Трек аудио эффектов. Не изменяется на протяжении всего времени */
46
46
  private _audioEffectsTrack;
47
47
  private _mediaSettings;
48
- private _lastMediaSettings;
49
48
  private _videoStatusOnScreenCapturingEnabled;
50
49
  private _effect;
51
50
  private _audioEffectParams;
@@ -64,7 +63,7 @@ export declare class MediaSource extends EventEmitter {
64
63
  getSendAudioTrack(): MediaStreamTrack | null;
65
64
  get isAnimojiRequested(): boolean;
66
65
  addTrackToPeerConnection(pc: RTCPeerConnection, observer: boolean, noDataChannel: boolean): void;
67
- get mediaSettings(): MediaSettings;
66
+ getMediaSettings(): MediaSettings;
68
67
  changeDevice(kind: MediaDeviceKind): Promise<void>;
69
68
  /**
70
69
  * Установка кастомного стрима для видео, например внешний шаринг экрана
@@ -92,8 +91,6 @@ export declare class MediaSource extends EventEmitter {
92
91
  private _setEffect;
93
92
  private _stopEffect;
94
93
  destroy(): void;
95
- stopLocalMedia(): void;
96
- resumeLocalMedia(): Promise<void>;
97
94
  toggleScreenCapturing(settings: ScreenCaptureSettings): Promise<void>;
98
95
  disableScreenCapturing(): Promise<void>;
99
96
  private videoTrackMuteHandler;
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.3d9bb708.0",
3
+ "version": "2.8.11-dev.4bbae276.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",
@@ -47,9 +47,8 @@ declare namespace External {
47
47
  *
48
48
  * @param stream
49
49
  * @param mediaSettings
50
- * @param conversationId ID звонка
51
50
  */
52
- function onLocalStream(stream: MediaStream | null, mediaSettings: MediaSettings, conversationId?: string): void;
51
+ function onLocalStream(stream: MediaStream | null, mediaSettings: MediaSettings): void;
53
52
  /**
54
53
  * Локальный стрим с экрана добавлен/удалён
55
54
  *
@@ -81,18 +80,16 @@ declare namespace External {
81
80
  * Изменился статус локального соединения
82
81
  *
83
82
  * @param status
84
- * @param conversationId ID звонка
85
83
  */
86
- function onLocalStatus(status: ParticipantStatus, conversationId?: string): void;
84
+ function onLocalStatus(status: ParticipantStatus): void;
87
85
  /**
88
86
  * Получен стрим собеседника.
89
87
  * Если сервер закончил стримить собеседника, вместо стрима будет передан null
90
88
  *
91
89
  * @param userId
92
90
  * @param stream
93
- * @param conversationId ID звонка
94
91
  */
95
- function onRemoteStream(userId: ExternalParticipantId, stream: MediaStream | null, conversationId?: string): void;
92
+ function onRemoteStream(userId: ExternalParticipantId, stream: MediaStream | null): void;
96
93
  /**
97
94
  * Получен стрим лайв от собеседника.
98
95
  * Если сервер закончил стримить собеседника, вместо стрима будет передан null
@@ -129,9 +126,8 @@ declare namespace External {
129
126
  *
130
127
  * @param userId
131
128
  * @param stream
132
- * @param conversationId ID звонка
133
129
  */
134
- function onRemoteScreenStream(userId: ExternalParticipantId, stream: MediaStream | null, conversationId?: string): void;
130
+ function onRemoteScreenStream(userId: ExternalParticipantId, stream: MediaStream | null): void;
135
131
  /**
136
132
  * Получен стрим вимоджи собеседника.
137
133
  * Если сервер закончил стримить собеседника, вместо стрима будет передан null
@@ -156,9 +152,8 @@ declare namespace External {
156
152
  * @param muteStates Состояние устройств при входе в звонок
157
153
  * @param participants Список участников звонка
158
154
  * @param rooms Список сессионных залов в звонке
159
- * @param conversationId ID звонка
160
155
  */
161
- function onConversation(userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants: ExternalParticipant[], rooms?: Rooms, conversationId?: string): void;
156
+ function onConversation(userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants: ExternalParticipant[], rooms?: Rooms): void;
162
157
  /**
163
158
  * Постраничные данные про участников при начале звонка
164
159
  * @param chunk
@@ -224,17 +219,15 @@ declare namespace External {
224
219
  *
225
220
  * @param userId
226
221
  * @param markers
227
- * @param conversationId ID звонка
228
222
  */
229
- function onParticipantAdded(userId: ExternalId, markers: ExternalParticipantListMarkers | null, conversationId?: string): void;
223
+ function onParticipantAdded(userId: ExternalId, markers: ExternalParticipantListMarkers | null): void;
230
224
  /**
231
225
  * Участник подключился
232
226
  *
233
227
  * @param userId
234
228
  * @param markers
235
- * @param conversationId ID звонка
236
229
  */
237
- function onParticipantJoined(userId: ExternalId, markers: ExternalParticipantListMarkers | null, conversationId?: string): void;
230
+ function onParticipantJoined(userId: ExternalId, markers: ExternalParticipantListMarkers | null): void;
238
231
  function onLocalParticipantState(participantState: ParticipantStateMapped, global?: boolean): void;
239
232
  /**
240
233
  * Изменились данные состояний собеседника
@@ -257,9 +250,8 @@ declare namespace External {
257
250
  * @param userIds
258
251
  * @param status
259
252
  * @param data
260
- * @param conversationId ID звонка
261
253
  */
262
- function onRemoteStatus(userIds: ExternalParticipantId[], status: ParticipantStatus, data?: any, conversationId?: string): void;
254
+ function onRemoteStatus(userIds: ExternalParticipantId[], status: ParticipantStatus, data?: any): void;
263
255
  /**
264
256
  * Разрешения на доступы были запрошены в браузере
265
257
  */
@@ -276,26 +268,23 @@ declare namespace External {
276
268
  *
277
269
  * @param userId
278
270
  * @param markers
279
- * @param conversationId ID звонка
280
271
  */
281
- function onRemoteRemoved(userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null, conversationId?: string): void;
272
+ function onRemoteRemoved(userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null): void;
282
273
  /**
283
274
  * Изменилось состояние звонка
284
275
  *
285
276
  * @param isCallActive Активен ли сейчас звонок
286
277
  * @param canAddParticipants Можно ли добавлять собеседников
287
278
  * @param conversation Информация о звонке
288
- * @param conversationId ID звонка
289
279
  */
290
- function onCallState(isCallActive: boolean, canAddParticipants: boolean, conversation: ConversationData, conversationId?: string): void;
280
+ function onCallState(isCallActive: boolean, canAddParticipants: boolean, conversation: ConversationData): void;
291
281
  /**
292
282
  * Изменилось состояние камеры или микрофона
293
283
  *
294
284
  * @param mediaOption Тип устройства
295
285
  * @param enabled Включено или выключено
296
- * @param conversationId ID звонка
297
286
  */
298
- function onDeviceSwitched(mediaOption: MediaOption, enabled: boolean, conversationId?: string): void;
287
+ function onDeviceSwitched(mediaOption: MediaOption, enabled: boolean): void;
299
288
  /**
300
289
  * Изменились состояния устройств пользователя или разрешения включать камеру/микрофон
301
290
  *
@@ -350,34 +339,21 @@ declare namespace External {
350
339
  function onOptionsChanged(options: ConversationOption[]): void;
351
340
  /**
352
341
  * Входящий звонок был принят мной
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
363
342
  */
364
- function onIncomingCall(conversationId: string, externalId: ExternalParticipantId | undefined, mediaSettings: MediaSettings | undefined): void;
343
+ function onCallAccepted(): void;
365
344
  /**
366
345
  * Исходящий звонок был принят кем-то
367
- *
368
346
  * @param userId
369
347
  * @param capabilities
370
- * @param conversationId ID звонка
371
348
  */
372
- function onAcceptedCall(userId: ExternalId, capabilities: ParticipantCapabilities, conversationId?: string): void;
349
+ function onAcceptedCall(userId: ExternalId, capabilities: ParticipantCapabilities): void;
373
350
  function onRateNeeded(): void;
374
351
  /**
375
352
  * Изменился говорящий в звонке
376
353
  *
377
354
  * @param userId
378
- * @param conversationId ID звонка
379
355
  */
380
- function onSpeakerChanged(userId: ExternalParticipantId, conversationId?: string): void;
356
+ function onSpeakerChanged(userId: ExternalParticipantId): void;
381
357
  /**
382
358
  * Громкость собеседников
383
359
  *
@@ -490,7 +490,7 @@ export type ParamsObject = {
490
490
  /**
491
491
  * Получен локальный стрим с камеры/микрофона
492
492
  */
493
- onLocalStream?: (stream: MediaStream | null, mediaSettings: MediaSettings, conversationId?: string) => void;
493
+ onLocalStream?: (stream: MediaStream | null, mediaSettings: MediaSettings) => void;
494
494
  /**
495
495
  * Локальный стрим изменился
496
496
  */
@@ -510,12 +510,12 @@ export type ParamsObject = {
510
510
  /**
511
511
  * Изменился статус локального соединения
512
512
  */
513
- onLocalStatus?: (status: ParticipantStatus, conversationId?: string) => void;
513
+ onLocalStatus?: (status: ParticipantStatus) => void;
514
514
  /**
515
515
  * Получен стрим собеседника.
516
516
  * Если сервер закончил стримить собеседника, вместо стрима будет передан null
517
517
  */
518
- onRemoteStream?: (userId: ExternalParticipantId, stream: MediaStream | null, conversationId?: string) => void;
518
+ onRemoteStream?: (userId: ExternalParticipantId, stream: MediaStream | null) => void;
519
519
  /**
520
520
  * Cтрим собеседника приостановлен/возобновлен.
521
521
  */
@@ -524,7 +524,7 @@ export type ParamsObject = {
524
524
  * Получен стрим с экрана собеседника.
525
525
  * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
526
526
  */
527
- onRemoteScreenStream?: (userId: ExternalParticipantId, stream: MediaStream | null, conversationId?: string) => void;
527
+ onRemoteScreenStream?: (userId: ExternalParticipantId, stream: MediaStream | null) => void;
528
528
  /**
529
529
  * Получен стрим вимоджи собеседника.
530
530
  * Если сервер закончил стримить вимоджи собеседника, вместо стрима будет передан null
@@ -551,7 +551,7 @@ export type ParamsObject = {
551
551
  /**
552
552
  * Начат звонок
553
553
  */
554
- onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants: ExternalParticipant[], rooms?: Rooms, conversationId?: string) => void;
554
+ onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants: ExternalParticipant[], rooms?: Rooms) => void;
555
555
  /**
556
556
  * Начальный список участников для постраничного звонка
557
557
  */
@@ -583,11 +583,11 @@ export type ParamsObject = {
583
583
  /**
584
584
  * Добавили участника
585
585
  */
586
- onParticipantAdded?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null, conversationId?: string) => void;
586
+ onParticipantAdded?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null) => void;
587
587
  /**
588
588
  * Участник присоединился к звонку
589
589
  */
590
- onParticipantJoined?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers, conversationId?: string) => void;
590
+ onParticipantJoined?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers) => void;
591
591
  /**
592
592
  * Получены данные по изменению локальных состояний со стороны админа
593
593
  * Например, принудительно опущена рука
@@ -607,7 +607,7 @@ export type ParamsObject = {
607
607
  /**
608
608
  * Изменился статус соединения собеседников
609
609
  */
610
- onRemoteStatus?: (userIds: ExternalParticipantId[], status: ParticipantStatus, data: any, conversationId?: string) => void;
610
+ onRemoteStatus?: (userIds: ExternalParticipantId[], status: ParticipantStatus, data: any) => void;
611
611
  /**
612
612
  * Разрешения на доступы были запрошены в браузере
613
613
  */
@@ -619,15 +619,15 @@ export type ParamsObject = {
619
619
  /**
620
620
  * Пользователь отключился от звонка
621
621
  */
622
- onRemoteRemoved?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null, conversationId?: string) => void;
622
+ onRemoteRemoved?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null) => void;
623
623
  /**
624
624
  * Изменилось состояние звонка
625
625
  */
626
- onCallState?: (isCallActive: boolean, canAddParticipants: boolean, conversation: ConversationData, conversationId?: string) => void;
626
+ onCallState?: (isCallActive: boolean, canAddParticipants: boolean, conversation: ConversationData) => void;
627
627
  /**
628
628
  * Изменилось состояние камеры или микрофона
629
629
  */
630
- onDeviceSwitched?: (mediaOption: MediaOption, enabled: boolean, conversationId?: string) => void;
630
+ onDeviceSwitched?: (mediaOption: MediaOption, enabled: boolean) => void;
631
631
  /**
632
632
  * Изменились состояния устройств пользователя или разрешения включать камеру/микрофон
633
633
  */
@@ -656,7 +656,7 @@ export type ParamsObject = {
656
656
  /**
657
657
  * Изменился говорящий в звонке
658
658
  */
659
- onSpeakerChanged?: (userId: ExternalParticipantId, conversationId?: string) => void;
659
+ onSpeakerChanged?: (userId: ExternalParticipantId) => void;
660
660
  /**
661
661
  * Громкость собеседников
662
662
  */
@@ -676,12 +676,12 @@ export type ParamsObject = {
676
676
  /**
677
677
  * Входящий звонок был принят мной
678
678
  */
679
- onCallAccepted?: (conversationId?: string) => void;
679
+ onCallAccepted?: () => void;
680
680
  /**
681
681
  * Исходящий звонок был принят кем-то
682
682
  * @param userId
683
683
  */
684
- onAcceptedCall?: (userId: ExternalParticipantId, capabilities: ParticipantCapabilities, conversationId?: string) => void;
684
+ onAcceptedCall?: (userId: ExternalParticipantId, capabilities: ParticipantCapabilities) => void;
685
685
  /**
686
686
  * Список устройств изменился
687
687
  */
@@ -859,14 +859,6 @@ export type ParamsObject = {
859
859
  * @param demoted участник разжалован
860
860
  */
861
861
  onPromoted?: (demoted: boolean) => void;
862
- /**
863
- * Входящий звонок получен во время активного звонка
864
- *
865
- * @param conversationId ID звонка
866
- * @param externalId Внешний ID вызывающего
867
- * @param mediaSettings Настройки медиа
868
- */
869
- onIncomingCall?: (conversationId: string, externalId: ExternalParticipantId | undefined, mediaSettings: MediaSettings | undefined) => void;
870
862
  /**
871
863
  * Собеседник подключился к сигналлингу
872
864
  */
@@ -1,18 +0,0 @@
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
- }