@vkontakte/calls-sdk 2.6.2-dev.0d61671.0 → 2.6.2-dev.10785ca.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 +66 -13
- package/abstract/BaseApi.d.ts +7 -3
- package/abstract/BaseSignaling.d.ts +13 -2
- package/calls-sdk.cjs.js +8 -8
- package/calls-sdk.esm.js +8 -8
- package/classes/Conversation.d.ts +35 -6
- package/classes/MediaSource.d.ts +7 -2
- package/classes/ProducerCommandSerializationService.d.ts +3 -1
- 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 +15 -1
- package/classes/screenshare/ScreenCongestionControl.d.ts +25 -0
- package/classes/screenshare/SharingStatReport.d.ts +6 -0
- package/classes/screenshare/Utils.d.ts +5 -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 +13 -2
- 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 +8 -1
- package/package.json +1 -1
- package/static/External.d.ts +43 -9
- package/static/Params.d.ts +69 -5
- package/static/Utils.d.ts +3 -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/Feedback.d.ts +22 -0
- package/types/MediaSettings.d.ts +4 -0
- package/types/MovieShare.d.ts +33 -7
- package/types/ParticipantListChunk.d.ts +2 -0
- package/types/ParticipantStreamDescription.d.ts +2 -1
- package/types/Room.d.ts +71 -0
- package/types/SignalingMessage.d.ts +56 -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/worker/LibVPxEncoderWorker.d.ts +1 -1
|
@@ -12,10 +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';
|
|
18
|
-
import { IAddMovieParams } from '../types/MovieShare';
|
|
20
|
+
import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
|
|
19
21
|
import MuteStates from '../types/MuteStates';
|
|
20
22
|
import { CompositeUserId, IGetParticipantsParameters, OkUserId, ParticipantId } from '../types/Participant';
|
|
21
23
|
import { ParticipantLayout } from '../types/ParticipantLayout';
|
|
@@ -38,6 +40,7 @@ export declare type ConversationData = {
|
|
|
38
40
|
*/
|
|
39
41
|
acceptTime: number | null;
|
|
40
42
|
features: ConversationFeature[];
|
|
43
|
+
featuresPerRole?: IFeaturesPerRole | null;
|
|
41
44
|
/**
|
|
42
45
|
* ID звонка
|
|
43
46
|
*/
|
|
@@ -49,6 +52,7 @@ export declare type ConversationData = {
|
|
|
49
52
|
needRate: boolean;
|
|
50
53
|
recordInfo: RecordInfo | null;
|
|
51
54
|
chatId: string | null;
|
|
55
|
+
asrInfo: AsrInfo | null;
|
|
52
56
|
/**
|
|
53
57
|
* Роли пользователя
|
|
54
58
|
*/
|
|
@@ -77,6 +81,7 @@ export default class Conversation extends EventEmitter {
|
|
|
77
81
|
private readonly _signaling;
|
|
78
82
|
private _mediaSource;
|
|
79
83
|
private _conversation;
|
|
84
|
+
private _myLastRequestedLayouts;
|
|
80
85
|
private _state;
|
|
81
86
|
private _participantState;
|
|
82
87
|
private _participants;
|
|
@@ -107,13 +112,14 @@ export default class Conversation extends EventEmitter {
|
|
|
107
112
|
static current(): Conversation | null;
|
|
108
113
|
static hangupAfterInit(): void;
|
|
109
114
|
static id(): string | null;
|
|
110
|
-
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>;
|
|
111
116
|
onJoin(joinArgs: {
|
|
112
117
|
conversationId?: string;
|
|
113
118
|
mediaOptions: MediaOption[];
|
|
114
119
|
chatId?: string;
|
|
115
120
|
joinLink?: string;
|
|
116
121
|
observedIds?: ExternalUserId[];
|
|
122
|
+
payload?: string;
|
|
117
123
|
}): Promise<ConversationData>;
|
|
118
124
|
private _onJoinPart2;
|
|
119
125
|
onPush(conversationId: string, type?: UserType, peerId?: number): Promise<void>;
|
|
@@ -152,10 +158,12 @@ export default class Conversation extends EventEmitter {
|
|
|
152
158
|
private _processConnection;
|
|
153
159
|
private _prepareParticipants;
|
|
154
160
|
private _onConversationParticipantListChunk;
|
|
161
|
+
private _createParticipantListChunk;
|
|
155
162
|
private _participantListChunkToExternalChunk;
|
|
156
163
|
private _registerConnectionParticipants;
|
|
157
164
|
private _registerParticipants;
|
|
158
|
-
|
|
165
|
+
/** Установим состояние локальных мьютов */
|
|
166
|
+
private _registerParticipantLocalMuteState;
|
|
159
167
|
private _getStatusByTransportState;
|
|
160
168
|
private _registerParticipantInCache;
|
|
161
169
|
private _getExistedParticipantByIdOrCreate;
|
|
@@ -189,7 +197,7 @@ export default class Conversation extends EventEmitter {
|
|
|
189
197
|
private _onAddParticipant;
|
|
190
198
|
private _onRemoveParticipant;
|
|
191
199
|
changeDevice(kind: MediaDeviceKind): Promise<void>;
|
|
192
|
-
toggleScreenCapturing(
|
|
200
|
+
toggleScreenCapturing(screenEnabled: boolean, audioShareEnabled: boolean): Promise<void>;
|
|
193
201
|
setVideoStream(stream: MediaStream, isScreen?: boolean): Promise<void>;
|
|
194
202
|
setAudioStream(stream: MediaStream): Promise<void>;
|
|
195
203
|
toggleLocalVideo(enabled: boolean): Promise<void>;
|
|
@@ -201,6 +209,8 @@ export default class Conversation extends EventEmitter {
|
|
|
201
209
|
requestKeyFrame(participantStreamDescription: ParticipantStreamDescription): Promise<void | SignalingMessage>;
|
|
202
210
|
requestTestMode(consumerCommand: string, producerCommand: string): Promise<void>;
|
|
203
211
|
updateDisplayLayout(layouts: ParticipantLayout[]): Promise<void>;
|
|
212
|
+
/** @async */
|
|
213
|
+
feedback(key: string): Promise<SignalingMessage>;
|
|
204
214
|
private _stopStreaming;
|
|
205
215
|
private _sendUpdateDisplayLayout;
|
|
206
216
|
private _cleanupCooldownQueue;
|
|
@@ -209,14 +219,21 @@ export default class Conversation extends EventEmitter {
|
|
|
209
219
|
private _onChatRoomUpdated;
|
|
210
220
|
private _onSharedMovieUpdate;
|
|
211
221
|
private _onSharedMovieInfoStarted;
|
|
222
|
+
private _processSharedMovieInfos;
|
|
223
|
+
private _processSharedMovieInfo;
|
|
224
|
+
private _processConnectionSharedMovieInfo;
|
|
212
225
|
private _onSharedMovieInfoStopped;
|
|
226
|
+
private _onFeaturesPerRoleChanged;
|
|
213
227
|
private _waitForStreamIfNeeded;
|
|
214
228
|
private _matchStreamDescription;
|
|
215
229
|
private _getWaitingTime;
|
|
216
230
|
private _isCallAdmin;
|
|
217
231
|
private _checkAdminRole;
|
|
218
232
|
grantRoles(participantId: CompositeUserId, roles: UserRole[], revoke: boolean): Promise<void>;
|
|
233
|
+
startAsr(): Promise<void>;
|
|
234
|
+
stopAsr(): Promise<void>;
|
|
219
235
|
muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia?: MediaOption[]): Promise<void>;
|
|
236
|
+
enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<void>;
|
|
220
237
|
pinParticipant(participantId: ParticipantId, unpin: boolean): Promise<void>;
|
|
221
238
|
updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<void>;
|
|
222
239
|
changeOptions(changes: {
|
|
@@ -233,12 +250,16 @@ export default class Conversation extends EventEmitter {
|
|
|
233
250
|
customData(data: JSONObject, participantId?: ParticipantId | null): Promise<void>;
|
|
234
251
|
createJoinLink(): Promise<string>;
|
|
235
252
|
removeJoinLink(): Promise<never>;
|
|
236
|
-
addMovie({ movieId, gain }: IAddMovieParams): Promise<{
|
|
253
|
+
addMovie({ movieId, gain, metadata }: IAddMovieParams): Promise<{
|
|
237
254
|
movieId: string;
|
|
238
255
|
streamType: string;
|
|
239
256
|
}>;
|
|
240
|
-
updateMovie(
|
|
257
|
+
updateMovie(params: IUpdateMovieData): Promise<void>;
|
|
241
258
|
removeMovie(movieId: string): Promise<void>;
|
|
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>;
|
|
242
263
|
startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null): Promise<SignalingMessage>;
|
|
243
264
|
stopStream(): Promise<SignalingMessage>;
|
|
244
265
|
recordSetRole(participantId: ParticipantId, role: RecordRole | null): Promise<void>;
|
|
@@ -279,6 +300,7 @@ export default class Conversation extends EventEmitter {
|
|
|
279
300
|
private _onChatMessage;
|
|
280
301
|
private _onCustomData;
|
|
281
302
|
private _onRecordInfo;
|
|
303
|
+
private _onAsrInfo;
|
|
282
304
|
private _onRolesChanged;
|
|
283
305
|
/**
|
|
284
306
|
* Клиент должен немедленно выключить микрофон и/или камеру
|
|
@@ -309,6 +331,13 @@ export default class Conversation extends EventEmitter {
|
|
|
309
331
|
private _updateDisplayLayoutFromCache;
|
|
310
332
|
private _setParticipantsStatus;
|
|
311
333
|
private _onJoinLinkChanged;
|
|
334
|
+
private _onRoomsUpdated;
|
|
335
|
+
private _onRoomUpdated;
|
|
336
|
+
private _convertRoomToExternal;
|
|
337
|
+
private _onRoomParticipantsUpdated;
|
|
338
|
+
/** получили из сингналинга сообщение о реакции пользователей */
|
|
339
|
+
private _onFeedback;
|
|
340
|
+
private _isMe;
|
|
312
341
|
}
|
|
313
342
|
export declare class UpdateDisplayLayoutError extends Error {
|
|
314
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
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
|
|
2
2
|
import SignalingMessage from '../types/SignalingMessage';
|
|
3
|
+
import { SharingStatReport } from '../classes/screenshare/SharingStatReport';
|
|
3
4
|
import { ParticipantIdRegistry } from './ParticipantIdRegistry';
|
|
4
5
|
import { PerfStatReport } from './transport/PerfStatReporter';
|
|
5
6
|
export declare class ProducerCommandSerializationService {
|
|
@@ -11,7 +12,8 @@ export declare class ProducerCommandSerializationService {
|
|
|
11
12
|
private writeLayout;
|
|
12
13
|
private writeStreamDesc;
|
|
13
14
|
serializePerfStatReport(sequenceNumber: number, report: PerfStatReport): ArrayBuffer;
|
|
14
|
-
|
|
15
|
+
serializeSharingStatReport(sequenceNumber: number, report: SharingStatReport): ArrayBuffer;
|
|
16
|
+
deserializeCommandResponse(data: BufferSource | Blob): Promise<SignalingMessage | undefined>;
|
|
15
17
|
private deserializeUpdateDisplayLayoutResponse;
|
|
16
18
|
private deserializeReportPerfStatResponse;
|
|
17
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;
|
|
5
|
+
private readonly _signaling;
|
|
4
6
|
private _destroyed;
|
|
5
7
|
private _needKeyframe;
|
|
6
8
|
private readonly DATA_SIZE;
|
|
7
|
-
|
|
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
|
+
}
|
|
@@ -15,3 +15,8 @@ export interface FrameChunk extends FrameChunkHeader {
|
|
|
15
15
|
export declare function wrapHeader(timestamp: number, start: boolean, end: boolean, keyframe: boolean, sequence: number, isVP9: boolean, data: ArrayBuffer | null): ArrayBuffer;
|
|
16
16
|
export declare function parseChunk(data: ArrayBuffer): FrameChunk;
|
|
17
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,13 +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';
|
|
14
|
-
import { IAddMovieParams,
|
|
15
|
+
import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
|
|
15
16
|
import MuteStates from '../types/MuteStates';
|
|
16
17
|
import { CompositeUserId, ParticipantId } from '../types/Participant';
|
|
17
18
|
import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
|
|
18
19
|
import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
|
|
19
20
|
import SignalingMessage from '../types/SignalingMessage';
|
|
20
21
|
import { WaitingParticipantId } from '../types/WaitingHall';
|
|
22
|
+
import { SharingStatReport } from '../classes/screenshare/SharingStatReport';
|
|
21
23
|
export default class Signaling extends BaseSignaling {
|
|
22
24
|
private socket;
|
|
23
25
|
protected sequence: number;
|
|
@@ -98,8 +100,12 @@ export default class Signaling extends BaseSignaling {
|
|
|
98
100
|
[streamDesc: string]: ParticipantLayout | StopStream | RequestKeyFrame;
|
|
99
101
|
}): Promise<SignalingMessage>;
|
|
100
102
|
addMovie(data: IAddMovieParams): Promise<SignalingMessage>;
|
|
101
|
-
updateMovie(data:
|
|
103
|
+
updateMovie(data: IUpdateMovieData): Promise<SignalingMessage>;
|
|
102
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>;
|
|
103
109
|
startStream(data: any): Promise<SignalingMessage>;
|
|
104
110
|
stopStream(): Promise<SignalingMessage>;
|
|
105
111
|
recordSetRole(participantId: ParticipantId, role: RecordRole | null): Promise<SignalingMessage>;
|
|
@@ -107,11 +113,13 @@ export default class Signaling extends BaseSignaling {
|
|
|
107
113
|
switchTopology(topology: TransportTopology, force?: boolean): Promise<SignalingMessage>;
|
|
108
114
|
requestRealloc(): Promise<SignalingMessage>;
|
|
109
115
|
reportPerfStat(report: PerfStatReport): Promise<SignalingMessage>;
|
|
116
|
+
reportSharingStat(report: SharingStatReport): Promise<SignalingMessage>;
|
|
110
117
|
chatMessage(message: string, participantId?: CompositeUserId | null): Promise<SignalingMessage>;
|
|
111
118
|
chatHistory(count: number): Promise<SignalingMessage>;
|
|
112
119
|
customData(data: JSONObject, participantId: ParticipantId | null): Promise<SignalingMessage>;
|
|
113
120
|
grantRoles(participantId: CompositeUserId, roles: UserRole[], revoke: boolean): Promise<SignalingMessage>;
|
|
114
121
|
muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia: MediaOption[]): Promise<SignalingMessage>;
|
|
122
|
+
enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<SignalingMessage>;
|
|
115
123
|
pinParticipant(participantId: ParticipantId, unpin: boolean): Promise<SignalingMessage>;
|
|
116
124
|
updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<SignalingMessage>;
|
|
117
125
|
changeOptions(changes: {
|
|
@@ -119,6 +127,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
119
127
|
}): Promise<SignalingMessage>;
|
|
120
128
|
getWaitingHall(fromId?: WaitingParticipantId | null, count?: number, backward?: boolean): Promise<SignalingMessage>;
|
|
121
129
|
promoteParticipant(participantId: CompositeUserId, demote?: boolean): Promise<SignalingMessage>;
|
|
130
|
+
feedback(key: string): Promise<SignalingMessage>;
|
|
122
131
|
/**
|
|
123
132
|
* Close a connection with a signaling server
|
|
124
133
|
*/
|
|
@@ -132,6 +141,8 @@ export default class Signaling extends BaseSignaling {
|
|
|
132
141
|
readyToSend(): void;
|
|
133
142
|
getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<SignalingMessage>;
|
|
134
143
|
getParticipants(externalIds: SignalingMessage.ExternalId[]): Promise<SignalingMessage>;
|
|
144
|
+
startAsr(): Promise<SignalingMessage>;
|
|
145
|
+
stopAsr(): Promise<SignalingMessage>;
|
|
135
146
|
protected _connect(connectionType: SignalingConnectionType): void;
|
|
136
147
|
protected _disconnect(): void;
|
|
137
148
|
private _onOpen;
|
|
@@ -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
|
@@ -12,6 +12,7 @@ declare enum SignalingCommandType {
|
|
|
12
12
|
CHANGE_STREAM_PRIORITIES = "change-streams-priorities",
|
|
13
13
|
UPDATE_DISPLAY_LAYOUT = "update-display-layout",
|
|
14
14
|
REPORT_PERF_STAT = "report-perf-stat",
|
|
15
|
+
REPORT_SHARING_STAT = "report-sharing-stat",
|
|
15
16
|
RECORD_START = "record-start",
|
|
16
17
|
RECORD_STOP = "record-stop",
|
|
17
18
|
RECORD_SET_ROLE = "record-set-role",
|
|
@@ -24,6 +25,7 @@ declare enum SignalingCommandType {
|
|
|
24
25
|
CUSTOM_DATA = "custom-data",
|
|
25
26
|
GRANT_ROLES = "grant-roles",
|
|
26
27
|
MUTE_PARTICIPANT = "mute-participant",
|
|
28
|
+
ENABLE_FEATURE_FOR_ROLES = "enable-feature-for-roles",
|
|
27
29
|
PIN_PARTICIPANT = "pin-participant",
|
|
28
30
|
UPDATE_MEDIA_MODIFIERS = "update-media-modifiers",
|
|
29
31
|
CHANGE_OPTIONS = "change-options",
|
|
@@ -34,6 +36,15 @@ declare enum SignalingCommandType {
|
|
|
34
36
|
REQUEST_TEST_MODE = "request-test-mode",
|
|
35
37
|
ADD_MOVIE = "add-movie",
|
|
36
38
|
UPDATE_MOVIE = "update-movie",
|
|
37
|
-
REMOVE_MOVIE = "remove-movie"
|
|
39
|
+
REMOVE_MOVIE = "remove-movie",
|
|
40
|
+
GET_ROOMS = "get_rooms",
|
|
41
|
+
GET_ROOM = "get_room",
|
|
42
|
+
UPDATE_ROOMS = "update-rooms",
|
|
43
|
+
ACTIVATE_ROOMS = "activate-rooms",
|
|
44
|
+
REMOVE_ROOMS = "remove-rooms",
|
|
45
|
+
SWITCH_ROOM = "switch-room",
|
|
46
|
+
FEEDBACK = "feedback",
|
|
47
|
+
ASR_START = "asr-start",
|
|
48
|
+
ASR_STOP = "asr-stop"
|
|
38
49
|
}
|
|
39
50
|
export default SignalingCommandType;
|
|
@@ -36,9 +36,16 @@ declare enum SignalingNotification {
|
|
|
36
36
|
CHAT_ROOM_UPDATED = "chat-room-updated",
|
|
37
37
|
PROMOTION_APPROVED = "promotion-approved",
|
|
38
38
|
JOIN_LINK_CHANGED = "join-link-changed",
|
|
39
|
+
FEEDBACK = "feedback",
|
|
39
40
|
MOVIE_UPDATE_NOTIFICATION = "movie-update-notification",
|
|
40
41
|
MOVIE_SHARE_INFO = "movie-share-info",
|
|
41
42
|
MOVIE_SHARE_STARTED = "movie-share-started",
|
|
42
|
-
MOVIE_SHARE_STOPPED = "movie-share-stopped"
|
|
43
|
+
MOVIE_SHARE_STOPPED = "movie-share-stopped",
|
|
44
|
+
ROOM_UPDATED = "room-updated",
|
|
45
|
+
ROOMS_UPDATED = "rooms-updated",
|
|
46
|
+
ROOM_PARTICIPANTS_UPDATED = "room-participants-updated",
|
|
47
|
+
FEATURES_PER_ROLE_CHANGED = "features-per-role-changed",
|
|
48
|
+
ASR_STARTED = "asr-started",
|
|
49
|
+
ASR_STOPPED = "asr-stopped"
|
|
43
50
|
}
|
|
44
51
|
export default SignalingNotification;
|