@vkontakte/calls-sdk 2.8.5-dev.70c56a40.0 → 2.8.5-dev.7186ce24.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 +40 -12
- package/abstract/BaseApi.d.ts +1 -1
- package/abstract/BaseSignaling.d.ts +5 -4
- package/calls-sdk.cjs.js +8 -8
- package/calls-sdk.esm.js +8 -8
- package/classes/Conversation.d.ts +20 -7
- package/classes/Logger.d.ts +3 -0
- package/classes/MediaSource.d.ts +13 -5
- package/classes/ProducerCommandSerializationService.d.ts +2 -0
- package/classes/codec/IDecoder.d.ts +1 -1
- package/classes/codec/LibVPxDecoder.d.ts +1 -1
- package/classes/codec/LibVPxEncoder.d.ts +0 -3
- package/classes/codec/WebCodecsDecoder.d.ts +1 -1
- package/classes/screenshare/StreamBuilder.d.ts +1 -0
- package/classes/transport/DirectStatReporter.d.ts +2 -1
- package/classes/transport/DirectTransport.d.ts +7 -0
- package/classes/transport/Transport.d.ts +2 -1
- package/default/Api.d.ts +1 -1
- package/default/Signaling.d.ts +5 -4
- package/enums/ConversationOption.d.ts +2 -1
- package/enums/SignalingCommandType.d.ts +3 -1
- package/enums/SignalingNotification.d.ts +3 -1
- package/package.json +3 -2
- package/static/ApiTransport.d.ts +0 -1
- package/static/External.d.ts +12 -2
- package/static/Params.d.ts +34 -30
- package/static/Utils.d.ts +3 -3
- package/static/WebRTCUtils.d.ts +6 -2
- package/types/EnableVideoSuspendSuggest.d.ts +3 -0
- package/types/Participant.d.ts +5 -0
- package/types/SignalingMessage.d.ts +21 -0
- package/types/Streams.d.ts +0 -1
- package/types/VideoSettings.d.ts +1 -1
- package/utils/Conversation.d.ts +3 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { IEffect } from '@vkontakte/calls-video-effects';
|
|
2
|
+
import type { RGBTuple } from '@vkontakte/calls-vmoji';
|
|
2
3
|
import BaseApi from '../abstract/BaseApi';
|
|
3
4
|
import BaseLogger from '../abstract/BaseLogger';
|
|
4
|
-
import
|
|
5
|
+
import { AddParticipantParams } from '../abstract/BaseSignaling';
|
|
5
6
|
import CallType from '../enums/CallType';
|
|
6
7
|
import ConversationFeature from '../enums/ConversationFeature';
|
|
7
8
|
import ConversationOption from '../enums/ConversationOption';
|
|
@@ -13,7 +14,7 @@ import { JSONObject } from '../static/Json';
|
|
|
13
14
|
import { IAsrStartParams, IAsrStopParams } from '../types/Asr';
|
|
14
15
|
import { AudienceModeHandsResponse } from '../types/AudienceMode';
|
|
15
16
|
import { ConversationData } from '../types/Conversation';
|
|
16
|
-
import { ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalUserId } from '../types/ExternalId';
|
|
17
|
+
import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalUserId } from '../types/ExternalId';
|
|
17
18
|
import MediaModifiers from '../types/MediaModifiers';
|
|
18
19
|
import { IVideoDimentions } from '../types/MediaSettings';
|
|
19
20
|
import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
|
|
@@ -61,7 +62,7 @@ export default class Conversation extends EventEmitter {
|
|
|
61
62
|
private _cooldownTimestampByStreamDescription;
|
|
62
63
|
private _cooldownQueueCleanupTimer;
|
|
63
64
|
private readonly _statFirstMediaReceived;
|
|
64
|
-
constructor(api: BaseApi,
|
|
65
|
+
constructor(api: BaseApi, externalLogger: BaseLogger | null);
|
|
65
66
|
static current(): Conversation | null;
|
|
66
67
|
static hangupAfterInit(): void;
|
|
67
68
|
static id(): string | null;
|
|
@@ -75,12 +76,15 @@ export default class Conversation extends EventEmitter {
|
|
|
75
76
|
payload?: string;
|
|
76
77
|
}): Promise<ConversationData>;
|
|
77
78
|
private _onJoinPart2;
|
|
79
|
+
private _extractExternalRooms;
|
|
80
|
+
private _extractExternalRoomsData;
|
|
78
81
|
onPush(conversationId: string, type?: UserType, peerId?: number): Promise<void>;
|
|
79
82
|
private _isInWaitingHall;
|
|
80
83
|
private _isRestricted;
|
|
81
84
|
private _isAudienceMode;
|
|
82
85
|
private _isAudienceModeListener;
|
|
83
86
|
private _acceptConcurrent;
|
|
87
|
+
private _getMainRoomParticipants;
|
|
84
88
|
accept(mediaOptions: MediaOption[]): Promise<ConversationData>;
|
|
85
89
|
decline(): Promise<void>;
|
|
86
90
|
hangup(): Promise<void>;
|
|
@@ -138,6 +142,7 @@ export default class Conversation extends EventEmitter {
|
|
|
138
142
|
* @param connection
|
|
139
143
|
*/
|
|
140
144
|
private _processRooms;
|
|
145
|
+
private _extractConnectionPersonalMuteStates;
|
|
141
146
|
/**
|
|
142
147
|
* Обрабатывает информацию о мьютах в основном и сессионных залах
|
|
143
148
|
* @param connection
|
|
@@ -187,6 +192,7 @@ export default class Conversation extends EventEmitter {
|
|
|
187
192
|
participantId?: ParticipantId | null,
|
|
188
193
|
/** ключ расшифровки svg внешнего пользователя или кастомный ключ, не требуется для незашифрованных svg */
|
|
189
194
|
decryptionKey?: string | null): void;
|
|
195
|
+
setAnimojiFill(fill: RGBTuple | string): void;
|
|
190
196
|
setVideoStream(stream: MediaStream, isScreen?: boolean): Promise<void>;
|
|
191
197
|
setAudioStream(stream: MediaStream): Promise<void>;
|
|
192
198
|
toggleLocalVideo(enabled: boolean): Promise<void>;
|
|
@@ -195,9 +201,8 @@ export default class Conversation extends EventEmitter {
|
|
|
195
201
|
* @deprecated Use updateDisplayLayout instead
|
|
196
202
|
*/
|
|
197
203
|
changePriorities(priorities: ParticipantPriority[]): Promise<void>;
|
|
198
|
-
changeParticipantState(state:
|
|
199
|
-
|
|
200
|
-
}): Promise<void>;
|
|
204
|
+
changeParticipantState(state: Record<string, string>, compositeUserId?: CompositeUserId): Promise<void>;
|
|
205
|
+
putHandsDown(): Promise<void>;
|
|
201
206
|
requestKeyFrame(participantStreamDescription: ParticipantStreamDescription): Promise<void | SignalingMessage>;
|
|
202
207
|
requestTestMode(consumerCommand: string, producerCommand: string): Promise<void>;
|
|
203
208
|
updateDisplayLayout(layouts: ParticipantLayout[]): Promise<void>;
|
|
@@ -227,6 +232,7 @@ export default class Conversation extends EventEmitter {
|
|
|
227
232
|
private _getWaitingTime;
|
|
228
233
|
private _isCallAdmin;
|
|
229
234
|
private _checkAdminRole;
|
|
235
|
+
private _isCalledState;
|
|
230
236
|
grantRoles(participantId: ParticipantId, roles: UserRole[], revoke: boolean): Promise<void>;
|
|
231
237
|
startAsr(params: IAsrStartParams): Promise<void>;
|
|
232
238
|
stopAsr(params?: IAsrStopParams): Promise<void>;
|
|
@@ -236,6 +242,7 @@ export default class Conversation extends EventEmitter {
|
|
|
236
242
|
pinParticipant(participantId: ParticipantId, unpin: boolean, roomId?: number | null): Promise<void>;
|
|
237
243
|
updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<void>;
|
|
238
244
|
enableVideoSuspend(enabled: boolean): Promise<void>;
|
|
245
|
+
enableVideoSuspendSuggest(enabled: boolean): Promise<void>;
|
|
239
246
|
changeOptions(changes: {
|
|
240
247
|
[key in ConversationOption]?: boolean;
|
|
241
248
|
}): Promise<void>;
|
|
@@ -266,7 +273,7 @@ export default class Conversation extends EventEmitter {
|
|
|
266
273
|
activateRooms(roomIds: number[], deactivate: boolean): Promise<void>;
|
|
267
274
|
switchRoom(toRoomId: number | null, participantId?: ParticipantId): Promise<void>;
|
|
268
275
|
removeRooms(roomIds: number[]): Promise<void>;
|
|
269
|
-
startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null, roomId?: number | null
|
|
276
|
+
startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null, roomId?: number | null): Promise<undefined>;
|
|
270
277
|
stopStream(roomId?: number | null): Promise<undefined>;
|
|
271
278
|
publishStream(roomId?: number | null): Promise<undefined>;
|
|
272
279
|
recordSetConf(king?: ParticipantId, pawns?: ParticipantId[], hideParticipantCount?: boolean, roomId?: number | null): Promise<void>;
|
|
@@ -279,13 +286,17 @@ export default class Conversation extends EventEmitter {
|
|
|
279
286
|
effect?: IVideoDimentions;
|
|
280
287
|
}): Promise<void | undefined>;
|
|
281
288
|
videoEffect(effect: IEffect | null): Promise<void | undefined>;
|
|
289
|
+
audioEffect(effects: string[] | null, isPreset?: boolean): Promise<void | undefined>;
|
|
290
|
+
_convertExternalIdsToServerExternalIds(externalIds: ExternalId[]): SignalingMessage.ExternalId[];
|
|
282
291
|
getParticipants(parameters: IGetParticipantsParameters): Promise<ExternalParticipant[]>;
|
|
283
292
|
getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<ExternalParticipantListChunk>;
|
|
284
293
|
private _getInitialParticiapntListChunk;
|
|
285
294
|
private _onLocalMediaStreamChanged;
|
|
286
295
|
private _onScreenSharingStatus;
|
|
287
296
|
private _changeRemoteMediaSettings;
|
|
297
|
+
private _changeLocalParticipantState;
|
|
288
298
|
private _changeRemoteParticipantState;
|
|
299
|
+
private _changeMultipleParticipantState;
|
|
289
300
|
private _invokeRolesChangedCallbackIfNeeded;
|
|
290
301
|
private _onSignalingNotification;
|
|
291
302
|
private _onPromotionApproved;
|
|
@@ -298,6 +309,7 @@ export default class Conversation extends EventEmitter {
|
|
|
298
309
|
private _onClosedConversation;
|
|
299
310
|
private _onMediaSettingsChanged;
|
|
300
311
|
private _onParticipantStateChanged;
|
|
312
|
+
private _onParticipantsStateChanged;
|
|
301
313
|
private _onNeedRate;
|
|
302
314
|
private _onFeatureSetChanged;
|
|
303
315
|
private _onMultipartyChatCreated;
|
|
@@ -373,6 +385,7 @@ export default class Conversation extends EventEmitter {
|
|
|
373
385
|
/** получили из сингналинга сообщение о реакции пользователей */
|
|
374
386
|
private _onFeedback;
|
|
375
387
|
private _onDecorativeParticipantIdChanged;
|
|
388
|
+
private _onVideoSuspendSuggest;
|
|
376
389
|
private _isMe;
|
|
377
390
|
private _getMuteStatesForRoomId;
|
|
378
391
|
private _getMuteStatesForCurrentRoom;
|
package/classes/Logger.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export default class Logger extends BaseLogger {
|
|
|
9
9
|
private _batchedClientStats;
|
|
10
10
|
private _batchedClientEvents;
|
|
11
11
|
private _batchTimeout;
|
|
12
|
+
private _serverTimeDelta;
|
|
12
13
|
private static _instance;
|
|
13
14
|
constructor(api: BaseApi, externalLogger: BaseLogger | null);
|
|
14
15
|
private _sendLogItems;
|
|
@@ -17,6 +18,8 @@ export default class Logger extends BaseLogger {
|
|
|
17
18
|
private _sendBatch;
|
|
18
19
|
private _startTimeout;
|
|
19
20
|
private _stopTimeout;
|
|
21
|
+
private _calculateServerTimeDelta;
|
|
22
|
+
private _now;
|
|
20
23
|
log(name: Stat, value?: string, immediately?: boolean): void;
|
|
21
24
|
logCustom(name: string, params: Record<string, string | number>, immediately?: boolean): void;
|
|
22
25
|
logClientStats(data: Record<string, string | number | undefined | null>, immediately?: boolean): void;
|
package/classes/MediaSource.d.ts
CHANGED
|
@@ -18,6 +18,10 @@ export declare const enum MediaTrackKind {
|
|
|
18
18
|
'screen' = "screen",
|
|
19
19
|
'audioshare' = "audioshare"
|
|
20
20
|
}
|
|
21
|
+
interface AudioEffectParams {
|
|
22
|
+
effects: string[];
|
|
23
|
+
isPreset?: boolean;
|
|
24
|
+
}
|
|
21
25
|
export declare class MediaSource extends EventEmitter {
|
|
22
26
|
/** Стрим с камеры и микрофона пользователя */
|
|
23
27
|
protected _stream: MediaStream | null;
|
|
@@ -25,14 +29,17 @@ export declare class MediaSource extends EventEmitter {
|
|
|
25
29
|
private _audioShareTrack;
|
|
26
30
|
/** Трек для отправки в медиа-канал. Может отличаться при скриншаринге в дата-канал */
|
|
27
31
|
private _sendVideoTrack;
|
|
28
|
-
/** Трек с камеры. В стриме будет другой трек при включенных эффектах */
|
|
32
|
+
/** Трек с камеры. В стриме будет другой трек при включенных видео эффектах */
|
|
29
33
|
private _cameraVideoTrack;
|
|
34
|
+
/** Трек с микрофона. В стриме будет другой трек при включенных аудио эффектах */
|
|
35
|
+
private _micAudioTrack;
|
|
36
|
+
/** Трек аудио эффектов. Не изменяется на протяжении всего времени */
|
|
37
|
+
private _audioEffectsTrack;
|
|
30
38
|
private _mediaSettings;
|
|
31
39
|
private _videoStatusOnScreenCapturingEnabled;
|
|
32
40
|
private _effect;
|
|
41
|
+
private _audioEffectParams;
|
|
33
42
|
private _onDeviceChange;
|
|
34
|
-
/** MediaSource занят при переключении камеры или микрофона */
|
|
35
|
-
private _sourceBusy;
|
|
36
43
|
/** Состояние выключателя Animoji в UI */
|
|
37
44
|
private _animojiEnabled;
|
|
38
45
|
constructor();
|
|
@@ -60,13 +67,12 @@ export declare class MediaSource extends EventEmitter {
|
|
|
60
67
|
* Может использоваться для тестирования.
|
|
61
68
|
*/
|
|
62
69
|
setAudioStream(stream: MediaStream): Promise<void>;
|
|
63
|
-
private _busy;
|
|
64
|
-
private _free;
|
|
65
70
|
private _changeAudioInput;
|
|
66
71
|
private _changeScreen;
|
|
67
72
|
private _disableScreenCapture;
|
|
68
73
|
private disableAudioShare;
|
|
69
74
|
private stopAudioShareTrack;
|
|
75
|
+
private _applyAudioEffect;
|
|
70
76
|
protected getSilentAudioShareTrack(): MediaStreamTrack;
|
|
71
77
|
protected _replaceLocalTrack(newTrack: MediaStreamTrack, sendTrack?: MediaStreamTrack): Promise<void>;
|
|
72
78
|
private _setEffect;
|
|
@@ -84,5 +90,7 @@ export declare class MediaSource extends EventEmitter {
|
|
|
84
90
|
}): Promise<void>;
|
|
85
91
|
updateNoiseSuppression(): Promise<void>;
|
|
86
92
|
videoEffect(effect: IEffect | null): Promise<void>;
|
|
93
|
+
audioEffect(audioEffectParams: AudioEffectParams | null): Promise<void>;
|
|
87
94
|
getAudioShareTrack(): MediaStreamTrack | null;
|
|
88
95
|
}
|
|
96
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import { NetworkStatReport } from '../types/NetworkStatReport';
|
|
|
2
2
|
import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
|
|
3
3
|
import { RequestAsr } from '../types/RequestAsr';
|
|
4
4
|
import { EnableVideoSuspend } from '../types/EnableVideoSuspend';
|
|
5
|
+
import { EnableVideoSuspendSuggest } from '../types/EnableVideoSuspendSuggest';
|
|
5
6
|
import SignalingMessage from '../types/SignalingMessage';
|
|
6
7
|
import { PerfStatReport } from '../types/PerfStatReporter';
|
|
7
8
|
import { SharingStatReport } from './screenshare/SharingStatReport';
|
|
@@ -19,6 +20,7 @@ export declare class ProducerCommandSerializationService {
|
|
|
19
20
|
serializeRequestAsr(sequenceNumber: number, params: RequestAsr): ArrayBuffer;
|
|
20
21
|
serializeNetworkStatReport(sequenceNumber: number, report: NetworkStatReport): ArrayBuffer;
|
|
21
22
|
serializeEnableVideoSuspend(sequenceNumber: number, params: EnableVideoSuspend): ArrayBuffer;
|
|
23
|
+
serializeEnableVideoSuspendSuggest(sequenceNumber: number, params: EnableVideoSuspendSuggest): ArrayBuffer;
|
|
22
24
|
deserializeCommandResponse(data: BufferSource | Blob): Promise<SignalingMessage | undefined>;
|
|
23
25
|
private deserializeUpdateDisplayLayoutResponse;
|
|
24
26
|
private deserializeReportPerfStatResponse;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default interface IDecoder {
|
|
2
|
-
init(onFrameImage: (image: VideoFrame | ImageData) => void): Promise<void>;
|
|
2
|
+
init(onFrameImage: (image: VideoFrame | ImageData) => void, onFrameError?: (error: unknown) => void): Promise<void>;
|
|
3
3
|
decodeFrame(timestamp: number, data: Uint8Array, isVP9: boolean, keyFrame?: boolean): void;
|
|
4
4
|
destroy(): void;
|
|
5
5
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import IDecoder from './IDecoder';
|
|
2
2
|
import WorkerBase from './WorkerBase';
|
|
3
3
|
export default class LibVPxDecoder extends WorkerBase implements IDecoder {
|
|
4
|
-
init(onFrameImage: (image: ImageData) => void): Promise<void>;
|
|
4
|
+
init(onFrameImage: (image: ImageData) => void, onFrameError: (error: unknown) => void): Promise<void>;
|
|
5
5
|
decodeFrame(timestamp: number, data: Uint8Array, isVP9: boolean, keyFrame?: boolean): void;
|
|
6
6
|
destroy(): void;
|
|
7
7
|
static isBrowserSupported(): boolean;
|
|
@@ -11,8 +11,6 @@ export default class LibVPxEncoder extends WorkerBase implements IEncoder {
|
|
|
11
11
|
private _imageCapture;
|
|
12
12
|
private _canvas;
|
|
13
13
|
private _canvasCtx;
|
|
14
|
-
private _stream;
|
|
15
|
-
private _track;
|
|
16
14
|
private _frameReadTimeout;
|
|
17
15
|
private _lastFrame;
|
|
18
16
|
constructor(sourceTrack: MediaStreamTrack, onFrame: OnFrameCallback, useCongestionControl: boolean, maxBitrate: number);
|
|
@@ -23,7 +21,6 @@ export default class LibVPxEncoder extends WorkerBase implements IEncoder {
|
|
|
23
21
|
private _drawFrameVideo;
|
|
24
22
|
private _getFrameBitmap;
|
|
25
23
|
private _drawFrameData;
|
|
26
|
-
private _requestCanvasFrame;
|
|
27
24
|
init(): Promise<void>;
|
|
28
25
|
private _encode;
|
|
29
26
|
private _requestFrameVideo;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import IDecoder from './IDecoder';
|
|
2
2
|
import WorkerBase from './WorkerBase';
|
|
3
3
|
export default class WebCodecsDecoder extends WorkerBase implements IDecoder {
|
|
4
|
-
init(onFrameImage: (frame: VideoFrame) => void): Promise<void>;
|
|
4
|
+
init(onFrameImage: (frame: VideoFrame) => void, onFrameError: (error: unknown) => void): Promise<void>;
|
|
5
5
|
decodeFrame(timestamp: number, data: Uint8Array, isVP9: boolean, keyFrame?: boolean): void;
|
|
6
6
|
destroy(): void;
|
|
7
7
|
static isBrowserSupported(): boolean;
|
|
@@ -4,6 +4,7 @@ export default class StreamBuilder extends BaseStreamBuilder {
|
|
|
4
4
|
private readonly _renderer;
|
|
5
5
|
private readonly _decoder;
|
|
6
6
|
private _decoderReady;
|
|
7
|
+
private _decoderBusy;
|
|
7
8
|
private _decoderQueue;
|
|
8
9
|
private readonly _fpsMeter;
|
|
9
10
|
constructor(participantId: ParticipantId, onStream: IOnStream, onStat: IOnStat);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
2
|
+
import { StatResult } from '../../types/Statistics';
|
|
2
3
|
import EventEmitter from '../EventEmitter';
|
|
3
4
|
import { WeightedAverage } from '../stat/WeightedAverage';
|
|
4
5
|
interface NetworkStat {
|
|
@@ -13,6 +13,7 @@ export default class DirectTransport extends BaseTransport {
|
|
|
13
13
|
private _animojiDataChannel;
|
|
14
14
|
private _animojiReceiver;
|
|
15
15
|
private _animojiSender;
|
|
16
|
+
private _remoteAnimojiVersion;
|
|
16
17
|
private _isOpen;
|
|
17
18
|
private _remotePeerId;
|
|
18
19
|
private _statInterval;
|
|
@@ -49,6 +50,7 @@ export default class DirectTransport extends BaseTransport {
|
|
|
49
50
|
private _addIceCandidate;
|
|
50
51
|
private _setRemoteCandidates;
|
|
51
52
|
private _setRemoteDescription;
|
|
53
|
+
private _processAnimojiProtocolVersion;
|
|
52
54
|
private _onAddTrack;
|
|
53
55
|
private _handleIceCandidate;
|
|
54
56
|
private _onSignalingStateChange;
|
|
@@ -64,6 +66,11 @@ export default class DirectTransport extends BaseTransport {
|
|
|
64
66
|
private static _patchRemoteDescription;
|
|
65
67
|
private _onReplacedTrack;
|
|
66
68
|
private _startStatInterval;
|
|
69
|
+
/**
|
|
70
|
+
* Check SVC support
|
|
71
|
+
* @see https://webrtc.internaut.com/mc/
|
|
72
|
+
*/
|
|
73
|
+
private _isSVCSupported;
|
|
67
74
|
private _checkPPTNetwork;
|
|
68
75
|
private _stopStatInterval;
|
|
69
76
|
private _onNetworkStatus;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnimojiSvgData } from '@vkontakte/calls-vmoji';
|
|
1
|
+
import type { AnimojiSvgData, RGBTuple } from '@vkontakte/calls-vmoji';
|
|
2
2
|
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
3
3
|
import { ParticipantId } from '../../types/Participant';
|
|
4
4
|
import ServerSettings from '../../types/ServerSettings';
|
|
@@ -65,6 +65,7 @@ export declare class Transport extends EventEmitter {
|
|
|
65
65
|
getState(): TransportState | undefined;
|
|
66
66
|
getStates(): Record<string, TransportState>;
|
|
67
67
|
setAnimojiSvg(participantId: ParticipantId, svgData: AnimojiSvgData): void;
|
|
68
|
+
setAnimojiFill(fill: RGBTuple | string): void;
|
|
68
69
|
private _setStates;
|
|
69
70
|
private _setLocalState;
|
|
70
71
|
private _onSignalingNotification;
|
package/default/Api.d.ts
CHANGED
|
@@ -17,7 +17,6 @@ export default class Api extends BaseApi {
|
|
|
17
17
|
log(items: LogItem[]): void;
|
|
18
18
|
logClientStats(items: ClientStats[]): void;
|
|
19
19
|
logClientEvents(items: ClientEvent[]): void;
|
|
20
|
-
init(): void;
|
|
21
20
|
joinConversation(conversationId: string, isVideo?: boolean, chatId?: string): Promise<ConversationResponse>;
|
|
22
21
|
createConversation(conversationId: string, payload?: string, requireAuthToJoin?: boolean, { onlyAdminCanShareMovie, audienceMode, audioOnly, }?: {
|
|
23
22
|
onlyAdminCanShareMovie?: boolean;
|
|
@@ -64,4 +63,5 @@ export default class Api extends BaseApi {
|
|
|
64
63
|
removeHistoryRecords(recordIds: number[]): Promise<void>;
|
|
65
64
|
cleanup(): void;
|
|
66
65
|
private _getExternalIdsByOkIds;
|
|
66
|
+
getServerTime(): Promise<number>;
|
|
67
67
|
}
|
package/default/Signaling.d.ts
CHANGED
|
@@ -82,12 +82,11 @@ export default class Signaling extends BaseSignaling {
|
|
|
82
82
|
hangup(reason: string): Promise<SignalingMessage | void>;
|
|
83
83
|
sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidate): Promise<SignalingMessage>;
|
|
84
84
|
requestTestMode(consumerCommand: string, producerCommand: string | null): Promise<SignalingMessage>;
|
|
85
|
-
sendSdp(participantId: ParticipantId, sdp: RTCSessionDescriptionInit): Promise<SignalingMessage>;
|
|
85
|
+
sendSdp(participantId: ParticipantId, sdp: RTCSessionDescriptionInit, extraPayload?: Record<string, any>): Promise<SignalingMessage>;
|
|
86
86
|
acceptCall(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
87
87
|
changeMediaSettings(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
88
|
-
changeParticipantState(state:
|
|
89
|
-
|
|
90
|
-
}): Promise<SignalingMessage>;
|
|
88
|
+
changeParticipantState(state: Record<string, string>, compositeUserId?: CompositeUserId): Promise<SignalingMessage>;
|
|
89
|
+
putHandsDown(): Promise<SignalingMessage>;
|
|
91
90
|
addParticipant(participantId: CompositeUserId, params?: AddParticipantParams): Promise<SignalingMessage>;
|
|
92
91
|
removeParticipant(participantId: CompositeUserId, ban?: boolean): Promise<SignalingMessage>;
|
|
93
92
|
allocateConsumer(description: RTCSessionDescription | null, capabilities: {
|
|
@@ -132,6 +131,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
132
131
|
pinParticipant(participantId: ParticipantId, unpin: boolean, roomId: number | null): Promise<SignalingMessage>;
|
|
133
132
|
updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<SignalingMessage>;
|
|
134
133
|
enableVideoSuspend(enabled: boolean): Promise<SignalingMessage>;
|
|
134
|
+
enableVideoSuspendSuggest(enabled: boolean): Promise<SignalingMessage>;
|
|
135
135
|
changeOptions(changes: {
|
|
136
136
|
[key in ConversationOption]?: boolean;
|
|
137
137
|
}): Promise<SignalingMessage>;
|
|
@@ -154,6 +154,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
154
154
|
readyToSend(isReady?: boolean): void;
|
|
155
155
|
getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<SignalingMessage>;
|
|
156
156
|
getParticipants(externalIds: SignalingMessage.ExternalId[]): Promise<GetParticipantsSignalingResponse>;
|
|
157
|
+
getPeerId(): number | null;
|
|
157
158
|
startAsr(params: IAsrStartParams): Promise<SignalingMessage>;
|
|
158
159
|
stopAsr(params?: IAsrStopParams): Promise<SignalingMessage>;
|
|
159
160
|
requestAsr(request: boolean): Promise<SignalingMessage>;
|
|
@@ -6,7 +6,8 @@ declare enum ConversationOption {
|
|
|
6
6
|
AUDIENCE_MODE = "AUDIENCE_MODE",
|
|
7
7
|
WAITING_HALL = "WAITING_HALL",
|
|
8
8
|
ASR = "ASR",
|
|
9
|
-
FEEDBACK = "FEEDBACK"
|
|
9
|
+
FEEDBACK = "FEEDBACK",
|
|
10
|
+
RECURRING = "RECURRING"
|
|
10
11
|
}
|
|
11
12
|
export default ConversationOption;
|
|
12
13
|
export declare function compareOptions(oldOptions: ConversationOption[], newOptions: ConversationOption[]): boolean;
|
|
@@ -53,6 +53,8 @@ declare enum SignalingCommandType {
|
|
|
53
53
|
REQUEST_PROMOTION = "request-promotion",
|
|
54
54
|
ACCEPT_PROMOTION = "accept-promotion",
|
|
55
55
|
GET_HAND_QUEUE = "get-hand-queue",
|
|
56
|
-
ENABLE_VIDEO_SUSPEND = "enable-video-suspend"
|
|
56
|
+
ENABLE_VIDEO_SUSPEND = "enable-video-suspend",
|
|
57
|
+
ENABLE_VIDEO_SUSPEND_SUGGEST = "enable-video-suspend-suggest",
|
|
58
|
+
PUT_HANDS_DOWN = "put-hands-down"
|
|
57
59
|
}
|
|
58
60
|
export default SignalingCommandType;
|
|
@@ -7,6 +7,7 @@ declare enum SignalingNotification {
|
|
|
7
7
|
CLOSED_CONVERSATION = "closed-conversation",
|
|
8
8
|
MEDIA_SETTINGS_CHANGED = "media-settings-changed",
|
|
9
9
|
PARTICIPANT_STATE_CHANGED = "participant-state-changed",
|
|
10
|
+
PARTICIPANTS_STATE_CHANGED = "participants-state-changed",
|
|
10
11
|
RATE_CALL_DATA = "rate-call-data",
|
|
11
12
|
FEATURE_SET_CHANGED = "feature-set-changed",
|
|
12
13
|
TOPOLOGY_CHANGED = "topology-changed",
|
|
@@ -48,6 +49,7 @@ declare enum SignalingNotification {
|
|
|
48
49
|
PARTICIPANT_ANIMOJI_CHANGED = "participant-animoji-changed",
|
|
49
50
|
ASR_STARTED = "asr-started",
|
|
50
51
|
ASR_STOPPED = "asr-stopped",
|
|
51
|
-
DECORATIVE_PARTICIPANT_ID_CHANGED = "decorative-participant-id-changed"
|
|
52
|
+
DECORATIVE_PARTICIPANT_ID_CHANGED = "decorative-participant-id-changed",
|
|
53
|
+
VIDEO_SUSPEND_SUGGEST = "video-suspend-suggest"
|
|
52
54
|
}
|
|
53
55
|
export default SignalingNotification;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/calls-sdk",
|
|
3
|
-
"version": "2.8.5-dev.
|
|
3
|
+
"version": "2.8.5-dev.7186ce24.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,8 +14,9 @@
|
|
|
14
14
|
"**/*.d.ts"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
+
"@vkontakte/calls-audio-effects": "1.2.4",
|
|
17
18
|
"@vkontakte/calls-video-effects": "2.2.3-beta.2",
|
|
18
|
-
"@vkontakte/calls-vmoji": "1.0.
|
|
19
|
+
"@vkontakte/calls-vmoji": "1.0.10-beta.11",
|
|
19
20
|
"@vkontakte/libvpx": "2.0.9",
|
|
20
21
|
"bit-buffer": "0.2.5",
|
|
21
22
|
"messagepack": "1.1.12",
|
package/static/ApiTransport.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IApiEnv } from '../types/Params';
|
|
2
2
|
export declare function _resolveApiEndpoint(apiEnv?: IApiEnv): Promise<string>;
|
|
3
|
-
export declare function init(): void;
|
|
4
3
|
export declare function sendBeakon(method: string, params?: {
|
|
5
4
|
[key: string]: any;
|
|
6
5
|
}, noSession?: boolean): Promise<void>;
|
package/static/External.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ import MediaModifiers from '../types/MediaModifiers';
|
|
|
17
17
|
import MediaSettings from '../types/MediaSettings';
|
|
18
18
|
import { IOnRemoteMovieData, ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from '../types/MovieShare';
|
|
19
19
|
import MuteStates from '../types/MuteStates';
|
|
20
|
-
import { ParticipantStateMapped } from '../types/Participant';
|
|
20
|
+
import { ParticipantsStateList, ParticipantStateMapped } from '../types/Participant';
|
|
21
21
|
import { IRoomId, Room, RoomParticipantUpdate, Rooms, RoomsUpdate } from '../types/Room';
|
|
22
22
|
import { VmojiError } from '../types/Vmoji';
|
|
23
23
|
import { DebugMessageType } from './Debug';
|
|
@@ -226,6 +226,7 @@ declare namespace External {
|
|
|
226
226
|
* @param markers
|
|
227
227
|
*/
|
|
228
228
|
function onParticipantJoined(userId: ExternalId, markers: ExternalParticipantListMarkers | null): void;
|
|
229
|
+
function onLocalParticipantState(participantState: ParticipantStateMapped): void;
|
|
229
230
|
/**
|
|
230
231
|
* Изменились данные состояний собеседника
|
|
231
232
|
*
|
|
@@ -234,6 +235,13 @@ declare namespace External {
|
|
|
234
235
|
* @param markers
|
|
235
236
|
*/
|
|
236
237
|
function onRemoteParticipantState(userId: ExternalParticipantId, participantState: ParticipantStateMapped, markers: ExternalParticipantListMarkers | null): void;
|
|
238
|
+
/**
|
|
239
|
+
* Изменились данные состояний нескольких собеседников
|
|
240
|
+
*
|
|
241
|
+
* @param stateList
|
|
242
|
+
* @param roomId
|
|
243
|
+
*/
|
|
244
|
+
function onRemoteParticipantsState(stateList: ParticipantsStateList, roomId?: IRoomId): void;
|
|
237
245
|
/**
|
|
238
246
|
* Изменился статус соединения собеседников
|
|
239
247
|
*
|
|
@@ -301,8 +309,9 @@ declare namespace External {
|
|
|
301
309
|
* Изменились свои роли в звонке
|
|
302
310
|
*
|
|
303
311
|
* @param roles Список ролей
|
|
312
|
+
* @param isInitial Коллбек вызван при инициализации (переподключение в звонок, заранее назначенный админ)
|
|
304
313
|
*/
|
|
305
|
-
function onLocalRolesChanged(roles: UserRole[]): void;
|
|
314
|
+
function onLocalRolesChanged(roles: UserRole[], isInitial?: boolean): void;
|
|
306
315
|
/**
|
|
307
316
|
* Закрепляет/открепляет собеседника для всех
|
|
308
317
|
*
|
|
@@ -539,6 +548,7 @@ declare namespace External {
|
|
|
539
548
|
* @param newId
|
|
540
549
|
*/
|
|
541
550
|
function onParticipantIdChanged(prevId: ExternalParticipantId, newId: ExternalParticipantId): void;
|
|
551
|
+
function onVideoSuspendSuggest(bandwidth: number): void;
|
|
542
552
|
/**
|
|
543
553
|
* Одобрено повышение пользователя в зеле ожидания/зале в режиме Audience
|
|
544
554
|
*
|
package/static/Params.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { VideoEffects } from '@vkontakte/calls-video-effects';
|
|
2
|
+
import type { EffectVoiceChange } from '@vkontakte/calls-audio-effects';
|
|
2
3
|
import type * as Vmoji from '@vkontakte/calls-vmoji';
|
|
3
4
|
import { IAsrData } from '../types/Asr';
|
|
4
5
|
import { ConversationData } from '../types/Conversation';
|
|
@@ -18,7 +19,7 @@ import MediaModifiers from '../types/MediaModifiers';
|
|
|
18
19
|
import MediaSettings from '../types/MediaSettings';
|
|
19
20
|
import { IOnRemoteMovieData, ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from '../types/MovieShare';
|
|
20
21
|
import MuteStates from '../types/MuteStates';
|
|
21
|
-
import { ParticipantStateMapped } from '../types/Participant';
|
|
22
|
+
import { ParticipantsStateList, ParticipantStateMapped } from '../types/Participant';
|
|
22
23
|
import { MediaType } from '../types/ParticipantStreamDescription';
|
|
23
24
|
import { IRoomId, Room, RoomParticipantUpdate, Rooms, RoomsUpdate } from '../types/Room';
|
|
24
25
|
import { IApiEnv } from '../types/Params';
|
|
@@ -159,6 +160,12 @@ export type ParamsObject = {
|
|
|
159
160
|
* Можно установить позднее методом `setVideoEffects`
|
|
160
161
|
*/
|
|
161
162
|
videoEffects: VideoEffects | null;
|
|
163
|
+
/**
|
|
164
|
+
* Экземпляр класса `AudioEffects` из [`@vkontakte/calls-audio-effects`](https://npmjs.com/package/@vkontakte/calls-audio-effects)
|
|
165
|
+
*
|
|
166
|
+
* Можно установить позднее методом `setAudioEffects`
|
|
167
|
+
*/
|
|
168
|
+
audioEffects: EffectVoiceChange | null;
|
|
162
169
|
/**
|
|
163
170
|
* Максимальная ширина видео в пикселях для видео эффекта
|
|
164
171
|
*
|
|
@@ -178,11 +185,12 @@ export type ParamsObject = {
|
|
|
178
185
|
*/
|
|
179
186
|
vmoji: typeof Vmoji | null;
|
|
180
187
|
/**
|
|
181
|
-
* Настройки
|
|
182
|
-
*
|
|
183
|
-
* Экземпляр класса `RenderingOptions` из [`@vkontakte/calls-vmoji`](https://npmjs.com/package/@vkontakte/calls-vmoji)
|
|
188
|
+
* Настройки Vmoji
|
|
184
189
|
*/
|
|
185
|
-
|
|
190
|
+
vmojiOptions: {
|
|
191
|
+
protocolVersion: Vmoji.AnimojiVersion;
|
|
192
|
+
renderingOptions: Partial<Vmoji.RenderingOptions>;
|
|
193
|
+
} | null;
|
|
186
194
|
/** @hidden */
|
|
187
195
|
iceRestartWaitTime: number;
|
|
188
196
|
/** @hidden */
|
|
@@ -226,14 +234,6 @@ export type ParamsObject = {
|
|
|
226
234
|
perfStatReportEnabled: boolean;
|
|
227
235
|
/** @hidden */
|
|
228
236
|
callStatReportEnabled: boolean;
|
|
229
|
-
/**
|
|
230
|
-
* Включает использование обновленного API и формата
|
|
231
|
-
* логирования статистики качества аудио/видео.
|
|
232
|
-
*
|
|
233
|
-
* _По умолчанию: `false`_
|
|
234
|
-
* @hidden
|
|
235
|
-
*/
|
|
236
|
-
useCallStatReportNewAPI: boolean;
|
|
237
237
|
/**
|
|
238
238
|
* Включает логирование событий продуктовой статистики.
|
|
239
239
|
*
|
|
@@ -241,16 +241,6 @@ export type ParamsObject = {
|
|
|
241
241
|
* @hidden
|
|
242
242
|
*/
|
|
243
243
|
clientEventsLoggingEnabled: boolean;
|
|
244
|
-
/** @hidden */
|
|
245
|
-
networkStatReportEnabled: boolean;
|
|
246
|
-
/**
|
|
247
|
-
* Включает извлечение `remote-inbound-rtp` для использования в статистике.
|
|
248
|
-
* Используется для вычисления `video_loss` и `audio_loss`.
|
|
249
|
-
*
|
|
250
|
-
* _По умолчанию: `false`_
|
|
251
|
-
* @hidden
|
|
252
|
-
*/
|
|
253
|
-
includeRemoteRtpsInCallStat: boolean;
|
|
254
244
|
/**
|
|
255
245
|
* Отдавать приоритет кодеку H264 для исходящего видео
|
|
256
246
|
*
|
|
@@ -261,7 +251,7 @@ export type ParamsObject = {
|
|
|
261
251
|
* Отдавать приоритет кодеку VP9 для исходящего видео,
|
|
262
252
|
* если preferH264 тоже выставлен в true то первый приоритет будет у VP9, второй у H264
|
|
263
253
|
*
|
|
264
|
-
* _По умолчанию: `
|
|
254
|
+
* _По умолчанию: `false`_
|
|
265
255
|
*/
|
|
266
256
|
preferVP9: boolean;
|
|
267
257
|
/** @hidden */
|
|
@@ -564,10 +554,19 @@ export type ParamsObject = {
|
|
|
564
554
|
* Участник присоединился к звонку
|
|
565
555
|
*/
|
|
566
556
|
onParticipantJoined?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers) => void;
|
|
557
|
+
/**
|
|
558
|
+
* Получены данные по изменению локальных состояний со стороны админа
|
|
559
|
+
* Например, принудительно опущена рука
|
|
560
|
+
*/
|
|
561
|
+
onLocalParticipantState?: (participantState: ParticipantStateMapped) => void;
|
|
567
562
|
/**
|
|
568
563
|
* Изменились данные состояний собеседника
|
|
569
564
|
*/
|
|
570
565
|
onRemoteParticipantState?: (userId: ExternalParticipantId, participantState: ParticipantStateMapped, markers: ExternalParticipantListMarkers | null) => void;
|
|
566
|
+
/**
|
|
567
|
+
* Изменились данные состояний нескольких собеседников
|
|
568
|
+
*/
|
|
569
|
+
onRemoteParticipantsState?: (stateList: ParticipantsStateList, roomId?: IRoomId) => void;
|
|
571
570
|
/**
|
|
572
571
|
* Изменился статус соединения собеседников
|
|
573
572
|
*/
|
|
@@ -603,7 +602,7 @@ export type ParamsObject = {
|
|
|
603
602
|
/**
|
|
604
603
|
* Изменились свои роли в звонке
|
|
605
604
|
*/
|
|
606
|
-
onLocalRolesChanged?: (roles: UserRole[]) => void;
|
|
605
|
+
onLocalRolesChanged?: (roles: UserRole[], isInitial?: boolean) => void;
|
|
607
606
|
/**
|
|
608
607
|
* Закрепляет/открепляет собеседника для всех
|
|
609
608
|
*/
|
|
@@ -805,6 +804,12 @@ export type ParamsObject = {
|
|
|
805
804
|
* @param newId
|
|
806
805
|
*/
|
|
807
806
|
onParticipantIdChanged?: (prevId: ExternalParticipantId, newId: ExternalParticipantId) => void;
|
|
807
|
+
/**
|
|
808
|
+
* Предложение включить режим автоматического отключения приёма видео
|
|
809
|
+
* в плохой сети
|
|
810
|
+
* @param bandwidth текущая полоса пропускания, kbps
|
|
811
|
+
*/
|
|
812
|
+
onVideoSuspendSuggest?: (bandwidth: number) => void;
|
|
808
813
|
/**
|
|
809
814
|
* Одобрено повышение пользователя в зале ожидания/зале в режиме Audience
|
|
810
815
|
*
|
|
@@ -885,6 +890,8 @@ export default abstract class Params {
|
|
|
885
890
|
static get videoFacingMode(): FacingMode | null;
|
|
886
891
|
static set videoFacingMode(value: FacingMode | null);
|
|
887
892
|
static get displaySurface(): DisplayCaptureSurfaceType;
|
|
893
|
+
static get audioEffects(): EffectVoiceChange | null;
|
|
894
|
+
static set audioEffects(value: EffectVoiceChange | null);
|
|
888
895
|
static get videoEffects(): VideoEffects | null;
|
|
889
896
|
static set videoEffects(value: VideoEffects | null);
|
|
890
897
|
static get videoEffectMaxWidth(): number;
|
|
@@ -893,8 +900,8 @@ export default abstract class Params {
|
|
|
893
900
|
static set videoEffectMaxHeight(value: number);
|
|
894
901
|
static get vmoji(): typeof Vmoji | null;
|
|
895
902
|
static set vmoji(value: typeof Vmoji | null);
|
|
896
|
-
static get
|
|
897
|
-
static set
|
|
903
|
+
static get vmojiOptions(): NonNullable<ParamsObject['vmojiOptions']>;
|
|
904
|
+
static set vmojiOptions(value: ParamsObject['vmojiOptions']);
|
|
898
905
|
static get voiceParams(): {
|
|
899
906
|
[key: string]: number;
|
|
900
907
|
};
|
|
@@ -908,11 +915,8 @@ export default abstract class Params {
|
|
|
908
915
|
static get networkStatisticsInterval(): number;
|
|
909
916
|
static get perfStatReportEnabled(): boolean;
|
|
910
917
|
static get callStatReportEnabled(): boolean;
|
|
911
|
-
static get useCallStatReportNewAPI(): boolean;
|
|
912
918
|
static get clientEventsLoggingEnabled(): boolean;
|
|
913
|
-
static get networkStatReportEnabled(): boolean;
|
|
914
919
|
static get enableLogPerfStatReport(): boolean;
|
|
915
|
-
static get includeRemoteRtpsInCallStat(): boolean;
|
|
916
920
|
static get producerNotificationDataChannel(): boolean;
|
|
917
921
|
static get producerCommandDataChannel(): boolean;
|
|
918
922
|
static get consumerScreenDataChannel(): boolean;
|