@vkontakte/calls-sdk 2.8.11-dev.3ca8f2a1.0 → 2.8.11-dev.3de63af6.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 +41 -1
- package/abstract/BaseApi.d.ts +1 -1
- package/abstract/BaseSignaling.d.ts +1 -1
- package/calls-sdk.cjs.js +11 -11
- package/calls-sdk.esm.js +7200 -6991
- package/classes/AudioFix.d.ts +5 -1
- package/classes/AudioOutput.d.ts +5 -1
- package/classes/Conversation.d.ts +6 -0
- package/classes/DebugInfo.d.ts +3 -0
- package/classes/MediaSource.d.ts +5 -1
- 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 +5 -1
- package/classes/StatsLogger.d.ts +29 -0
- 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 +5 -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 +4 -4
- 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 +9 -1
- package/classes/transport/PerfStatReporter.d.ts +5 -1
- package/classes/transport/ServerTransport.d.ts +10 -2
- package/classes/transport/Transport.d.ts +11 -14
- package/default/Signaling.d.ts +12 -1
- 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 +6 -0
- package/static/Utils.d.ts +3 -2
- package/static/WebRTCUtils.d.ts +6 -4
- package/types/Conversation.d.ts +1 -1
- package/types/PerfStatReporter.d.ts +2 -1
- package/types/SignalingMessage.d.ts +4 -1
- package/types/Statistics.d.ts +1 -1
- package/utils/DebugStorage.d.ts +100 -1
- package/classes/Logger.d.ts +0 -36
- package/classes/stat/EventMetricsService.d.ts +0 -9
- package/static/ConversationDebugLogger.d.ts +0 -13
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
2
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
2
3
|
import { StatResult } from '../../types/Statistics';
|
|
3
4
|
import EventEmitter from '../EventEmitter';
|
|
4
5
|
import { WeightedAverage } from '../stat/WeightedAverage';
|
|
@@ -30,7 +31,8 @@ export default class DirectStatReporter extends EventEmitter {
|
|
|
30
31
|
private readonly _networkLimits;
|
|
31
32
|
private _lastStatSentTimestamp;
|
|
32
33
|
private _currentState;
|
|
33
|
-
|
|
34
|
+
private readonly _debug;
|
|
35
|
+
constructor(signaling: BaseSignaling, debug?: DebugLogger);
|
|
34
36
|
private _calcRttRating;
|
|
35
37
|
private _calcLossRating;
|
|
36
38
|
private _calcBitrateRating;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { AnimojiReceiver, AnimojiSender } from '@vkontakte/calls-vmoji';
|
|
2
2
|
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
3
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
3
4
|
import { ParticipantId } from '../../types/Participant';
|
|
4
5
|
import ServerSettings from '../../types/ServerSettings';
|
|
6
|
+
import StatsLogger from '../StatsLogger';
|
|
5
7
|
import { MediaSource } from '../MediaSource';
|
|
8
|
+
import { CodecStatsAggregator } from '../stat/CodecStatsAggregator';
|
|
9
|
+
import { StatAggregator } from '../stat/StatAggregator';
|
|
6
10
|
import BaseTransport from './BaseTransport';
|
|
7
11
|
export default class DirectTransport extends BaseTransport {
|
|
8
12
|
private readonly _participantId;
|
|
@@ -34,7 +38,11 @@ export default class DirectTransport extends BaseTransport {
|
|
|
34
38
|
private _lastBadConnection;
|
|
35
39
|
private _perfStatReporter;
|
|
36
40
|
private _directStatReporter;
|
|
37
|
-
|
|
41
|
+
private readonly _debug;
|
|
42
|
+
private readonly _logger;
|
|
43
|
+
private readonly _statAggregator;
|
|
44
|
+
private readonly _codecStatsAggregator;
|
|
45
|
+
constructor(participantId: ParticipantId, isMaster: boolean, signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null);
|
|
38
46
|
get participantId(): ParticipantId;
|
|
39
47
|
updateStatisticsInterval(): void;
|
|
40
48
|
private _isDeadConnection;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
2
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
2
3
|
import EventEmitter from '../EventEmitter';
|
|
4
|
+
import { StatAggregator } from '../stat/StatAggregator';
|
|
3
5
|
import DirectTransport from './DirectTransport';
|
|
4
6
|
import ServerTransport from './ServerTransport';
|
|
5
7
|
export default class PerfStatReporter extends EventEmitter {
|
|
@@ -10,7 +12,9 @@ export default class PerfStatReporter extends EventEmitter {
|
|
|
10
12
|
private _screenShareStats;
|
|
11
13
|
private _signaling;
|
|
12
14
|
private readonly _directTopology;
|
|
13
|
-
|
|
15
|
+
private readonly _debug;
|
|
16
|
+
private readonly _statAggregator;
|
|
17
|
+
constructor(transport: ServerTransport | DirectTransport, signaling: BaseSignaling, statAggregator?: StatAggregator | null, directTopology?: boolean, debug?: DebugLogger);
|
|
14
18
|
destroy(): void;
|
|
15
19
|
static getEstimatedPerformanceIndex(): number;
|
|
16
20
|
private _handleStats;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { AnimojiReceiver, AnimojiSender } from '@vkontakte/calls-vmoji';
|
|
2
2
|
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
3
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
3
4
|
import { ParticipantId } from '../../types/Participant';
|
|
4
5
|
import ServerSettings from '../../types/ServerSettings';
|
|
6
|
+
import StatsLogger from '../StatsLogger';
|
|
5
7
|
import { MediaSource } from '../MediaSource';
|
|
8
|
+
import { CodecStatsAggregator } from '../stat/CodecStatsAggregator';
|
|
9
|
+
import { StatAggregator } from '../stat/StatAggregator';
|
|
6
10
|
import BaseTransport from './BaseTransport';
|
|
7
11
|
export default class ServerTransport extends BaseTransport {
|
|
8
12
|
private _producerNotification;
|
|
@@ -39,7 +43,11 @@ export default class ServerTransport extends BaseTransport {
|
|
|
39
43
|
private _producerSessionId;
|
|
40
44
|
private _newAudioShareTrack;
|
|
41
45
|
private _simulcastInfo;
|
|
42
|
-
|
|
46
|
+
private readonly _debug;
|
|
47
|
+
private readonly _logger;
|
|
48
|
+
private readonly _statAggregator;
|
|
49
|
+
private readonly _codecStatsAggregator;
|
|
50
|
+
constructor(signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null);
|
|
43
51
|
updateStatisticsInterval(): void;
|
|
44
52
|
open(observer?: boolean): void;
|
|
45
53
|
close(error?: Error): void;
|
|
@@ -88,7 +96,7 @@ export default class ServerTransport extends BaseTransport {
|
|
|
88
96
|
private _onAsrTranscription;
|
|
89
97
|
private _onProducerUpdated;
|
|
90
98
|
private _onAddTrack;
|
|
91
|
-
|
|
99
|
+
private _onSignalingStateChange;
|
|
92
100
|
private _onConnectionStateChange;
|
|
93
101
|
private _onReplacedTrack;
|
|
94
102
|
private _onSourcesChanged;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { AnimojiSvgData, RGBTuple } from '@vkontakte/calls-vmoji';
|
|
2
2
|
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
3
|
+
import TransportState from '../../enums/TransportState';
|
|
4
|
+
import TransportTopology from '../../enums/TransportTopology';
|
|
5
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
3
6
|
import { ParticipantId } from '../../types/Participant';
|
|
4
7
|
import ServerSettings from '../../types/ServerSettings';
|
|
5
8
|
import EventEmitter from '../EventEmitter';
|
|
9
|
+
import StatsLogger from '../StatsLogger';
|
|
6
10
|
import { MediaSource } from '../MediaSource';
|
|
11
|
+
import { CodecStatsAggregator } from '../stat/CodecStatsAggregator';
|
|
12
|
+
import { StatAggregator } from '../stat/StatAggregator';
|
|
7
13
|
export declare const enum TransportEvent {
|
|
8
14
|
REMOTE_TRACK_ADDED = "REMOTE_TRACK_ADDED",
|
|
9
15
|
REMOTE_TRACK_REMOVED = "REMOTE_TRACK_REMOVED",
|
|
@@ -23,19 +29,6 @@ export declare const enum TransportEvent {
|
|
|
23
29
|
ANIMOJI_ERROR = "ANIMOJI_ERROR",
|
|
24
30
|
SCREEN_SHARING_STAT = "SCREEN_SHARING_STAT"
|
|
25
31
|
}
|
|
26
|
-
export declare const enum TransportState {
|
|
27
|
-
IDLE = "IDLE",
|
|
28
|
-
OPENED = "OPENED",
|
|
29
|
-
CONNECTING = "CONNECTING",
|
|
30
|
-
RECONNECTING = "RECONNECTING",
|
|
31
|
-
CONNECTED = "CONNECTED",
|
|
32
|
-
CLOSED = "CLOSED",
|
|
33
|
-
FAILED = "FAILED"
|
|
34
|
-
}
|
|
35
|
-
export declare const enum TransportTopology {
|
|
36
|
-
DIRECT = "DIRECT",
|
|
37
|
-
SERVER = "SERVER"
|
|
38
|
-
}
|
|
39
32
|
export declare class Transport extends EventEmitter {
|
|
40
33
|
private readonly _signaling;
|
|
41
34
|
private readonly _mediaSource;
|
|
@@ -51,7 +44,11 @@ export declare class Transport extends EventEmitter {
|
|
|
51
44
|
private _localState;
|
|
52
45
|
private _animojiReceiver;
|
|
53
46
|
private _animojiSender;
|
|
54
|
-
|
|
47
|
+
private readonly _debug;
|
|
48
|
+
private readonly _logger;
|
|
49
|
+
private readonly _statAggregator;
|
|
50
|
+
private readonly _codecStatsAggregator;
|
|
51
|
+
constructor(topology: TransportTopology, signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null);
|
|
55
52
|
updateSettings(settings: ServerSettings): void;
|
|
56
53
|
updateStatisticsInterval(): void;
|
|
57
54
|
allocate(participantId: ParticipantId, isMaster?: boolean): void;
|
package/default/Signaling.d.ts
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import BaseSignaling, { AddParticipantParams } from '../abstract/BaseSignaling';
|
|
2
|
+
import StatsLogger from '../classes/StatsLogger';
|
|
2
3
|
import { ParticipantIdRegistry } from '../classes/ParticipantIdRegistry';
|
|
3
4
|
import { SharingStatReport } from '../classes/screenshare/SharingStatReport';
|
|
4
|
-
import {
|
|
5
|
+
import { StatAggregator } from '../classes/stat/StatAggregator';
|
|
6
|
+
import { StatPings } from '../classes/stat/StatPings';
|
|
7
|
+
import { StatSignalingCommands } from '../classes/stat/StatSignalingCommands';
|
|
8
|
+
import TransportTopology from '../enums/TransportTopology';
|
|
5
9
|
import ConversationFeature from '../enums/ConversationFeature';
|
|
6
10
|
import ConversationOption from '../enums/ConversationOption';
|
|
7
11
|
import MediaOption from '../enums/MediaOption';
|
|
8
12
|
import SignalingCommandType from '../enums/SignalingCommandType';
|
|
9
13
|
import SignalingConnectionType from '../enums/SignalingConnectionType';
|
|
10
14
|
import UserRole from '../enums/UserRole';
|
|
15
|
+
import { type DebugLogger } from '../static/Debug';
|
|
11
16
|
import { JSONObject } from '../static/Json';
|
|
12
17
|
import { IAsrStartParams, IAsrStopParams } from '../types/Asr';
|
|
13
18
|
import { ChangeSimulcast } from '../types/ChangeSimulcast';
|
|
@@ -49,12 +54,18 @@ export default class Signaling extends BaseSignaling {
|
|
|
49
54
|
private producerCommandDataChannel;
|
|
50
55
|
private producerCommandDataChannelEnabled;
|
|
51
56
|
private producerCommandSerializationService;
|
|
57
|
+
private readonly _debug;
|
|
58
|
+
private readonly _logger;
|
|
59
|
+
private readonly _statAggregator;
|
|
60
|
+
private readonly _pings;
|
|
61
|
+
private readonly _signalingCommands;
|
|
52
62
|
private static get RECONNECT_DELAY();
|
|
53
63
|
private static get RECONNECT_MAX_DELAY();
|
|
54
64
|
private static get RECONNECT_MAX_COUNT();
|
|
55
65
|
private static get WAIT_CONNECTION_DELAY();
|
|
56
66
|
private static get WAIT_RESPONSE_DELAY();
|
|
57
67
|
private static get WAIT_MESSAGE_DELAY();
|
|
68
|
+
constructor(debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, pings?: StatPings | null, signalingCommands?: StatSignalingCommands | null);
|
|
58
69
|
get ready(): boolean;
|
|
59
70
|
setEndpoint(endpoint: string): void;
|
|
60
71
|
setWebTransportEndpoint(endpoint: string | null): void;
|
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
|
@@ -446,6 +446,9 @@ declare namespace External {
|
|
|
446
446
|
* @param args
|
|
447
447
|
*/
|
|
448
448
|
function onDebugMessage(type: DebugMessageType, ...args: any[]): void;
|
|
449
|
+
function onDebugMessageWithContext(type: DebugMessageType, context: {
|
|
450
|
+
conversationId: string | null;
|
|
451
|
+
}, ...args: any[]): void;
|
|
449
452
|
/**
|
|
450
453
|
* Статистика звонка
|
|
451
454
|
*
|
package/static/Params.d.ts
CHANGED
|
@@ -730,6 +730,12 @@ export type ParamsObject = {
|
|
|
730
730
|
* Получено отладочное сообщение. Работает только при выключенном режиме отладки
|
|
731
731
|
*/
|
|
732
732
|
onDebugMessage?: (type: DebugMessageType, ...args: any[]) => void;
|
|
733
|
+
/**
|
|
734
|
+
* Получено отладочное сообщение с контекстом звонка. Работает только при выключенном режиме отладки
|
|
735
|
+
*/
|
|
736
|
+
onDebugMessageWithContext?: (type: DebugMessageType, context: {
|
|
737
|
+
conversationId: string | null;
|
|
738
|
+
}, ...args: any[]) => void;
|
|
733
739
|
/**
|
|
734
740
|
* Статистика звонка
|
|
735
741
|
*/
|
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';
|
|
@@ -41,10 +41,11 @@ export interface CallStatReport {
|
|
|
41
41
|
remote_connection_type?: RTCIceCandidateType;
|
|
42
42
|
}
|
|
43
43
|
export interface ICallStatLog extends Pick<CallStatReport, 'call_topology' | 'nack_sent' | 'nack_received' | 'pli_sent' | 'pli_received' | 'fir_sent' | 'fir_received' | 'frames_dropped' | 'stat_time_delta'>, Pick<Partial<CallStatReport>, 'rtt' | 'jitter_video' | 'jitter_audio' | 'interframe_delay_variance' | 'freeze_count' | 'total_freezes_duration' | 'ss_freeze_count' | 'ss_total_freezes_duration' | 'inserted_audio_samples_for_deceleration' | 'removed_audio_samples_for_acceleration' | 'concealed_audio_samples' | 'total_audio_energy' | 'local_address' | 'local_connection_type' | 'network_type' | 'transport' | 'remote_address' | 'remote_connection_type'> {
|
|
44
|
+
is_simulcast?: boolean;
|
|
44
45
|
concealed_silent_audio_samples?: number;
|
|
45
46
|
concealment_audio_avg_size?: number;
|
|
46
47
|
video_loss?: number;
|
|
47
48
|
audio_loss?: number;
|
|
48
49
|
cpu_hardware_concurrency?: number;
|
|
49
|
-
[k: string]: string | number | undefined;
|
|
50
|
+
[k: string]: string | number | boolean | undefined;
|
|
50
51
|
}
|
|
@@ -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';
|
|
@@ -366,6 +366,9 @@ declare namespace SignalingMessage {
|
|
|
366
366
|
export interface Connection extends Notification {
|
|
367
367
|
endpoint: string;
|
|
368
368
|
conversation: Conversation;
|
|
369
|
+
conversationParams: {
|
|
370
|
+
serverTime: number;
|
|
371
|
+
};
|
|
369
372
|
isConcurrent: boolean;
|
|
370
373
|
peerId: PeerId;
|
|
371
374
|
mediaModifiers: MediaModifiers;
|
package/types/Statistics.d.ts
CHANGED
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>;
|
package/classes/Logger.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import BaseApi from '../abstract/BaseApi';
|
|
2
|
-
import BaseLogger from '../abstract/BaseLogger';
|
|
3
|
-
import StatLog from '../enums/StatLog';
|
|
4
|
-
/**
|
|
5
|
-
* Класс отвечает за отправку различной информации в сервис статистики (события, статистика и подобное)
|
|
6
|
-
*/
|
|
7
|
-
export default class Logger extends BaseLogger {
|
|
8
|
-
private static _instance;
|
|
9
|
-
private static _conversationIdProvider;
|
|
10
|
-
static setConversationIdProvider(provider: () => string | null): void;
|
|
11
|
-
static create(api: BaseApi, externalLogger: BaseLogger | null): void;
|
|
12
|
-
static log(name: StatLog, value?: string, immediately?: boolean): void;
|
|
13
|
-
static logClientStats(params: Record<string, string | number | undefined | null>, immediately?: boolean): void;
|
|
14
|
-
static logClientEvent(params: Record<string, string | number | undefined | null>, immediately?: boolean): void;
|
|
15
|
-
static destroy(): void;
|
|
16
|
-
private readonly _externalLogger;
|
|
17
|
-
private readonly _api;
|
|
18
|
-
private readonly _batchInterval;
|
|
19
|
-
private _batchedClientStats;
|
|
20
|
-
private _batchedClientEvents;
|
|
21
|
-
private _batchTimeout;
|
|
22
|
-
private _serverTimeDelta;
|
|
23
|
-
constructor(api: BaseApi, externalLogger: BaseLogger | null);
|
|
24
|
-
log(name: StatLog, value?: string, immediately?: boolean): void;
|
|
25
|
-
logClientStats(data: Record<string, string | number | undefined | null>, immediately?: boolean): void;
|
|
26
|
-
logClientEvent(data: Record<string, string | number | undefined | null>, immediately?: boolean): void;
|
|
27
|
-
destroy(): void;
|
|
28
|
-
private _getConversationId;
|
|
29
|
-
private _sendBatch;
|
|
30
|
-
private _startTimeout;
|
|
31
|
-
private _stopTimeout;
|
|
32
|
-
private _sendClientStats;
|
|
33
|
-
private _sendClientEvents;
|
|
34
|
-
private _calculateServerTimeDelta;
|
|
35
|
-
private _now;
|
|
36
|
-
}
|
|
@@ -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
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CurrentLogItem } from '../utils/DebugStorage';
|
|
2
|
-
export declare class ConversationDebugLogger {
|
|
3
|
-
private static _list;
|
|
4
|
-
private static _conversationId;
|
|
5
|
-
static get startTime(): number;
|
|
6
|
-
static get endTime(): number;
|
|
7
|
-
static startSession(): void;
|
|
8
|
-
static get conversationId(): string | null;
|
|
9
|
-
static set conversationId(conversationId: string | null);
|
|
10
|
-
static add(item: CurrentLogItem): void;
|
|
11
|
-
private static _createContextLogs;
|
|
12
|
-
static collectLogs(): CurrentLogItem[];
|
|
13
|
-
}
|