@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.
- package/CallsSDK.d.ts +46 -23
- package/abstract/BaseApi.d.ts +5 -8
- package/abstract/BaseSignaling.d.ts +2 -3
- package/calls-sdk.cjs.js +9 -9
- package/calls-sdk.esm.js +6038 -5138
- package/classes/AudioFix.d.ts +5 -1
- package/classes/AudioOutput.d.ts +5 -1
- package/classes/CallRegistry.d.ts +5 -1
- package/classes/Conversation.d.ts +35 -7
- package/classes/ConversationResponseValidator.d.ts +3 -0
- package/classes/DebugInfo.d.ts +3 -0
- package/classes/DisplayLayoutRequester.d.ts +39 -0
- package/classes/ExternalIdCache.d.ts +19 -0
- package/classes/MediaSource.d.ts +6 -2
- package/classes/ParticipantIdRegistry.d.ts +3 -0
- package/classes/ProducerCommandSerializationService.d.ts +3 -0
- package/classes/SignalingActor.d.ts +3 -1
- package/classes/SpeakerDetector.d.ts +2 -1
- package/classes/SpecListener.d.ts +10 -1
- package/classes/{Logger.d.ts → StatsLogger.d.ts} +3 -13
- package/classes/VideoEffectsFpsLimiter.d.ts +3 -0
- package/classes/asr/AsrReceiver.d.ts +3 -1
- package/classes/codec/LibVPxDecoder.d.ts +3 -0
- package/classes/codec/LibVPxEncoder.d.ts +3 -1
- package/classes/codec/WebCodecsDecoder.d.ts +3 -0
- package/classes/codec/WebCodecsEncoder.d.ts +3 -1
- package/classes/codec/WorkerBase.d.ts +7 -0
- package/classes/screenshare/BaseStreamBuilder.d.ts +4 -1
- package/classes/screenshare/CanvasRenderer.d.ts +3 -1
- package/classes/screenshare/ScreenCaptureReceiver.d.ts +7 -1
- package/classes/screenshare/ScreenCaptureSender.d.ts +5 -1
- package/classes/screenshare/ScreenCongestionControl.d.ts +3 -1
- package/classes/screenshare/StreamBuilder.d.ts +5 -1
- package/classes/screenshare/TrackGeneratorRenderer.d.ts +3 -1
- package/classes/screenshare/WebmBuilder.d.ts +3 -1
- package/classes/stat/CodecStatsAggregator.d.ts +7 -7
- package/classes/stat/ConversationStats.d.ts +21 -0
- package/classes/stat/StatAggregator.d.ts +6 -6
- package/classes/stat/StatFirstMediaReceived.d.ts +6 -2
- package/classes/stat/StatPings.d.ts +9 -9
- package/classes/stat/StatScreenShareFirstFrame.d.ts +3 -1
- package/classes/stat/StatSignalingCommands.d.ts +8 -8
- package/classes/transport/BaseTransport.d.ts +1 -1
- package/classes/transport/DirectStatReporter.d.ts +3 -1
- package/classes/transport/DirectTransport.d.ts +14 -1
- package/classes/transport/PerfStatReporter.d.ts +5 -1
- package/classes/transport/ServerTransport.d.ts +10 -2
- package/classes/transport/Transport.d.ts +13 -14
- package/default/Api.d.ts +12 -19
- package/default/Signaling.d.ts +41 -45
- package/default/SignalingTransport.d.ts +68 -0
- package/enums/HangupType.d.ts +2 -1
- package/enums/SignalingNotification.d.ts +1 -0
- package/enums/TransportState.d.ts +10 -0
- package/enums/TransportTopology.d.ts +5 -0
- package/package.json +1 -1
- package/static/Debug.d.ts +27 -8
- package/static/External.d.ts +3 -0
- package/static/Params.d.ts +32 -8
- package/static/ParticipantConnectionStatusUtils.d.ts +16 -0
- package/static/Utils.d.ts +3 -2
- package/static/WebRTCUtils.d.ts +6 -4
- package/types/Conversation.d.ts +1 -1
- package/types/ExternalId.d.ts +1 -1
- package/types/FastStart.d.ts +1 -0
- package/types/Participant.d.ts +12 -1
- package/types/ParticipantLayout.d.ts +33 -0
- package/types/PushData.d.ts +3 -0
- package/types/SignalingMessage.d.ts +12 -2
- package/types/Statistics.d.ts +1 -1
- package/types/WebTransport.d.ts +4 -0
- package/utils/DebugStorage.d.ts +100 -1
- package/classes/stat/EventMetricsService.d.ts +0 -9
- package/static/ConversationDebugLogger.d.ts +0 -13
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import SignalingConnectionType from '../enums/SignalingConnectionType';
|
|
2
|
+
import { SignalingTransportType } from '../enums/SignalingTransportStat';
|
|
3
|
+
export declare enum SignalingTransportFailure {
|
|
4
|
+
EMPTY_ENDPOINT = "EMPTY_ENDPOINT",
|
|
5
|
+
NETWORK_ERROR = "NETWORK_ERROR",
|
|
6
|
+
ABORTED = "ABORTED"
|
|
7
|
+
}
|
|
8
|
+
export type SignalingTransportFailedEvent = {
|
|
9
|
+
failure: SignalingTransportFailure;
|
|
10
|
+
message: string;
|
|
11
|
+
remote?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type SignalingTransportReconnectEvent = {
|
|
14
|
+
count: number;
|
|
15
|
+
delay: number;
|
|
16
|
+
};
|
|
17
|
+
export type SignalingTransportHandlers = {
|
|
18
|
+
onOpen: () => void;
|
|
19
|
+
onMessage: (event: MessageEvent) => void;
|
|
20
|
+
onError: (event: Event) => void;
|
|
21
|
+
onClose: (event: CloseEvent) => void;
|
|
22
|
+
onFailed: (event: SignalingTransportFailedEvent) => void;
|
|
23
|
+
onReconnectScheduled: (event: SignalingTransportReconnectEvent) => void;
|
|
24
|
+
onConnectionDead: () => void;
|
|
25
|
+
};
|
|
26
|
+
export default class SignalingTransport {
|
|
27
|
+
private readonly handlers;
|
|
28
|
+
private socket;
|
|
29
|
+
private endpoint;
|
|
30
|
+
private wtEndpoint;
|
|
31
|
+
private peerId;
|
|
32
|
+
private lastStamp;
|
|
33
|
+
private connectionType;
|
|
34
|
+
private reconnectCount;
|
|
35
|
+
private reconnectTimer;
|
|
36
|
+
private doctorTimer;
|
|
37
|
+
private forceWebSocket;
|
|
38
|
+
private abortSignal;
|
|
39
|
+
private manualClose;
|
|
40
|
+
private currentType;
|
|
41
|
+
constructor(handlers: SignalingTransportHandlers);
|
|
42
|
+
get readyState(): number | null;
|
|
43
|
+
get type(): SignalingTransportType;
|
|
44
|
+
setEndpoint(endpoint: string): void;
|
|
45
|
+
setWebTransportEndpoint(endpoint: string | null): void;
|
|
46
|
+
setPeerId(peerId: number | null): void;
|
|
47
|
+
setLastStamp(lastStamp: number): void;
|
|
48
|
+
setAbortSignal(signal?: AbortSignal): void;
|
|
49
|
+
resetReconnectCount(): void;
|
|
50
|
+
connect(connectionType: SignalingConnectionType): void;
|
|
51
|
+
close(code?: number): void;
|
|
52
|
+
send(data: string | ArrayBuffer): void;
|
|
53
|
+
private _connect;
|
|
54
|
+
private _connectWebTransport;
|
|
55
|
+
private _connectWebSocket;
|
|
56
|
+
private _setSocketHandlers;
|
|
57
|
+
private _buildUrl;
|
|
58
|
+
private _canUseWebTransport;
|
|
59
|
+
private _onOpen;
|
|
60
|
+
private _onMessage;
|
|
61
|
+
private _onError;
|
|
62
|
+
private _onClose;
|
|
63
|
+
private _disconnect;
|
|
64
|
+
private _scheduleReconnect;
|
|
65
|
+
private _getReconnectDelay;
|
|
66
|
+
private _startDoctor;
|
|
67
|
+
private _stopDoctor;
|
|
68
|
+
}
|
package/enums/HangupType.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ declare enum HangupType {
|
|
|
53
53
|
* - Приложение вызываемого не запущено или упало
|
|
54
54
|
* - Брандмауэр или сетевые ограничения блокируют подключение
|
|
55
55
|
*/
|
|
56
|
-
CALL_TIMEOUT = "CALL_TIMEOUT"
|
|
56
|
+
CALL_TIMEOUT = "CALL_TIMEOUT",
|
|
57
|
+
OBSOLETE_CLIENT = "OBSOLETE_CLIENT"
|
|
57
58
|
}
|
|
58
59
|
export default HangupType;
|
|
@@ -24,6 +24,7 @@ declare enum SignalingNotification {
|
|
|
24
24
|
REALLOC_CON = "realloc-con",
|
|
25
25
|
AUDIO_ACTIVITY = "audio-activity",
|
|
26
26
|
SPEAKER_CHANGED = "speaker-changed",
|
|
27
|
+
SESSION_STATE = "session-state",
|
|
27
28
|
STALLED_ACTIVITY = "stalled-activity",
|
|
28
29
|
CHAT_MESSAGE = "chat-message",
|
|
29
30
|
CUSTOM_DATA = "custom-data",
|
package/package.json
CHANGED
package/static/Debug.d.ts
CHANGED
|
@@ -7,14 +7,33 @@ export declare enum DebugMessageType {
|
|
|
7
7
|
WARN = "WARN",
|
|
8
8
|
ERROR = "ERROR"
|
|
9
9
|
}
|
|
10
|
+
export type DebugMessageContext = {
|
|
11
|
+
readonly sessionId: string | null;
|
|
12
|
+
readonly conversationId: string | null;
|
|
13
|
+
};
|
|
14
|
+
export type DebugLogger = {
|
|
15
|
+
debug(...args: any[]): void;
|
|
16
|
+
log(...args: any[]): void;
|
|
17
|
+
warn(...args: any[]): void;
|
|
18
|
+
error(...args: any[]): void;
|
|
19
|
+
};
|
|
20
|
+
export type DebugSessionLogger = DebugLogger & {
|
|
21
|
+
readonly sessionId: string | null;
|
|
22
|
+
readonly conversationId: string | null;
|
|
23
|
+
setConversationId(conversationId: string | null): void;
|
|
24
|
+
};
|
|
10
25
|
declare namespace Debug {
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
function
|
|
14
|
-
function
|
|
15
|
-
function
|
|
16
|
-
function
|
|
17
|
-
function
|
|
18
|
-
function
|
|
26
|
+
type ContextProvider = () => DebugMessageContext;
|
|
27
|
+
export function debug(...args: any[]): void;
|
|
28
|
+
export function log(...args: any[]): void;
|
|
29
|
+
export function warn(...args: any[]): void;
|
|
30
|
+
export function error(...args: any[]): void;
|
|
31
|
+
export function enabled(): boolean;
|
|
32
|
+
export function toggle(enable: boolean): void;
|
|
33
|
+
export function send(type: DebugMessageType, ...args: any[]): void;
|
|
34
|
+
export function createLogger(getContext: ContextProvider): DebugLogger;
|
|
35
|
+
export function createSessionLogger(initialConversationId?: string | null): DebugSessionLogger;
|
|
36
|
+
export function test(tag: string, ...args: any[]): void;
|
|
37
|
+
export {};
|
|
19
38
|
}
|
|
20
39
|
export default Debug;
|
package/static/External.d.ts
CHANGED
|
@@ -503,6 +503,9 @@ declare namespace External {
|
|
|
503
503
|
* @param args
|
|
504
504
|
*/
|
|
505
505
|
function onDebugMessage(type: DebugMessageType, ...args: any[]): void;
|
|
506
|
+
function onDebugMessageWithContext(type: DebugMessageType, context: {
|
|
507
|
+
conversationId: string | null;
|
|
508
|
+
}, ...args: any[]): void;
|
|
506
509
|
/**
|
|
507
510
|
* Статистика звонка
|
|
508
511
|
*
|
package/static/Params.d.ts
CHANGED
|
@@ -256,13 +256,6 @@ export type ParamsObject = {
|
|
|
256
256
|
perfStatReportEnabled: boolean;
|
|
257
257
|
/** @hidden */
|
|
258
258
|
callStatReportEnabled: boolean;
|
|
259
|
-
/**
|
|
260
|
-
* Включает логирование событий продуктовой статистики.
|
|
261
|
-
*
|
|
262
|
-
* _По умолчанию: `false`_
|
|
263
|
-
* @hidden
|
|
264
|
-
*/
|
|
265
|
-
clientEventsLoggingEnabled: boolean;
|
|
266
259
|
/**
|
|
267
260
|
* Отдавать приоритет кодеку H264 для исходящего видео
|
|
268
261
|
*
|
|
@@ -306,6 +299,12 @@ export type ParamsObject = {
|
|
|
306
299
|
* _По умолчанию: `30`_
|
|
307
300
|
*/
|
|
308
301
|
videoTracksCount: number;
|
|
302
|
+
/**
|
|
303
|
+
* Минимальный интервал отправки diff для requestDisplayLayout в миллисекундах.
|
|
304
|
+
*
|
|
305
|
+
* _По умолчанию: `250`_
|
|
306
|
+
*/
|
|
307
|
+
requestDisplayLayoutThrottleMs: number;
|
|
309
308
|
/** @hidden */
|
|
310
309
|
movieShare: boolean;
|
|
311
310
|
/** @hidden */
|
|
@@ -488,12 +487,26 @@ export type ParamsObject = {
|
|
|
488
487
|
* _По умолчанию: `false`_
|
|
489
488
|
*/
|
|
490
489
|
webtransportFF: boolean;
|
|
490
|
+
/**
|
|
491
|
+
* Ждать подтверждения от бэкенда для команд startStream/stopStream.
|
|
492
|
+
* При включении: reject без соединения, resolve/reject по ответу бэкенда,
|
|
493
|
+
* а при реконнекте — по стейту записи из Connection-сообщения.
|
|
494
|
+
*
|
|
495
|
+
* _По умолчанию: `false`_
|
|
496
|
+
*/
|
|
497
|
+
waitForRecordResponse: boolean;
|
|
491
498
|
/**
|
|
492
499
|
* Включить поддержку прозрачного аудио
|
|
493
500
|
*
|
|
494
501
|
* _По умолчанию: `false`_
|
|
495
502
|
*/
|
|
496
503
|
transparentAudio: boolean;
|
|
504
|
+
/**
|
|
505
|
+
* Включить получение обновлений состояния медийной сессии участников
|
|
506
|
+
*
|
|
507
|
+
* _По умолчанию: `false`_
|
|
508
|
+
*/
|
|
509
|
+
enableSessionStateUpdates: boolean;
|
|
497
510
|
/**
|
|
498
511
|
* Получен локальный стрим с камеры/микрофона
|
|
499
512
|
*/
|
|
@@ -737,6 +750,12 @@ export type ParamsObject = {
|
|
|
737
750
|
* Получено отладочное сообщение. Работает только при выключенном режиме отладки
|
|
738
751
|
*/
|
|
739
752
|
onDebugMessage?: (type: DebugMessageType, ...args: any[]) => void;
|
|
753
|
+
/**
|
|
754
|
+
* Получено отладочное сообщение с контекстом звонка. Работает только при выключенном режиме отладки
|
|
755
|
+
*/
|
|
756
|
+
onDebugMessageWithContext?: (type: DebugMessageType, context: {
|
|
757
|
+
conversationId: string | null;
|
|
758
|
+
}, ...args: any[]) => void;
|
|
740
759
|
/**
|
|
741
760
|
* Статистика звонка
|
|
742
761
|
*/
|
|
@@ -965,7 +984,6 @@ export default abstract class Params {
|
|
|
965
984
|
static get networkStatisticsInterval(): number;
|
|
966
985
|
static get perfStatReportEnabled(): boolean;
|
|
967
986
|
static get callStatReportEnabled(): boolean;
|
|
968
|
-
static get clientEventsLoggingEnabled(): boolean;
|
|
969
987
|
static get enableLogPerfStatReport(): boolean;
|
|
970
988
|
static get asrDataChannel(): boolean;
|
|
971
989
|
static get consumerScreenDataChannelPacketSize(): number;
|
|
@@ -976,6 +994,7 @@ export default abstract class Params {
|
|
|
976
994
|
static get audioNack(): boolean;
|
|
977
995
|
static get movieShare(): boolean;
|
|
978
996
|
static get videoTracksCount(): number;
|
|
997
|
+
static get requestDisplayLayoutThrottleMs(): number;
|
|
979
998
|
static get breakVideoPayloadTypes(): boolean;
|
|
980
999
|
static get useCallsToContacts(): boolean;
|
|
981
1000
|
static get useParticipantListChunk(): boolean;
|
|
@@ -1007,7 +1026,9 @@ export default abstract class Params {
|
|
|
1007
1026
|
static get simulcast(): boolean;
|
|
1008
1027
|
static get webtransport(): boolean;
|
|
1009
1028
|
static get webtransportFF(): boolean;
|
|
1029
|
+
static get waitForRecordResponse(): boolean;
|
|
1010
1030
|
static get transparentAudio(): boolean;
|
|
1031
|
+
static get enableSessionStateUpdates(): boolean;
|
|
1011
1032
|
static toJSON(): {
|
|
1012
1033
|
apiKey: string;
|
|
1013
1034
|
apiEnv: string;
|
|
@@ -1024,6 +1045,7 @@ export default abstract class Params {
|
|
|
1024
1045
|
screenShareCongestionControl: boolean;
|
|
1025
1046
|
screenShareCongestionControlThreshold: number;
|
|
1026
1047
|
videoTracksCount: number;
|
|
1048
|
+
requestDisplayLayoutThrottleMs: number;
|
|
1027
1049
|
asrDataChannel: boolean;
|
|
1028
1050
|
videoMaxHeight: number;
|
|
1029
1051
|
videoMaxWidth: number;
|
|
@@ -1041,6 +1063,8 @@ export default abstract class Params {
|
|
|
1041
1063
|
simulcast: boolean;
|
|
1042
1064
|
webtransport: boolean;
|
|
1043
1065
|
webtransportFF: boolean;
|
|
1066
|
+
waitForRecordResponse: boolean;
|
|
1044
1067
|
transparentAudio: boolean;
|
|
1068
|
+
enableSessionStateUpdates: boolean;
|
|
1045
1069
|
};
|
|
1046
1070
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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, sessionStateConnectedBySpeaker?: boolean): StatusTransition;
|
|
13
|
+
function setTransport(status: ParticipantConnectionStatus, transport: ParticipantStatus): StatusTransition;
|
|
14
|
+
function setSessionStateApplicable(status: ParticipantConnectionStatus, applicable: boolean): StatusTransition;
|
|
15
|
+
}
|
|
16
|
+
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 Где ищем
|
package/static/WebRTCUtils.d.ts
CHANGED
|
@@ -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
|
*
|
package/types/Conversation.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
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';
|
package/types/ExternalId.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type ExternalUserId = string;
|
|
|
18
18
|
export declare namespace ExternalIdUtils {
|
|
19
19
|
function fromIds(ids: ExternalUserId[] | ExternalId[]): ExternalId[];
|
|
20
20
|
function fromId(id: ExternalUserId, type?: ExternalIdType, deviceIdx?: number): ExternalParticipantId;
|
|
21
|
-
function fromSignalingParticipant(participant: SignalingMessage.Participant, useDecorative?: boolean): ExternalParticipantId | undefined;
|
|
21
|
+
function fromSignalingParticipant(participant: SignalingMessage.Participant, useDecorative?: boolean, fallbackToNonDecorative?: boolean): ExternalParticipantId | undefined;
|
|
22
22
|
function fromSignaling(signalingId: SignalingMessage.ExternalId, deviceIdx?: number): ExternalParticipantId;
|
|
23
23
|
function toSignaling(externalId: ExternalId): string;
|
|
24
24
|
function toString(externalId: ExternalId): ExternalIdString;
|
package/types/FastStart.d.ts
CHANGED
package/types/Participant.d.ts
CHANGED
|
@@ -44,6 +44,16 @@ 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
|
+
sessionStateApplicable: boolean;
|
|
54
|
+
sessionStateConnectedBySpeaker: boolean;
|
|
55
|
+
lastEffective: ParticipantStatus;
|
|
56
|
+
}
|
|
47
57
|
/**
|
|
48
58
|
* Состояния участников звонка
|
|
49
59
|
*/
|
|
@@ -63,7 +73,6 @@ export interface Participant {
|
|
|
63
73
|
externalId: ExternalParticipantId;
|
|
64
74
|
mediaSettings: MediaSettings;
|
|
65
75
|
state: ParticipantState;
|
|
66
|
-
status: ParticipantStatus;
|
|
67
76
|
remoteStream?: MediaStream | null;
|
|
68
77
|
remoteAudioTrack?: MediaStreamTrack | null;
|
|
69
78
|
secondStream?: MediaStream | null;
|
|
@@ -72,6 +81,8 @@ export interface Participant {
|
|
|
72
81
|
clientType: string;
|
|
73
82
|
roles: UserRole[];
|
|
74
83
|
participantState: ParticipantStateMapped;
|
|
84
|
+
isOnHold?: boolean;
|
|
85
|
+
connectionStatus: ParticipantConnectionStatus;
|
|
75
86
|
networkRating: number;
|
|
76
87
|
lastRequestedLayouts: {
|
|
77
88
|
[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;
|
package/types/PushData.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import IceServer from './IceServer';
|
|
1
2
|
type PushData = {
|
|
2
3
|
caller_id: string;
|
|
3
4
|
caller_client_type?: string;
|
|
4
5
|
conversation_id: string;
|
|
5
6
|
endpoint: string;
|
|
7
|
+
wt_endpoint?: string;
|
|
8
|
+
turn_server?: IceServer;
|
|
6
9
|
is_video: boolean;
|
|
7
10
|
token: string;
|
|
8
11
|
sdp_offer?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnimojiVersion } from '@vkontakte/calls-vmoji';
|
|
2
|
-
import
|
|
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;
|
|
@@ -97,6 +98,7 @@ declare namespace SignalingMessage {
|
|
|
97
98
|
markers?: ParticipantListMarkers;
|
|
98
99
|
observedIds?: CompositeUserId[];
|
|
99
100
|
movieShareInfos?: ISharedMovieInfo[];
|
|
101
|
+
onHold?: boolean;
|
|
100
102
|
}
|
|
101
103
|
export interface ParticipantListChunk extends Notification {
|
|
102
104
|
participants: (Participant & Required<Pick<Participant, 'markers'>>)[];
|
|
@@ -190,6 +192,7 @@ declare namespace SignalingMessage {
|
|
|
190
192
|
deviceIdx?: number;
|
|
191
193
|
peerId: PeerId;
|
|
192
194
|
reason: HangupType;
|
|
195
|
+
errorCode?: string;
|
|
193
196
|
markers?: ParticipantListMarkers;
|
|
194
197
|
}
|
|
195
198
|
export interface ClosedConversation extends Notification {
|
|
@@ -322,6 +325,13 @@ declare namespace SignalingMessage {
|
|
|
322
325
|
export interface SpeakerChanged extends Notification {
|
|
323
326
|
speaker: ParticipantId;
|
|
324
327
|
}
|
|
328
|
+
export interface SessionState extends Notification {
|
|
329
|
+
connected: boolean;
|
|
330
|
+
participantId: OkUserId;
|
|
331
|
+
participantType: UserType;
|
|
332
|
+
deviceIdx?: number;
|
|
333
|
+
markers?: ParticipantListMarkers;
|
|
334
|
+
}
|
|
325
335
|
export interface OptionsChanged extends Notification {
|
|
326
336
|
options: ConversationOption[];
|
|
327
337
|
}
|
package/types/Statistics.d.ts
CHANGED
package/types/WebTransport.d.ts
CHANGED
|
@@ -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 };
|
package/utils/DebugStorage.d.ts
CHANGED
|
@@ -1,8 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Запись отладочного лога SDK.
|
|
3
|
+
*/
|
|
1
4
|
export type CurrentLogItem = {
|
|
2
5
|
readonly t: number;
|
|
3
6
|
readonly l: string;
|
|
4
7
|
readonly d: any[];
|
|
5
8
|
readonly h: string;
|
|
6
9
|
};
|
|
7
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Информация о сохраненной локальной сессии логирования.
|
|
12
|
+
*/
|
|
13
|
+
export type DebugLogSessionInfo = {
|
|
14
|
+
/**
|
|
15
|
+
* Внутренний id локальной сессии логирования.
|
|
16
|
+
*/
|
|
17
|
+
readonly sessionId: string;
|
|
18
|
+
/**
|
|
19
|
+
* Id звонка. Может быть null, если звонок не успел стартовать.
|
|
20
|
+
*/
|
|
21
|
+
readonly conversationId: string | null;
|
|
22
|
+
/**
|
|
23
|
+
* Время первой записи в ms.
|
|
24
|
+
*/
|
|
25
|
+
readonly startTime: number;
|
|
26
|
+
/**
|
|
27
|
+
* Время последней записи в ms.
|
|
28
|
+
*/
|
|
29
|
+
readonly endTime: number;
|
|
30
|
+
/**
|
|
31
|
+
* Время последнего обновления в ms.
|
|
32
|
+
*/
|
|
33
|
+
readonly updatedAt: number;
|
|
34
|
+
/**
|
|
35
|
+
* Размер сохраненных данных в байтах.
|
|
36
|
+
*/
|
|
37
|
+
readonly bytes: number;
|
|
38
|
+
/**
|
|
39
|
+
* Количество записей лога.
|
|
40
|
+
*/
|
|
41
|
+
readonly entriesCount: number;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Статистика локального хранилища отладочных логов.
|
|
45
|
+
*/
|
|
46
|
+
export type DebugLogStorageStats = {
|
|
47
|
+
/**
|
|
48
|
+
* Доступен ли IndexedDB для сохранения логов.
|
|
49
|
+
*/
|
|
50
|
+
readonly supported: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Количество сохраненных звонков.
|
|
53
|
+
*/
|
|
54
|
+
readonly callsCount: number;
|
|
55
|
+
/**
|
|
56
|
+
* Количество локальных сессий логирования.
|
|
57
|
+
*/
|
|
58
|
+
readonly sessionsCount: number;
|
|
59
|
+
/**
|
|
60
|
+
* Размер сохраненных логов SDK в байтах.
|
|
61
|
+
*/
|
|
62
|
+
readonly usedBytes: number;
|
|
63
|
+
/**
|
|
64
|
+
* Максимальный размер DebugStorage в байтах.
|
|
65
|
+
*/
|
|
66
|
+
readonly maxBytes: number;
|
|
67
|
+
/**
|
|
68
|
+
* Максимальное количество звонков в DebugStorage.
|
|
69
|
+
*/
|
|
70
|
+
readonly maxCalls: number;
|
|
71
|
+
/**
|
|
72
|
+
* Общая квота браузерного хранилища, если доступна.
|
|
73
|
+
*/
|
|
74
|
+
readonly quotaBytes?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Использование браузерного хранилища, если доступно.
|
|
77
|
+
*/
|
|
78
|
+
readonly usageBytes?: number;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Параметры чтения или очистки локальных логов.
|
|
82
|
+
*/
|
|
83
|
+
export type DebugLogGetParams = {
|
|
84
|
+
/**
|
|
85
|
+
* Id звонка. Вернет все локальные сессии с этим conversationId.
|
|
86
|
+
*/
|
|
87
|
+
readonly conversationId: string;
|
|
88
|
+
readonly sessionId?: never;
|
|
89
|
+
} | {
|
|
90
|
+
/**
|
|
91
|
+
* Внутренний id локальной сессии из debugLogs.list().
|
|
92
|
+
*/
|
|
93
|
+
readonly sessionId: string;
|
|
94
|
+
readonly conversationId?: never;
|
|
95
|
+
};
|
|
96
|
+
export declare function add(level: string, args: any[], sessionId?: string): CurrentLogItem;
|
|
8
97
|
export declare function init(): void;
|
|
98
|
+
export declare function startConversationSession(): string;
|
|
99
|
+
export declare function setConversationId(conversationId: string | null, sessionId?: string): void;
|
|
100
|
+
export declare function list(): Promise<DebugLogSessionInfo[]>;
|
|
101
|
+
export declare function get(params: DebugLogGetParams): Promise<CurrentLogItem[]>;
|
|
102
|
+
export declare function getJson(params: DebugLogGetParams): Promise<string>;
|
|
103
|
+
export declare function download(params: DebugLogGetParams): Promise<string>;
|
|
104
|
+
export declare function clear(params?: DebugLogGetParams): Promise<void>;
|
|
105
|
+
export declare function stats(): Promise<DebugLogStorageStats>;
|
|
106
|
+
export declare function getAllJson(): Promise<string>;
|
|
107
|
+
export declare function downloadAll(): 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
|
-
}
|