@vkontakte/calls-sdk 2.8.5-dev.5bdb0ab6.0 → 2.8.5-dev.5be10715.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 +18 -9
- package/abstract/BaseApi.d.ts +1 -1
- package/abstract/BaseSignaling.d.ts +4 -4
- package/calls-sdk.cjs.js +8 -9
- package/calls-sdk.esm.js +8 -9
- package/classes/Conversation.d.ts +17 -7
- package/classes/Logger.d.ts +3 -0
- 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/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 +6 -4
- package/default/Api.d.ts +1 -1
- package/default/Signaling.d.ts +4 -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 +2 -2
- package/static/ApiTransport.d.ts +0 -1
- package/static/External.d.ts +12 -2
- package/static/Params.d.ts +17 -23
- package/static/Utils.d.ts +1 -1
- package/static/WebRTCUtils.d.ts +4 -0
- 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
|
@@ -2,7 +2,7 @@ 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
4
|
import BaseLogger from '../abstract/BaseLogger';
|
|
5
|
-
import
|
|
5
|
+
import { AddParticipantParams } from '../abstract/BaseSignaling';
|
|
6
6
|
import CallType from '../enums/CallType';
|
|
7
7
|
import ConversationFeature from '../enums/ConversationFeature';
|
|
8
8
|
import ConversationOption from '../enums/ConversationOption';
|
|
@@ -14,7 +14,7 @@ import { JSONObject } from '../static/Json';
|
|
|
14
14
|
import { IAsrStartParams, IAsrStopParams } from '../types/Asr';
|
|
15
15
|
import { AudienceModeHandsResponse } from '../types/AudienceMode';
|
|
16
16
|
import { ConversationData } from '../types/Conversation';
|
|
17
|
-
import { ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalUserId } from '../types/ExternalId';
|
|
17
|
+
import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalUserId } from '../types/ExternalId';
|
|
18
18
|
import MediaModifiers from '../types/MediaModifiers';
|
|
19
19
|
import { IVideoDimentions } from '../types/MediaSettings';
|
|
20
20
|
import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
|
|
@@ -62,7 +62,7 @@ export default class Conversation extends EventEmitter {
|
|
|
62
62
|
private _cooldownTimestampByStreamDescription;
|
|
63
63
|
private _cooldownQueueCleanupTimer;
|
|
64
64
|
private readonly _statFirstMediaReceived;
|
|
65
|
-
constructor(api: BaseApi,
|
|
65
|
+
constructor(api: BaseApi, externalLogger: BaseLogger | null);
|
|
66
66
|
static current(): Conversation | null;
|
|
67
67
|
static hangupAfterInit(): void;
|
|
68
68
|
static id(): string | null;
|
|
@@ -76,12 +76,15 @@ export default class Conversation extends EventEmitter {
|
|
|
76
76
|
payload?: string;
|
|
77
77
|
}): Promise<ConversationData>;
|
|
78
78
|
private _onJoinPart2;
|
|
79
|
+
private _extractExternalRooms;
|
|
80
|
+
private _extractExternalRoomsData;
|
|
79
81
|
onPush(conversationId: string, type?: UserType, peerId?: number): Promise<void>;
|
|
80
82
|
private _isInWaitingHall;
|
|
81
83
|
private _isRestricted;
|
|
82
84
|
private _isAudienceMode;
|
|
83
85
|
private _isAudienceModeListener;
|
|
84
86
|
private _acceptConcurrent;
|
|
87
|
+
private _getMainRoomParticipants;
|
|
85
88
|
accept(mediaOptions: MediaOption[]): Promise<ConversationData>;
|
|
86
89
|
decline(): Promise<void>;
|
|
87
90
|
hangup(): Promise<void>;
|
|
@@ -139,6 +142,7 @@ export default class Conversation extends EventEmitter {
|
|
|
139
142
|
* @param connection
|
|
140
143
|
*/
|
|
141
144
|
private _processRooms;
|
|
145
|
+
private _extractConnectionPersonalMuteStates;
|
|
142
146
|
/**
|
|
143
147
|
* Обрабатывает информацию о мьютах в основном и сессионных залах
|
|
144
148
|
* @param connection
|
|
@@ -197,9 +201,8 @@ export default class Conversation extends EventEmitter {
|
|
|
197
201
|
* @deprecated Use updateDisplayLayout instead
|
|
198
202
|
*/
|
|
199
203
|
changePriorities(priorities: ParticipantPriority[]): Promise<void>;
|
|
200
|
-
changeParticipantState(state:
|
|
201
|
-
|
|
202
|
-
}): Promise<void>;
|
|
204
|
+
changeParticipantState(state: Record<string, string>, compositeUserId?: CompositeUserId): Promise<void>;
|
|
205
|
+
putHandsDown(): Promise<void>;
|
|
203
206
|
requestKeyFrame(participantStreamDescription: ParticipantStreamDescription): Promise<void | SignalingMessage>;
|
|
204
207
|
requestTestMode(consumerCommand: string, producerCommand: string): Promise<void>;
|
|
205
208
|
updateDisplayLayout(layouts: ParticipantLayout[]): Promise<void>;
|
|
@@ -229,6 +232,7 @@ export default class Conversation extends EventEmitter {
|
|
|
229
232
|
private _getWaitingTime;
|
|
230
233
|
private _isCallAdmin;
|
|
231
234
|
private _checkAdminRole;
|
|
235
|
+
private _isCalledState;
|
|
232
236
|
grantRoles(participantId: ParticipantId, roles: UserRole[], revoke: boolean): Promise<void>;
|
|
233
237
|
startAsr(params: IAsrStartParams): Promise<void>;
|
|
234
238
|
stopAsr(params?: IAsrStopParams): Promise<void>;
|
|
@@ -238,6 +242,7 @@ export default class Conversation extends EventEmitter {
|
|
|
238
242
|
pinParticipant(participantId: ParticipantId, unpin: boolean, roomId?: number | null): Promise<void>;
|
|
239
243
|
updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<void>;
|
|
240
244
|
enableVideoSuspend(enabled: boolean): Promise<void>;
|
|
245
|
+
enableVideoSuspendSuggest(enabled: boolean): Promise<void>;
|
|
241
246
|
changeOptions(changes: {
|
|
242
247
|
[key in ConversationOption]?: boolean;
|
|
243
248
|
}): Promise<void>;
|
|
@@ -268,7 +273,7 @@ export default class Conversation extends EventEmitter {
|
|
|
268
273
|
activateRooms(roomIds: number[], deactivate: boolean): Promise<void>;
|
|
269
274
|
switchRoom(toRoomId: number | null, participantId?: ParticipantId): Promise<void>;
|
|
270
275
|
removeRooms(roomIds: number[]): Promise<void>;
|
|
271
|
-
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>;
|
|
272
277
|
stopStream(roomId?: number | null): Promise<undefined>;
|
|
273
278
|
publishStream(roomId?: number | null): Promise<undefined>;
|
|
274
279
|
recordSetConf(king?: ParticipantId, pawns?: ParticipantId[], hideParticipantCount?: boolean, roomId?: number | null): Promise<void>;
|
|
@@ -281,13 +286,16 @@ export default class Conversation extends EventEmitter {
|
|
|
281
286
|
effect?: IVideoDimentions;
|
|
282
287
|
}): Promise<void | undefined>;
|
|
283
288
|
videoEffect(effect: IEffect | null): Promise<void | undefined>;
|
|
289
|
+
_convertExternalIdsToServerExternalIds(externalIds: ExternalId[]): SignalingMessage.ExternalId[];
|
|
284
290
|
getParticipants(parameters: IGetParticipantsParameters): Promise<ExternalParticipant[]>;
|
|
285
291
|
getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<ExternalParticipantListChunk>;
|
|
286
292
|
private _getInitialParticiapntListChunk;
|
|
287
293
|
private _onLocalMediaStreamChanged;
|
|
288
294
|
private _onScreenSharingStatus;
|
|
289
295
|
private _changeRemoteMediaSettings;
|
|
296
|
+
private _changeLocalParticipantState;
|
|
290
297
|
private _changeRemoteParticipantState;
|
|
298
|
+
private _changeMultipleParticipantState;
|
|
291
299
|
private _invokeRolesChangedCallbackIfNeeded;
|
|
292
300
|
private _onSignalingNotification;
|
|
293
301
|
private _onPromotionApproved;
|
|
@@ -300,6 +308,7 @@ export default class Conversation extends EventEmitter {
|
|
|
300
308
|
private _onClosedConversation;
|
|
301
309
|
private _onMediaSettingsChanged;
|
|
302
310
|
private _onParticipantStateChanged;
|
|
311
|
+
private _onParticipantsStateChanged;
|
|
303
312
|
private _onNeedRate;
|
|
304
313
|
private _onFeatureSetChanged;
|
|
305
314
|
private _onMultipartyChatCreated;
|
|
@@ -375,6 +384,7 @@ export default class Conversation extends EventEmitter {
|
|
|
375
384
|
/** получили из сингналинга сообщение о реакции пользователей */
|
|
376
385
|
private _onFeedback;
|
|
377
386
|
private _onDecorativeParticipantIdChanged;
|
|
387
|
+
private _onVideoSuspendSuggest;
|
|
378
388
|
private _isMe;
|
|
379
389
|
private _getMuteStatesForRoomId;
|
|
380
390
|
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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -61,14 +62,15 @@ export default class DirectTransport extends BaseTransport {
|
|
|
61
62
|
private _startIceRestart;
|
|
62
63
|
private _createOffer;
|
|
63
64
|
private _createAnswer;
|
|
64
|
-
/**
|
|
65
|
-
* Обогащает SDP кастомными атрибутами
|
|
66
|
-
*/
|
|
67
|
-
private _enrichSDP;
|
|
68
65
|
private static _patchLocalDescription;
|
|
69
66
|
private static _patchRemoteDescription;
|
|
70
67
|
private _onReplacedTrack;
|
|
71
68
|
private _startStatInterval;
|
|
69
|
+
/**
|
|
70
|
+
* Check SVC support
|
|
71
|
+
* @see https://webrtc.internaut.com/mc/
|
|
72
|
+
*/
|
|
73
|
+
private _isSVCSupported;
|
|
72
74
|
private _checkPPTNetwork;
|
|
73
75
|
private _stopStatInterval;
|
|
74
76
|
private _onNetworkStatus;
|
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>;
|
|
@@ -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.5be10715.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",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@vkontakte/calls-video-effects": "2.2.3-beta.2",
|
|
18
|
-
"@vkontakte/calls-vmoji": "1.0.10-beta.
|
|
18
|
+
"@vkontakte/calls-vmoji": "1.0.10-beta.6",
|
|
19
19
|
"@vkontakte/libvpx": "2.0.9",
|
|
20
20
|
"bit-buffer": "0.2.5",
|
|
21
21
|
"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
|
@@ -18,7 +18,7 @@ import MediaModifiers from '../types/MediaModifiers';
|
|
|
18
18
|
import MediaSettings from '../types/MediaSettings';
|
|
19
19
|
import { IOnRemoteMovieData, ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from '../types/MovieShare';
|
|
20
20
|
import MuteStates from '../types/MuteStates';
|
|
21
|
-
import { ParticipantStateMapped } from '../types/Participant';
|
|
21
|
+
import { ParticipantsStateList, ParticipantStateMapped } from '../types/Participant';
|
|
22
22
|
import { MediaType } from '../types/ParticipantStreamDescription';
|
|
23
23
|
import { IRoomId, Room, RoomParticipantUpdate, Rooms, RoomsUpdate } from '../types/Room';
|
|
24
24
|
import { IApiEnv } from '../types/Params';
|
|
@@ -227,14 +227,6 @@ export type ParamsObject = {
|
|
|
227
227
|
perfStatReportEnabled: boolean;
|
|
228
228
|
/** @hidden */
|
|
229
229
|
callStatReportEnabled: boolean;
|
|
230
|
-
/**
|
|
231
|
-
* Включает использование обновленного API и формата
|
|
232
|
-
* логирования статистики качества аудио/видео.
|
|
233
|
-
*
|
|
234
|
-
* _По умолчанию: `false`_
|
|
235
|
-
* @hidden
|
|
236
|
-
*/
|
|
237
|
-
useCallStatReportNewAPI: boolean;
|
|
238
230
|
/**
|
|
239
231
|
* Включает логирование событий продуктовой статистики.
|
|
240
232
|
*
|
|
@@ -242,16 +234,6 @@ export type ParamsObject = {
|
|
|
242
234
|
* @hidden
|
|
243
235
|
*/
|
|
244
236
|
clientEventsLoggingEnabled: boolean;
|
|
245
|
-
/** @hidden */
|
|
246
|
-
networkStatReportEnabled: boolean;
|
|
247
|
-
/**
|
|
248
|
-
* Включает извлечение `remote-inbound-rtp` для использования в статистике.
|
|
249
|
-
* Используется для вычисления `video_loss` и `audio_loss`.
|
|
250
|
-
*
|
|
251
|
-
* _По умолчанию: `false`_
|
|
252
|
-
* @hidden
|
|
253
|
-
*/
|
|
254
|
-
includeRemoteRtpsInCallStat: boolean;
|
|
255
237
|
/**
|
|
256
238
|
* Отдавать приоритет кодеку H264 для исходящего видео
|
|
257
239
|
*
|
|
@@ -565,10 +547,19 @@ export type ParamsObject = {
|
|
|
565
547
|
* Участник присоединился к звонку
|
|
566
548
|
*/
|
|
567
549
|
onParticipantJoined?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers) => void;
|
|
550
|
+
/**
|
|
551
|
+
* Получены данные по изменению локальных состояний со стороны админа
|
|
552
|
+
* Например, принудительно опущена рука
|
|
553
|
+
*/
|
|
554
|
+
onLocalParticipantState?: (participantState: ParticipantStateMapped) => void;
|
|
568
555
|
/**
|
|
569
556
|
* Изменились данные состояний собеседника
|
|
570
557
|
*/
|
|
571
558
|
onRemoteParticipantState?: (userId: ExternalParticipantId, participantState: ParticipantStateMapped, markers: ExternalParticipantListMarkers | null) => void;
|
|
559
|
+
/**
|
|
560
|
+
* Изменились данные состояний нескольких собеседников
|
|
561
|
+
*/
|
|
562
|
+
onRemoteParticipantsState?: (stateList: ParticipantsStateList, roomId?: IRoomId) => void;
|
|
572
563
|
/**
|
|
573
564
|
* Изменился статус соединения собеседников
|
|
574
565
|
*/
|
|
@@ -604,7 +595,7 @@ export type ParamsObject = {
|
|
|
604
595
|
/**
|
|
605
596
|
* Изменились свои роли в звонке
|
|
606
597
|
*/
|
|
607
|
-
onLocalRolesChanged?: (roles: UserRole[]) => void;
|
|
598
|
+
onLocalRolesChanged?: (roles: UserRole[], isInitial?: boolean) => void;
|
|
608
599
|
/**
|
|
609
600
|
* Закрепляет/открепляет собеседника для всех
|
|
610
601
|
*/
|
|
@@ -806,6 +797,12 @@ export type ParamsObject = {
|
|
|
806
797
|
* @param newId
|
|
807
798
|
*/
|
|
808
799
|
onParticipantIdChanged?: (prevId: ExternalParticipantId, newId: ExternalParticipantId) => void;
|
|
800
|
+
/**
|
|
801
|
+
* Предложение включить режим автоматического отключения приёма видео
|
|
802
|
+
* в плохой сети
|
|
803
|
+
* @param bandwidth текущая полоса пропускания, kbps
|
|
804
|
+
*/
|
|
805
|
+
onVideoSuspendSuggest?: (bandwidth: number) => void;
|
|
809
806
|
/**
|
|
810
807
|
* Одобрено повышение пользователя в зале ожидания/зале в режиме Audience
|
|
811
808
|
*
|
|
@@ -909,11 +906,8 @@ export default abstract class Params {
|
|
|
909
906
|
static get networkStatisticsInterval(): number;
|
|
910
907
|
static get perfStatReportEnabled(): boolean;
|
|
911
908
|
static get callStatReportEnabled(): boolean;
|
|
912
|
-
static get useCallStatReportNewAPI(): boolean;
|
|
913
909
|
static get clientEventsLoggingEnabled(): boolean;
|
|
914
|
-
static get networkStatReportEnabled(): boolean;
|
|
915
910
|
static get enableLogPerfStatReport(): boolean;
|
|
916
|
-
static get includeRemoteRtpsInCallStat(): boolean;
|
|
917
911
|
static get producerNotificationDataChannel(): boolean;
|
|
918
912
|
static get producerCommandDataChannel(): boolean;
|
|
919
913
|
static get consumerScreenDataChannel(): boolean;
|
package/static/Utils.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare const DEVICE_IDX_PARAMETER = "d";
|
|
|
8
8
|
/** @hidden */
|
|
9
9
|
declare namespace Utils {
|
|
10
10
|
function patchLocalSDP(sdp: string, preferH264: boolean, brokenH264: boolean, preferVP9: boolean, h264spsPpsIdrInKeyframe: boolean, isAudioNack?: boolean, preferRed?: boolean): string;
|
|
11
|
-
function patchRemoteSDP(sdp: string, oldDataChannelDescription: boolean, preferH264: boolean, brokenH264: boolean, preferVP9: boolean, brokenVP9Encoder: boolean): string;
|
|
11
|
+
function patchRemoteSDP(sdp: string, oldDataChannelDescription: boolean, preferH264: boolean, brokenH264: boolean, preferVP9: boolean, brokenVP9Encoder: boolean, brokenVP9Decoder: boolean): string;
|
|
12
12
|
function getPeerIdString(peerId: SignalingMessage.PeerId): string;
|
|
13
13
|
function comparePeerId(peerId1: SignalingMessage.PeerId, peerId2: SignalingMessage.PeerId): boolean;
|
|
14
14
|
function getPeerConnectionHostInfo(pc: RTCPeerConnection): Promise<{
|
package/static/WebRTCUtils.d.ts
CHANGED
|
@@ -128,6 +128,10 @@ declare namespace WebRTCUtils {
|
|
|
128
128
|
* В некоторых браузерах VP9 encoder сломан
|
|
129
129
|
*/
|
|
130
130
|
function isBrokenVP9Encoder(): boolean;
|
|
131
|
+
/**
|
|
132
|
+
* В некоторых браузерах VP9 decoder сломан
|
|
133
|
+
*/
|
|
134
|
+
function isBrokenVP9Decoder(): boolean;
|
|
131
135
|
/**
|
|
132
136
|
* Изменился формат описания датаканала в SDP
|
|
133
137
|
* @link https://blog.mozilla.org/webrtc/how-to-avoid-data-channel-breaking/
|
package/types/Participant.d.ts
CHANGED
|
@@ -44,6 +44,11 @@ export interface ParticipantStateMapped {
|
|
|
44
44
|
ts: number;
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
+
export type ParticipantsStateList = {
|
|
48
|
+
externalId: ExternalParticipantId;
|
|
49
|
+
participantState: ParticipantStateMapped;
|
|
50
|
+
markers: ExternalParticipantListMarkers | null;
|
|
51
|
+
}[];
|
|
47
52
|
export interface Participant {
|
|
48
53
|
/**
|
|
49
54
|
* string representation
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AnimojiVersion } from '@vkontakte/calls-vmoji';
|
|
1
2
|
import { TransportTopology } from '../classes/transport/Transport';
|
|
2
3
|
import ChatRoomEventType from '../enums/ChatRoomEventType';
|
|
3
4
|
import ConversationFeature from '../enums/ConversationFeature';
|
|
@@ -5,6 +6,7 @@ import ConversationOption from '../enums/ConversationOption';
|
|
|
5
6
|
import FatalError from '../enums/FatalError';
|
|
6
7
|
import HangupType from '../enums/HangupType';
|
|
7
8
|
import MediaOption from '../enums/MediaOption';
|
|
9
|
+
import MuteState from '../enums/MuteState';
|
|
8
10
|
import ParticipantState from '../enums/ParticipantState';
|
|
9
11
|
import RoomsEventType from '../enums/RoomsEventType';
|
|
10
12
|
import SignalingCommandType from '../enums/SignalingCommandType';
|
|
@@ -162,6 +164,7 @@ declare namespace SignalingMessage {
|
|
|
162
164
|
data: {
|
|
163
165
|
candidate?: RTCIceCandidateInit;
|
|
164
166
|
sdp?: Required<RTCSessionDescriptionInit>;
|
|
167
|
+
animojiVersion?: AnimojiVersion;
|
|
165
168
|
};
|
|
166
169
|
}
|
|
167
170
|
export interface RegisteredPeer extends Notification {
|
|
@@ -210,6 +213,17 @@ declare namespace SignalingMessage {
|
|
|
210
213
|
};
|
|
211
214
|
markers?: ParticipantListMarkers;
|
|
212
215
|
}
|
|
216
|
+
export interface ParticipantsStateChanged extends Notification {
|
|
217
|
+
participants: {
|
|
218
|
+
id: CompositeUserId;
|
|
219
|
+
participantState?: {
|
|
220
|
+
state: Record<string, string>;
|
|
221
|
+
stateUpdateTs: Record<string, number>;
|
|
222
|
+
};
|
|
223
|
+
markers?: ParticipantListMarkers;
|
|
224
|
+
}[];
|
|
225
|
+
roomId?: IRoomId;
|
|
226
|
+
}
|
|
213
227
|
export interface RolesChanged extends Notification {
|
|
214
228
|
adminId: ParticipantId;
|
|
215
229
|
participantId: ParticipantId;
|
|
@@ -319,6 +333,8 @@ declare namespace SignalingMessage {
|
|
|
319
333
|
mediaModifiers: MediaModifiers;
|
|
320
334
|
conversation: Conversation;
|
|
321
335
|
participants?: ParticipantListChunk;
|
|
336
|
+
muteState?: MuteState;
|
|
337
|
+
muteOptions?: MediaOption[];
|
|
322
338
|
}
|
|
323
339
|
export interface ChatRoomUpdated extends Notification {
|
|
324
340
|
eventType: ChatRoomEventType;
|
|
@@ -355,6 +371,8 @@ declare namespace SignalingMessage {
|
|
|
355
371
|
rooms: Room[];
|
|
356
372
|
roomId?: number;
|
|
357
373
|
};
|
|
374
|
+
muteState?: MuteState;
|
|
375
|
+
muteOptions?: MediaOption[];
|
|
358
376
|
}
|
|
359
377
|
export interface Feedback extends Notification {
|
|
360
378
|
feedback: IFeedback[];
|
|
@@ -427,6 +445,9 @@ declare namespace SignalingMessage {
|
|
|
427
445
|
decorativeParticipantId?: CompositeUserId;
|
|
428
446
|
decorativeExternalParticipantId?: ExternalId;
|
|
429
447
|
}
|
|
448
|
+
export interface VideoSuspendSuggest extends Notification {
|
|
449
|
+
bandwidth: number;
|
|
450
|
+
}
|
|
430
451
|
export {};
|
|
431
452
|
}
|
|
432
453
|
export default SignalingMessage;
|
package/types/Streams.d.ts
CHANGED
package/types/VideoSettings.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export type VideoSettings = {
|
|
|
19
19
|
* Настройка деградации - понижаем фпс или разрешение
|
|
20
20
|
* https://www.w3.org/TR/mst-content-hint/#dom-rtcdegradationpreference
|
|
21
21
|
*/
|
|
22
|
-
degradationPreference:
|
|
22
|
+
degradationPreference: RTCDegradationPreference;
|
|
23
23
|
/**
|
|
24
24
|
* Настройка временных слоев
|
|
25
25
|
* https://www.w3.org/TR/webrtc-svc/
|
package/utils/Conversation.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import MediaOption from '../enums/MediaOption';
|
|
2
|
+
import MuteState from '../enums/MuteState';
|
|
3
|
+
import MuteStates from '../types/MuteStates';
|
|
2
4
|
export declare const getMediaOptionsByMuteState: (muteStates: MuteStates, value: MuteState) => MediaOption[];
|