@vkontakte/calls-sdk 2.8.11-dev.aeebd796.0 → 2.8.11-dev.be993e85.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.
Files changed (72) hide show
  1. package/CallsSDK.d.ts +18 -16
  2. package/abstract/BaseApi.d.ts +2 -3
  3. package/abstract/BaseSignaling.d.ts +2 -3
  4. package/calls-sdk.cjs.js +9 -9
  5. package/calls-sdk.esm.js +3975 -3348
  6. package/classes/AudioFix.d.ts +5 -1
  7. package/classes/AudioOutput.d.ts +5 -1
  8. package/classes/Conversation.d.ts +17 -5
  9. package/classes/ConversationResponseValidator.d.ts +3 -0
  10. package/classes/DebugInfo.d.ts +3 -0
  11. package/classes/DisplayLayoutRequester.d.ts +39 -0
  12. package/classes/ExternalIdCache.d.ts +19 -0
  13. package/classes/MediaSource.d.ts +5 -1
  14. package/classes/ParticipantIdRegistry.d.ts +3 -0
  15. package/classes/ProducerCommandSerializationService.d.ts +3 -0
  16. package/classes/SignalingActor.d.ts +3 -1
  17. package/classes/SpeakerDetector.d.ts +2 -1
  18. package/classes/SpecListener.d.ts +5 -1
  19. package/classes/{Logger.d.ts → StatsLogger.d.ts} +3 -10
  20. package/classes/VideoEffectsFpsLimiter.d.ts +3 -0
  21. package/classes/asr/AsrReceiver.d.ts +3 -1
  22. package/classes/codec/LibVPxDecoder.d.ts +3 -0
  23. package/classes/codec/LibVPxEncoder.d.ts +3 -1
  24. package/classes/codec/WebCodecsDecoder.d.ts +3 -0
  25. package/classes/codec/WebCodecsEncoder.d.ts +3 -1
  26. package/classes/codec/WorkerBase.d.ts +7 -0
  27. package/classes/screenshare/BaseStreamBuilder.d.ts +4 -1
  28. package/classes/screenshare/CanvasRenderer.d.ts +3 -1
  29. package/classes/screenshare/ScreenCaptureReceiver.d.ts +7 -1
  30. package/classes/screenshare/ScreenCaptureSender.d.ts +5 -1
  31. package/classes/screenshare/ScreenCongestionControl.d.ts +3 -1
  32. package/classes/screenshare/StreamBuilder.d.ts +5 -1
  33. package/classes/screenshare/TrackGeneratorRenderer.d.ts +3 -1
  34. package/classes/screenshare/WebmBuilder.d.ts +3 -1
  35. package/classes/stat/CodecStatsAggregator.d.ts +7 -7
  36. package/classes/stat/ConversationStats.d.ts +21 -0
  37. package/classes/stat/StatAggregator.d.ts +6 -6
  38. package/classes/stat/StatFirstMediaReceived.d.ts +6 -2
  39. package/classes/stat/StatPings.d.ts +9 -9
  40. package/classes/stat/StatScreenShareFirstFrame.d.ts +3 -1
  41. package/classes/stat/StatSignalingCommands.d.ts +8 -8
  42. package/classes/transport/BaseTransport.d.ts +1 -1
  43. package/classes/transport/DirectStatReporter.d.ts +3 -1
  44. package/classes/transport/DirectTransport.d.ts +9 -1
  45. package/classes/transport/PerfStatReporter.d.ts +5 -1
  46. package/classes/transport/ServerTransport.d.ts +10 -2
  47. package/classes/transport/Transport.d.ts +11 -14
  48. package/default/Api.d.ts +8 -11
  49. package/default/Signaling.d.ts +39 -45
  50. package/default/SignalingTransport.d.ts +68 -0
  51. package/enums/HangupType.d.ts +2 -1
  52. package/enums/SignalingNotification.d.ts +1 -0
  53. package/enums/TransportState.d.ts +10 -0
  54. package/enums/TransportTopology.d.ts +5 -0
  55. package/package.json +1 -1
  56. package/static/Capabilities.d.ts +5 -0
  57. package/static/Debug.d.ts +27 -8
  58. package/static/External.d.ts +3 -0
  59. package/static/Params.d.ts +22 -0
  60. package/static/ParticipantConnectionStatusUtils.d.ts +15 -0
  61. package/static/Utils.d.ts +3 -2
  62. package/static/WebRTCUtils.d.ts +6 -4
  63. package/types/Capabilities.d.ts +24 -0
  64. package/types/Conversation.d.ts +1 -1
  65. package/types/FastStart.d.ts +1 -0
  66. package/types/Participant.d.ts +10 -1
  67. package/types/ParticipantLayout.d.ts +33 -0
  68. package/types/SignalingMessage.d.ts +14 -2
  69. package/types/Statistics.d.ts +1 -1
  70. package/types/WebTransport.d.ts +4 -0
  71. package/utils/DebugStorage.d.ts +1 -2
  72. package/classes/stat/EventMetricsService.d.ts +0 -9
