@vkontakte/calls-sdk 2.8.2-dev.420d5a9.0 → 2.8.2-dev.638a3c6.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 +63 -38
- package/abstract/BaseApi.d.ts +11 -9
- package/abstract/BaseSignaling.d.ts +11 -6
- package/calls-sdk.cjs.js +8 -8
- package/calls-sdk.esm.js +8 -8
- package/classes/Conversation.d.ts +17 -11
- package/classes/FpsMeter.d.ts +10 -0
- package/classes/SpecListener.d.ts +0 -1
- package/classes/codec/Types.d.ts +11 -1
- package/classes/screenshare/PacketHistory.d.ts +2 -2
- package/classes/screenshare/ScreenCaptureSender.d.ts +12 -3
- package/classes/screenshare/ScreenCongestionControl.d.ts +1 -1
- package/classes/screenshare/StreamBuilder.d.ts +1 -0
- package/classes/screenshare/Utils.d.ts +1 -1
- package/classes/stat/StatAggregator.d.ts +1 -1
- package/classes/stat/StatFirstMediaReceived.d.ts +14 -2
- package/classes/transport/BaseTransport.d.ts +13 -0
- package/classes/transport/DirectTransport.d.ts +7 -18
- package/classes/transport/ServerTransport.d.ts +7 -17
- package/classes/transport/Transport.d.ts +7 -3
- package/default/Api.d.ts +12 -13
- package/default/Signaling.d.ts +11 -6
- package/enums/FatalError.d.ts +1 -0
- package/enums/SignalingCommandType.d.ts +4 -2
- package/enums/SignalingNotification.d.ts +0 -1
- package/package.json +3 -3
- package/static/External.d.ts +34 -16
- package/static/Params.d.ts +38 -31
- package/static/Utils.d.ts +8 -4
- package/types/Asr.d.ts +1 -1
- package/types/Conversation.d.ts +3 -0
- package/types/ExternalId.d.ts +13 -15
- package/types/{Logger.d.ts → IEventualStatLog.d.ts} +2 -2
- package/types/MovieShare.d.ts +2 -2
- package/types/MuteStates.d.ts +1 -1
- package/types/Participant.d.ts +4 -3
- package/types/ParticipantLayout.d.ts +2 -2
- package/types/ParticipantListChunk.d.ts +1 -1
- package/types/ParticipantStreamDescription.d.ts +3 -3
- package/types/PerfStatReporter.d.ts +1 -1
- package/types/Room.d.ts +4 -0
- package/types/SignalingCommand.d.ts +2 -1
- package/types/SignalingMessage.d.ts +17 -4
- package/types/Statistics.d.ts +3 -4
- package/types/Streams.d.ts +7 -0
- package/utils/ArrayDequeue.d.ts +1 -1
- package/utils/ArrayList.d.ts +5 -2
- package/utils/FastList.d.ts +5 -2
- package/utils/IList.d.ts +5 -2
|
@@ -6,7 +6,6 @@ import CallType from '../enums/CallType';
|
|
|
6
6
|
import ConversationFeature from '../enums/ConversationFeature';
|
|
7
7
|
import ConversationOption from '../enums/ConversationOption';
|
|
8
8
|
import MediaOption from '../enums/MediaOption';
|
|
9
|
-
import RecordRole from '../enums/RecordRole';
|
|
10
9
|
import UpdateDisplayLayoutErrorReason from '../enums/UpdateDisplayLayoutErrorReason';
|
|
11
10
|
import UserRole from '../enums/UserRole';
|
|
12
11
|
import UserType from '../enums/UserType';
|
|
@@ -83,6 +82,8 @@ export default class Conversation extends EventEmitter {
|
|
|
83
82
|
private _onJoinPart2;
|
|
84
83
|
onPush(conversationId: string, type?: UserType, peerId?: number): Promise<void>;
|
|
85
84
|
private _isInWaitingHall;
|
|
85
|
+
private _isRestricted;
|
|
86
|
+
private _isAudienceMode;
|
|
86
87
|
private _acceptConcurrent;
|
|
87
88
|
accept(mediaOptions: MediaOption[]): Promise<ConversationData>;
|
|
88
89
|
decline(): Promise<void>;
|
|
@@ -129,7 +130,6 @@ export default class Conversation extends EventEmitter {
|
|
|
129
130
|
private _getExternalIdByParticipantId;
|
|
130
131
|
private _registerParticipantAndSetMarkersIfChunkEnabled;
|
|
131
132
|
private _warnParticipantNotInConversation;
|
|
132
|
-
private _setParticipantMarkers;
|
|
133
133
|
private _denormalizeMarkers;
|
|
134
134
|
/**
|
|
135
135
|
* Обрабатывает данные connection из сигналинга. Должен вызываться после `_registerParticipants`
|
|
@@ -181,7 +181,7 @@ export default class Conversation extends EventEmitter {
|
|
|
181
181
|
private _onAddParticipant;
|
|
182
182
|
private _onRemoveParticipant;
|
|
183
183
|
changeDevice(kind: MediaDeviceKind): Promise<void>;
|
|
184
|
-
stopVideoTrack(): void;
|
|
184
|
+
stopVideoTrack(): void | undefined;
|
|
185
185
|
toggleScreenCapturing(settings: ScreenCaptureSettings): Promise<void>;
|
|
186
186
|
disableScreenCapturing(): Promise<void>;
|
|
187
187
|
toggleAnimojiCapturing(state: boolean): void;
|
|
@@ -196,6 +196,9 @@ export default class Conversation extends EventEmitter {
|
|
|
196
196
|
setAudioStream(stream: MediaStream): Promise<void>;
|
|
197
197
|
toggleLocalVideo(enabled: boolean): Promise<void>;
|
|
198
198
|
toggleLocalAudio(enabled: boolean): Promise<void>;
|
|
199
|
+
/**
|
|
200
|
+
* @deprecated Use updateDisplayLayout instead
|
|
201
|
+
*/
|
|
199
202
|
changePriorities(priorities: ParticipantPriority[]): Promise<void>;
|
|
200
203
|
changeParticipantState(state: {
|
|
201
204
|
[key: string]: string;
|
|
@@ -224,11 +227,11 @@ export default class Conversation extends EventEmitter {
|
|
|
224
227
|
private _getWaitingTime;
|
|
225
228
|
private _isCallAdmin;
|
|
226
229
|
private _checkAdminRole;
|
|
227
|
-
grantRoles(participantId:
|
|
230
|
+
grantRoles(participantId: ParticipantId, roles: UserRole[], revoke: boolean): Promise<void>;
|
|
228
231
|
startAsr(params: IAsrStartParams): Promise<void>;
|
|
229
232
|
stopAsr(params?: IAsrStopParams): Promise<void>;
|
|
230
233
|
requestAsr(request: boolean): Promise<void>;
|
|
231
|
-
muteParticipant(participantId:
|
|
234
|
+
muteParticipant(participantId: string | null | undefined, muteStates: MuteStates, requestedMedia?: MediaOption[], roomId?: number | null): Promise<void>;
|
|
232
235
|
enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<void>;
|
|
233
236
|
pinParticipant(participantId: ParticipantId, unpin: boolean, roomId?: number | null): Promise<void>;
|
|
234
237
|
updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<void>;
|
|
@@ -241,11 +244,13 @@ export default class Conversation extends EventEmitter {
|
|
|
241
244
|
*/
|
|
242
245
|
getWaitingHall(pageMarker: string | null, count?: number, backward?: boolean): Promise<WaitingHallResponse>;
|
|
243
246
|
promoteParticipant(participantId: CompositeUserId, demote?: boolean): Promise<void>;
|
|
247
|
+
requestPromotion(demote?: boolean): Promise<void>;
|
|
248
|
+
acceptPromotion(reject?: boolean): Promise<void>;
|
|
244
249
|
chatMessage(message: string, participantId?: CompositeUserId | null): Promise<void>;
|
|
245
250
|
chatHistory(count: number): Promise<void>;
|
|
246
251
|
customData(data: JSONObject, participantId?: ParticipantId | null): Promise<void>;
|
|
247
252
|
createJoinLink(): Promise<string>;
|
|
248
|
-
removeJoinLink(): Promise<
|
|
253
|
+
removeJoinLink(): Promise<undefined>;
|
|
249
254
|
addMovie({ movieId, gain, metadata }: IAddMovieParams): Promise<{
|
|
250
255
|
movieId: number;
|
|
251
256
|
streamType: string;
|
|
@@ -256,9 +261,9 @@ export default class Conversation extends EventEmitter {
|
|
|
256
261
|
activateRooms(roomIds: number[], deactivate: boolean): Promise<void>;
|
|
257
262
|
switchRoom(toRoomId: number | null, participantId?: ParticipantId): Promise<void>;
|
|
258
263
|
removeRooms(roomIds: number[]): Promise<void>;
|
|
259
|
-
startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null, roomId?: number | null): Promise<
|
|
260
|
-
stopStream(roomId?: number | null): Promise<
|
|
261
|
-
|
|
264
|
+
startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null, roomId?: number | null): Promise<undefined>;
|
|
265
|
+
stopStream(roomId?: number | null): Promise<undefined>;
|
|
266
|
+
recordSetConf(king?: ParticipantId, pawns?: ParticipantId[], hideParticipantCount?: boolean, roomId?: number | null): Promise<void>;
|
|
262
267
|
getStreamInfo(): Promise<{
|
|
263
268
|
movieId: any;
|
|
264
269
|
preview: any;
|
|
@@ -266,8 +271,8 @@ export default class Conversation extends EventEmitter {
|
|
|
266
271
|
setLocalResolution({ video, effect }: {
|
|
267
272
|
video: IVideoDimentions;
|
|
268
273
|
effect?: IVideoDimentions;
|
|
269
|
-
}): Promise<void>;
|
|
270
|
-
videoEffect(effect: IEffect | null): Promise<void>;
|
|
274
|
+
}): Promise<void | undefined>;
|
|
275
|
+
videoEffect(effect: IEffect | null): Promise<void | undefined>;
|
|
271
276
|
getParticipants(parameters: IGetParticipantsParameters): Promise<ExternalParticipant[]>;
|
|
272
277
|
getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<ExternalParticipantListChunk>;
|
|
273
278
|
private _getInitialParticiapntListChunk;
|
|
@@ -277,6 +282,7 @@ export default class Conversation extends EventEmitter {
|
|
|
277
282
|
private _changeRemoteParticipantState;
|
|
278
283
|
private _invokeRolesChangedCallbackIfNeeded;
|
|
279
284
|
private _onSignalingNotification;
|
|
285
|
+
private _onPromotionApproved;
|
|
280
286
|
private _onSignalingReconnect;
|
|
281
287
|
private _onSignalingFailed;
|
|
282
288
|
private _onAcceptedCall;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default class FpsMeter {
|
|
2
|
+
private _counter;
|
|
3
|
+
private _interval;
|
|
4
|
+
private _lastCalculationTime;
|
|
5
|
+
private readonly _onCalculated;
|
|
6
|
+
constructor(callback?: Function | null, intervalMs?: number);
|
|
7
|
+
increment(value?: number): void;
|
|
8
|
+
calculate(): number;
|
|
9
|
+
destroy(): void;
|
|
10
|
+
}
|
|
@@ -5,7 +5,6 @@ import { Transport } from './transport/Transport';
|
|
|
5
5
|
import { VolumesDetector } from './VolumesDetector';
|
|
6
6
|
export default class SpecListener extends EventEmitter {
|
|
7
7
|
private _transport;
|
|
8
|
-
private _states;
|
|
9
8
|
private _volumes;
|
|
10
9
|
private readonly _participants;
|
|
11
10
|
private _connectionTimeout;
|
package/classes/codec/Types.d.ts
CHANGED
|
@@ -11,9 +11,19 @@ export declare const enum MessageType {
|
|
|
11
11
|
DEBUG = "debug",
|
|
12
12
|
LOG_ERROR = "log_error"
|
|
13
13
|
}
|
|
14
|
-
export type EncodedVideoFrame = Pick<EncodedVideoChunk, 'type' | '
|
|
14
|
+
export type EncodedVideoFrame = Pick<EncodedVideoChunk, 'type' | 'duration' | 'byteLength' | 'data'> & {
|
|
15
15
|
width: number;
|
|
16
16
|
height: number;
|
|
17
|
+
timestamp: number;
|
|
17
18
|
};
|
|
19
|
+
export interface EncodedVideoFrameChunk {
|
|
20
|
+
sequence: number;
|
|
21
|
+
timestamp: number;
|
|
22
|
+
data: ArrayBuffer;
|
|
23
|
+
frameSize: number;
|
|
24
|
+
isFirst: boolean;
|
|
25
|
+
isLast: boolean;
|
|
26
|
+
isKey: boolean;
|
|
27
|
+
}
|
|
18
28
|
export type OnFrameCallback = (chunk: EncodedVideoFrame | null, error?: string) => void;
|
|
19
29
|
export type OnCongestionCallback = (bitrate: number, useCbr: boolean) => void;
|
|
@@ -21,8 +21,8 @@ export default class PacketHistory {
|
|
|
21
21
|
private _tail;
|
|
22
22
|
constructor(maxSize: number);
|
|
23
23
|
add(seq: number, ts: number, size: number, start: boolean, end: boolean): number;
|
|
24
|
-
update(seq: number, ts2: number): HistoryRecord;
|
|
25
|
-
get(seq: number): HistoryRecord;
|
|
24
|
+
update(seq: number, ts2: number): HistoryRecord | null;
|
|
25
|
+
get(seq: number): HistoryRecord | null;
|
|
26
26
|
getServerBitrateK(windowMs: number): number;
|
|
27
27
|
getCurrentDelay(): number;
|
|
28
28
|
getMaxBandwidth(): number;
|
|
@@ -13,13 +13,22 @@ export default class ScreenCaptureSender {
|
|
|
13
13
|
private _height;
|
|
14
14
|
private _feedback;
|
|
15
15
|
private _lastSharingStat;
|
|
16
|
-
private _congestionControlEnabled;
|
|
16
|
+
private readonly _congestionControlEnabled;
|
|
17
|
+
private readonly _queue;
|
|
18
|
+
private readonly _fpsMeter;
|
|
17
19
|
constructor(track: MediaStreamTrack, datachannel: RTCDataChannel, signaling: BaseSignaling, fastSharing: boolean);
|
|
20
|
+
private _handleQueue;
|
|
21
|
+
/**
|
|
22
|
+
* Очищает очередь до опорного кадра
|
|
23
|
+
* @returns Есть ли в очереди опорный кадр
|
|
24
|
+
* @hidden
|
|
25
|
+
*/
|
|
26
|
+
private _cleanupQueue;
|
|
18
27
|
private _requestFrame;
|
|
28
|
+
private _sliceFrame;
|
|
19
29
|
private _wrapHeader;
|
|
20
30
|
private _stopPacket;
|
|
21
|
-
private
|
|
22
|
-
private _sendChunk;
|
|
31
|
+
private _sendFrameChunk;
|
|
23
32
|
destroy(): void;
|
|
24
33
|
static isBrowserSupported(): boolean;
|
|
25
34
|
private _onCongestionCallback;
|
|
@@ -5,6 +5,7 @@ export default class StreamBuilder extends BaseStreamBuilder {
|
|
|
5
5
|
private readonly _decoder;
|
|
6
6
|
private _decoderReady;
|
|
7
7
|
private _decoderQueue;
|
|
8
|
+
private readonly _fpsMeter;
|
|
8
9
|
constructor(participantId: ParticipantId, onStream: IOnStream, onStat: IOnStat);
|
|
9
10
|
protected _processFrame(frame: FrameData): void;
|
|
10
11
|
private _decodeQueue;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ICallStatLog } from '../../types/PerfStatReporter';
|
|
2
|
-
import { IEventualStatLog } from '../../types/
|
|
2
|
+
import { IEventualStatLog } from '../../types/IEventualStatLog';
|
|
3
3
|
export declare class StatAggregator {
|
|
4
4
|
private static _instance;
|
|
5
5
|
private readonly _eventualLogs;
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import SignalingMessage from '../../types/SignalingMessage';
|
|
2
2
|
import { TransportTopology } from '../transport/Transport';
|
|
3
|
+
/** связанный с операцией `first_media_received` тип логируемого звонка */
|
|
4
|
+
declare enum ECallType {
|
|
5
|
+
DirectOutgoing = "direct_outgoing",
|
|
6
|
+
DirectIncoming = "direct_incoming",
|
|
7
|
+
ServerIncoming = "server_incoming",
|
|
8
|
+
ServerJoinServer = "server_join_server",
|
|
9
|
+
ServerChangeTopology = "server_change_topology"
|
|
10
|
+
}
|
|
3
11
|
export declare class StatFirstMediaReceived {
|
|
4
|
-
|
|
12
|
+
/** уже поставили засечку на приём звонка */
|
|
13
|
+
protected _isCallMarked: boolean;
|
|
14
|
+
protected static _callType: ECallType | null;
|
|
5
15
|
measureSignalingConnection(connection?: SignalingMessage.Connection): void;
|
|
6
|
-
markAcceptCall(): void;
|
|
16
|
+
markAcceptCall(topology: TransportTopology): void;
|
|
7
17
|
markAcceptedCall(topology: TransportTopology): void;
|
|
18
|
+
markParticipantJoined(topology: TransportTopology): void;
|
|
8
19
|
static measure(): void;
|
|
9
20
|
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
2
|
+
import EventEmitter from '../EventEmitter';
|
|
3
|
+
import { MediaSource } from '../MediaSource';
|
|
4
|
+
import { TransportState } from './Transport';
|
|
5
|
+
export default abstract class BaseTransport extends EventEmitter {
|
|
6
|
+
protected readonly _signaling: BaseSignaling;
|
|
7
|
+
protected readonly _mediaSource: MediaSource;
|
|
8
|
+
protected _state: TransportState;
|
|
9
|
+
protected _pc: RTCPeerConnection | null;
|
|
10
|
+
protected constructor(signaling: BaseSignaling, mediaSource: MediaSource);
|
|
11
|
+
getState(): TransportState;
|
|
12
|
+
abstract close(error?: Error): void;
|
|
13
|
+
}
|
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnimojiReceiver, AnimojiSender } 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';
|
|
5
|
-
import EventEmitter from '../EventEmitter';
|
|
6
5
|
import { MediaSource } from '../MediaSource';
|
|
7
|
-
import
|
|
8
|
-
export default class DirectTransport extends
|
|
9
|
-
private readonly _signaling;
|
|
10
|
-
private readonly _mediaSource;
|
|
6
|
+
import BaseTransport from './BaseTransport';
|
|
7
|
+
export default class DirectTransport extends BaseTransport {
|
|
11
8
|
private readonly _participantId;
|
|
12
9
|
private readonly _isMaster;
|
|
13
|
-
private readonly _pc;
|
|
14
10
|
private _remoteSDP;
|
|
15
11
|
private _remoteCandidates;
|
|
16
|
-
private _state;
|
|
17
12
|
private _animojiDataChannel;
|
|
18
13
|
private _animojiReceiver;
|
|
19
14
|
private _animojiSender;
|
|
20
|
-
private _animojiSvgDataByParticipantId;
|
|
21
15
|
private _isOpen;
|
|
22
16
|
private _remotePeerId;
|
|
23
17
|
private _statInterval;
|
|
@@ -36,22 +30,22 @@ export default class DirectTransport extends EventEmitter {
|
|
|
36
30
|
private _remoteNetworkStat;
|
|
37
31
|
private _networkLimits;
|
|
38
32
|
private _perfStatReporter;
|
|
39
|
-
constructor(participantId: ParticipantId, isMaster: boolean, signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings
|
|
40
|
-
|
|
33
|
+
constructor(participantId: ParticipantId, isMaster: boolean, signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings);
|
|
34
|
+
get participantId(): ParticipantId;
|
|
41
35
|
updateStatisticsInterval(): void;
|
|
42
36
|
private _isDeadConnection;
|
|
43
37
|
open(peerId?: string | null): Promise<void>;
|
|
44
38
|
updateSettings(settings: ServerSettings): void;
|
|
45
39
|
preventRestart(): void;
|
|
46
40
|
allowRestart(): void;
|
|
41
|
+
setAnimojiTransport(receiver: AnimojiReceiver, sender: AnimojiSender): void;
|
|
47
42
|
close(error?: Error): void;
|
|
48
|
-
setAnimojiSvg(participantId: ParticipantId, svgData: AnimojiSvgData): void;
|
|
49
43
|
private _setState;
|
|
50
44
|
private _onSignalingNotification;
|
|
51
45
|
private _handleTransmittedData;
|
|
52
46
|
private _addIceCandidate;
|
|
53
47
|
private _setRemoteCandidates;
|
|
54
|
-
_setRemoteDescription
|
|
48
|
+
private _setRemoteDescription;
|
|
55
49
|
private _onAddTrack;
|
|
56
50
|
private _handleIceCandidate;
|
|
57
51
|
private _onSignalingStateChange;
|
|
@@ -65,7 +59,6 @@ export default class DirectTransport extends EventEmitter {
|
|
|
65
59
|
private _createAnswer;
|
|
66
60
|
private static _patchDescription;
|
|
67
61
|
private _onReplacedTrack;
|
|
68
|
-
private _onAnimojiStatus;
|
|
69
62
|
private _startStatInterval;
|
|
70
63
|
private _stopStatInterval;
|
|
71
64
|
private _checkBadNetwork;
|
|
@@ -74,8 +67,4 @@ export default class DirectTransport extends EventEmitter {
|
|
|
74
67
|
private _calcFingerprint;
|
|
75
68
|
private _applySettings;
|
|
76
69
|
private _createDataChannel;
|
|
77
|
-
private _createAnimojiReceiver;
|
|
78
|
-
private _removeAnimojiReceiver;
|
|
79
|
-
private _createAnimojiSender;
|
|
80
|
-
private _removeAnimojiSender;
|
|
81
70
|
}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnimojiReceiver, AnimojiSender } 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';
|
|
5
|
-
import EventEmitter from '../EventEmitter';
|
|
6
5
|
import { MediaSource } from '../MediaSource';
|
|
7
|
-
import
|
|
8
|
-
export default class ServerTransport extends
|
|
9
|
-
private readonly _signaling;
|
|
10
|
-
private readonly _mediaSource;
|
|
11
|
-
private _pc;
|
|
6
|
+
import BaseTransport from './BaseTransport';
|
|
7
|
+
export default class ServerTransport extends BaseTransport {
|
|
12
8
|
private _producerNotification;
|
|
13
9
|
private _producerCommand;
|
|
14
10
|
private _producerScreen;
|
|
@@ -17,15 +13,14 @@ export default class ServerTransport extends EventEmitter {
|
|
|
17
13
|
private _animojiDataChannel;
|
|
18
14
|
private _animojiReceiver;
|
|
19
15
|
private _animojiSender;
|
|
20
|
-
private _animojiSvgDataByParticipantId;
|
|
21
16
|
private _isOpen;
|
|
22
17
|
private _observer;
|
|
23
18
|
private _reconnectionPrevented;
|
|
24
|
-
private _state;
|
|
25
19
|
private _statInterval;
|
|
26
20
|
private _settingsInterval;
|
|
27
21
|
private _statBytes;
|
|
28
22
|
private _ssrcMap;
|
|
23
|
+
private _ssrcMapUpdated;
|
|
29
24
|
private _perfStatReporter;
|
|
30
25
|
private _producerOfferIsProcessing;
|
|
31
26
|
private _producerNextOffer;
|
|
@@ -40,8 +35,7 @@ export default class ServerTransport extends EventEmitter {
|
|
|
40
35
|
private _rtpReceiversByStreamId;
|
|
41
36
|
private _producerSessionId;
|
|
42
37
|
private _newAudioShareTrack;
|
|
43
|
-
constructor(signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings
|
|
44
|
-
getState(): TransportState;
|
|
38
|
+
constructor(signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings);
|
|
45
39
|
updateStatisticsInterval(): void;
|
|
46
40
|
open(observer?: boolean): void;
|
|
47
41
|
close(error?: Error): void;
|
|
@@ -49,7 +43,8 @@ export default class ServerTransport extends EventEmitter {
|
|
|
49
43
|
preventRestart(): void;
|
|
50
44
|
allowRestart(): void;
|
|
51
45
|
updateSettings(settings: ServerSettings): void;
|
|
52
|
-
|
|
46
|
+
setAnimojiTransport(receiver: AnimojiReceiver, sender: AnimojiSender): void;
|
|
47
|
+
private _createPerfStatsReporter;
|
|
53
48
|
private _closeConnection;
|
|
54
49
|
private static _closeDataChannel;
|
|
55
50
|
private _createDataChannel;
|
|
@@ -65,13 +60,8 @@ export default class ServerTransport extends EventEmitter {
|
|
|
65
60
|
private _removeCaptureSender;
|
|
66
61
|
private _createCaptureReceiver;
|
|
67
62
|
private _removeCaptureReceiver;
|
|
68
|
-
private _createAnimojiSender;
|
|
69
|
-
private _removeAnimojiSender;
|
|
70
|
-
private _createAnimojiReceiver;
|
|
71
|
-
private _removeAnimojiReceiver;
|
|
72
63
|
private _applyConsumerSettings;
|
|
73
64
|
private _onScreenSharingStatus;
|
|
74
|
-
private _onAnimojiStatus;
|
|
75
65
|
private _setState;
|
|
76
66
|
private _startStatInterval;
|
|
77
67
|
private _stopStatInterval;
|
|
@@ -48,7 +48,8 @@ export declare class Transport extends EventEmitter {
|
|
|
48
48
|
private _stListeners;
|
|
49
49
|
private _states;
|
|
50
50
|
private _localState;
|
|
51
|
-
private
|
|
51
|
+
private _animojiReceiver;
|
|
52
|
+
private _animojiSender;
|
|
52
53
|
constructor(topology: TransportTopology, signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings);
|
|
53
54
|
updateSettings(settings: ServerSettings): void;
|
|
54
55
|
updateStatisticsInterval(): void;
|
|
@@ -60,10 +61,10 @@ export declare class Transport extends EventEmitter {
|
|
|
60
61
|
isAllocated(participantId: ParticipantId): boolean;
|
|
61
62
|
allocated(): string[];
|
|
62
63
|
opened(): string[];
|
|
63
|
-
getState(): TransportState;
|
|
64
|
+
getState(): TransportState | undefined;
|
|
65
|
+
getStates(): Record<string, TransportState>;
|
|
64
66
|
setAnimojiSvg(participantId: ParticipantId, svgData: AnimojiSvgData): void;
|
|
65
67
|
private _setStates;
|
|
66
|
-
private _setState;
|
|
67
68
|
private _setLocalState;
|
|
68
69
|
private _onSignalingNotification;
|
|
69
70
|
private _onTopologyChanged;
|
|
@@ -88,8 +89,11 @@ export declare class Transport extends EventEmitter {
|
|
|
88
89
|
private _onServerRemoteTrackAdded;
|
|
89
90
|
private _onServerRemoteTrackRemoved;
|
|
90
91
|
private _onAsrTranscription;
|
|
92
|
+
private _onSourceChanged;
|
|
91
93
|
private _onAnimojiStream;
|
|
92
94
|
/** Обработчик, досылающий MediaSourceEvent.SOURCE_CHANGED событие до аллокации транспортов */
|
|
93
95
|
private _onAnimojiStatus;
|
|
96
|
+
private _createAnimojiTransport;
|
|
97
|
+
private _removeAnimojiTransport;
|
|
94
98
|
getStreamWaitingTimeMs(streamId: string, targetRtpTimestamp: number): number;
|
|
95
99
|
}
|
package/default/Api.d.ts
CHANGED
|
@@ -2,27 +2,24 @@ import BaseApi, { LogItem } from '../abstract/BaseApi';
|
|
|
2
2
|
import CallType from '../enums/CallType';
|
|
3
3
|
import ConversationParams from '../types/ConversationParams';
|
|
4
4
|
import ConversationResponse from '../types/ConversationResponse';
|
|
5
|
-
import { ExternalId, ExternalUserId } from '../types/ExternalId';
|
|
6
|
-
import { CompositeUserId, OkUserId } from '../types/Participant';
|
|
5
|
+
import { ExternalId, ExternalParticipantId, ExternalUserId } from '../types/ExternalId';
|
|
6
|
+
import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
|
|
7
7
|
export default class Api extends BaseApi {
|
|
8
8
|
private _userId;
|
|
9
9
|
private _uuid;
|
|
10
10
|
private _externalUidsCache;
|
|
11
|
-
private _extrnalUidsBatchPromise?;
|
|
12
|
-
private _extrnalUidsBatch;
|
|
13
|
-
private _extrnalUidsBatchTimeout;
|
|
14
11
|
private _callUnsafe;
|
|
15
12
|
private _call;
|
|
16
|
-
userId(compositeUserId:
|
|
13
|
+
userId(compositeUserId: ParticipantId): Promise<ExternalParticipantId>;
|
|
17
14
|
prepareUserIds(ids: OkUserId[]): Promise<void>;
|
|
18
|
-
private _prepareUserIdsByOkIdsBatched;
|
|
19
15
|
authorize(): Promise<void>;
|
|
20
16
|
log(items: LogItem[]): void;
|
|
21
17
|
init(): void;
|
|
22
18
|
joinConversation(conversationId: string, isVideo?: boolean, chatId?: string): Promise<ConversationResponse>;
|
|
23
|
-
createConversation(conversationId: string, payload?: string, requireAuthToJoin?: boolean, { onlyAdminCanShareMovie }?: {
|
|
19
|
+
createConversation(conversationId: string, payload?: string, requireAuthToJoin?: boolean, { onlyAdminCanShareMovie, audienceMode, }?: {
|
|
24
20
|
onlyAdminCanShareMovie?: boolean;
|
|
25
|
-
|
|
21
|
+
audienceMode?: boolean;
|
|
22
|
+
}, speakerIds?: OkUserId[]): Promise<ConversationResponse>;
|
|
26
23
|
startConversation(conversationId: string, ids?: OkUserId[], type?: CallType, isVideo?: boolean, payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean, { onlyAdminCanShareMovie }?: {
|
|
27
24
|
onlyAdminCanShareMovie?: boolean;
|
|
28
25
|
}): Promise<ConversationResponse>;
|
|
@@ -38,16 +35,18 @@ export default class Api extends BaseApi {
|
|
|
38
35
|
joinConversationByLink(joinLink: string, isVideo?: boolean, observedIds?: ExternalUserId[], payload?: string): Promise<ConversationResponse>;
|
|
39
36
|
/**
|
|
40
37
|
* NB: Не сохраняет порядок возвращаемых ID
|
|
38
|
+
* Этот метод принимает именно ExternalId, т.к. для OkUserId не принципиально наличие deviceIdx
|
|
41
39
|
* @hidden
|
|
42
40
|
*/
|
|
43
|
-
getOkIdsByExternalIds(externalIds:
|
|
41
|
+
getOkIdsByExternalIds(externalIds: ExternalId[]): Promise<OkUserId[]>;
|
|
42
|
+
getParticipantIdsByExternalIds(externalIds: ExternalId[]): Promise<Map<ExternalId, ParticipantId>>;
|
|
44
43
|
/**
|
|
45
44
|
* NB: Не сохраняет порядок возвращаемых ID
|
|
46
45
|
* @hidden
|
|
47
46
|
*/
|
|
48
|
-
getExternalIdsByOkIds(uids: OkUserId[]): Promise<
|
|
49
|
-
getCachedOkIdByExternalId(externalId: ExternalId):
|
|
50
|
-
cacheExternalId(participantId: CompositeUserId, externalId:
|
|
47
|
+
getExternalIdsByOkIds(uids: OkUserId[]): Promise<ExternalParticipantId[]>;
|
|
48
|
+
getCachedOkIdByExternalId(externalId: ExternalId): ParticipantId | null;
|
|
49
|
+
cacheExternalId(participantId: CompositeUserId, externalId: ExternalParticipantId): void;
|
|
51
50
|
getConversationParams(conversationId?: string): Promise<ConversationParams>;
|
|
52
51
|
getUserId(): OkUserId | null;
|
|
53
52
|
setUserId(userId: OkUserId): void;
|
package/default/Signaling.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import BaseSignaling, { AddParticipantParams } from '../abstract/BaseSignaling';
|
|
2
2
|
import { ParticipantIdRegistry } from '../classes/ParticipantIdRegistry';
|
|
3
3
|
import { SharingStatReport } from '../classes/screenshare/SharingStatReport';
|
|
4
|
+
import { StreamDescriptionString } from '../types/ParticipantStreamDescription';
|
|
4
5
|
import { PerfStatReport } from '../types/PerfStatReporter';
|
|
5
6
|
import { TransportTopology } from '../classes/transport/Transport';
|
|
6
7
|
import ConversationFeature from '../enums/ConversationFeature';
|
|
7
8
|
import ConversationOption from '../enums/ConversationOption';
|
|
8
9
|
import MediaOption from '../enums/MediaOption';
|
|
9
|
-
import RecordRole from '../enums/RecordRole';
|
|
10
10
|
import SignalingCommandType from '../enums/SignalingCommandType';
|
|
11
11
|
import SignalingConnectionType from '../enums/SignalingConnectionType';
|
|
12
12
|
import UserRole from '../enums/UserRole';
|
|
@@ -20,7 +20,7 @@ import { CompositeUserId, ParticipantId } from '../types/Participant';
|
|
|
20
20
|
import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
|
|
21
21
|
import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
|
|
22
22
|
import SignalingMessage from '../types/SignalingMessage';
|
|
23
|
-
import { IStartStreamData, IStopStreamData } from '../types/Streams';
|
|
23
|
+
import { IRecordConfData, IStartStreamData, IStopStreamData } from '../types/Streams';
|
|
24
24
|
import { WaitingParticipantId } from '../types/WaitingHall';
|
|
25
25
|
export default class Signaling extends BaseSignaling {
|
|
26
26
|
private socket;
|
|
@@ -85,7 +85,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
85
85
|
getNextCommandSequenceNumber(): number;
|
|
86
86
|
hangup(reason: string): Promise<SignalingMessage | void>;
|
|
87
87
|
sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidate): Promise<SignalingMessage>;
|
|
88
|
-
requestTestMode(consumerCommand: string, producerCommand: string): Promise<SignalingMessage>;
|
|
88
|
+
requestTestMode(consumerCommand: string, producerCommand: string | null): Promise<SignalingMessage>;
|
|
89
89
|
sendSdp(participantId: ParticipantId, sdp: RTCSessionDescription): Promise<SignalingMessage>;
|
|
90
90
|
acceptCall(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
91
91
|
changeMediaSettings(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
@@ -98,11 +98,14 @@ export default class Signaling extends BaseSignaling {
|
|
|
98
98
|
[key: string]: number | boolean | string;
|
|
99
99
|
}): Promise<SignalingMessage>;
|
|
100
100
|
acceptProducer(description: RTCSessionDescriptionInit, ssrcs: string[]): Promise<SignalingMessage>;
|
|
101
|
+
/**
|
|
102
|
+
* @deprecated Use updateDisplayLayout instead
|
|
103
|
+
*/
|
|
101
104
|
changePriorities(priorities: {
|
|
102
105
|
[key: string]: number;
|
|
103
106
|
}): Promise<SignalingMessage | void>;
|
|
104
107
|
updateDisplayLayout(layouts: {
|
|
105
|
-
[streamDesc:
|
|
108
|
+
[streamDesc: StreamDescriptionString]: ParticipantLayout | StopStream | RequestKeyFrame;
|
|
106
109
|
}): Promise<SignalingMessage>;
|
|
107
110
|
addMovie(data: IAddMovieParams): Promise<SignalingMessage>;
|
|
108
111
|
updateMovie(data: IUpdateMovieData): Promise<SignalingMessage>;
|
|
@@ -114,7 +117,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
114
117
|
removeRooms(roomIds: number[]): Promise<SignalingMessage>;
|
|
115
118
|
startStream(data: IStartStreamData): Promise<SignalingMessage>;
|
|
116
119
|
stopStream(data?: IStopStreamData): Promise<SignalingMessage>;
|
|
117
|
-
|
|
120
|
+
recordSetConf(conf?: IRecordConfData): Promise<SignalingMessage>;
|
|
118
121
|
getRecordStatus(): Promise<SignalingMessage>;
|
|
119
122
|
switchTopology(topology: TransportTopology, force?: boolean): Promise<SignalingMessage>;
|
|
120
123
|
requestRealloc(): Promise<SignalingMessage>;
|
|
@@ -123,7 +126,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
123
126
|
chatMessage(message: string, participantId?: CompositeUserId | null): Promise<SignalingMessage>;
|
|
124
127
|
chatHistory(count: number): Promise<SignalingMessage>;
|
|
125
128
|
customData(data: JSONObject, participantId: ParticipantId | null): Promise<SignalingMessage>;
|
|
126
|
-
grantRoles(participantId:
|
|
129
|
+
grantRoles(participantId: ParticipantId, roles: UserRole[], revoke: boolean): Promise<SignalingMessage>;
|
|
127
130
|
muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia: MediaOption[], roomId?: number | null): Promise<SignalingMessage>;
|
|
128
131
|
enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<SignalingMessage>;
|
|
129
132
|
pinParticipant(participantId: ParticipantId, unpin: boolean, roomId: number | null): Promise<SignalingMessage>;
|
|
@@ -133,6 +136,8 @@ export default class Signaling extends BaseSignaling {
|
|
|
133
136
|
}): Promise<SignalingMessage>;
|
|
134
137
|
getWaitingHall(fromId?: WaitingParticipantId | null, count?: number, backward?: boolean): Promise<SignalingMessage>;
|
|
135
138
|
promoteParticipant(participantId: CompositeUserId, demote?: boolean): Promise<SignalingMessage>;
|
|
139
|
+
requestPromotion(demote?: boolean): Promise<SignalingMessage>;
|
|
140
|
+
acceptPromotion(reject?: boolean): Promise<SignalingMessage>;
|
|
136
141
|
feedback(key: string): Promise<SignalingMessage>;
|
|
137
142
|
/**
|
|
138
143
|
* Close a connection with a signaling server
|
package/enums/FatalError.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ declare enum SignalingCommandType {
|
|
|
15
15
|
REPORT_SHARING_STAT = "report-sharing-stat",
|
|
16
16
|
RECORD_START = "record-start",
|
|
17
17
|
RECORD_STOP = "record-stop",
|
|
18
|
-
|
|
18
|
+
RECORD_SET_CONF = "record-set-conf",
|
|
19
19
|
RECORD_GET_STATUS = "record-get-status",
|
|
20
20
|
SWITCH_MICRO = "switch-micro",
|
|
21
21
|
SWITCH_TOPOLOGY = "switch-topology",
|
|
@@ -45,6 +45,8 @@ declare enum SignalingCommandType {
|
|
|
45
45
|
FEEDBACK = "feedback",
|
|
46
46
|
ASR_START = "asr-start",
|
|
47
47
|
ASR_STOP = "asr-stop",
|
|
48
|
-
REQUEST_ASR = "request-asr"
|
|
48
|
+
REQUEST_ASR = "request-asr",
|
|
49
|
+
REQUEST_PROMOTION = "request-promotion",
|
|
50
|
+
ACCEPT_PROMOTION = "accept-promotion"
|
|
49
51
|
}
|
|
50
52
|
export default SignalingCommandType;
|
|
@@ -38,7 +38,6 @@ declare enum SignalingNotification {
|
|
|
38
38
|
JOIN_LINK_CHANGED = "join-link-changed",
|
|
39
39
|
FEEDBACK = "feedback",
|
|
40
40
|
MOVIE_UPDATE_NOTIFICATION = "movie-update-notification",
|
|
41
|
-
MOVIE_SHARE_INFO = "movie-share-info",
|
|
42
41
|
MOVIE_SHARE_STARTED = "movie-share-started",
|
|
43
42
|
MOVIE_SHARE_STOPPED = "movie-share-stopped",
|
|
44
43
|
ROOM_UPDATED = "room-updated",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/calls-sdk",
|
|
3
|
-
"version": "2.8.2-dev.
|
|
3
|
+
"version": "2.8.2-dev.638a3c6.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,8 @@
|
|
|
14
14
|
"**/*.d.ts"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@vkontakte/calls-video-effects": "
|
|
18
|
-
"@vkontakte/calls-vmoji": "1.0.
|
|
17
|
+
"@vkontakte/calls-video-effects": "2.0.1-beta.4",
|
|
18
|
+
"@vkontakte/calls-vmoji": "1.0.8-beta.5",
|
|
19
19
|
"@vkontakte/libvpx": "2.0.9",
|
|
20
20
|
"bit-buffer": "0.2.5",
|
|
21
21
|
"messagepack": "1.1.12",
|