@vkontakte/calls-sdk 2.8.12-dev.8c2bbcbf.0 → 2.8.12-dev.8f58ce7b.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.
- package/CallsSDK.d.ts +24 -7
- package/abstract/BaseApi.d.ts +1 -1
- package/abstract/BaseSignaling.d.ts +6 -5
- package/calls-sdk.cjs.js +7 -13
- package/calls-sdk.esm.js +2756 -2157
- package/classes/CallRegistry.d.ts +1 -1
- package/classes/ExternalIdCache.d.ts +1 -0
- package/classes/MediaSource.d.ts +4 -0
- package/classes/{Conversation.d.ts → conversation/Conversation.d.ts} +40 -36
- package/classes/conversation/Conversation.testUtils.d.ts +148 -0
- package/classes/{ConversationResponseValidator.d.ts → conversation/ConversationResponseValidator.d.ts} +1 -1
- package/classes/{DisplayLayoutRequester.d.ts → conversation/DisplayLayoutRequester.d.ts} +5 -5
- package/classes/conversation/index.d.ts +1 -0
- package/classes/stat/CallFinishClassifier.d.ts +11 -0
- package/classes/stat/CallLifecycleStats.d.ts +1 -6
- package/classes/stat/StatAggregator.d.ts +4 -0
- package/classes/transport/DirectTransport.d.ts +1 -0
- package/classes/transport/ServerTransport.d.ts +1 -4
- package/classes/transport/SimulcastSender.d.ts +27 -0
- package/classes/transport/Transport.d.ts +3 -0
- package/default/Api.d.ts +2 -2
- package/default/Signaling.d.ts +12 -15
- package/default/SignalingTransport.d.ts +7 -1
- package/enums/ClientHangupReason.d.ts +7 -0
- package/enums/HangupType.d.ts +0 -1
- package/enums/Stat.d.ts +0 -1
- package/package.json +3 -3
- package/static/External.d.ts +1 -1
- package/static/Params.d.ts +28 -2
- package/static/Sdp.d.ts +3 -0
- package/static/SignalingCapabilities.d.ts +1 -1
- package/static/SimulcastInfo.d.ts +5 -3
- package/static/Utils.d.ts +1 -2
- package/static/WebRTCUtils.d.ts +8 -7
- package/types/Capabilities.d.ts +1 -0
- package/types/SignalingMessage.d.ts +5 -1
- package/types/WebTransport.d.ts +14 -15
- package/utils/IceServers.d.ts +2 -0
- package/utils/NavigatorPermissions.d.ts +2 -2
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import HangupType from './HangupType';
|
|
2
|
+
/**
|
|
3
|
+
* Причины завершения звонка, которые клиент может передать в {@link hangup}/{@link declineCall}
|
|
4
|
+
* и пробросить в сигналинг без маппинга.
|
|
5
|
+
*/
|
|
6
|
+
export type ClientHangupReason = HangupType.HUNGUP | HangupType.CANCELED | HangupType.REJECTED | HangupType.BUSY | HangupType.MISSED | HangupType.CALL_TIMEOUT;
|
|
7
|
+
export default ClientHangupReason;
|
package/enums/HangupType.d.ts
CHANGED
|
@@ -20,7 +20,6 @@ declare enum HangupType {
|
|
|
20
20
|
CALLER_IS_REJECTED = "CALLER_IS_REJECTED",
|
|
21
21
|
UNKNOWN_ERROR = "UNKNOWN_ERROR",
|
|
22
22
|
UNSUPPORTED = "UNSUPPORTED",
|
|
23
|
-
OLD_VERSION = "OLD_VERSION",
|
|
24
23
|
SERVICE_DISABLED = "SERVICE_DISABLED",
|
|
25
24
|
SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE",
|
|
26
25
|
EXTERNAL_API_ERROR = "EXTERNAL_API_ERROR",
|
package/enums/Stat.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/calls-sdk",
|
|
3
|
-
"version": "2.8.12-dev.
|
|
3
|
+
"version": "2.8.12-dev.8f58ce7b.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,7 +14,7 @@
|
|
|
14
14
|
"**/*.d.ts"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@vkontakte/calls-audio-effects": "1.
|
|
17
|
+
"@vkontakte/calls-audio-effects": "1.4.0",
|
|
18
18
|
"@vkontakte/calls-video-effects": "2.2.3-beta.7",
|
|
19
19
|
"@vkontakte/calls-vmoji": "1.0.10-beta.17",
|
|
20
20
|
"@vkontakte/libvpx": "2.0.9",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"fflate": "^0.8.2",
|
|
23
23
|
"messagepack": "1.1.12",
|
|
24
24
|
"simple-ebml-builder": "0.2.2",
|
|
25
|
-
"webrtc-adapter": "
|
|
25
|
+
"webrtc-adapter": "9.0.5"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/static/External.d.ts
CHANGED
|
@@ -637,6 +637,6 @@ declare namespace External {
|
|
|
637
637
|
/**
|
|
638
638
|
* Собеседник подключился к сигналлингу
|
|
639
639
|
*/
|
|
640
|
-
function onPeerRegistered(conversationId?: string): void;
|
|
640
|
+
function onPeerRegistered(conversationId?: string, externalIds?: ExternalId[]): void;
|
|
641
641
|
}
|
|
642
642
|
export default External;
|
package/static/Params.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { VideoEffects } from '@vkontakte/calls-video-effects';
|
|
2
|
-
import type { EffectVoiceChange } from '@vkontakte/calls-audio-effects';
|
|
2
|
+
import type { EffectVoiceChange, VadControllerOptions, VadLib } from '@vkontakte/calls-audio-effects';
|
|
3
3
|
import type * as Vmoji from '@vkontakte/calls-vmoji';
|
|
4
4
|
import { IAsrData } from '../types/Asr';
|
|
5
5
|
import { ConversationData } from '../types/Conversation';
|
|
@@ -193,6 +193,14 @@ export type ParamsObject = {
|
|
|
193
193
|
* Можно установить позднее методом `setAudioEffects`
|
|
194
194
|
*/
|
|
195
195
|
audioEffects: EffectVoiceChange | null;
|
|
196
|
+
/**
|
|
197
|
+
* Namespace библиотеки VAD из `@vkontakte/calls-audio-effects`.
|
|
198
|
+
*
|
|
199
|
+
* Можно установить методом `setVad`
|
|
200
|
+
*/
|
|
201
|
+
vad: VadLib | null;
|
|
202
|
+
/** Настройки VAD (threshold, hangoverMs, enabled) */
|
|
203
|
+
vadOptions: VadControllerOptions;
|
|
196
204
|
/**
|
|
197
205
|
* Максимальная ширина видео в пикселях для видео эффекта
|
|
198
206
|
*
|
|
@@ -505,6 +513,16 @@ export type ParamsObject = {
|
|
|
505
513
|
* _По умолчанию: `false`_
|
|
506
514
|
*/
|
|
507
515
|
enableSessionStateUpdates: boolean;
|
|
516
|
+
/**
|
|
517
|
+
* Использовать `<audio>` вместо `<video>` для воспроизведения звука в desktop Safari
|
|
518
|
+
* @hidden
|
|
519
|
+
*/
|
|
520
|
+
safariAudioElement: boolean;
|
|
521
|
+
/**
|
|
522
|
+
* Отправлять пустой ICE candidate (end-of-candidates) удалённому пиру
|
|
523
|
+
* @hidden
|
|
524
|
+
*/
|
|
525
|
+
forwardEmptyIceCandidate: boolean;
|
|
508
526
|
/**
|
|
509
527
|
* Получен локальный стрим с камеры/микрофона
|
|
510
528
|
*/
|
|
@@ -892,7 +910,7 @@ export type ParamsObject = {
|
|
|
892
910
|
/**
|
|
893
911
|
* Собеседник подключился к сигналлингу
|
|
894
912
|
*/
|
|
895
|
-
onPeerRegistered?: (conversationId?: string) => void;
|
|
913
|
+
onPeerRegistered?: (conversationId?: string, externalIds?: ExternalId[]) => void;
|
|
896
914
|
};
|
|
897
915
|
export default abstract class Params {
|
|
898
916
|
private static _params;
|
|
@@ -960,6 +978,10 @@ export default abstract class Params {
|
|
|
960
978
|
static get displaySurface(): DisplayCaptureSurfaceType;
|
|
961
979
|
static get audioEffects(): EffectVoiceChange | null;
|
|
962
980
|
static set audioEffects(value: EffectVoiceChange | null);
|
|
981
|
+
static get vad(): VadLib | null;
|
|
982
|
+
static set vad(value: VadLib | null);
|
|
983
|
+
static get vadOptions(): VadControllerOptions;
|
|
984
|
+
static set vadOptions(value: VadControllerOptions);
|
|
963
985
|
static get videoEffects(): VideoEffects | null;
|
|
964
986
|
static set videoEffects(value: VideoEffects | null);
|
|
965
987
|
static get videoEffectMaxWidth(): number;
|
|
@@ -1027,6 +1049,8 @@ export default abstract class Params {
|
|
|
1027
1049
|
static get waitForRecordResponse(): boolean;
|
|
1028
1050
|
static get transparentAudio(): boolean;
|
|
1029
1051
|
static get enableSessionStateUpdates(): boolean;
|
|
1052
|
+
static get safariAudioElement(): boolean;
|
|
1053
|
+
static get forwardEmptyIceCandidate(): boolean;
|
|
1030
1054
|
static toJSON(): {
|
|
1031
1055
|
apiKey: string;
|
|
1032
1056
|
apiEnv: string;
|
|
@@ -1063,5 +1087,7 @@ export default abstract class Params {
|
|
|
1063
1087
|
waitForRecordResponse: boolean;
|
|
1064
1088
|
transparentAudio: boolean;
|
|
1065
1089
|
enableSessionStateUpdates: boolean;
|
|
1090
|
+
safariAudioElement: boolean;
|
|
1091
|
+
forwardEmptyIceCandidate: boolean;
|
|
1066
1092
|
};
|
|
1067
1093
|
}
|
package/static/Sdp.d.ts
ADDED
|
@@ -6,8 +6,10 @@ export declare const SIMULCAST_DEFAULT: {
|
|
|
6
6
|
BITRATE: number;
|
|
7
7
|
};
|
|
8
8
|
export declare const SIMULCAST_SCALABILITY_MODE = "L1T2";
|
|
9
|
-
export declare const MAP_RID_TO_SCALE_RESOLUTION_DOWN_BY: Record<string, number>;
|
|
10
9
|
export declare function isEqualSimulcastInfo(si1: ISimulcastInfo | null, si2: ISimulcastInfo | null): boolean;
|
|
11
10
|
export declare function findBitrateAsc(maxDimension: number, bitrates: VideoBitrateSettings[]): number;
|
|
12
|
-
export declare function calculateSimulcastInfo(width?: number, height?: number, bitrates?: VideoBitrateSettings[]):
|
|
13
|
-
|
|
11
|
+
export declare function calculateSimulcastInfo(width?: number, height?: number, bitrates?: VideoBitrateSettings[], fps?: number): {
|
|
12
|
+
streams: import("../types/SimulcastInfo").SimulcastStreamInfo[];
|
|
13
|
+
};
|
|
14
|
+
export declare function findScaleResolutionDownBy(rid: string | undefined, simulcastInfo: ISimulcastInfo): number;
|
|
15
|
+
export declare function applySimulcastInfoToEncodings(encodings: RTCRtpEncodingParameters[], simulcastInfo: ISimulcastInfo, maxDimension?: number, maxBitrate?: number): void;
|
package/static/Utils.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare const DEVICE_IDX_PARAMETER = "d";
|
|
|
9
9
|
/** @hidden */
|
|
10
10
|
declare namespace Utils {
|
|
11
11
|
function patchLocalSDP(sdp: string, preferH264: boolean, brokenH264Decoder: boolean, preferVP9: boolean, isAudioNack?: boolean): string;
|
|
12
|
-
function patchRemoteSDP(sdp: string,
|
|
12
|
+
function patchRemoteSDP(sdp: string, preferH264: boolean, brokenH264: boolean, preferVP9: boolean, brokenVP9Encoder: boolean, brokenVP9Decoder: boolean): string;
|
|
13
13
|
function getPeerIdString(peerId: SignalingMessage.PeerId): string;
|
|
14
14
|
function comparePeerId(peerId1: SignalingMessage.PeerId, peerId2: SignalingMessage.PeerId): boolean;
|
|
15
15
|
function getPeerConnectionHostInfo(pc: RTCPeerConnection): Promise<{
|
|
@@ -77,6 +77,5 @@ declare namespace Utils {
|
|
|
77
77
|
function objectReduce<R, T extends object>(obj: T, callback: (acc: R, value: T[keyof T], key: keyof T) => R, initialValue: R): R;
|
|
78
78
|
const setImmediate: (fn: VoidFunction) => VoidFunction;
|
|
79
79
|
function isObject(obj: unknown): obj is object;
|
|
80
|
-
function patchSimulcastAnswerSdp(sdp: string, trans: RTCRtpTransceiver, width: number, height: number): string;
|
|
81
80
|
}
|
|
82
81
|
export default Utils;
|
package/static/WebRTCUtils.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare enum FacingMode {
|
|
|
20
20
|
/**
|
|
21
21
|
* Известные браузеры
|
|
22
22
|
*/
|
|
23
|
-
export type BrowserName = '
|
|
23
|
+
export type BrowserName = 'Edge' | 'Chrome' | 'Firefox' | 'Yandex' | 'Opera' | 'Sferum';
|
|
24
24
|
declare namespace WebRTCUtils {
|
|
25
25
|
/**
|
|
26
26
|
* До вызова этого метода бесполезно опрашивать другие публичные методы.
|
|
@@ -122,6 +122,10 @@ declare namespace WebRTCUtils {
|
|
|
122
122
|
* Проверяет поддержку WebRTC браузером
|
|
123
123
|
*/
|
|
124
124
|
function isBrowserSupported(): boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Возвращает первую отсутствующую capability в стабильном порядке.
|
|
127
|
+
*/
|
|
128
|
+
function getBrowserSupportFailure(): BrowserSupportFailure | null;
|
|
125
129
|
/**
|
|
126
130
|
* Проверяет поддержку шаринга экрана браузером
|
|
127
131
|
*/
|
|
@@ -139,17 +143,14 @@ declare namespace WebRTCUtils {
|
|
|
139
143
|
* В некоторых браузерах VP9 decoder сломан
|
|
140
144
|
*/
|
|
141
145
|
function isBrokenVP9Decoder(): boolean;
|
|
142
|
-
/**
|
|
143
|
-
* Изменился формат описания датаканала в SDP
|
|
144
|
-
* @link https://blog.mozilla.org/webrtc/how-to-avoid-data-channel-breaking/
|
|
145
|
-
*/
|
|
146
|
-
function isOldDataChannelDescription(): boolean;
|
|
147
146
|
/**
|
|
148
147
|
* Может ли браузер делать H264 приоритетным
|
|
149
148
|
*/
|
|
150
149
|
function canPreferH264(): boolean;
|
|
151
150
|
/**
|
|
152
|
-
*
|
|
151
|
+
* Поддержка simulcast браузером.
|
|
152
|
+
* Safari корректно поддерживает simulcast начиная с версии 18.
|
|
153
|
+
* Firefox поддерживает simulcast с VP8 начиная с версии 134.
|
|
153
154
|
*/
|
|
154
155
|
function isSimulcastSupportedByBrowser(): boolean;
|
|
155
156
|
/**
|
package/types/Capabilities.d.ts
CHANGED
|
@@ -34,8 +34,11 @@ export type RecordInfo = {
|
|
|
34
34
|
recordExternalOwnerId?: string;
|
|
35
35
|
};
|
|
36
36
|
export interface SignalingResponse extends SignalingMessage {
|
|
37
|
-
response?: SignalingCommandType;
|
|
38
37
|
error?: string;
|
|
38
|
+
errorCode?: string;
|
|
39
|
+
errorMessage?: string;
|
|
40
|
+
message?: string;
|
|
41
|
+
response?: SignalingCommandType;
|
|
39
42
|
reason?: HangupType | FatalError;
|
|
40
43
|
sequence?: number;
|
|
41
44
|
type: 'response' | 'error' | 'timeout';
|
|
@@ -185,6 +188,7 @@ declare namespace SignalingMessage {
|
|
|
185
188
|
peerId: PeerId;
|
|
186
189
|
mediaSettings: Partial<MediaSettings>;
|
|
187
190
|
capabilities?: string;
|
|
191
|
+
externalId?: ExternalId;
|
|
188
192
|
}
|
|
189
193
|
export interface Hungup extends Notification {
|
|
190
194
|
participantId: OkUserId;
|
package/types/WebTransport.d.ts
CHANGED
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
import { WebTransportOptions } from '@fails-components/webtransport';
|
|
2
2
|
import { DebugLogger } from '../static/Debug';
|
|
3
3
|
declare class WebTransportEventual {
|
|
4
|
+
static isBrowserSupported(): boolean;
|
|
5
|
+
onopen: ((this: WebTransportEventual, ev: Event) => any) | null;
|
|
6
|
+
onmessage: ((this: WebTransportEventual, ev: MessageEvent) => any) | null;
|
|
7
|
+
onerror: ((this: WebTransportEventual, ev: Event) => any) | null;
|
|
8
|
+
onclose: ((this: WebTransportEventual, ev: CloseEvent) => any) | null;
|
|
9
|
+
readyState: number;
|
|
4
10
|
private webTransport;
|
|
5
|
-
private stream;
|
|
6
11
|
private writer;
|
|
7
|
-
private reader;
|
|
8
12
|
private readonly url;
|
|
9
13
|
private readonly options;
|
|
10
14
|
private readonly compression;
|
|
11
|
-
private closeRequested;
|
|
12
|
-
private closeEventEmitted;
|
|
13
15
|
private encoder;
|
|
14
16
|
private decoder;
|
|
15
17
|
private readonly _debug;
|
|
16
|
-
onopen: ((this: WebTransportEventual, ev: Event) => any) | null;
|
|
17
|
-
onmessage: ((this: WebTransportEventual, ev: MessageEvent) => any) | null;
|
|
18
|
-
onerror: ((this: WebTransportEventual, ev: Event) => any) | null;
|
|
19
|
-
onclose: ((this: WebTransportEventual, ev: CloseEvent) => any) | null;
|
|
20
|
-
readyState: number;
|
|
21
18
|
constructor(url: string, options?: WebTransportOptions, debug?: DebugLogger);
|
|
19
|
+
send(data: string): Promise<void>;
|
|
20
|
+
close(code?: number, reason?: string): void;
|
|
22
21
|
private getCompressionTypeFromUrl;
|
|
23
22
|
private connect;
|
|
24
|
-
private
|
|
23
|
+
private observeClosed;
|
|
25
24
|
private readLoop;
|
|
26
|
-
|
|
25
|
+
private fail;
|
|
26
|
+
private handleStreamError;
|
|
27
|
+
private requestNativeClose;
|
|
28
|
+
private finishClose;
|
|
29
|
+
private emitEvent;
|
|
27
30
|
private createErrorEvent;
|
|
28
|
-
close(code?: number, reason?: string): void;
|
|
29
|
-
private closeConnectedTransport;
|
|
30
|
-
private emitClose;
|
|
31
|
-
static isBrowserSupported(): boolean;
|
|
32
31
|
}
|
|
33
32
|
export { WebTransportEventual as WebTransport };
|
|
@@ -2,8 +2,8 @@ type Device = 'camera' | 'microphone';
|
|
|
2
2
|
type PermissionStatusState = typeof PermissionStatus.prototype.state;
|
|
3
3
|
type EventListener = (name: Device, state: PermissionStatusState) => void;
|
|
4
4
|
export declare class NavigatorPermissions {
|
|
5
|
-
private _cameraPermissionStatus
|
|
6
|
-
private _microphonePermissionStatus
|
|
5
|
+
private _cameraPermissionStatus?;
|
|
6
|
+
private _microphonePermissionStatus?;
|
|
7
7
|
private _listener;
|
|
8
8
|
static isSupported(): boolean;
|
|
9
9
|
init(listener: EventListener): Promise<void>;
|