@vkontakte/calls-sdk 2.8.2-dev.f5b551c.0 → 2.8.2
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 +78 -41
- package/abstract/BaseApi.d.ts +11 -9
- package/abstract/BaseSignaling.d.ts +10 -8
- package/calls-sdk.cjs.js +8 -8
- package/calls-sdk.esm.js +8 -8
- package/classes/AudioOutput.d.ts +8 -3
- package/classes/Conversation.d.ts +27 -21
- package/classes/FpsMeter.d.ts +10 -0
- package/classes/MediaSource.d.ts +3 -3
- package/classes/ParticipantIdRegistry.d.ts +5 -0
- package/classes/ProducerCommandSerializationService.d.ts +2 -0
- package/classes/codec/IEncoder.d.ts +1 -1
- package/classes/codec/LibVPxEncoder.d.ts +1 -1
- package/classes/codec/Types.d.ts +12 -2
- package/classes/codec/WebCodecsEncoder.d.ts +1 -1
- package/classes/screenshare/PacketHistory.d.ts +3 -2
- package/classes/screenshare/ScreenCaptureSender.d.ts +14 -4
- package/classes/screenshare/ScreenCongestionControl.d.ts +7 -2
- 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/transport/ServerTransport.d.ts +2 -0
- package/classes/transport/Statistics.d.ts +19 -1
- package/classes/transport/Transport.d.ts +2 -1
- package/constants/Rooms.d.ts +1 -0
- package/default/Api.d.ts +14 -14
- package/default/ApiExternal.d.ts +11 -0
- package/default/Signaling.d.ts +12 -14
- package/enums/FatalError.d.ts +1 -0
- package/enums/SignalingCommandType.d.ts +6 -2
- package/enums/SignalingNotification.d.ts +2 -2
- package/package.json +3 -6
- package/static/ApiTransport.d.ts +3 -1
- package/static/AuthData.d.ts +6 -6
- package/static/External.d.ts +59 -18
- package/static/Params.d.ts +119 -42
- package/static/Utils.d.ts +8 -4
- package/types/Asr.d.ts +22 -1
- package/types/AudienceMode.d.ts +8 -0
- package/types/Conversation.d.ts +4 -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/Params.d.ts +1 -0
- package/types/Participant.d.ts +2 -2
- package/types/ParticipantLayout.d.ts +2 -2
- package/types/ParticipantListChunk.d.ts +1 -1
- package/types/ParticipantStreamDescription.d.ts +0 -1
- package/types/PerfStatReporter.d.ts +1 -1
- package/types/RequestAsr.d.ts +3 -0
- package/types/Room.d.ts +4 -0
- package/types/SignalingMessage.d.ts +34 -4
- package/types/Statistics.d.ts +3 -4
- package/types/Streams.d.ts +10 -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
- package/classes/asr/AsrCommandSerializer.d.ts +0 -3
package/classes/AudioOutput.d.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
+
type ParticipantAudioOutput = {
|
|
2
|
+
audioElement?: HTMLAudioElement;
|
|
3
|
+
audioTrack?: MediaStreamTrack;
|
|
4
|
+
};
|
|
1
5
|
export default class AudioOutput {
|
|
2
|
-
|
|
6
|
+
protected _output: ParticipantAudioOutput | null;
|
|
3
7
|
private _volume;
|
|
4
8
|
private readonly _features;
|
|
5
9
|
add(track: MediaStreamTrack): void;
|
|
6
10
|
remove(track: MediaStreamTrack): void;
|
|
7
11
|
get volume(): number;
|
|
8
12
|
set volume(volume: number);
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
protected _initAudioElement(): void;
|
|
14
|
+
protected _stopAudioElement(): void;
|
|
11
15
|
destroy(): void;
|
|
12
16
|
/** изменяем устройство для воспроизведения аудио */
|
|
13
17
|
changeOutput(): Promise<void>;
|
|
14
18
|
}
|
|
19
|
+
export {};
|
|
@@ -6,12 +6,12 @@ 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';
|
|
13
12
|
import { JSONObject } from '../static/Json';
|
|
14
|
-
import { IAsrStartParams } from '../types/Asr';
|
|
13
|
+
import { IAsrStartParams, IAsrStopParams } from '../types/Asr';
|
|
14
|
+
import { AudienceModeHandsResponse } from '../types/AudienceMode';
|
|
15
15
|
import { ConversationData } from '../types/Conversation';
|
|
16
16
|
import { ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalUserId } from '../types/ExternalId';
|
|
17
17
|
import MediaModifiers from '../types/MediaModifiers';
|
|
@@ -27,13 +27,6 @@ import { ScreenCaptureSettings } from '../types/ScreenCaptureSettings';
|
|
|
27
27
|
import SignalingMessage from '../types/SignalingMessage';
|
|
28
28
|
import { WaitingHallResponse } from '../types/WaitingHall';
|
|
29
29
|
import EventEmitter from './EventEmitter';
|
|
30
|
-
export type ParticipantUpdateInfo = {
|
|
31
|
-
participantStreamDescription: ParticipantStreamDescription | null;
|
|
32
|
-
streamId: string;
|
|
33
|
-
rtpTimestamp: number | null;
|
|
34
|
-
sequenceNumber: number;
|
|
35
|
-
fastScreenShare: boolean;
|
|
36
|
-
};
|
|
37
30
|
export default class Conversation extends EventEmitter {
|
|
38
31
|
private readonly _api;
|
|
39
32
|
private readonly _signaling;
|
|
@@ -83,6 +76,9 @@ export default class Conversation extends EventEmitter {
|
|
|
83
76
|
private _onJoinPart2;
|
|
84
77
|
onPush(conversationId: string, type?: UserType, peerId?: number): Promise<void>;
|
|
85
78
|
private _isInWaitingHall;
|
|
79
|
+
private _isRestricted;
|
|
80
|
+
private _isAudienceMode;
|
|
81
|
+
private _isAudienceModeListener;
|
|
86
82
|
private _acceptConcurrent;
|
|
87
83
|
accept(mediaOptions: MediaOption[]): Promise<ConversationData>;
|
|
88
84
|
decline(): Promise<void>;
|
|
@@ -129,7 +125,6 @@ export default class Conversation extends EventEmitter {
|
|
|
129
125
|
private _getExternalIdByParticipantId;
|
|
130
126
|
private _registerParticipantAndSetMarkersIfChunkEnabled;
|
|
131
127
|
private _warnParticipantNotInConversation;
|
|
132
|
-
private _setParticipantMarkers;
|
|
133
128
|
private _denormalizeMarkers;
|
|
134
129
|
/**
|
|
135
130
|
* Обрабатывает данные connection из сигналинга. Должен вызываться после `_registerParticipants`
|
|
@@ -181,7 +176,7 @@ export default class Conversation extends EventEmitter {
|
|
|
181
176
|
private _onAddParticipant;
|
|
182
177
|
private _onRemoveParticipant;
|
|
183
178
|
changeDevice(kind: MediaDeviceKind): Promise<void>;
|
|
184
|
-
stopVideoTrack(): void;
|
|
179
|
+
stopVideoTrack(): void | undefined;
|
|
185
180
|
toggleScreenCapturing(settings: ScreenCaptureSettings): Promise<void>;
|
|
186
181
|
disableScreenCapturing(): Promise<void>;
|
|
187
182
|
toggleAnimojiCapturing(state: boolean): void;
|
|
@@ -212,6 +207,7 @@ export default class Conversation extends EventEmitter {
|
|
|
212
207
|
private _sendUpdateDisplayLayout;
|
|
213
208
|
private _cleanupCooldownQueue;
|
|
214
209
|
private _onParticipantSourcesUpdate;
|
|
210
|
+
private _onParticipantSourcesSuspend;
|
|
215
211
|
private _onParticipantPromoted;
|
|
216
212
|
private _onChatRoomUpdated;
|
|
217
213
|
private _onSharedMovieUpdate;
|
|
@@ -219,18 +215,20 @@ export default class Conversation extends EventEmitter {
|
|
|
219
215
|
private _processSharedMovieInfos;
|
|
220
216
|
private _processSharedMovieInfo;
|
|
221
217
|
private _processConnectionSharedMovieInfo;
|
|
218
|
+
private _processConnectionAsrInfo;
|
|
222
219
|
private _onSharedMovieInfoStopped;
|
|
223
220
|
private _onFeaturesPerRoleChanged;
|
|
224
221
|
private _waitForStreamIfNeeded;
|
|
225
222
|
private _matchStreamDescription;
|
|
223
|
+
private _handleParticipantSuspend;
|
|
226
224
|
private _getWaitingTime;
|
|
227
225
|
private _isCallAdmin;
|
|
228
226
|
private _checkAdminRole;
|
|
229
|
-
grantRoles(participantId:
|
|
227
|
+
grantRoles(participantId: ParticipantId, roles: UserRole[], revoke: boolean): Promise<void>;
|
|
230
228
|
startAsr(params: IAsrStartParams): Promise<void>;
|
|
231
|
-
stopAsr(): Promise<void>;
|
|
229
|
+
stopAsr(params?: IAsrStopParams): Promise<void>;
|
|
232
230
|
requestAsr(request: boolean): Promise<void>;
|
|
233
|
-
muteParticipant(participantId:
|
|
231
|
+
muteParticipant(participantId: string | null | undefined, muteStates: MuteStates, requestedMedia?: MediaOption[], roomId?: number | null): Promise<void>;
|
|
234
232
|
enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<void>;
|
|
235
233
|
pinParticipant(participantId: ParticipantId, unpin: boolean, roomId?: number | null): Promise<void>;
|
|
236
234
|
updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<void>;
|
|
@@ -242,12 +240,16 @@ export default class Conversation extends EventEmitter {
|
|
|
242
240
|
* @hidden
|
|
243
241
|
*/
|
|
244
242
|
getWaitingHall(pageMarker: string | null, count?: number, backward?: boolean): Promise<WaitingHallResponse>;
|
|
243
|
+
private _resolveExternalIds;
|
|
244
|
+
getAudienceModeHands(): Promise<AudienceModeHandsResponse>;
|
|
245
245
|
promoteParticipant(participantId: CompositeUserId, demote?: boolean): Promise<void>;
|
|
246
|
+
requestPromotion(demote?: boolean): Promise<void>;
|
|
247
|
+
acceptPromotion(reject?: boolean): Promise<void>;
|
|
246
248
|
chatMessage(message: string, participantId?: CompositeUserId | null): Promise<void>;
|
|
247
249
|
chatHistory(count: number): Promise<void>;
|
|
248
250
|
customData(data: JSONObject, participantId?: ParticipantId | null): Promise<void>;
|
|
249
251
|
createJoinLink(): Promise<string>;
|
|
250
|
-
removeJoinLink(): Promise<
|
|
252
|
+
removeJoinLink(): Promise<undefined>;
|
|
251
253
|
addMovie({ movieId, gain, metadata }: IAddMovieParams): Promise<{
|
|
252
254
|
movieId: number;
|
|
253
255
|
streamType: string;
|
|
@@ -258,9 +260,10 @@ export default class Conversation extends EventEmitter {
|
|
|
258
260
|
activateRooms(roomIds: number[], deactivate: boolean): Promise<void>;
|
|
259
261
|
switchRoom(toRoomId: number | null, participantId?: ParticipantId): Promise<void>;
|
|
260
262
|
removeRooms(roomIds: number[]): Promise<void>;
|
|
261
|
-
startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null, roomId?: number | null): Promise<
|
|
262
|
-
stopStream(roomId?: number | null): Promise<
|
|
263
|
-
|
|
263
|
+
startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null, roomId?: number | null): Promise<undefined>;
|
|
264
|
+
stopStream(roomId?: number | null): Promise<undefined>;
|
|
265
|
+
publishStream(roomId?: number | null): Promise<undefined>;
|
|
266
|
+
recordSetConf(king?: ParticipantId, pawns?: ParticipantId[], hideParticipantCount?: boolean, roomId?: number | null): Promise<void>;
|
|
264
267
|
getStreamInfo(): Promise<{
|
|
265
268
|
movieId: any;
|
|
266
269
|
preview: any;
|
|
@@ -268,8 +271,8 @@ export default class Conversation extends EventEmitter {
|
|
|
268
271
|
setLocalResolution({ video, effect }: {
|
|
269
272
|
video: IVideoDimentions;
|
|
270
273
|
effect?: IVideoDimentions;
|
|
271
|
-
}): Promise<void>;
|
|
272
|
-
videoEffect(effect: IEffect | null): Promise<void>;
|
|
274
|
+
}): Promise<void | undefined>;
|
|
275
|
+
videoEffect(effect: IEffect | null): Promise<void | undefined>;
|
|
273
276
|
getParticipants(parameters: IGetParticipantsParameters): Promise<ExternalParticipant[]>;
|
|
274
277
|
getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<ExternalParticipantListChunk>;
|
|
275
278
|
private _getInitialParticiapntListChunk;
|
|
@@ -279,6 +282,7 @@ export default class Conversation extends EventEmitter {
|
|
|
279
282
|
private _changeRemoteParticipantState;
|
|
280
283
|
private _invokeRolesChangedCallbackIfNeeded;
|
|
281
284
|
private _onSignalingNotification;
|
|
285
|
+
private _onPromotionApproved;
|
|
282
286
|
private _onSignalingReconnect;
|
|
283
287
|
private _onSignalingFailed;
|
|
284
288
|
private _onAcceptedCall;
|
|
@@ -301,8 +305,10 @@ export default class Conversation extends EventEmitter {
|
|
|
301
305
|
private _onRecordInfo;
|
|
302
306
|
private _changePinnedParticipantForRoom;
|
|
303
307
|
_changeRecordInfoForRoom(): Promise<void>;
|
|
308
|
+
private _changeAsrInfoForRoom;
|
|
304
309
|
private _onParticipantAnimojiChanged;
|
|
305
|
-
private
|
|
310
|
+
private _onAsrStart;
|
|
311
|
+
private _onAsrStop;
|
|
306
312
|
private _onAsrTranscription;
|
|
307
313
|
private _onRolesChanged;
|
|
308
314
|
/**
|
|
@@ -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
|
+
}
|
package/classes/MediaSource.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare const enum MediaTrackKind {
|
|
|
20
20
|
}
|
|
21
21
|
export declare class MediaSource extends EventEmitter {
|
|
22
22
|
/** Стрим с камеры и микрофона пользователя */
|
|
23
|
-
|
|
23
|
+
protected _stream: MediaStream | null;
|
|
24
24
|
private _screenTrack;
|
|
25
25
|
private _audioShareTrack;
|
|
26
26
|
/** Трек для отправки в медиа-канал. Может отличаться при скриншаринге в дата-канал */
|
|
@@ -67,8 +67,8 @@ export declare class MediaSource extends EventEmitter {
|
|
|
67
67
|
private _disableScreenCapture;
|
|
68
68
|
private disableAudioShare;
|
|
69
69
|
private stopAudioShareTrack;
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
protected getSilentAudioShareTrack(): MediaStreamTrack;
|
|
71
|
+
protected _replaceLocalTrack(newTrack: MediaStreamTrack, sendTrack?: MediaStreamTrack): Promise<void>;
|
|
72
72
|
private _setEffect;
|
|
73
73
|
private _stopEffect;
|
|
74
74
|
destroy(): void;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ParticipantStreamDescription } from '../types/ParticipantStreamDescription';
|
|
2
2
|
import SignalingMessage from '../types/SignalingMessage';
|
|
3
|
+
export type IParticipantSuspendInfoParse = [
|
|
4
|
+
number,
|
|
5
|
+
boolean
|
|
6
|
+
];
|
|
3
7
|
export declare class ParticipantIdRegistry {
|
|
4
8
|
private streamDescriptionByCompactId;
|
|
5
9
|
private compactIdByStreamDescription;
|
|
@@ -7,4 +11,5 @@ export declare class ParticipantIdRegistry {
|
|
|
7
11
|
getCompactId(streamDescription: string): number | undefined;
|
|
8
12
|
handleMessage(data: ArrayBuffer): SignalingMessage | null;
|
|
9
13
|
private _createParticipantSourcesUpdateNotification;
|
|
14
|
+
private _createParticipantSourcesSuspendNotification;
|
|
10
15
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
|
|
2
|
+
import { RequestAsr } from '../types/RequestAsr';
|
|
2
3
|
import SignalingMessage from '../types/SignalingMessage';
|
|
3
4
|
import { PerfStatReport } from '../types/PerfStatReporter';
|
|
4
5
|
import { SharingStatReport } from './screenshare/SharingStatReport';
|
|
@@ -13,6 +14,7 @@ export declare class ProducerCommandSerializationService {
|
|
|
13
14
|
private writeStreamDesc;
|
|
14
15
|
serializePerfStatReport(sequenceNumber: number, report: PerfStatReport): ArrayBuffer;
|
|
15
16
|
serializeSharingStatReport(sequenceNumber: number, report: SharingStatReport): ArrayBuffer;
|
|
17
|
+
serializeRequestAsr(sequenceNumber: number, params: RequestAsr): ArrayBuffer;
|
|
16
18
|
deserializeCommandResponse(data: BufferSource | Blob): Promise<SignalingMessage | undefined>;
|
|
17
19
|
private deserializeUpdateDisplayLayoutResponse;
|
|
18
20
|
private deserializeReportPerfStatResponse;
|
|
@@ -5,7 +5,7 @@ export default interface IEncoder {
|
|
|
5
5
|
requestFrame(keyFrame: boolean): void;
|
|
6
6
|
isVP9(): boolean;
|
|
7
7
|
destroy(): void;
|
|
8
|
-
setBitrate(bitrate: number, useCbr: boolean): void;
|
|
8
|
+
setBitrate(bitrate: number, useCbr: boolean, fps: number): void;
|
|
9
9
|
}
|
|
10
10
|
export interface FrameMessage {
|
|
11
11
|
type: MessageType;
|
|
@@ -29,7 +29,7 @@ export default class LibVPxEncoder extends WorkerBase implements IEncoder {
|
|
|
29
29
|
private _requestFrameVideo;
|
|
30
30
|
private _requestFrameBitmap;
|
|
31
31
|
requestFrame(keyFrame?: boolean): void;
|
|
32
|
-
setBitrate(bitrate: number, useCbr
|
|
32
|
+
setBitrate(bitrate: number, useCbr: boolean, fps: number): void;
|
|
33
33
|
isVP9(): boolean;
|
|
34
34
|
destroy(): void;
|
|
35
35
|
static isBrowserSupported(): boolean;
|
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
|
-
export type OnCongestionCallback = (bitrate: number, useCbr: boolean) => void;
|
|
29
|
+
export type OnCongestionCallback = (bitrate: number, useCbr: boolean, fps: number) => void;
|
|
@@ -12,7 +12,7 @@ export default class WebCodecsEncoder extends WorkerBase implements IEncoder {
|
|
|
12
12
|
constructor(sourceTrack: MediaStreamTrack, onFrame: OnFrameCallback, useCongestionControl: boolean, maxBitrate: number, useCbr: boolean, frameRate: number);
|
|
13
13
|
init(): Promise<void>;
|
|
14
14
|
requestFrame(keyFrame?: boolean): void;
|
|
15
|
-
setBitrate(bitrate: number, useCbr: boolean): void;
|
|
15
|
+
setBitrate(bitrate: number, useCbr: boolean, fps: number): void;
|
|
16
16
|
isVP9(): boolean;
|
|
17
17
|
destroy(): void;
|
|
18
18
|
static isBrowserSupported(): boolean;
|
|
@@ -21,10 +21,11 @@ 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;
|
|
29
|
+
clear(): void;
|
|
29
30
|
}
|
|
30
31
|
export {};
|
|
@@ -12,19 +12,29 @@ export default class ScreenCaptureSender {
|
|
|
12
12
|
private _width;
|
|
13
13
|
private _height;
|
|
14
14
|
private _feedback;
|
|
15
|
+
private _lastSentFrameSeq;
|
|
16
|
+
private _lastDeliveredFrameSeq;
|
|
15
17
|
private _lastSharingStat;
|
|
16
|
-
private _congestionControlEnabled;
|
|
18
|
+
private readonly _congestionControlEnabled;
|
|
19
|
+
private readonly _queue;
|
|
20
|
+
private readonly _fpsMeter;
|
|
17
21
|
constructor(track: MediaStreamTrack, datachannel: RTCDataChannel, signaling: BaseSignaling, fastSharing: boolean);
|
|
22
|
+
private _handleQueue;
|
|
23
|
+
/**
|
|
24
|
+
* Очищает очередь до опорного кадра
|
|
25
|
+
* @returns Есть ли в очереди опорный кадр
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
private _cleanupQueue;
|
|
18
29
|
private _requestFrame;
|
|
30
|
+
private _sliceFrame;
|
|
19
31
|
private _wrapHeader;
|
|
20
32
|
private _stopPacket;
|
|
21
|
-
private
|
|
22
|
-
private _sendChunk;
|
|
33
|
+
private _sendFrameChunk;
|
|
23
34
|
destroy(): void;
|
|
24
35
|
static isBrowserSupported(): boolean;
|
|
25
36
|
private _onCongestionCallback;
|
|
26
37
|
private _onResize;
|
|
27
38
|
private _calcMinMaxBitrate;
|
|
28
|
-
private _checkCcFeedback;
|
|
29
39
|
private _sendSharingStat;
|
|
30
40
|
}
|
|
@@ -6,6 +6,7 @@ export default class ScreenCongestionControl {
|
|
|
6
6
|
private readonly _fastSharing;
|
|
7
7
|
private readonly _trendDelayThreshold;
|
|
8
8
|
private readonly _highDelayThreshold;
|
|
9
|
+
private readonly _targetFps;
|
|
9
10
|
private _minBitrate;
|
|
10
11
|
private _maxBitrate;
|
|
11
12
|
private _targetBitrate;
|
|
@@ -20,10 +21,14 @@ export default class ScreenCongestionControl {
|
|
|
20
21
|
private _minDelay;
|
|
21
22
|
private _maxDelay;
|
|
22
23
|
private _largeDelayDuration;
|
|
23
|
-
|
|
24
|
+
private _lastFpsCalcMs;
|
|
25
|
+
private _frames;
|
|
26
|
+
private _fps;
|
|
27
|
+
constructor(onCongestion: OnCongestionCallback, minBitrate: number, maxBitrate: number, ccEnabled: boolean, fastSharing: boolean, delayThreshold: number, targetFps: number);
|
|
24
28
|
checkDelay(frameNum: number, delay: number, bitrateK: number): void;
|
|
25
29
|
private _setBitrate;
|
|
26
30
|
private _calcDelay;
|
|
27
31
|
reconfigure(minBitrate: number, maxBitrate: number): void;
|
|
28
|
-
getStat(): SharingStatReport;
|
|
32
|
+
getStat(): SharingStatReport | null;
|
|
33
|
+
private _calcFps;
|
|
29
34
|
}
|
|
@@ -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;
|
|
@@ -20,6 +20,7 @@ export default class ServerTransport extends BaseTransport {
|
|
|
20
20
|
private _settingsInterval;
|
|
21
21
|
private _statBytes;
|
|
22
22
|
private _ssrcMap;
|
|
23
|
+
private _ssrcMapUpdated;
|
|
23
24
|
private _perfStatReporter;
|
|
24
25
|
private _producerOfferIsProcessing;
|
|
25
26
|
private _producerNextOffer;
|
|
@@ -43,6 +44,7 @@ export default class ServerTransport extends BaseTransport {
|
|
|
43
44
|
allowRestart(): void;
|
|
44
45
|
updateSettings(settings: ServerSettings): void;
|
|
45
46
|
setAnimojiTransport(receiver: AnimojiReceiver, sender: AnimojiSender): void;
|
|
47
|
+
private _createPerfStatsReporter;
|
|
46
48
|
private _closeConnection;
|
|
47
49
|
private static _closeDataChannel;
|
|
48
50
|
private _createDataChannel;
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import { ParticipantId } from '../../types/Participant';
|
|
2
|
-
import { StatItem } from '../../types/Statistics';
|
|
2
|
+
import { StatItem, StatRtp, StatTransport } from '../../types/Statistics';
|
|
3
|
+
export declare const NO_STAT_REQUEST_DELAY = 1000;
|
|
4
|
+
export declare function distinctById(items: RTCStats[]): RTCStats[];
|
|
5
|
+
export declare function rtcStatsToArray(stats: RTCStatsReport[]): RTCStats[];
|
|
6
|
+
/**
|
|
7
|
+
* Extracts transport statistics from the gives stats
|
|
8
|
+
* @hidden
|
|
9
|
+
*/
|
|
10
|
+
export declare function extractTransport(stats: RTCStats[]): StatTransport;
|
|
11
|
+
/**
|
|
12
|
+
* Extracts media statistics from the given stats
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
export declare function extractRtps(stats: RTCStats[], ssrcMap: Record<string, string>): StatRtp[];
|
|
16
|
+
/**
|
|
17
|
+
* Computes delta (the difference) between two stat reports.
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
export declare function delta(current: StatItem, previous: StatItem): StatItem;
|
|
3
21
|
export declare function collectStats(pc: RTCPeerConnection, previous: StatItem | null, ssrcMap?: Record<string, string>): Promise<StatItem>;
|
|
4
22
|
export declare function setMark(name: string): void;
|
|
5
23
|
export declare function clearMark(name: string): void;
|
|
@@ -61,7 +61,7 @@ export declare class Transport extends EventEmitter {
|
|
|
61
61
|
isAllocated(participantId: ParticipantId): boolean;
|
|
62
62
|
allocated(): string[];
|
|
63
63
|
opened(): string[];
|
|
64
|
-
getState(): TransportState;
|
|
64
|
+
getState(): TransportState | undefined;
|
|
65
65
|
getStates(): Record<string, TransportState>;
|
|
66
66
|
setAnimojiSvg(participantId: ParticipantId, svgData: AnimojiSvgData): void;
|
|
67
67
|
private _setStates;
|
|
@@ -89,6 +89,7 @@ export declare class Transport extends EventEmitter {
|
|
|
89
89
|
private _onServerRemoteTrackAdded;
|
|
90
90
|
private _onServerRemoteTrackRemoved;
|
|
91
91
|
private _onAsrTranscription;
|
|
92
|
+
private _onSourceChanged;
|
|
92
93
|
private _onAnimojiStream;
|
|
93
94
|
/** Обработчик, досылающий MediaSourceEvent.SOURCE_CHANGED событие до аллокации транспортов */
|
|
94
95
|
private _onAnimojiStatus;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MAIN_ROOM_ID: number | null;
|
package/default/Api.d.ts
CHANGED
|
@@ -2,30 +2,28 @@ 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
|
-
|
|
16
|
-
userId(compositeUserId:
|
|
12
|
+
protected _call(method: string, data?: any, noSession?: boolean): Promise<any>;
|
|
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>;
|
|
26
|
+
protected _ensureUuid(): void;
|
|
29
27
|
private _preareStartConversationData;
|
|
30
28
|
private _startConversation;
|
|
31
29
|
createJoinLink(conversationId: string): Promise<{
|
|
@@ -38,16 +36,18 @@ export default class Api extends BaseApi {
|
|
|
38
36
|
joinConversationByLink(joinLink: string, isVideo?: boolean, observedIds?: ExternalUserId[], payload?: string): Promise<ConversationResponse>;
|
|
39
37
|
/**
|
|
40
38
|
* NB: Не сохраняет порядок возвращаемых ID
|
|
39
|
+
* Этот метод принимает именно ExternalId, т.к. для OkUserId не принципиально наличие deviceIdx
|
|
41
40
|
* @hidden
|
|
42
41
|
*/
|
|
43
|
-
getOkIdsByExternalIds(externalIds:
|
|
42
|
+
getOkIdsByExternalIds(externalIds: ExternalId[]): Promise<OkUserId[]>;
|
|
43
|
+
getParticipantIdsByExternalIds(externalIds: ExternalId[]): Promise<Map<ExternalId, ParticipantId>>;
|
|
44
44
|
/**
|
|
45
45
|
* NB: Не сохраняет порядок возвращаемых ID
|
|
46
46
|
* @hidden
|
|
47
47
|
*/
|
|
48
|
-
getExternalIdsByOkIds(uids: OkUserId[]): Promise<
|
|
49
|
-
getCachedOkIdByExternalId(externalId: ExternalId):
|
|
50
|
-
cacheExternalId(participantId: CompositeUserId, externalId:
|
|
48
|
+
getExternalIdsByOkIds(uids: OkUserId[]): Promise<ExternalParticipantId[]>;
|
|
49
|
+
getCachedOkIdByExternalId(externalId: ExternalId): ParticipantId | null;
|
|
50
|
+
cacheExternalId(participantId: CompositeUserId, externalId: ExternalParticipantId): void;
|
|
51
51
|
getConversationParams(conversationId?: string): Promise<ConversationParams>;
|
|
52
52
|
getUserId(): OkUserId | null;
|
|
53
53
|
setUserId(userId: OkUserId): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IApiEnv } from '../types/Params';
|
|
2
|
+
export declare class ApiExternal {
|
|
3
|
+
private readonly _uuid;
|
|
4
|
+
private readonly _apiKey;
|
|
5
|
+
private readonly _callToken;
|
|
6
|
+
private readonly _apiEnv;
|
|
7
|
+
private _sessionKey;
|
|
8
|
+
constructor(apiEvn: IApiEnv, apiKey: string, callToken: string);
|
|
9
|
+
authorize(): Promise<boolean>;
|
|
10
|
+
hangupConversation(conversationId: string): Promise<void>;
|
|
11
|
+
}
|
package/default/Signaling.d.ts
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
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';
|
|
5
|
-
import { PerfStatReport } from '../types/PerfStatReporter';
|
|
6
4
|
import { TransportTopology } from '../classes/transport/Transport';
|
|
7
5
|
import ConversationFeature from '../enums/ConversationFeature';
|
|
8
6
|
import ConversationOption from '../enums/ConversationOption';
|
|
9
7
|
import MediaOption from '../enums/MediaOption';
|
|
10
|
-
import RecordRole from '../enums/RecordRole';
|
|
11
8
|
import SignalingCommandType from '../enums/SignalingCommandType';
|
|
12
9
|
import SignalingConnectionType from '../enums/SignalingConnectionType';
|
|
13
10
|
import UserRole from '../enums/UserRole';
|
|
14
11
|
import { JSONObject } from '../static/Json';
|
|
15
|
-
import { IAsrStartParams } from '../types/Asr';
|
|
12
|
+
import { IAsrStartParams, IAsrStopParams } from '../types/Asr';
|
|
16
13
|
import MediaModifiers from '../types/MediaModifiers';
|
|
17
14
|
import MediaSettings from '../types/MediaSettings';
|
|
18
15
|
import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
|
|
@@ -20,8 +17,10 @@ import MuteStates from '../types/MuteStates';
|
|
|
20
17
|
import { CompositeUserId, ParticipantId } from '../types/Participant';
|
|
21
18
|
import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
|
|
22
19
|
import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
|
|
20
|
+
import { StreamDescriptionString } from '../types/ParticipantStreamDescription';
|
|
21
|
+
import { PerfStatReport } from '../types/PerfStatReporter';
|
|
23
22
|
import SignalingMessage from '../types/SignalingMessage';
|
|
24
|
-
import { IStartStreamData, IStopStreamData } from '../types/Streams';
|
|
23
|
+
import { IRecordConfData, IStartStreamData, IStopStreamData, IPublishStreamData } from '../types/Streams';
|
|
25
24
|
import { WaitingParticipantId } from '../types/WaitingHall';
|
|
26
25
|
export default class Signaling extends BaseSignaling {
|
|
27
26
|
private socket;
|
|
@@ -29,7 +28,6 @@ export default class Signaling extends BaseSignaling {
|
|
|
29
28
|
private lastStamp;
|
|
30
29
|
private websocketCommandsQueue;
|
|
31
30
|
private datachannelCommandsQueue;
|
|
32
|
-
private asrCommandsQueue;
|
|
33
31
|
private incomingCache;
|
|
34
32
|
private responseHandlers;
|
|
35
33
|
private reconnectCount;
|
|
@@ -47,10 +45,8 @@ export default class Signaling extends BaseSignaling {
|
|
|
47
45
|
private participantIdRegistry;
|
|
48
46
|
private producerNotificationDataChannel;
|
|
49
47
|
private producerCommandDataChannel;
|
|
50
|
-
private asrDataChannel;
|
|
51
48
|
private producerCommandDataChannelEnabled;
|
|
52
49
|
private producerCommandSerializationService;
|
|
53
|
-
private asrCommandSerializer;
|
|
54
50
|
private static readonly RECONNECT_DELAY;
|
|
55
51
|
private static readonly RECONNECT_MAX_DELAY;
|
|
56
52
|
private static readonly RECONNECT_MAX_COUNT;
|
|
@@ -86,7 +82,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
86
82
|
getNextCommandSequenceNumber(): number;
|
|
87
83
|
hangup(reason: string): Promise<SignalingMessage | void>;
|
|
88
84
|
sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidate): Promise<SignalingMessage>;
|
|
89
|
-
requestTestMode(consumerCommand: string, producerCommand: string): Promise<SignalingMessage>;
|
|
85
|
+
requestTestMode(consumerCommand: string, producerCommand: string | null): Promise<SignalingMessage>;
|
|
90
86
|
sendSdp(participantId: ParticipantId, sdp: RTCSessionDescription): Promise<SignalingMessage>;
|
|
91
87
|
acceptCall(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
92
88
|
changeMediaSettings(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
@@ -118,7 +114,8 @@ export default class Signaling extends BaseSignaling {
|
|
|
118
114
|
removeRooms(roomIds: number[]): Promise<SignalingMessage>;
|
|
119
115
|
startStream(data: IStartStreamData): Promise<SignalingMessage>;
|
|
120
116
|
stopStream(data?: IStopStreamData): Promise<SignalingMessage>;
|
|
121
|
-
|
|
117
|
+
publishStream(data?: IPublishStreamData): Promise<SignalingMessage>;
|
|
118
|
+
recordSetConf(conf?: IRecordConfData): Promise<SignalingMessage>;
|
|
122
119
|
getRecordStatus(): Promise<SignalingMessage>;
|
|
123
120
|
switchTopology(topology: TransportTopology, force?: boolean): Promise<SignalingMessage>;
|
|
124
121
|
requestRealloc(): Promise<SignalingMessage>;
|
|
@@ -127,7 +124,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
127
124
|
chatMessage(message: string, participantId?: CompositeUserId | null): Promise<SignalingMessage>;
|
|
128
125
|
chatHistory(count: number): Promise<SignalingMessage>;
|
|
129
126
|
customData(data: JSONObject, participantId: ParticipantId | null): Promise<SignalingMessage>;
|
|
130
|
-
grantRoles(participantId:
|
|
127
|
+
grantRoles(participantId: ParticipantId, roles: UserRole[], revoke: boolean): Promise<SignalingMessage>;
|
|
131
128
|
muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia: MediaOption[], roomId?: number | null): Promise<SignalingMessage>;
|
|
132
129
|
enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<SignalingMessage>;
|
|
133
130
|
pinParticipant(participantId: ParticipantId, unpin: boolean, roomId: number | null): Promise<SignalingMessage>;
|
|
@@ -137,7 +134,10 @@ export default class Signaling extends BaseSignaling {
|
|
|
137
134
|
}): Promise<SignalingMessage>;
|
|
138
135
|
getWaitingHall(fromId?: WaitingParticipantId | null, count?: number, backward?: boolean): Promise<SignalingMessage>;
|
|
139
136
|
promoteParticipant(participantId: CompositeUserId, demote?: boolean): Promise<SignalingMessage>;
|
|
137
|
+
requestPromotion(demote?: boolean): Promise<SignalingMessage>;
|
|
138
|
+
acceptPromotion(reject?: boolean): Promise<SignalingMessage>;
|
|
140
139
|
feedback(key: string): Promise<SignalingMessage>;
|
|
140
|
+
getHandQueue(): Promise<SignalingMessage>;
|
|
141
141
|
/**
|
|
142
142
|
* Close a connection with a signaling server
|
|
143
143
|
*/
|
|
@@ -152,9 +152,8 @@ export default class Signaling extends BaseSignaling {
|
|
|
152
152
|
getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<SignalingMessage>;
|
|
153
153
|
getParticipants(externalIds: SignalingMessage.ExternalId[]): Promise<SignalingMessage>;
|
|
154
154
|
startAsr(params: IAsrStartParams): Promise<SignalingMessage>;
|
|
155
|
-
stopAsr(): Promise<SignalingMessage>;
|
|
155
|
+
stopAsr(params?: IAsrStopParams): Promise<SignalingMessage>;
|
|
156
156
|
requestAsr(request: boolean): Promise<SignalingMessage>;
|
|
157
|
-
setAsrDataChannel(dataChannel: RTCDataChannel): void;
|
|
158
157
|
protected _connect(connectionType: SignalingConnectionType): void;
|
|
159
158
|
protected _disconnect(code?: number): void;
|
|
160
159
|
private _onOpen;
|
|
@@ -168,7 +167,6 @@ export default class Signaling extends BaseSignaling {
|
|
|
168
167
|
protected _closeSocket(error?: Error | null): void;
|
|
169
168
|
protected _reconnect(): void;
|
|
170
169
|
private _handleCommandResponse;
|
|
171
|
-
private _serializeAsrCommand;
|
|
172
170
|
private _handleCommandsQueue;
|
|
173
171
|
private _serializeBinary;
|
|
174
172
|
private _serializeJson;
|