@vkontakte/calls-sdk 2.8.6-dev.97c05c29.0 → 2.8.6-dev.9cc6d398.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.
@@ -78,19 +78,18 @@ export default class Conversation extends EventEmitter {
78
78
  private _onJoinPart2;
79
79
  private _extractExternalRooms;
80
80
  private _extractExternalRoomsData;
81
- onPush(conversationId: string, type?: UserType, peerId?: number, conversationParams?: string): Promise<void>;
81
+ onPush(conversationId: string, type?: UserType, peerId?: number): Promise<void>;
82
82
  private _isInWaitingHall;
83
83
  private _isRestricted;
84
84
  private _isAudienceMode;
85
85
  private _isAudienceModeListener;
86
86
  private _acceptConcurrent;
87
87
  private _getMainRoomParticipants;
88
- private _decodeExternalConversationParams;
89
- private _logCallStartEvent;
90
88
  accept(mediaOptions: MediaOption[]): Promise<ConversationData>;
91
89
  decline(): Promise<void>;
92
90
  hangup(): Promise<void>;
93
- addParticipant(participantIds: CompositeUserId[], params?: AddParticipantParams): Promise<void>;
91
+ addParticipant(participantIds: ExternalId[], params?: AddParticipantParams): Promise<void>;
92
+ addParticipantLegacy(participantIds: CompositeUserId[], params?: AddParticipantParams): Promise<void>;
94
93
  removeParticipant(participantId: CompositeUserId, ban?: boolean): Promise<void>;
95
94
  setVolume(volume: number): void;
96
95
  updateStatisticsInterval(): void;
@@ -98,7 +97,6 @@ export default class Conversation extends EventEmitter {
98
97
  private _close;
99
98
  destroy(): void;
100
99
  private _getConversationParams;
101
- private _setConversationParams;
102
100
  private _addGeoParamsToEndpoint;
103
101
  /**
104
102
  * @throws ErrorEvent
@@ -33,6 +33,7 @@ export default class Signaling extends BaseSignaling {
33
33
  private responseHandlers;
34
34
  private reconnectCount;
35
35
  private endpoint;
36
+ private wtEndpoint;
36
37
  protected conversationResolve: Function | null;
37
38
  protected conversationReject: Function | null;
38
39
  private connected;
@@ -57,6 +58,7 @@ export default class Signaling extends BaseSignaling {
57
58
  private static _getCapabilityFlags;
58
59
  get ready(): boolean;
59
60
  setEndpoint(endpoint: string): void;
61
+ setWebTransportEndpoint(endpoint: string | null): void;
60
62
  setConversationId(conversationId: string): void;
61
63
  setParticipantIdRegistry(participantIdRegistry: ParticipantIdRegistry): void;
62
64
  setProducerNotificationDataChannel(dataChannel: RTCDataChannel): void;
@@ -88,7 +90,8 @@ export default class Signaling extends BaseSignaling {
88
90
  changeMediaSettings(mediaSettings: MediaSettings): Promise<SignalingMessage>;
89
91
  changeParticipantState(state: ParticipantStateData, compositeUserId?: CompositeUserId): Promise<SignalingMessage>;
90
92
  putHandsDown(): Promise<SignalingMessage>;
91
- addParticipant(participantIds: CompositeUserId[], params?: AddParticipantParams): Promise<SignalingMessage>;
93
+ addParticipant(externalIds: CompositeUserId[], params?: AddParticipantParams): Promise<SignalingMessage>;
94
+ addParticipantLegacy(participantIds: CompositeUserId[], params?: AddParticipantParams): Promise<SignalingMessage>;
92
95
  removeParticipant(participantId: CompositeUserId, ban?: boolean): Promise<SignalingMessage>;
93
96
  allocateConsumer(description: RTCSessionDescription | null, capabilities: {
94
97
  [key: string]: number | boolean | string;
@@ -160,7 +163,7 @@ export default class Signaling extends BaseSignaling {
160
163
  startAsr(params: IAsrStartParams): Promise<SignalingMessage>;
161
164
  stopAsr(params?: IAsrStopParams): Promise<SignalingMessage>;
162
165
  requestAsr(request: boolean): Promise<SignalingMessage>;
163
- protected _connect(connectionType: SignalingConnectionType): void;
166
+ protected _connect(connectionType: SignalingConnectionType, useWebTransport: boolean): void;
164
167
  protected _disconnect(code?: number): void;
165
168
  private _onOpen;
166
169
  private _onMessage;
@@ -182,4 +185,5 @@ export default class Signaling extends BaseSignaling {
182
185
  protected _stopWaitConnectionMessage(): void;
183
186
  private _startDoctor;
184
187
  private _stopDoctor;
188
+ private isWebtransportAvailable;
185
189
  }
package/enums/Stat.d.ts CHANGED
@@ -37,7 +37,6 @@ declare const enum Stat {
37
37
  FIRST_MEDIA_RECEIVED = "first_media_received",
38
38
  CALL_EVENTUAL_STAT = "callEventualStat",
39
39
  CALL_DECLINED_OR_HANGED_LOCALLY = "CallDeclinedOrHangedLocally",
40
- USER_FEEDBACK_RECEIVED = "UserFeedbackReceived",
41
- CALL_START = "call_start"
40
+ USER_FEEDBACK_RECEIVED = "UserFeedbackReceived"
42
41
  }
43
42
  export default Stat;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.8.6-dev.97c05c29.0",
3
+ "version": "2.8.6-dev.9cc6d398.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",
@@ -14,11 +14,14 @@
14
14
  "**/*.d.ts"
15
15
  ],
16
16
  "dependencies": {
17
+ "@fails-components/webtransport": "^1.3.0",
18
+ "@fails-components/webtransport-transport-http3-quiche": "^1.3.0",
17
19
  "@vkontakte/calls-audio-effects": "1.2.8",
18
20
  "@vkontakte/calls-video-effects": "2.2.3-beta.5",
19
21
  "@vkontakte/calls-vmoji": "1.0.10-beta.17",
20
22
  "@vkontakte/libvpx": "2.0.9",
21
23
  "bit-buffer": "0.2.5",
24
+ "fflate": "^0.8.2",
22
25
  "messagepack": "1.1.12",
23
26
  "simple-ebml-builder": "0.2.2",
24
27
  "webrtc-adapter": "7.7.0"
@@ -461,6 +461,31 @@ export type ParamsObject = {
461
461
  * _По умолчанию: `false`_
462
462
  */
463
463
  enableLogPerfStatReport: boolean;
464
+ /**
465
+ * Поддержка переключения качества видео в зависимости от сети
466
+ * Только для режима p2p
467
+ *
468
+ * _По умолчанию: `false`_
469
+ */
470
+ switchVideoAtBadNetwork: boolean;
471
+ /**
472
+ * Включает деградацию фпс для видео с камеры при низком фпс с включенными вирт фонами
473
+ *
474
+ * _По умолчанию: `false`_
475
+ */
476
+ enableVideoEffectsFpsDegradation: boolean;
477
+ /**
478
+ * Включить поддержку simulcast на отправке
479
+ *
480
+ * _По умолчанию: `false`_
481
+ */
482
+ simulcast: boolean;
483
+ /**
484
+ * Включить поддержку webtransport для сигналинга
485
+ *
486
+ * _По умолчанию: `false`_
487
+ */
488
+ webtransport: boolean;
464
489
  /**
465
490
  * Получен локальный стрим с камеры/микрофона
466
491
  */
@@ -834,27 +859,6 @@ export type ParamsObject = {
834
859
  * Собеседник подключился к сигналлингу
835
860
  */
836
861
  onPeerRegistered?: () => void;
837
- /**
838
- * Поддержка переключения качества видео в зависимости от сети
839
- * Только для режима p2p
840
- *
841
- * _По умолчанию: `false`_
842
- */
843
- switchVideoAtBadNetwork: boolean;
844
- /** включает деградацию фпс для видео с камеры при низком фпс с включенными вирт фонами */
845
- enableVideoEffectsFpsDegradation: boolean;
846
- /**
847
- * Включить поддержку simulcast на отправке
848
- *
849
- * _По умолчанию: `false`_
850
- */
851
- simulcast: boolean;
852
- /**
853
- * Не запрашивать conversation params при входе в звонок
854
- *
855
- * _По умолчанию: `false`_
856
- */
857
- skipConversationParams?: boolean;
858
862
  };
859
863
  export default abstract class Params {
860
864
  private static _params;
@@ -984,7 +988,8 @@ export default abstract class Params {
984
988
  static get enableVideoEffectsFpsDegradation(): boolean;
985
989
  static get simulcast(): boolean;
986
990
  static set simulcast(value: boolean);
987
- static get skipConversationParams(): boolean | undefined;
991
+ static get webtransport(): boolean;
992
+ static set webtransport(value: boolean);
988
993
  static toJSON(): {
989
994
  apiKey: string;
990
995
  apiEnv: string;
@@ -1013,5 +1018,7 @@ export default abstract class Params {
1013
1018
  clientStatsPlatform: string;
1014
1019
  consumerScreenDataChannelPacketSize: number;
1015
1020
  switchVideoAtBadNetwork: boolean;
1021
+ simulcast: boolean;
1022
+ webtransport: boolean;
1016
1023
  };
1017
1024
  }
@@ -10,17 +10,6 @@ type ConversationParams = {
10
10
  isp_as_org?: string;
11
11
  loc_cc?: string;
12
12
  loc_reg?: string;
13
- external_user_type?: string;
14
- };
15
- export type ExternalConversationParams = {
16
- et: number;
17
- iv: boolean;
18
- srcp: string;
19
- stne: string;
20
- tkn: string;
21
- trne: string;
22
- trnp: string;
23
- trnu: string;
24
- wse: string;
13
+ external_user_type: string;
25
14
  };
26
15
  export default ConversationParams;
@@ -1,5 +1,4 @@
1
1
  import HangupType from '../enums/HangupType';
2
- import IceServer from './IceServer';
3
2
  /**
4
3
  * Начальные данные создания звонка
5
4
  * @hidden
@@ -13,6 +12,10 @@ type ConversationResponse = {
13
12
  * URL для подключения
14
13
  */
15
14
  endpoint: string;
15
+ /**
16
+ * URL для подключения по WebTransport
17
+ */
18
+ wt_endpoint?: string;
16
19
  /**
17
20
  * Токен комнаты для подключения к звонку по ссылке
18
21
  */
@@ -28,9 +31,5 @@ type ConversationResponse = {
28
31
  * Порядковый номер, присвоенный устройству при входе в звонок
29
32
  */
30
33
  device_idx?: number;
31
- turn_server?: IceServer;
32
- stun_server?: IceServer;
33
- client_type?: string;
34
- token: string;
35
34
  };
36
35
  export default ConversationResponse;
@@ -19,6 +19,7 @@ export declare namespace ExternalIdUtils {
19
19
  function fromId(id: ExternalUserId, type?: ExternalIdType, deviceIdx?: number): ExternalParticipantId;
20
20
  function fromSignalingParticipant(participant: SignalingMessage.Participant, useDecorative?: boolean): ExternalParticipantId | undefined;
21
21
  function fromSignaling(signalingId: SignalingMessage.ExternalId, deviceIdx?: number): ExternalParticipantId;
22
+ function toSignaling(externalId: ExternalId): string;
22
23
  function toString(externalId: ExternalId): ExternalIdString;
23
24
  function fromIdToString(id: ExternalUserId, type?: ExternalIdType, deviceIdx?: number): ExternalIdString;
24
25
  function fromString(stringId: ExternalIdString): ExternalParticipantId;
@@ -0,0 +1,34 @@
1
+ interface WebTransportHash {
2
+ algorithm?: string;
3
+ value?: BufferSource;
4
+ }
5
+ interface WebTransportOptions {
6
+ allowPooling?: boolean;
7
+ congestionControl?: CongestionControlType;
8
+ requireUnreliable?: boolean;
9
+ serverCertificateHashes?: WebTransportHash[];
10
+ }
11
+ type CongestionControlType = 'default' | 'low-latency' | 'throughput';
12
+ declare class WebTransportEventual {
13
+ private webTransport;
14
+ private stream;
15
+ private writer;
16
+ private reader;
17
+ private readonly url;
18
+ private readonly options;
19
+ private readonly compression;
20
+ private encoder;
21
+ private decoder;
22
+ onopen: ((this: WebTransportEventual, ev: Event) => any) | null;
23
+ onmessage: ((this: WebTransportEventual, ev: MessageEvent) => any) | null;
24
+ onerror: ((this: WebTransportEventual, ev: Event) => any) | null;
25
+ onclose: ((this: WebTransportEventual, ev: CloseEvent) => any) | null;
26
+ readyState: number;
27
+ constructor(url: string, options?: WebTransportOptions);
28
+ private getCompressionTypeFromUrl;
29
+ private connect;
30
+ private readLoop;
31
+ send(data: string): Promise<void>;
32
+ close(code?: number, reason?: string): void;
33
+ }
34
+ export { WebTransportEventual as WebTransport };
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Encodes a string into a Uint8Array, prepending the length of the string as a variable-length integer and optionally compressing it.
3
+ */
4
+ declare class LengthPrefixedTextEncoder {
5
+ private readonly encoder;
6
+ private readonly compression;
7
+ private readonly lengthEncoder;
8
+ constructor(compression?: 'gzip' | 'deflate' | 'deflate-raw' | null);
9
+ /**
10
+ * Encodes the given string into a Uint8Array.
11
+ *
12
+ * @param data The string to encode.
13
+ * @returns A Uint8Array containing the length-prefixed and optionally compressed encoded string.
14
+ * @throws {RangeError} If the string length exceeds the maximum representable value.
15
+ */
16
+ encode(data: string): Uint8Array;
17
+ private compress;
18
+ }
19
+ /**
20
+ * Decodes a stream of Uint8Arrays into strings, where each string
21
+ * is prefixed by its length as a variable-length integer and optionally decompressed.
22
+ */
23
+ declare class LengthPrefixedTextDecoder {
24
+ private readonly decoder;
25
+ private readonly compression;
26
+ private readonly lengthDecoder;
27
+ private buffer;
28
+ private expectedLength;
29
+ private offset;
30
+ private lengthPrefixLength;
31
+ constructor(compression?: 'gzip' | 'deflate' | 'deflate-raw' | null);
32
+ /**
33
+ * Decodes a Uint8Array into a list of strings.
34
+ *
35
+ * @param data The Uint8Array to decode.
36
+ * @returns An array of decoded strings.
37
+ */
38
+ decode(data: Uint8Array): string[];
39
+ /**
40
+ * Reads the length prefix from the beginning of the data.
41
+ *
42
+ * @param data The Uint8Array containing the length prefix.
43
+ * @returns The length of the message, or null if there's not enough data to read the length.
44
+ */
45
+ private readLength;
46
+ private decompress;
47
+ }
48
+ export { LengthPrefixedTextEncoder, LengthPrefixedTextDecoder };
@@ -0,0 +1,18 @@
1
+ declare class VariableLengthIntegerEncoder {
2
+ /**
3
+ * Encodes an integer using a variable-length integer encoding.
4
+ * @param num The number to encode.
5
+ * @returns A Uint8Array representing the encoded integer.
6
+ */
7
+ encode(num: number | bigint): Uint8Array;
8
+ }
9
+ declare class VariableLengthIntegerDecoder {
10
+ /**
11
+ * Decodes an integer from a Uint8Array using variable-length integer encoding.
12
+ * @param data The Uint8Array to decode.
13
+ * @returns The decoded integer.
14
+ */
15
+ decode(data: Uint8Array): bigint;
16
+ getNumBytesForLengthInteger(data: Uint8Array): number;
17
+ }
18
+ export { VariableLengthIntegerEncoder, VariableLengthIntegerDecoder };
package/utils/Lz4.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare function lz4Decompress(input: Uint8Array, outputLength: number): Uint8Array;