@vkontakte/calls-sdk 2.8.10-dev.42b99e05.0 → 2.8.10-dev.45f89d69.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 +1 -1
- package/abstract/BaseApi.d.ts +6 -17
- package/abstract/BaseLogger.d.ts +0 -1
- package/abstract/BaseSignaling.d.ts +7 -1
- package/calls-sdk.cjs.js +10 -10
- package/calls-sdk.esm.js +10 -10
- package/classes/AudioOutput.d.ts +17 -20
- package/classes/Conversation.d.ts +2 -3
- package/classes/Logger.d.ts +2 -11
- package/classes/VolumesDetector.d.ts +6 -1
- package/classes/transport/DirectTransport.d.ts +1 -0
- package/classes/transport/ServerTransport.d.ts +1 -0
- package/default/Api.d.ts +1 -3
- package/default/Signaling.d.ts +1 -1
- package/package.json +1 -1
- package/static/Utils.d.ts +3 -1
- package/types/FastJoin.d.ts +1 -1
- package/types/FastStart.d.ts +1 -1
- package/classes/TransparentAudioOutput.d.ts +0 -19
- package/enums/StatLog.d.ts +0 -32
package/classes/AudioOutput.d.ts
CHANGED
|
@@ -1,30 +1,27 @@
|
|
|
1
|
+
import { ParticipantId } from '../types/Participant';
|
|
1
2
|
import { StatFirstMediaReceived } from './stat/StatFirstMediaReceived';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
get volume(): number;
|
|
10
|
-
set volume(volume: number);
|
|
11
|
-
destroy(): void;
|
|
12
|
-
changeOutput(): Promise<void>;
|
|
13
|
-
}
|
|
14
|
-
export default class AudioOutput implements IAudioOutput {
|
|
15
|
-
protected _output: ParticipantAudioOutput | null;
|
|
3
|
+
/**
|
|
4
|
+
* Единый AudioOutput поддерживающий p2p, audioMix и transparent-audio
|
|
5
|
+
*/
|
|
6
|
+
export default class AudioOutput {
|
|
7
|
+
protected _audioElement: HTMLAudioElement | null;
|
|
8
|
+
private _audioTracks;
|
|
9
|
+
private readonly _allowMultipleTracks;
|
|
16
10
|
private _volume;
|
|
17
11
|
private readonly _features;
|
|
18
12
|
private readonly _statFirstMediaReceived;
|
|
19
|
-
constructor(statFirstMediaReceived: StatFirstMediaReceived);
|
|
20
|
-
add(track: MediaStreamTrack): void;
|
|
21
|
-
remove(track: MediaStreamTrack): void;
|
|
13
|
+
constructor(statFirstMediaReceived: StatFirstMediaReceived, allowMultipleTracks?: boolean);
|
|
14
|
+
add(participantId: ParticipantId, track: MediaStreamTrack): void;
|
|
15
|
+
remove(participantId: ParticipantId, track: MediaStreamTrack): void;
|
|
22
16
|
get volume(): number;
|
|
23
17
|
set volume(volume: number);
|
|
24
|
-
protected _initAudioElement(): void;
|
|
25
|
-
protected _stopAudioElement(): void;
|
|
26
18
|
destroy(): void;
|
|
27
19
|
/** изменяем устройство для воспроизведения аудио */
|
|
28
20
|
changeOutput(): Promise<void>;
|
|
21
|
+
protected _getTracks(): MediaStreamTrack[];
|
|
22
|
+
protected _initAudioElement(): void;
|
|
23
|
+
protected _stopAudioElement(): void;
|
|
24
|
+
private _addTrackToAudioElement;
|
|
25
|
+
private _removeTrackFromAudioElement;
|
|
26
|
+
private _clearTracks;
|
|
29
27
|
}
|
|
30
|
-
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { IEffect } from '@vkontakte/calls-video-effects';
|
|
2
2
|
import type { RGBTuple } from '@vkontakte/calls-vmoji';
|
|
3
3
|
import BaseApi from '../abstract/BaseApi';
|
|
4
|
-
import BaseLogger from '../abstract/BaseLogger';
|
|
5
4
|
import { AddParticipantParams } from '../abstract/BaseSignaling';
|
|
6
5
|
import ConversationFeature from '../enums/ConversationFeature';
|
|
7
6
|
import ConversationOption from '../enums/ConversationOption';
|
|
@@ -52,6 +51,7 @@ export default class Conversation extends EventEmitter {
|
|
|
52
51
|
private static _current;
|
|
53
52
|
private static _activationMutex;
|
|
54
53
|
private static _delayedHangup;
|
|
54
|
+
private static _abortController;
|
|
55
55
|
private readonly _onUnload;
|
|
56
56
|
private readonly _audioOutput;
|
|
57
57
|
private _lastStalled;
|
|
@@ -64,7 +64,7 @@ export default class Conversation extends EventEmitter {
|
|
|
64
64
|
private _cooldownTimestampByStreamDescription;
|
|
65
65
|
private _cooldownQueueCleanupTimer;
|
|
66
66
|
private readonly _statFirstMediaReceived;
|
|
67
|
-
constructor(api: BaseApi
|
|
67
|
+
constructor(api: BaseApi);
|
|
68
68
|
static current(): Conversation | null;
|
|
69
69
|
static hangupAfterInit(): void;
|
|
70
70
|
static id(): string | null;
|
|
@@ -164,7 +164,6 @@ export default class Conversation extends EventEmitter {
|
|
|
164
164
|
private _createSpeakerDetector;
|
|
165
165
|
private _createSpecListener;
|
|
166
166
|
private _logDevices;
|
|
167
|
-
private _logWithMediaSettings;
|
|
168
167
|
private _removeParticipant;
|
|
169
168
|
private _cleanupListeners;
|
|
170
169
|
private _cleanupMediaSource;
|
package/classes/Logger.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import BaseApi from '../abstract/BaseApi';
|
|
2
2
|
import BaseLogger from '../abstract/BaseLogger';
|
|
3
|
-
import StatLog from '../enums/StatLog';
|
|
4
3
|
/**
|
|
5
4
|
* Класс отвечает за отправку различной информации в сервис статистики (события, статистика и подобное)
|
|
6
5
|
*/
|
|
@@ -8,32 +7,24 @@ export default class Logger extends BaseLogger {
|
|
|
8
7
|
private static _instance;
|
|
9
8
|
private static _conversationIdProvider;
|
|
10
9
|
static setConversationIdProvider(provider: () => string | null): void;
|
|
11
|
-
static create(api: BaseApi
|
|
12
|
-
static log(name: StatLog, value?: string, immediately?: boolean): void;
|
|
13
|
-
static logCustom(name: StatLog, params: Record<string, string | number>, immediately?: boolean): void;
|
|
10
|
+
static create(api: BaseApi): void;
|
|
14
11
|
static logClientStats(params: Record<string, string | number | undefined | null>, immediately?: boolean): void;
|
|
15
12
|
static logClientEvent(params: Record<string, string | number | undefined | null>, immediately?: boolean): void;
|
|
16
13
|
static destroy(): void;
|
|
17
|
-
private readonly _externalLogger;
|
|
18
14
|
private readonly _api;
|
|
19
15
|
private readonly _batchInterval;
|
|
20
|
-
private _batchedLogItems;
|
|
21
16
|
private _batchedClientStats;
|
|
22
17
|
private _batchedClientEvents;
|
|
23
18
|
private _batchTimeout;
|
|
24
19
|
private _serverTimeDelta;
|
|
25
|
-
constructor(api: BaseApi
|
|
26
|
-
log(name: StatLog, value?: string, immediately?: boolean): void;
|
|
27
|
-
logCustom(name: string, params: Record<string, string | number>, immediately?: boolean): void;
|
|
20
|
+
constructor(api: BaseApi);
|
|
28
21
|
logClientStats(data: Record<string, string | number | undefined | null>, immediately?: boolean): void;
|
|
29
22
|
logClientEvent(data: Record<string, string | number | undefined | null>, immediately?: boolean): void;
|
|
30
23
|
destroy(): void;
|
|
31
|
-
private _logInternal;
|
|
32
24
|
private _getConversationId;
|
|
33
25
|
private _sendBatch;
|
|
34
26
|
private _startTimeout;
|
|
35
27
|
private _stopTimeout;
|
|
36
|
-
private _sendLogItems;
|
|
37
28
|
private _sendClientStats;
|
|
38
29
|
private _sendClientEvents;
|
|
39
30
|
private _calculateServerTimeDelta;
|
|
@@ -4,15 +4,20 @@ export declare const enum VolumesDetectorEvent {
|
|
|
4
4
|
VOLUMES_DETECTED = "VOLUMES_DETECTED"
|
|
5
5
|
}
|
|
6
6
|
export declare class VolumesDetector extends EventEmitter {
|
|
7
|
-
private
|
|
7
|
+
private _detectors;
|
|
8
8
|
private _interval;
|
|
9
9
|
private _activeParticipants;
|
|
10
10
|
private _removedParticipants;
|
|
11
|
+
private _topology;
|
|
11
12
|
constructor(transport: Transport);
|
|
12
13
|
destroy(): void;
|
|
13
14
|
private _onRemoteTrackAdded;
|
|
14
15
|
private _onRemoteTrackRemoved;
|
|
15
16
|
private _collectVolumes;
|
|
17
|
+
private _getAudioTrackLevelByParticipantId;
|
|
18
|
+
private _getTransparentAudioLevelByParticipantId;
|
|
16
19
|
private _onSignalledActiveParticipants;
|
|
17
20
|
private _onTopologyChanged;
|
|
21
|
+
private _isTransparentAudioMode;
|
|
22
|
+
private _destroyDetectors;
|
|
18
23
|
}
|
|
@@ -55,6 +55,7 @@ export default class DirectTransport extends BaseTransport {
|
|
|
55
55
|
private _handleIceCandidate;
|
|
56
56
|
private _onSignalingStateChange;
|
|
57
57
|
private _onIceConnectionStateChange;
|
|
58
|
+
private _markConnected;
|
|
58
59
|
private _onConnectionStateChange;
|
|
59
60
|
private _startReconnection;
|
|
60
61
|
private _requestTopologySwitch;
|
|
@@ -25,6 +25,7 @@ export default class ServerTransport extends BaseTransport {
|
|
|
25
25
|
private _perfStatReporter;
|
|
26
26
|
private _producerOfferIsProcessing;
|
|
27
27
|
private _producerNextOffer;
|
|
28
|
+
private _producerNextSessionId;
|
|
28
29
|
private _lastStat;
|
|
29
30
|
private _serverSettings;
|
|
30
31
|
private _prevConsumerSettings;
|
package/default/Api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import BaseApi, { ClientEvent, ClientStats
|
|
1
|
+
import BaseApi, { ClientEvent, ClientStats } from '../abstract/BaseApi';
|
|
2
2
|
import CallType from '../enums/CallType';
|
|
3
3
|
import HangupType from '../enums/HangupType';
|
|
4
4
|
import ConversationParams from '../types/ConversationParams';
|
|
@@ -15,7 +15,6 @@ export default class Api extends BaseApi {
|
|
|
15
15
|
protected _call(method: string, data?: any, noSession?: boolean): Promise<any>;
|
|
16
16
|
userId(participantId: ParticipantId): Promise<ExternalParticipantId>;
|
|
17
17
|
authorize(): Promise<void>;
|
|
18
|
-
log(items: LogItem[]): void;
|
|
19
18
|
logClientStats(items: ClientStats[]): void;
|
|
20
19
|
logClientEvents(items: ClientEvent[]): void;
|
|
21
20
|
uploadDebugLogs(conversationId: string, startTime: number, endTime: number, log: string): Promise<void>;
|
|
@@ -65,7 +64,6 @@ export default class Api extends BaseApi {
|
|
|
65
64
|
getUserId(): OkUserId | null;
|
|
66
65
|
setUserId(userId: OkUserId): void;
|
|
67
66
|
hangupConversation(conversationId: string, reason?: HangupType): void;
|
|
68
|
-
sendUserFeedbackStats(conversationId: string, userResponse: number, reason?: string, groupCallUsersCount?: number): void;
|
|
69
67
|
removeHistoryRecords(recordIds: number[]): Promise<void>;
|
|
70
68
|
cleanup(): void;
|
|
71
69
|
private _getExternalIdsByOkIds;
|
package/default/Signaling.d.ts
CHANGED
|
@@ -97,7 +97,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
97
97
|
allocateConsumer(description: RTCSessionDescription | null, capabilities: {
|
|
98
98
|
[key: string]: number | boolean | string;
|
|
99
99
|
}): Promise<SignalingMessage>;
|
|
100
|
-
acceptProducer(description: RTCSessionDescriptionInit, ssrcs: string[]): Promise<SignalingMessage>;
|
|
100
|
+
acceptProducer(description: RTCSessionDescriptionInit, ssrcs: string[], sessionId: string): Promise<SignalingMessage>;
|
|
101
101
|
/**
|
|
102
102
|
* @deprecated Use updateDisplayLayout instead
|
|
103
103
|
*/
|
package/package.json
CHANGED
package/static/Utils.d.ts
CHANGED
|
@@ -33,7 +33,9 @@ declare namespace Utils {
|
|
|
33
33
|
function uuid(): string;
|
|
34
34
|
function debounce<F extends (...args: Parameters<F>) => ReturnType<F>>(func: F, ms: number): (this: any, ..._args: Parameters<F>) => void;
|
|
35
35
|
function sdpFingerprint(sdp: string): bigint | null;
|
|
36
|
-
function delay(time: number
|
|
36
|
+
function delay(time: number, { signal }?: {
|
|
37
|
+
signal?: AbortSignal;
|
|
38
|
+
}): Promise<void>;
|
|
37
39
|
function applySettings(pc: RTCPeerConnection, videoSettings: VideoSettings, prevSettings: any): any;
|
|
38
40
|
function applyVideoTrackSettings(videoSettings: VideoSettings, s: RTCRtpSender, track: MediaStreamTrack | null, prevSettings: any, retSettings: any): void;
|
|
39
41
|
/**
|
package/types/FastJoin.d.ts
CHANGED
|
@@ -10,4 +10,4 @@ export interface FastJoinResponse {
|
|
|
10
10
|
conversationId: string;
|
|
11
11
|
internalCallerParams: string;
|
|
12
12
|
}
|
|
13
|
-
export type FastJoinHandler = (params: FastJoinParams) => Promise<FastJoinResponse>;
|
|
13
|
+
export type FastJoinHandler = (params: FastJoinParams, signal?: AbortSignal) => Promise<FastJoinResponse>;
|
package/types/FastStart.d.ts
CHANGED
|
@@ -44,4 +44,4 @@ export interface FastStartResponse {
|
|
|
44
44
|
status: string;
|
|
45
45
|
}[];
|
|
46
46
|
}
|
|
47
|
-
export type FastStartHandler = (params: FastStartParams) => Promise<FastStartResponse>;
|
|
47
|
+
export type FastStartHandler = (params: FastStartParams, signal?: AbortSignal) => Promise<FastStartResponse>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { IAudioOutput } from './AudioOutput';
|
|
2
|
-
import { StatFirstMediaReceived } from './stat/StatFirstMediaReceived';
|
|
3
|
-
export default class TransparentAudioOutput implements IAudioOutput {
|
|
4
|
-
private audioTracks;
|
|
5
|
-
private audioElement;
|
|
6
|
-
private _volume;
|
|
7
|
-
private readonly _features;
|
|
8
|
-
private readonly _statFirstMediaReceived;
|
|
9
|
-
constructor(statFirstMediaReceived: StatFirstMediaReceived);
|
|
10
|
-
add(track: MediaStreamTrack): void;
|
|
11
|
-
remove(track: MediaStreamTrack): void;
|
|
12
|
-
get volume(): number;
|
|
13
|
-
set volume(volume: number);
|
|
14
|
-
protected _initAudioElement(): void;
|
|
15
|
-
protected _stopAudioElement(): void;
|
|
16
|
-
destroy(): void;
|
|
17
|
-
/** изменяем устройство для воспроизведения аудио */
|
|
18
|
-
changeOutput(): Promise<void>;
|
|
19
|
-
}
|
package/enums/StatLog.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
declare const enum StatLog {
|
|
2
|
-
ACCEPT_CONCURRENT = "callAcceptConcurrent",// video/audio
|
|
3
|
-
ACCEPT_INCOMING = "callAcceptIncoming",// video/audio
|
|
4
|
-
ACCEPTED_OUTGOING = "callAcceptedOutgoing",// video/audio
|
|
5
|
-
ADD_PARTICIPANT = "callAddParticipant",
|
|
6
|
-
CALL_SPEC_ERROR = "callSpecError",// ошибки WebRTC
|
|
7
|
-
DECLINE_INCOMING = "callDeclineIncoming",
|
|
8
|
-
DEVICE_CHANGED = "callDeviceChanged",// смена камеры video/audio/screen
|
|
9
|
-
DEVICES = "callDevices",// залогировать количество %d_%d
|
|
10
|
-
ERROR = "callError",
|
|
11
|
-
HANGUP = "callHangup",
|
|
12
|
-
ICE_CONNECTION_STATE = "callIceConnectionState",// state
|
|
13
|
-
ICE_CONNECTION_TYPE = "callIceConnectionType",// type
|
|
14
|
-
ICE_RESTART = "callIceRestart",// без параметров
|
|
15
|
-
JOIN_CONVERSATION = "callJoinConversation",// video/audio
|
|
16
|
-
MEDIA_STATUS = "callMediaStatus",// изменение video_1, audio_0
|
|
17
|
-
OUTGOING_CALL = "callStart",// video/audio
|
|
18
|
-
OUTGOING_MULTIPARTY_CALL = "callStartMultiparty",// video/audio
|
|
19
|
-
PAT_ALLOCATED = "patAllocate",
|
|
20
|
-
PAT_DEALLOCATED = "patDeallocate",
|
|
21
|
-
PAT_ERROR = "patError",
|
|
22
|
-
PAT_OUTDATED_RESPONSE = "patOutdatedResponse",
|
|
23
|
-
PAT_WAITING_TIME_ERROR = "patWaitingTimeError",
|
|
24
|
-
POOR_CONNECTION = "callPoorConnection",// video / audio
|
|
25
|
-
PUSH = "callPush",// busy / rejected / accepted
|
|
26
|
-
RECONNECT = "callReconnect",// measure
|
|
27
|
-
RELAY_POLICY = "callForceRelay",// 1 / 0
|
|
28
|
-
REMOVE_PARTICIPANT = "callRemoveParticipant",
|
|
29
|
-
SOCKET_ACTION = "callSocketAction",
|
|
30
|
-
TOPOLOGY_CHANGE_REQUESTED = "callTopologyChangeRequested"
|
|
31
|
-
}
|
|
32
|
-
export default StatLog;
|