@@ -306,6 +306,12 @@ export type ParamsObject = {
306
306
  * _По умолчанию: `30`_
307
307
  */
308
308
  videoTracksCount: number;
309
+ /**
310
+ * Минимальный интервал отправки diff для requestDisplayLayout в миллисекундах.
311
+ *
312
+ * _По умолчанию: `250`_
313
+ */
314
+ requestDisplayLayoutThrottleMs: number;
309
315
  /** @hidden */
310
316
  movieShare: boolean;
311
317
  /** @hidden */
@@ -487,6 +493,12 @@ export type ParamsObject = {
487
493
  * _По умолчанию: `false`_
488
494
  */
489
495
  transparentAudio: boolean;
496
+ /**
497
+ * Включить получение обновлений состояния медийной сессии участников
498
+ *
499
+ * _По умолчанию: `false`_
500
+ */
501
+ enableSessionStateUpdates: boolean;
490
502
  /**
491
503
  * Получен локальный стрим с камеры/микрофона
492
504
  */
@@ -730,6 +742,12 @@ export type ParamsObject = {
730
742
  * Получено отладочное сообщение. Работает только при выключенном режиме отладки
731
743
  */
732
744
  onDebugMessage?: (type: DebugMessageType, ...args: any[]) => void;
745
+ /**
746
+ * Получено отладочное сообщение с контекстом звонка. Работает только при выключенном режиме отладки
747
+ */
748
+ onDebugMessageWithContext?: (type: DebugMessageType, context: {
749
+ conversationId: string | null;
750
+ }, ...args: any[]) => void;
733
751
  /**
734
752
  * Статистика звонка
735
753
  */
@@ -963,6 +981,7 @@ export default abstract class Params {
963
981
  static get audioNack(): boolean;
964
982
  static get movieShare(): boolean;
965
983
  static get videoTracksCount(): number;
984
+ static get requestDisplayLayoutThrottleMs(): number;
966
985
  static get breakVideoPayloadTypes(): boolean;
967
986
  static get useCallsToContacts(): boolean;
968
987
  static get useParticipantListChunk(): boolean;
@@ -994,6 +1013,7 @@ export default abstract class Params {
994
1013
  static get webtransport(): boolean;
995
1014
  static get webtransportFF(): boolean;
996
1015
  static get transparentAudio(): boolean;
1016
+ static get enableSessionStateUpdates(): boolean;
997
1017
  static toJSON(): {
998
1018
  apiKey: string;
999
1019
  apiEnv: string;
@@ -1010,6 +1030,7 @@ export default abstract class Params {
1010
1030
  screenShareCongestionControl: boolean;
1011
1031
  screenShareCongestionControlThreshold: number;
1012
1032
  videoTracksCount: number;
1033
+ requestDisplayLayoutThrottleMs: number;
1013
1034
  asrDataChannel: boolean;
1014
1035
  videoMaxHeight: number;
1015
1036
  videoMaxWidth: number;
@@ -1028,5 +1049,6 @@ export default abstract class Params {
1028
1049
  webtransport: boolean;
1029
1050
  webtransportFF: boolean;
1030
1051
  transparentAudio: boolean;
1052
+ enableSessionStateUpdates: boolean;
1031
1053
  };
1032
1054
  }
@@ -0,0 +1,15 @@
1
+ import { ParticipantConnectionStatus, ParticipantSessionState } from '../types/Participant';
2
+ import { ParticipantStatus } from './External';
3
+ import TransportState from '../enums/TransportState';
4
+ type StatusTransition = {
5
+ status: ParticipantStatus;
6
+ shouldNotify: boolean;
7
+ };
8
+ declare namespace ParticipantConnectionStatusUtils {
9
+ function create(status?: Partial<ParticipantConnectionStatus> | null): ParticipantConnectionStatus;
10
+ function fromTransportState(state?: TransportState): ParticipantStatus | null;
11
+ function computeEffective(status: ParticipantConnectionStatus): ParticipantStatus;
12
+ function setSessionState(status: ParticipantConnectionStatus, sessionState?: ParticipantSessionState): StatusTransition;
13
+ function setTransport(status: ParticipantConnectionStatus, transport: ParticipantStatus): StatusTransition;
14
+ }
15
+ export default ParticipantConnectionStatusUtils;
package/static/Utils.d.ts CHANGED
@@ -3,6 +3,7 @@ import { ExternalParticipant, ExternalParticipantListMarker } from '../types/Ext
3
3
  import { CompositeUserId, OkUserId, Participant, ParticipantId, ParticipantStateMapped } from '../types/Participant';
4
4
  import SignalingMessage from '../types/SignalingMessage';
5
5
  import VideoSettings from '../types/VideoSettings';
6
+ import { type DebugLogger } from './Debug';
6
7
  export declare const PARAMETERS_SEPARATOR = ":";
7
8
  export declare const DEVICE_IDX_PARAMETER = "d";
8
9
  /** @hidden */
@@ -36,8 +37,8 @@ declare namespace Utils {
36
37
  function delay(time: number, { signal }?: {
37
38
  signal?: AbortSignal;
38
39
  }): Promise<void>;
39
- function applySettings(pc: RTCPeerConnection, videoSettings: VideoSettings, prevSettings: any): any;
40
- function applyVideoTrackSettings(videoSettings: VideoSettings, s: RTCRtpSender, track: MediaStreamTrack | null, prevSettings: any, retSettings: any): void;
40
+ function applySettings(pc: RTCPeerConnection, videoSettings: VideoSettings, prevSettings: any, debug?: DebugLogger): any;
41
+ function applyVideoTrackSettings(videoSettings: VideoSettings, s: RTCRtpSender, track: MediaStreamTrack | null, prevSettings: any, retSettings: any, debug?: DebugLogger): void;
41
42
  /**
42
43
  * Проверяет, есть ли в первом массиве хотя бы один элемент из второго массива
43
44
  * @param arr Где ищем
@@ -2,6 +2,8 @@
2
2
  * Вспомогательный плагин для работы с WebRTC
3
3
  */
4
4
  import { IVideoDimentions } from '../types/MediaSettings';
5
+ import type StatsLogger from '../classes/StatsLogger';
6
+ import { type DebugLogger } from './Debug';
5
7
  /**
6
8
  * Тип камеры мобильного устройства
7
9
  */
@@ -83,24 +85,24 @@ declare namespace WebRTCUtils {
83
85
  * @param needAudio Нужно ли аудио
84
86
  * @param needEmptyTracks Добавлять ли в стрим пустые треки для отключенного видео/аудио
85
87
  */
86
- function getUserMedia(needVideo?: boolean, needAudio?: boolean, needEmptyTracks?: boolean): Promise<MediaStream>;
88
+ function getUserMedia(needVideo?: boolean, needAudio?: boolean, needEmptyTracks?: boolean, debug?: DebugLogger, logger?: StatsLogger | null): Promise<MediaStream>;
87
89
  /**
88
90
  * Запрашивает трансляцию экрана пользователя с опциональным захватом звука
89
91
  */
90
- function getScreenMedia(fastScreenShare: boolean, withAudioShare: boolean): Promise<MediaStream>;
92
+ function getScreenMedia(fastScreenShare: boolean, withAudioShare: boolean, debug?: DebugLogger, logger?: StatsLogger | null): Promise<MediaStream>;
91
93
  /**
92
94
  * Запрашивает камеру пользователя
93
95
  *
94
96
  * @param deviceId ID устройства
95
97
  * @param resolution Размеры видео
96
98
  */
97
- function getUserVideo(deviceId?: string, resolution?: IVideoDimentions): Promise<MediaStream>;
99
+ function getUserVideo(deviceId?: string, resolution?: IVideoDimentions, debug?: DebugLogger, logger?: StatsLogger | null): Promise<MediaStream>;
98
100
  /**
99
101
  * Запрашивает микрофон пользователя
100
102
  *
101
103
  * @param deviceId ID устройства
102
104
  */
103
- function getUserAudio(deviceId?: string): Promise<MediaStream>;
105
+ function getUserAudio(deviceId?: string, debug?: DebugLogger, logger?: StatsLogger | null): Promise<MediaStream>;
104
106
  /**
105
107
  * Устанавливает размер видео в стриме
106
108
  *
@@ -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
+ };
@@ -1,4 +1,4 @@
1
- import { TransportTopology } from '../classes/transport/Transport';
1
+ import TransportTopology from '../enums/TransportTopology';
2
2
  import CallDirection from '../enums/CallDirection';
3
3
  import CallType from '../enums/CallType';
4
4
  import ConversationFeature from '../enums/ConversationFeature';
@@ -31,6 +31,7 @@ export interface FastStartParams {
31
31
  conversationId: string;
32
32
  internalParams: string;
33
33
  externalIds?: ExternalId[];
34
+ payload: string;
34
35
  opponentType: CallType;
35
36
  mediaOptions: MediaOption[];
36
37
  joiningAllowed?: boolean;
@@ -44,6 +44,15 @@ export interface ParticipantStateMapped {
44
44
  ts: number;
45
45
  };
46
46
  }
47
+ export interface ParticipantSessionState {
48
+ connected: boolean;
49
+ }
50
+ export interface ParticipantConnectionStatus {
51
+ transport: ParticipantStatus;
52
+ sessionState?: ParticipantSessionState;
53
+ sessionStateConnectedBySpeaker: boolean;
54
+ lastEffective: ParticipantStatus;
55
+ }
47
56
  /**
48
57
  * Состояния участников звонка
49
58
  */
@@ -63,7 +72,6 @@ export interface Participant {
63
72
  externalId: ExternalParticipantId;
64
73
  mediaSettings: MediaSettings;
65
74
  state: ParticipantState;
66
- status: ParticipantStatus;
67
75
  remoteStream?: MediaStream | null;
68
76
  remoteAudioTrack?: MediaStreamTrack | null;
69
77
  secondStream?: MediaStream | null;
@@ -72,6 +80,7 @@ export interface Participant {
72
80
  clientType: string;
73
81
  roles: UserRole[];
74
82
  participantState: ParticipantStateMapped;
83
+ connectionStatus: ParticipantConnectionStatus;
75
84
  networkRating: number;
76
85
  lastRequestedLayouts: {
77
86
  [key: StreamDescriptionString]: ParticipantLayout;
@@ -54,4 +54,37 @@ export type ParticipantLayout = (Layout | StopStream | RequestKeyFrame) & {
54
54
  */
55
55
  streamName?: string;
56
56
  };
57
+ /**
58
+ * Запрос стрима, который клиент хочет получать для отображения.
59
+ */
60
+ export type DisplayLayoutRequest = {
61
+ /**
62
+ * Внешний ID пользователя
63
+ */
64
+ uid: ExternalParticipantId | string;
65
+ /**
66
+ * Тип медиа (видео с камеры, картинка с экрана, лайв или мувик)
67
+ */
68
+ mediaType: MediaType;
69
+ /**
70
+ * Ширина окошка в котором отображается видео, в пикселях
71
+ */
72
+ width: number;
73
+ /**
74
+ * Высота окошка в котором отображается видео, в пикселях
75
+ */
76
+ height: number;
77
+ /**
78
+ * Отображать видео как CSS object-fit: cover. По умолчанию используется contain.
79
+ */
80
+ cover?: boolean;
81
+ /**
82
+ * Приоритет
83
+ */
84
+ priority?: number;
85
+ /**
86
+ * ID лайва или мувика. null для камеры или скрин-шары.
87
+ */
88
+ streamName?: string;
89
+ };
57
90
  export default ParticipantLayout;
@@ -1,5 +1,5 @@
1
1
  import { AnimojiVersion } from '@vkontakte/calls-vmoji';
2
- import { TransportTopology } from '../classes/transport/Transport';
2
+ import TransportTopology from '../enums/TransportTopology';
3
3
  import ChatRoomEventType from '../enums/ChatRoomEventType';
4
4
  import ConversationFeature from '../enums/ConversationFeature';
5
5
  import ConversationOption from '../enums/ConversationOption';
@@ -19,7 +19,7 @@ import MediaModifiers from './MediaModifiers';
19
19
  import MediaSettings from './MediaSettings';
20
20
  import { ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from './MovieShare';
21
21
  import MuteStates from './MuteStates';
22
- import { CompositeUserId, OkUserId, ParticipantId, ParticipantListMarker as ParticipantParticipantListMarker, ParticipantListMarkers, ParticipantListType as ParticipantParticipantListType } from './Participant';
22
+ import { CompositeUserId, OkUserId, ParticipantId, ParticipantListMarker as ParticipantParticipantListMarker, ParticipantListMarkers, ParticipantListType as ParticipantParticipantListType, ParticipantSessionState } from './Participant';
23
23
  import { MediaType, ParticipantStreamDescription } from './ParticipantStreamDescription';
24
24
  import { IRoomId } from './Room';
25
25
  import VideoSettings from './VideoSettings';
@@ -89,6 +89,7 @@ declare namespace SignalingMessage {
89
89
  state: Record<string, string>;
90
90
  stateUpdateTs: Record<string, number>;
91
91
  };
92
+ sessionState?: ParticipantSessionState;
92
93
  roles?: UserRole[];
93
94
  peerId?: PeerId;
94
95
  restricted?: boolean;
@@ -190,6 +191,7 @@ declare namespace SignalingMessage {
190
191
  deviceIdx?: number;
191
192
  peerId: PeerId;
192
193
  reason: HangupType;
194
+ errorCode?: string;
193
195
  markers?: ParticipantListMarkers;
194
196
  }
195
197
  export interface ClosedConversation extends Notification {
@@ -322,6 +324,13 @@ declare namespace SignalingMessage {
322
324
  export interface SpeakerChanged extends Notification {
323
325
  speaker: ParticipantId;
324
326
  }
327
+ export interface SessionState extends Notification {
328
+ connected: boolean;
329
+ participantId: OkUserId;
330
+ participantType: UserType;
331
+ deviceIdx?: number;
332
+ markers?: ParticipantListMarkers;
333
+ }
325
334
  export interface OptionsChanged extends Notification {
326
335
  options: ConversationOption[];
327
336
  }
@@ -366,6 +375,9 @@ declare namespace SignalingMessage {
366
375
  export interface Connection extends Notification {
367
376
  endpoint: string;
368
377
  conversation: Conversation;
378
+ conversationParams: {
379
+ serverTime: number;
380
+ };
369
381
  isConcurrent: boolean;
370
382
  peerId: PeerId;
371
383
  mediaModifiers: MediaModifiers;
@@ -1,4 +1,4 @@
1
- import { TransportTopology } from '../classes/transport/Transport';
1
+ import TransportTopology from '../enums/TransportTopology';
2
2
  export type StatTransport = {
3
3
  timestamp: number;
4
4
  availableOutgoingBitrate: number;
@@ -7,6 +7,8 @@ declare class WebTransportEventual {
7
7
  private readonly url;
8
8
  private readonly options;
9
9
  private readonly compression;
10
+ private closeRequested;
11
+ private closeEventEmitted;
10
12
  private encoder;
11
13
  private decoder;
12
14
  onopen: ((this: WebTransportEventual, ev: Event) => any) | null;
@@ -22,6 +24,8 @@ declare class WebTransportEventual {
22
24
  send(data: string): Promise<void>;
23
25
  private createErrorEvent;
24
26
  close(code?: number, reason?: string): void;
27
+ private closeConnectedTransport;
28
+ private emitClose;
25
29
  static isBrowserSupported(): boolean;
26
30
  }
27
31
  export { WebTransportEventual as WebTransport };
@@ -95,10 +95,9 @@ export type DebugLogGetParams = {
95
95
  };
96
96
  export declare function add(level: string, args: any[], sessionId?: string): CurrentLogItem;
97
97
  export declare function init(): void;
98
- export declare function startSession(forceNew?: boolean): string;
98
+ export declare function startConversationSession(): string;
99
99
  export declare function setConversationId(conversationId: string | null, sessionId?: string): void;
100
100
  export declare function list(): Promise<DebugLogSessionInfo[]>;
101
- export declare function getCurrentSession(): Promise<DebugLogSessionInfo | null>;
102
101
  export declare function get(params: DebugLogGetParams): Promise<CurrentLogItem[]>;
103
102
  export declare function getJson(params: DebugLogGetParams): Promise<string>;
104
103
  export declare function download(params: DebugLogGetParams): Promise<string>;
@@ -1,9 +0,0 @@
1
- import HangupReason from '../HangupReason';
2
- import { TransportTopology } from '../transport/Transport';
3
- /**
4
- * Класс для работы с событийными метриками, обертка для правильной отправки событий
5
- */
6
- export declare class EventMetricsService {
7
- private static correctHangupReason;
8
- static sendHangupEvent(reason: HangupReason, topology?: TransportTopology): void;
9
- }