@vkontakte/calls-sdk 2.8.12-dev.8a7f9c02.0 → 2.8.12-dev.8bd84f52.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 +8 -1
- package/abstract/BaseApi.d.ts +2 -1
- package/calls-sdk.cjs.js +7 -13
- package/calls-sdk.esm.js +1151 -1075
- package/classes/conversation/Conversation.d.ts +1 -0
- package/classes/transport/ServerTransport.d.ts +1 -5
- package/classes/transport/SimulcastSender.d.ts +27 -0
- package/classes/transport/Transport.d.ts +3 -0
- package/default/Api.d.ts +2 -1
- package/default/ApiExternal.d.ts +2 -1
- package/package.json +2 -2
- package/static/Params.d.ts +13 -1
- 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 +0 -1
- package/types/Api.d.ts +9 -0
- package/types/Capabilities.d.ts +1 -0
- package/types/SignalingMessage.d.ts +1 -0
|
@@ -42,12 +42,11 @@ export default class ServerTransport extends BaseTransport {
|
|
|
42
42
|
private _rtpReceiversByStreamId;
|
|
43
43
|
private _producerSessionId;
|
|
44
44
|
private _newAudioShareTrack;
|
|
45
|
-
private _simulcastInfo;
|
|
46
|
-
private _isSimulcastNegotiated;
|
|
47
45
|
private readonly _debug;
|
|
48
46
|
private readonly _logger;
|
|
49
47
|
private readonly _statAggregator;
|
|
50
48
|
private readonly _codecStatsAggregator;
|
|
49
|
+
private readonly _simulcast;
|
|
51
50
|
constructor(signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null, onFirstMediaSent?: (() => void) | null);
|
|
52
51
|
updateStatisticsInterval(): void;
|
|
53
52
|
open(observer?: boolean): void;
|
|
@@ -86,8 +85,6 @@ export default class ServerTransport extends BaseTransport {
|
|
|
86
85
|
private _detectStaleTracks;
|
|
87
86
|
private _allocateConsumer;
|
|
88
87
|
private _processOffer;
|
|
89
|
-
private _findFirstSimTransceiver;
|
|
90
|
-
private _setupSimulcastTransceiver;
|
|
91
88
|
private _acceptProducer;
|
|
92
89
|
private _replaceScreenShareTrack;
|
|
93
90
|
private _handleTracks;
|
|
@@ -102,7 +99,6 @@ export default class ServerTransport extends BaseTransport {
|
|
|
102
99
|
private _onReplacedTrack;
|
|
103
100
|
private _onSourcesChanged;
|
|
104
101
|
getStreamWaitingTimeMs(streamId: string, targetRtpTimestamp: number): number;
|
|
105
|
-
private _changeSimulcastInfo;
|
|
106
102
|
private _monitorRtpShare;
|
|
107
103
|
private _startMonitorRtpShareInterval;
|
|
108
104
|
private _stopMonitorRtpShareInterval;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
2
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
3
|
+
import type VideoSettings from '../../types/VideoSettings';
|
|
4
|
+
import { MediaSource } from '../MediaSource';
|
|
5
|
+
import StatsLogger from '../StatsLogger';
|
|
6
|
+
export default class SimulcastSender {
|
|
7
|
+
private _pc;
|
|
8
|
+
private _transceiver;
|
|
9
|
+
private _simulcastInfo;
|
|
10
|
+
private readonly _signaling;
|
|
11
|
+
private readonly _mediaSource;
|
|
12
|
+
private readonly _getCameraSettings;
|
|
13
|
+
private readonly _debug;
|
|
14
|
+
private readonly _logger;
|
|
15
|
+
constructor(signaling: BaseSignaling, mediaSource: MediaSource, getCameraSettings: () => VideoSettings | null, debug?: DebugLogger, logger?: StatsLogger | null);
|
|
16
|
+
configureFromRemoteOffer(pc: RTCPeerConnection): Promise<void>;
|
|
17
|
+
finalizeAnswer(sdp: string): string;
|
|
18
|
+
sync({ force }?: {
|
|
19
|
+
force?: boolean;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
replaceTrack(track: MediaStreamTrack): boolean;
|
|
22
|
+
reset(): void;
|
|
23
|
+
private _findTransceiver;
|
|
24
|
+
private _findMediaSection;
|
|
25
|
+
private _getTrackConfig;
|
|
26
|
+
private _syncReplacedTrack;
|
|
27
|
+
}
|
|
@@ -50,6 +50,7 @@ export declare class Transport extends EventEmitter {
|
|
|
50
50
|
private readonly _codecStatsAggregator;
|
|
51
51
|
private readonly _onFirstMediaSent;
|
|
52
52
|
private _firstMediaSentProbeStopped;
|
|
53
|
+
private _vadController;
|
|
53
54
|
constructor(topology: TransportTopology, signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null, onFirstMediaSent?: (() => void) | null);
|
|
54
55
|
updateSettings(settings: ServerSettings): void;
|
|
55
56
|
updateStatisticsInterval(): void;
|
|
@@ -96,6 +97,8 @@ export declare class Transport extends EventEmitter {
|
|
|
96
97
|
private _onAnimojiStream;
|
|
97
98
|
/** Обработчик, досылающий MediaSourceEvent.SOURCE_CHANGED событие до аллокации транспортов */
|
|
98
99
|
private _onAnimojiStatus;
|
|
100
|
+
private _createVad;
|
|
101
|
+
private _updateVadTrack;
|
|
99
102
|
private _createAnimojiTransport;
|
|
100
103
|
private _removeAnimojiTransport;
|
|
101
104
|
getStreamWaitingTimeMs(streamId: string, targetRtpTimestamp: number): number;
|
package/default/Api.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import BaseApi, { ClientStats } from '../abstract/BaseApi';
|
|
2
2
|
import CallType from '../enums/CallType';
|
|
3
3
|
import HangupType from '../enums/HangupType';
|
|
4
|
+
import { IHangupParams } from '../types/Api';
|
|
4
5
|
import ConversationParams from '../types/ConversationParams';
|
|
5
6
|
import ConversationResponse from '../types/ConversationResponse';
|
|
6
7
|
import { ExternalId, ExternalParticipantId, ExternalUserId } from '../types/ExternalId';
|
|
@@ -57,7 +58,7 @@ export default class Api extends BaseApi {
|
|
|
57
58
|
getConversationParams(conversationId?: string): Promise<ConversationParams>;
|
|
58
59
|
getUserId(): OkUserId | null;
|
|
59
60
|
setUserId(userId: OkUserId): void;
|
|
60
|
-
hangupConversation(conversationId: string, reason?: HangupType): void;
|
|
61
|
+
hangupConversation(conversationId: string, reason?: HangupType, params?: Partial<IHangupParams>): void;
|
|
61
62
|
removeHistoryRecords(recordIds: number[]): Promise<void>;
|
|
62
63
|
cleanup(): void;
|
|
63
64
|
getServerTime(): Promise<number>;
|
package/default/ApiExternal.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IHangupParams } from '../types/Api';
|
|
1
2
|
import { IAPIBaseUrl, IApiEnv } from '../types/Params';
|
|
2
3
|
export declare class ApiExternal {
|
|
3
4
|
private readonly _uuid;
|
|
@@ -8,5 +9,5 @@ export declare class ApiExternal {
|
|
|
8
9
|
private _sessionKey;
|
|
9
10
|
constructor(apiEvn: IApiEnv, apiKey: string, callToken: string, baseApiUrl?: IAPIBaseUrl);
|
|
10
11
|
authorize(): Promise<boolean>;
|
|
11
|
-
hangupConversation(conversationId: string): Promise<void>;
|
|
12
|
+
hangupConversation(conversationId: string, params?: Partial<IHangupParams>): Promise<void>;
|
|
12
13
|
}
|
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.8bd84f52.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.1",
|
|
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",
|
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
|
*
|
|
@@ -970,6 +978,10 @@ export default abstract class Params {
|
|
|
970
978
|
static get displaySurface(): DisplayCaptureSurfaceType;
|
|
971
979
|
static get audioEffects(): EffectVoiceChange | null;
|
|
972
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);
|
|
973
985
|
static get videoEffects(): VideoEffects | null;
|
|
974
986
|
static set videoEffects(value: VideoEffects | null);
|
|
975
987
|
static get videoEffectMaxWidth(): number;
|
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
|
@@ -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/types/Api.d.ts
ADDED
package/types/Capabilities.d.ts
CHANGED