@vkontakte/calls-sdk 2.6.2-dev.2b57aff.0 → 2.6.2-dev.30ea81e.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 +69 -12
- package/abstract/BaseApi.d.ts +7 -3
- package/abstract/BaseSignaling.d.ts +18 -4
- package/calls-sdk.cjs.js +8 -8
- package/calls-sdk.esm.js +8 -8
- package/classes/Conversation.d.ts +41 -9
- package/classes/MediaSource.d.ts +7 -2
- package/classes/ParticipantIdRegistry.d.ts +2 -0
- package/classes/ProducerCommandSerializationService.d.ts +19 -0
- package/classes/codec/IEncoder.d.ts +3 -0
- package/classes/codec/LibVPxEncoder.d.ts +4 -1
- package/classes/codec/Types.d.ts +6 -1
- package/classes/codec/WebCodecsEncoder.d.ts +4 -1
- package/classes/screenshare/PacketHistory.d.ts +30 -0
- package/classes/screenshare/PacketHistory.test.d.ts +1 -0
- package/classes/screenshare/ScreenCaptureSender.d.ts +16 -2
- package/classes/screenshare/ScreenCongestionControl.d.ts +25 -0
- package/classes/screenshare/SharingStatReport.d.ts +6 -0
- package/classes/screenshare/Utils.d.ts +6 -0
- package/classes/transport/ServerTransport.d.ts +2 -0
- package/default/Api.d.ts +8 -3
- package/default/Api.test.d.ts +1 -0
- package/default/Signaling.d.ts +24 -5
- package/enums/ConversationFeature.d.ts +2 -1
- package/enums/ConversationOption.d.ts +3 -1
- package/enums/HangupType.d.ts +3 -1
- package/enums/LiveStatus.d.ts +7 -0
- package/enums/MediaOption.d.ts +3 -1
- package/enums/RoomsEventType.d.ts +6 -0
- package/enums/SignalingCommandType.d.ts +12 -1
- package/enums/SignalingNotification.d.ts +12 -1
- package/package.json +1 -1
- package/static/ApiTransport.d.ts +1 -1
- package/static/External.d.ts +98 -5
- package/static/Params.d.ts +110 -3
- package/static/Polyfills.d.ts +6 -0
- package/static/Utils.d.ts +5 -1
- package/static/WebRTCUtils.d.ts +2 -1
- package/types/Asr.d.ts +5 -0
- package/types/Conversation.d.ts +12 -0
- package/types/ConversationFeature.d.ts +3 -0
- package/types/ConversationParams.d.ts +1 -0
- package/types/ExternalId.d.ts +2 -0
- package/types/Feedback.d.ts +22 -0
- package/types/LayoutUtils.d.ts +5 -0
- package/types/MediaSettings.d.ts +5 -1
- package/types/MovieShare.d.ts +58 -0
- package/types/Participant.d.ts +3 -0
- package/types/ParticipantLayout.d.ts +7 -1
- package/types/ParticipantListChunk.d.ts +2 -0
- package/types/ParticipantStreamDescription.d.ts +2 -1
- package/types/Room.d.ts +72 -0
- package/types/SignalingMessage.d.ts +67 -0
- package/types/WaitingHall.d.ts +2 -8
- package/utils/ArrayDequeue.d.ts +24 -0
- package/utils/ArrayDequeue.spec.d.ts +1 -0
- package/utils/Conversation.d.ts +2 -0
- package/utils/MsgPackerBufferUtils.d.ts +31 -0
- package/worker/LibVPxEncoderWorker.d.ts +1 -1
|
@@ -12,9 +12,12 @@ import UpdateDisplayLayoutErrorReason from '../enums/UpdateDisplayLayoutErrorRea
|
|
|
12
12
|
import UserRole from '../enums/UserRole';
|
|
13
13
|
import UserType from '../enums/UserType';
|
|
14
14
|
import { JSONObject } from '../static/Json';
|
|
15
|
+
import { IFeaturesPerRole } from '../types/ConversationFeature';
|
|
16
|
+
import { AsrInfo } from '../types/Asr';
|
|
15
17
|
import { ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalUserId } from '../types/ExternalId';
|
|
16
18
|
import MediaModifiers from '../types/MediaModifiers';
|
|
17
19
|
import { IVideoDimentions } from '../types/MediaSettings';
|
|
20
|
+
import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
|
|
18
21
|
import MuteStates from '../types/MuteStates';
|
|
19
22
|
import { CompositeUserId, IGetParticipantsParameters, OkUserId, ParticipantId } from '../types/Participant';
|
|
20
23
|
import { ParticipantLayout } from '../types/ParticipantLayout';
|
|
@@ -37,6 +40,7 @@ export declare type ConversationData = {
|
|
|
37
40
|
*/
|
|
38
41
|
acceptTime: number | null;
|
|
39
42
|
features: ConversationFeature[];
|
|
43
|
+
featuresPerRole?: IFeaturesPerRole | null;
|
|
40
44
|
/**
|
|
41
45
|
* ID звонка
|
|
42
46
|
*/
|
|
@@ -48,6 +52,7 @@ export declare type ConversationData = {
|
|
|
48
52
|
needRate: boolean;
|
|
49
53
|
recordInfo: RecordInfo | null;
|
|
50
54
|
chatId: string | null;
|
|
55
|
+
asrInfo: AsrInfo | null;
|
|
51
56
|
/**
|
|
52
57
|
* Роли пользователя
|
|
53
58
|
*/
|
|
@@ -76,6 +81,7 @@ export default class Conversation extends EventEmitter {
|
|
|
76
81
|
private readonly _signaling;
|
|
77
82
|
private _mediaSource;
|
|
78
83
|
private _conversation;
|
|
84
|
+
private _myLastRequestedLayouts;
|
|
79
85
|
private _state;
|
|
80
86
|
private _participantState;
|
|
81
87
|
private _participants;
|
|
@@ -106,13 +112,14 @@ export default class Conversation extends EventEmitter {
|
|
|
106
112
|
static current(): Conversation | null;
|
|
107
113
|
static hangupAfterInit(): void;
|
|
108
114
|
static id(): string | null;
|
|
109
|
-
onStart(opponentIds: OkUserId[], opponentType: CallType, mediaOptions: MediaOption[], payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean): Promise<ConversationData>;
|
|
115
|
+
onStart(opponentIds: OkUserId[], opponentType: CallType, mediaOptions: MediaOption[], payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean, onlyAdminCanShareMovie?: boolean): Promise<ConversationData>;
|
|
110
116
|
onJoin(joinArgs: {
|
|
111
117
|
conversationId?: string;
|
|
112
118
|
mediaOptions: MediaOption[];
|
|
113
119
|
chatId?: string;
|
|
114
120
|
joinLink?: string;
|
|
115
121
|
observedIds?: ExternalUserId[];
|
|
122
|
+
payload?: string;
|
|
116
123
|
}): Promise<ConversationData>;
|
|
117
124
|
private _onJoinPart2;
|
|
118
125
|
onPush(conversationId: string, type?: UserType, peerId?: number): Promise<void>;
|
|
@@ -151,10 +158,12 @@ export default class Conversation extends EventEmitter {
|
|
|
151
158
|
private _processConnection;
|
|
152
159
|
private _prepareParticipants;
|
|
153
160
|
private _onConversationParticipantListChunk;
|
|
161
|
+
private _createParticipantListChunk;
|
|
154
162
|
private _participantListChunkToExternalChunk;
|
|
155
163
|
private _registerConnectionParticipants;
|
|
156
164
|
private _registerParticipants;
|
|
157
|
-
|
|
165
|
+
/** Установим состояние локальных мьютов */
|
|
166
|
+
private _registerParticipantLocalMuteState;
|
|
158
167
|
private _getStatusByTransportState;
|
|
159
168
|
private _registerParticipantInCache;
|
|
160
169
|
private _getExistedParticipantByIdOrCreate;
|
|
@@ -188,7 +197,7 @@ export default class Conversation extends EventEmitter {
|
|
|
188
197
|
private _onAddParticipant;
|
|
189
198
|
private _onRemoveParticipant;
|
|
190
199
|
changeDevice(kind: MediaDeviceKind): Promise<void>;
|
|
191
|
-
toggleScreenCapturing(
|
|
200
|
+
toggleScreenCapturing(screenEnabled: boolean, audioShareEnabled: boolean): Promise<void>;
|
|
192
201
|
setVideoStream(stream: MediaStream, isScreen?: boolean): Promise<void>;
|
|
193
202
|
setAudioStream(stream: MediaStream): Promise<void>;
|
|
194
203
|
toggleLocalVideo(enabled: boolean): Promise<void>;
|
|
@@ -200,21 +209,31 @@ export default class Conversation extends EventEmitter {
|
|
|
200
209
|
requestKeyFrame(participantStreamDescription: ParticipantStreamDescription): Promise<void | SignalingMessage>;
|
|
201
210
|
requestTestMode(consumerCommand: string, producerCommand: string): Promise<void>;
|
|
202
211
|
updateDisplayLayout(layouts: ParticipantLayout[]): Promise<void>;
|
|
212
|
+
/** @async */
|
|
213
|
+
feedback(key: string): Promise<SignalingMessage>;
|
|
203
214
|
private _stopStreaming;
|
|
204
215
|
private _sendUpdateDisplayLayout;
|
|
205
216
|
private _cleanupCooldownQueue;
|
|
206
|
-
private static _isStopStreaming;
|
|
207
|
-
private static _layoutToString;
|
|
208
217
|
private _onParticipantSourcesUpdate;
|
|
209
218
|
private _onParticipantPromoted;
|
|
210
219
|
private _onChatRoomUpdated;
|
|
220
|
+
private _onSharedMovieUpdate;
|
|
221
|
+
private _onSharedMovieInfoStarted;
|
|
222
|
+
private _processSharedMovieInfos;
|
|
223
|
+
private _processSharedMovieInfo;
|
|
224
|
+
private _processConnectionSharedMovieInfo;
|
|
225
|
+
private _onSharedMovieInfoStopped;
|
|
226
|
+
private _onFeaturesPerRoleChanged;
|
|
211
227
|
private _waitForStreamIfNeeded;
|
|
212
228
|
private _matchStreamDescription;
|
|
213
229
|
private _getWaitingTime;
|
|
214
230
|
private _isCallAdmin;
|
|
215
231
|
private _checkAdminRole;
|
|
216
232
|
grantRoles(participantId: CompositeUserId, roles: UserRole[], revoke: boolean): Promise<void>;
|
|
233
|
+
startAsr(): Promise<void>;
|
|
234
|
+
stopAsr(): Promise<void>;
|
|
217
235
|
muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia?: MediaOption[]): Promise<void>;
|
|
236
|
+
enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<void>;
|
|
218
237
|
pinParticipant(participantId: ParticipantId, unpin: boolean): Promise<void>;
|
|
219
238
|
updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<void>;
|
|
220
239
|
changeOptions(changes: {
|
|
@@ -231,14 +250,18 @@ export default class Conversation extends EventEmitter {
|
|
|
231
250
|
customData(data: JSONObject, participantId?: ParticipantId | null): Promise<void>;
|
|
232
251
|
createJoinLink(): Promise<string>;
|
|
233
252
|
removeJoinLink(): Promise<never>;
|
|
234
|
-
addMovie(movieId:
|
|
253
|
+
addMovie({ movieId, gain, metadata }: IAddMovieParams): Promise<{
|
|
235
254
|
movieId: string;
|
|
236
255
|
streamType: string;
|
|
237
256
|
}>;
|
|
238
|
-
updateMovie(
|
|
257
|
+
updateMovie(params: IUpdateMovieData): Promise<void>;
|
|
239
258
|
removeMovie(movieId: string): Promise<void>;
|
|
240
|
-
|
|
241
|
-
|
|
259
|
+
updateRooms(rooms: SignalingMessage.Room[], assignRandomly: boolean): Promise<void>;
|
|
260
|
+
activateRooms(roomIds: number[], deactivate: boolean): Promise<void>;
|
|
261
|
+
switchRoom(toRoomId?: number, participantId?: ParticipantId): Promise<void>;
|
|
262
|
+
removeRooms(roomIds: number[]): Promise<void>;
|
|
263
|
+
startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null, roomId?: number | null): Promise<SignalingMessage>;
|
|
264
|
+
stopStream(roomId?: number | null): Promise<SignalingMessage>;
|
|
242
265
|
recordSetRole(participantId: ParticipantId, role: RecordRole | null): Promise<void>;
|
|
243
266
|
getStreamInfo(): Promise<{
|
|
244
267
|
movieId: any;
|
|
@@ -250,6 +273,7 @@ export default class Conversation extends EventEmitter {
|
|
|
250
273
|
videoEffect(effect: IEffect | null): Promise<void>;
|
|
251
274
|
getParticipants(parameters: IGetParticipantsParameters): Promise<ExternalParticipant[]>;
|
|
252
275
|
getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<ExternalParticipantListChunk>;
|
|
276
|
+
private _getInitialParticiapntListChunk;
|
|
253
277
|
private _onLocalMediaStreamChanged;
|
|
254
278
|
private _onScreenSharingStatus;
|
|
255
279
|
private _changeRemoteMediaSettings;
|
|
@@ -276,6 +300,7 @@ export default class Conversation extends EventEmitter {
|
|
|
276
300
|
private _onChatMessage;
|
|
277
301
|
private _onCustomData;
|
|
278
302
|
private _onRecordInfo;
|
|
303
|
+
private _onAsrInfo;
|
|
279
304
|
private _onRolesChanged;
|
|
280
305
|
/**
|
|
281
306
|
* Клиент должен немедленно выключить микрофон и/или камеру
|
|
@@ -306,6 +331,13 @@ export default class Conversation extends EventEmitter {
|
|
|
306
331
|
private _updateDisplayLayoutFromCache;
|
|
307
332
|
private _setParticipantsStatus;
|
|
308
333
|
private _onJoinLinkChanged;
|
|
334
|
+
private _onRoomsUpdated;
|
|
335
|
+
private _onRoomUpdated;
|
|
336
|
+
private _convertRoomToExternal;
|
|
337
|
+
private _onRoomParticipantsUpdated;
|
|
338
|
+
/** получили из сингналинга сообщение о реакции пользователей */
|
|
339
|
+
private _onFeedback;
|
|
340
|
+
private _isMe;
|
|
309
341
|
}
|
|
310
342
|
export declare class UpdateDisplayLayoutError extends Error {
|
|
311
343
|
readonly participantErrors: {
|
package/classes/MediaSource.d.ts
CHANGED
|
@@ -13,7 +13,8 @@ export declare const enum MediaSourceEvent {
|
|
|
13
13
|
export declare const enum MediaTrackKind {
|
|
14
14
|
'audio' = "audio",
|
|
15
15
|
'video' = "video",
|
|
16
|
-
'screen' = "screen"
|
|
16
|
+
'screen' = "screen",
|
|
17
|
+
'audioshare' = "audioshare"
|
|
17
18
|
}
|
|
18
19
|
export declare class MediaSource extends EventEmitter {
|
|
19
20
|
/** Стрим с камеры и микрофона пользователя */
|
|
@@ -21,6 +22,7 @@ export declare class MediaSource extends EventEmitter {
|
|
|
21
22
|
/** Последний сохраненный оригинальный видео трек с камеры */
|
|
22
23
|
private _trackVideoStreamBackup;
|
|
23
24
|
private _screenTrack;
|
|
25
|
+
private _audioShareTrack;
|
|
24
26
|
/** Трек для отправки в медиа-канал. Может отличаться при скриншаринге в дата-канал */
|
|
25
27
|
private _sendVideoTrack;
|
|
26
28
|
private _mediaSettings;
|
|
@@ -58,16 +60,19 @@ export declare class MediaSource extends EventEmitter {
|
|
|
58
60
|
private _changeAudioInput;
|
|
59
61
|
private _changeScreen;
|
|
60
62
|
private _disableScreenCapture;
|
|
63
|
+
private disableAudioShare;
|
|
64
|
+
private getSilentAudioShareTrack;
|
|
61
65
|
private _replaceLocalTrack;
|
|
62
66
|
private _stopLocalTrack;
|
|
63
67
|
private _videoEffect;
|
|
64
68
|
/** останавливает и удаляет сохраненный трек с камеры пользователя */
|
|
65
69
|
private _stopAndRemoveTrackVideoStreamBackup;
|
|
66
70
|
destroy(): void;
|
|
67
|
-
toggleScreenCapturing(
|
|
71
|
+
toggleScreenCapturing(captureScreen: boolean, captureAudio: boolean): Promise<void>;
|
|
68
72
|
toggleVideo(enabled: boolean): Promise<void>;
|
|
69
73
|
toggleAudio(enabled: boolean): Promise<void>;
|
|
70
74
|
setResolution(width: number, height: number): Promise<void>;
|
|
71
75
|
updateNoiseSuppression(): Promise<void>;
|
|
72
76
|
videoEffect(effect: IEffect | null): Promise<void>;
|
|
77
|
+
getAudioShareTrack(): MediaStreamTrack | null;
|
|
73
78
|
}
|
|
@@ -2,7 +2,9 @@ import { ParticipantStreamDescription } from '../types/ParticipantStreamDescript
|
|
|
2
2
|
import SignalingMessage from '../types/SignalingMessage';
|
|
3
3
|
export declare class ParticipantIdRegistry {
|
|
4
4
|
private streamDescriptionByCompactId;
|
|
5
|
+
private compactIdByStreamDescription;
|
|
5
6
|
getStreamDescription(compactedId: number): ParticipantStreamDescription | undefined;
|
|
7
|
+
getCompactId(streamDescription: string): number | undefined;
|
|
6
8
|
handleMessage(data: ArrayBuffer): SignalingMessage | null;
|
|
7
9
|
private _createParticipantSourcesUpdateNotification;
|
|
8
10
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
|
|
2
|
+
import SignalingMessage from '../types/SignalingMessage';
|
|
3
|
+
import { SharingStatReport } from '../classes/screenshare/SharingStatReport';
|
|
4
|
+
import { ParticipantIdRegistry } from './ParticipantIdRegistry';
|
|
5
|
+
import { PerfStatReport } from './transport/PerfStatReporter';
|
|
6
|
+
export declare class ProducerCommandSerializationService {
|
|
7
|
+
private participantIdRegistry;
|
|
8
|
+
setParticipantIdRegistry(participantIdRegistry: ParticipantIdRegistry): void;
|
|
9
|
+
serializeUpdateDisplayLayout(sequenceNumber: number, layouts: {
|
|
10
|
+
[key: string]: ParticipantLayout | StopStream | RequestKeyFrame;
|
|
11
|
+
}): ArrayBuffer;
|
|
12
|
+
private writeLayout;
|
|
13
|
+
private writeStreamDesc;
|
|
14
|
+
serializePerfStatReport(sequenceNumber: number, report: PerfStatReport): ArrayBuffer;
|
|
15
|
+
serializeSharingStatReport(sequenceNumber: number, report: SharingStatReport): ArrayBuffer;
|
|
16
|
+
deserializeCommandResponse(data: BufferSource | Blob): Promise<SignalingMessage | undefined>;
|
|
17
|
+
private deserializeUpdateDisplayLayoutResponse;
|
|
18
|
+
private deserializeReportPerfStatResponse;
|
|
19
|
+
}
|
|
@@ -4,6 +4,7 @@ export default interface IEncoder {
|
|
|
4
4
|
requestFrame(keyFrame: boolean): void;
|
|
5
5
|
isVP9(): boolean;
|
|
6
6
|
destroy(): void;
|
|
7
|
+
setBitrate(bitrate: number, useCbr: boolean): void;
|
|
7
8
|
}
|
|
8
9
|
export interface FrameMessage {
|
|
9
10
|
type: MessageType;
|
|
@@ -12,4 +13,6 @@ export interface FrameMessage {
|
|
|
12
13
|
duration?: number;
|
|
13
14
|
data?: ArrayBuffer;
|
|
14
15
|
error?: string;
|
|
16
|
+
width?: number;
|
|
17
|
+
height?: number;
|
|
15
18
|
}
|
|
@@ -4,6 +4,8 @@ import WorkerBase from './WorkerBase';
|
|
|
4
4
|
export default class LibVPxEncoder extends WorkerBase implements IEncoder {
|
|
5
5
|
private readonly _sourceTrack;
|
|
6
6
|
private readonly _onFrame;
|
|
7
|
+
private readonly _useCongestionControl;
|
|
8
|
+
private readonly _maxBitrate;
|
|
7
9
|
private readonly _useImageCapture;
|
|
8
10
|
private _video;
|
|
9
11
|
private _imageCapture;
|
|
@@ -13,7 +15,7 @@ export default class LibVPxEncoder extends WorkerBase implements IEncoder {
|
|
|
13
15
|
private _track;
|
|
14
16
|
private _frameReadTimeout;
|
|
15
17
|
private _lastFrame;
|
|
16
|
-
constructor(sourceTrack: MediaStreamTrack, onFrame: OnFrameCallback);
|
|
18
|
+
constructor(sourceTrack: MediaStreamTrack, onFrame: OnFrameCallback, useCongestionControl: boolean, maxBitrate: number);
|
|
17
19
|
private _createDom;
|
|
18
20
|
private _removeDom;
|
|
19
21
|
private _createStream;
|
|
@@ -27,6 +29,7 @@ export default class LibVPxEncoder extends WorkerBase implements IEncoder {
|
|
|
27
29
|
private _requestFrameVideo;
|
|
28
30
|
private _requestFrameBitmap;
|
|
29
31
|
requestFrame(keyFrame?: boolean): void;
|
|
32
|
+
setBitrate(bitrate: number, useCbr?: boolean): void;
|
|
30
33
|
isVP9(): boolean;
|
|
31
34
|
destroy(): void;
|
|
32
35
|
static isBrowserSupported(): boolean;
|
package/classes/codec/Types.d.ts
CHANGED
|
@@ -6,9 +6,14 @@ export declare const enum MessageType {
|
|
|
6
6
|
INIT = "init",
|
|
7
7
|
READY = "ready",
|
|
8
8
|
FRAME = "frame",
|
|
9
|
+
SET_BITRATE = "set_bitrate",
|
|
9
10
|
ERROR = "error",
|
|
10
11
|
DEBUG = "debug",
|
|
11
12
|
LOG_ERROR = "log_error"
|
|
12
13
|
}
|
|
13
|
-
export declare type EncodedVideoFrame = Pick<EncodedVideoChunk, 'type' | 'timestamp' | 'duration' | 'byteLength' | 'data'
|
|
14
|
+
export declare type EncodedVideoFrame = Pick<EncodedVideoChunk, 'type' | 'timestamp' | 'duration' | 'byteLength' | 'data'> & {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
14
18
|
export declare type OnFrameCallback = (chunk: EncodedVideoFrame | null, error?: string) => void;
|
|
19
|
+
export declare type OnCongestionCallback = (bitrate: number, useCbr: boolean) => void;
|
|
@@ -5,9 +5,12 @@ export default class WebCodecsEncoder extends WorkerBase implements IEncoder {
|
|
|
5
5
|
private readonly _sourceTrack;
|
|
6
6
|
private readonly _trackProcessor;
|
|
7
7
|
private readonly _onFrame;
|
|
8
|
-
|
|
8
|
+
private readonly _useCongestionControl;
|
|
9
|
+
private readonly _maxBitrate;
|
|
10
|
+
constructor(sourceTrack: MediaStreamTrack, onFrame: OnFrameCallback, useCongestionControl: boolean, maxBitrate: number);
|
|
9
11
|
init(): Promise<void>;
|
|
10
12
|
requestFrame(keyFrame?: boolean): void;
|
|
13
|
+
setBitrate(bitrate: number, useCbr: boolean): void;
|
|
11
14
|
isVP9(): boolean;
|
|
12
15
|
destroy(): void;
|
|
13
16
|
static isBrowserSupported(): boolean;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
declare type HistoryRecord = {
|
|
2
|
+
seq: number;
|
|
3
|
+
ts: number;
|
|
4
|
+
size: number;
|
|
5
|
+
sent: number;
|
|
6
|
+
start: boolean;
|
|
7
|
+
end: boolean;
|
|
8
|
+
ts2: number;
|
|
9
|
+
recv: number;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Class calculates server bitrate and delay, based on server cc feedback
|
|
13
|
+
* Ring buffer to keep sent packets info (HistoryRecord)
|
|
14
|
+
* Packet info is updated when cc feedback is received from server
|
|
15
|
+
*/
|
|
16
|
+
export default class PacketHistory {
|
|
17
|
+
private readonly _maxSize;
|
|
18
|
+
private _size;
|
|
19
|
+
private readonly _buffer;
|
|
20
|
+
private _head;
|
|
21
|
+
private _tail;
|
|
22
|
+
constructor(maxSize: number);
|
|
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;
|
|
26
|
+
getServerBitrateK(windowMs: number): number;
|
|
27
|
+
getCurrentDelay(): number;
|
|
28
|
+
getMaxBandwidth(): number;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
+
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
1
2
|
export default class ScreenCaptureSender {
|
|
2
3
|
private readonly _encoder;
|
|
3
4
|
private readonly _datachannel;
|
|
4
|
-
private readonly
|
|
5
|
+
private readonly _signaling;
|
|
5
6
|
private _destroyed;
|
|
6
7
|
private _needKeyframe;
|
|
7
|
-
|
|
8
|
+
private readonly DATA_SIZE;
|
|
9
|
+
private _congestionControl;
|
|
10
|
+
private _frameNum;
|
|
11
|
+
private _width;
|
|
12
|
+
private _height;
|
|
13
|
+
private _feedback;
|
|
14
|
+
private _lastSharingStat;
|
|
15
|
+
private _congestionControlEnabled;
|
|
16
|
+
constructor(track: MediaStreamTrack, datachannel: RTCDataChannel, signaling: BaseSignaling);
|
|
8
17
|
private _requestFrame;
|
|
9
18
|
private _wrapHeader;
|
|
10
19
|
private _stopPacket;
|
|
@@ -12,4 +21,9 @@ export default class ScreenCaptureSender {
|
|
|
12
21
|
private _sendChunk;
|
|
13
22
|
destroy(): void;
|
|
14
23
|
static isBrowserSupported(): boolean;
|
|
24
|
+
private _onCongestionCallback;
|
|
25
|
+
private _onResize;
|
|
26
|
+
private _calcMinMaxBitrate;
|
|
27
|
+
private _checkCcFeedback;
|
|
28
|
+
private _sendSharingStat;
|
|
15
29
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { OnCongestionCallback } from '../codec/Types';
|
|
2
|
+
import { SharingStatReport } from './SharingStatReport';
|
|
3
|
+
export default class ScreenCongestionControl {
|
|
4
|
+
private readonly _onCongestion;
|
|
5
|
+
private readonly _ccEnabled;
|
|
6
|
+
private _minBitrate;
|
|
7
|
+
private _maxBitrate;
|
|
8
|
+
private _targetBitrate;
|
|
9
|
+
private _lastDown;
|
|
10
|
+
private _lastUp;
|
|
11
|
+
private _lastProbing;
|
|
12
|
+
private _lastCheckDelay;
|
|
13
|
+
private _upPenalty;
|
|
14
|
+
private _probing;
|
|
15
|
+
private _delayAvgShort;
|
|
16
|
+
private _delayAvgLong;
|
|
17
|
+
private _minDelay;
|
|
18
|
+
private _maxDelay;
|
|
19
|
+
private _largeDelayDuration;
|
|
20
|
+
constructor(onCongestion: OnCongestionCallback, minBitrate: number, maxBitrate: number, ccEnabled: boolean);
|
|
21
|
+
checkDelay(frameNum: number, delay: number, bitrateK: number): void;
|
|
22
|
+
private _calcDelay;
|
|
23
|
+
reconfigure(minBitrate: number, maxBitrate: number): void;
|
|
24
|
+
getStat(): SharingStatReport;
|
|
25
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const HEADER_SIZE = 11;
|
|
1
2
|
export interface FrameChunkHeader {
|
|
2
3
|
timestamp: number;
|
|
3
4
|
start: boolean;
|
|
@@ -14,3 +15,8 @@ export interface FrameChunk extends FrameChunkHeader {
|
|
|
14
15
|
export declare function wrapHeader(timestamp: number, start: boolean, end: boolean, keyframe: boolean, sequence: number, isVP9: boolean, data: ArrayBuffer | null): ArrayBuffer;
|
|
15
16
|
export declare function parseChunk(data: ArrayBuffer): FrameChunk;
|
|
16
17
|
export declare function isKeyframeRequested(data?: ArrayBuffer): boolean;
|
|
18
|
+
export interface CcFeedback {
|
|
19
|
+
seq: number;
|
|
20
|
+
ts2: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function parseCcFeedback(data?: ArrayBuffer): CcFeedback;
|
|
@@ -33,6 +33,7 @@ export default class ServerTransport extends EventEmitter {
|
|
|
33
33
|
private _disabledSenders;
|
|
34
34
|
private _rtpReceiversByStreamId;
|
|
35
35
|
private _producerSessionId;
|
|
36
|
+
private _newAudioShareTrack;
|
|
36
37
|
constructor(signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings);
|
|
37
38
|
getState(): TransportState;
|
|
38
39
|
updateStatisticsInterval(): void;
|
|
@@ -68,6 +69,7 @@ export default class ServerTransport extends EventEmitter {
|
|
|
68
69
|
private _detectStaleTracks;
|
|
69
70
|
private _allocateConsumer;
|
|
70
71
|
private _acceptProducer;
|
|
72
|
+
private handleTracks;
|
|
71
73
|
_onSignalingNotification(message: SignalingMessage): Promise<void>;
|
|
72
74
|
private _onProducerUpdated;
|
|
73
75
|
private _onAddTrack;
|
package/default/Api.d.ts
CHANGED
|
@@ -16,8 +16,13 @@ export default class Api extends BaseApi {
|
|
|
16
16
|
log(items: LogItem[]): void;
|
|
17
17
|
init(): void;
|
|
18
18
|
joinConversation(conversationId: string, isVideo?: boolean, chatId?: string): Promise<ConversationResponse>;
|
|
19
|
-
createConversation(conversationId: string, payload?: string, requireAuthToJoin?: boolean
|
|
20
|
-
|
|
19
|
+
createConversation(conversationId: string, payload?: string, requireAuthToJoin?: boolean, { onlyAdminCanShareMovie }?: {
|
|
20
|
+
onlyAdminCanShareMovie?: boolean;
|
|
21
|
+
}): Promise<ConversationResponse>;
|
|
22
|
+
startConversation(conversationId: string, ids?: OkUserId[], type?: CallType, isVideo?: boolean, payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean, { onlyAdminCanShareMovie }?: {
|
|
23
|
+
onlyAdminCanShareMovie?: boolean;
|
|
24
|
+
}): Promise<ConversationResponse>;
|
|
25
|
+
private _preareStartConversationData;
|
|
21
26
|
private _startConversation;
|
|
22
27
|
createJoinLink(conversationId: string): Promise<{
|
|
23
28
|
join_link: string;
|
|
@@ -26,7 +31,7 @@ export default class Api extends BaseApi {
|
|
|
26
31
|
success: boolean;
|
|
27
32
|
}>;
|
|
28
33
|
getAnonymTokenByLink(joinLink: string, username?: string): Promise<string>;
|
|
29
|
-
joinConversationByLink(joinLink: string, isVideo?: boolean, observedIds?: ExternalUserId[]): Promise<ConversationResponse>;
|
|
34
|
+
joinConversationByLink(joinLink: string, isVideo?: boolean, observedIds?: ExternalUserId[], payload?: string): Promise<ConversationResponse>;
|
|
30
35
|
/**
|
|
31
36
|
* NB: Не сохраняет порядок возвращаемых ID
|
|
32
37
|
* @hidden
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/default/Signaling.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import BaseSignaling, { AddParticipantParams } from '../abstract/BaseSignaling';
|
|
|
2
2
|
import { ParticipantIdRegistry } from '../classes/ParticipantIdRegistry';
|
|
3
3
|
import { PerfStatReport } from '../classes/transport/PerfStatReporter';
|
|
4
4
|
import { TransportTopology } from '../classes/transport/Transport';
|
|
5
|
+
import ConversationFeature from '../enums/ConversationFeature';
|
|
5
6
|
import ConversationOption from '../enums/ConversationOption';
|
|
6
7
|
import MediaOption from '../enums/MediaOption';
|
|
7
8
|
import RecordRole from '../enums/RecordRole';
|
|
@@ -11,11 +12,14 @@ import UserRole from '../enums/UserRole';
|
|
|
11
12
|
import { JSONObject } from '../static/Json';
|
|
12
13
|
import MediaModifiers from '../types/MediaModifiers';
|
|
13
14
|
import MediaSettings from '../types/MediaSettings';
|
|
15
|
+
import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
|
|
14
16
|
import MuteStates from '../types/MuteStates';
|
|
15
17
|
import { CompositeUserId, ParticipantId } from '../types/Participant';
|
|
18
|
+
import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
|
|
16
19
|
import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
|
|
17
20
|
import SignalingMessage from '../types/SignalingMessage';
|
|
18
21
|
import { WaitingParticipantId } from '../types/WaitingHall';
|
|
22
|
+
import { SharingStatReport } from '../classes/screenshare/SharingStatReport';
|
|
19
23
|
export default class Signaling extends BaseSignaling {
|
|
20
24
|
private socket;
|
|
21
25
|
protected sequence: number;
|
|
@@ -39,6 +43,8 @@ export default class Signaling extends BaseSignaling {
|
|
|
39
43
|
private participantIdRegistry;
|
|
40
44
|
private producerNotificationDataChannel;
|
|
41
45
|
private producerCommandDataChannel;
|
|
46
|
+
private producerCommandDataChannelEnabled;
|
|
47
|
+
private producerCommandSerializationService;
|
|
42
48
|
private static readonly RECONNECT_DELAY;
|
|
43
49
|
private static readonly RECONNECT_MAX_DELAY;
|
|
44
50
|
private static readonly RECONNECT_MAX_COUNT;
|
|
@@ -52,6 +58,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
52
58
|
setParticipantIdRegistry(participantIdRegistry: ParticipantIdRegistry): void;
|
|
53
59
|
setProducerNotificationDataChannel(dataChannel: RTCDataChannel): void;
|
|
54
60
|
setProducerCommandDataChannel(dataChannel: RTCDataChannel): void;
|
|
61
|
+
useCommandDataChannel(status: boolean): void;
|
|
55
62
|
/**
|
|
56
63
|
* Free used resources
|
|
57
64
|
*/
|
|
@@ -89,24 +96,30 @@ export default class Signaling extends BaseSignaling {
|
|
|
89
96
|
changePriorities(priorities: {
|
|
90
97
|
[key: string]: number;
|
|
91
98
|
}): Promise<SignalingMessage | void>;
|
|
92
|
-
updateDisplayLayout(
|
|
93
|
-
[
|
|
99
|
+
updateDisplayLayout(layouts: {
|
|
100
|
+
[streamDesc: string]: ParticipantLayout | StopStream | RequestKeyFrame;
|
|
94
101
|
}): Promise<SignalingMessage>;
|
|
95
|
-
addMovie(data:
|
|
96
|
-
updateMovie(data:
|
|
102
|
+
addMovie(data: IAddMovieParams): Promise<SignalingMessage>;
|
|
103
|
+
updateMovie(data: IUpdateMovieData): Promise<SignalingMessage>;
|
|
97
104
|
removeMovie(data: any): Promise<SignalingMessage>;
|
|
105
|
+
updateRooms(rooms: SignalingMessage.Room[], assignRandomly: boolean): Promise<SignalingMessage>;
|
|
106
|
+
activateRooms(roomIds: number[], deactivate: boolean): Promise<SignalingMessage>;
|
|
107
|
+
switchRoom(toRoomId?: number, participantId?: ParticipantId): Promise<SignalingMessage>;
|
|
108
|
+
removeRooms(roomIds: number[]): Promise<SignalingMessage>;
|
|
98
109
|
startStream(data: any): Promise<SignalingMessage>;
|
|
99
|
-
stopStream(): Promise<SignalingMessage>;
|
|
110
|
+
stopStream(data: any): Promise<SignalingMessage>;
|
|
100
111
|
recordSetRole(participantId: ParticipantId, role: RecordRole | null): Promise<SignalingMessage>;
|
|
101
112
|
getRecordStatus(): Promise<SignalingMessage>;
|
|
102
113
|
switchTopology(topology: TransportTopology, force?: boolean): Promise<SignalingMessage>;
|
|
103
114
|
requestRealloc(): Promise<SignalingMessage>;
|
|
104
115
|
reportPerfStat(report: PerfStatReport): Promise<SignalingMessage>;
|
|
116
|
+
reportSharingStat(report: SharingStatReport): Promise<SignalingMessage>;
|
|
105
117
|
chatMessage(message: string, participantId?: CompositeUserId | null): Promise<SignalingMessage>;
|
|
106
118
|
chatHistory(count: number): Promise<SignalingMessage>;
|
|
107
119
|
customData(data: JSONObject, participantId: ParticipantId | null): Promise<SignalingMessage>;
|
|
108
120
|
grantRoles(participantId: CompositeUserId, roles: UserRole[], revoke: boolean): Promise<SignalingMessage>;
|
|
109
121
|
muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia: MediaOption[]): Promise<SignalingMessage>;
|
|
122
|
+
enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<SignalingMessage>;
|
|
110
123
|
pinParticipant(participantId: ParticipantId, unpin: boolean): Promise<SignalingMessage>;
|
|
111
124
|
updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<SignalingMessage>;
|
|
112
125
|
changeOptions(changes: {
|
|
@@ -114,6 +127,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
114
127
|
}): Promise<SignalingMessage>;
|
|
115
128
|
getWaitingHall(fromId?: WaitingParticipantId | null, count?: number, backward?: boolean): Promise<SignalingMessage>;
|
|
116
129
|
promoteParticipant(participantId: CompositeUserId, demote?: boolean): Promise<SignalingMessage>;
|
|
130
|
+
feedback(key: string): Promise<SignalingMessage>;
|
|
117
131
|
/**
|
|
118
132
|
* Close a connection with a signaling server
|
|
119
133
|
*/
|
|
@@ -127,6 +141,8 @@ export default class Signaling extends BaseSignaling {
|
|
|
127
141
|
readyToSend(): void;
|
|
128
142
|
getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<SignalingMessage>;
|
|
129
143
|
getParticipants(externalIds: SignalingMessage.ExternalId[]): Promise<SignalingMessage>;
|
|
144
|
+
startAsr(): Promise<SignalingMessage>;
|
|
145
|
+
stopAsr(): Promise<SignalingMessage>;
|
|
130
146
|
protected _connect(connectionType: SignalingConnectionType): void;
|
|
131
147
|
protected _disconnect(): void;
|
|
132
148
|
private _onOpen;
|
|
@@ -140,6 +156,9 @@ export default class Signaling extends BaseSignaling {
|
|
|
140
156
|
protected _reconnect(): void;
|
|
141
157
|
private _handleCommandResponse;
|
|
142
158
|
private _handleCommandsQueue;
|
|
159
|
+
private _serializeBinary;
|
|
160
|
+
private _serializeJson;
|
|
161
|
+
private _convertDisplayLayout;
|
|
143
162
|
protected _waitConnectionMessage(): void;
|
|
144
163
|
protected _stopWaitConnectionMessage(): void;
|
|
145
164
|
private _startDoctor;
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
declare enum ConversationOption {
|
|
5
5
|
REQUIRE_AUTH_TO_JOIN = "REQUIRE_AUTH_TO_JOIN",
|
|
6
6
|
AUDIENCE_MODE = "AUDIENCE_MODE",
|
|
7
|
-
WAITING_HALL = "WAITING_HALL"
|
|
7
|
+
WAITING_HALL = "WAITING_HALL",
|
|
8
|
+
ASR = "ASR",
|
|
9
|
+
FEEDBACK = "FEEDBACK"
|
|
8
10
|
}
|
|
9
11
|
export default ConversationOption;
|
|
10
12
|
export declare function compareOptions(oldOptions: ConversationOption[], newOptions: ConversationOption[]): boolean;
|
package/enums/HangupType.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ declare enum HangupType {
|
|
|
16
16
|
CALLER_IS_BLOCKED = "CALLER_IS_BLOCKED",
|
|
17
17
|
NOT_FRIENDS = "NOT_FRIENDS",
|
|
18
18
|
CALLEE_IS_OFFLINE = "CALLEE_IS_OFFLINE",
|
|
19
|
+
CALLER_IS_REJECTED = "CALLER_IS_REJECTED",
|
|
19
20
|
UNKNOWN_ERROR = "UNKNOWN_ERROR",
|
|
20
21
|
UNSUPPORTED = "UNSUPPORTED",
|
|
21
22
|
OLD_VERSION = "OLD_VERSION",
|
|
@@ -23,6 +24,7 @@ declare enum HangupType {
|
|
|
23
24
|
EXTERNAL_API_ERROR = "EXTERNAL_API_ERROR",
|
|
24
25
|
SOCKET_CLOSED = "SOCKET_CLOSED",
|
|
25
26
|
ENDED = "ENDED",
|
|
26
|
-
KILLED_WITHOUT_DELETE = "KILLED_WITHOUT_DELETE"
|
|
27
|
+
KILLED_WITHOUT_DELETE = "KILLED_WITHOUT_DELETE",
|
|
28
|
+
ANOTHER_DEVICE = "ANOTHER_DEVICE"
|
|
27
29
|
}
|
|
28
30
|
export default HangupType;
|
package/enums/MediaOption.d.ts
CHANGED