@vkontakte/calls-sdk 2.6.2-dev.c83d2bc.0 → 2.6.2-dev.c8d6e43.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 +76 -16
- package/abstract/BaseApi.d.ts +7 -3
- package/abstract/BaseSignaling.d.ts +16 -5
- package/calls-sdk.cjs.js +8 -8
- package/calls-sdk.esm.js +8 -8
- package/classes/Conversation.d.ts +37 -9
- package/classes/MediaSource.d.ts +7 -2
- package/classes/ProducerCommandSerializationService.d.ts +2 -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 +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 -1
- package/default/Api.d.ts +7 -3
- package/default/Signaling.d.ts +16 -5
- package/enums/ConversationFeature.d.ts +2 -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 +11 -1
- package/enums/SignalingNotification.d.ts +11 -1
- package/package.json +1 -1
- package/static/External.d.ts +93 -6
- package/static/Params.d.ts +97 -9
- package/static/Polyfills.d.ts +7 -0
- package/static/Utils.d.ts +2 -1
- package/static/WebRTCUtils.d.ts +44 -11
- package/static/WebRTCUtils.test.d.ts +1 -0
- package/types/Asr.d.ts +5 -0
- package/types/Conversation.d.ts +1 -0
- package/types/ConversationFeature.d.ts +3 -0
- package/types/ConversationParams.d.ts +1 -0
- package/types/ExternalId.d.ts +2 -0
- package/types/MediaSettings.d.ts +5 -1
- package/types/MovieShare.d.ts +58 -0
- package/types/Participant.d.ts +3 -0
- package/types/ParticipantListChunk.d.ts +2 -0
- package/types/ParticipantStreamDescription.d.ts +2 -1
- package/types/Room.d.ts +77 -0
- package/types/SignalingMessage.d.ts +62 -0
- package/types/WaitingHall.d.ts +2 -8
- package/utils/ArrayDequeue.d.ts +24 -0
- package/utils/ArrayDequeue.spec.d.ts +1 -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>;
|
|
@@ -157,7 +164,6 @@ export default class Conversation extends EventEmitter {
|
|
|
157
164
|
private _registerParticipants;
|
|
158
165
|
/** Установим состояние локальных мьютов */
|
|
159
166
|
private _registerParticipantLocalMuteState;
|
|
160
|
-
private _getClientType;
|
|
161
167
|
private _getStatusByTransportState;
|
|
162
168
|
private _registerParticipantInCache;
|
|
163
169
|
private _getExistedParticipantByIdOrCreate;
|
|
@@ -191,7 +197,7 @@ export default class Conversation extends EventEmitter {
|
|
|
191
197
|
private _onAddParticipant;
|
|
192
198
|
private _onRemoveParticipant;
|
|
193
199
|
changeDevice(kind: MediaDeviceKind): Promise<void>;
|
|
194
|
-
toggleScreenCapturing(
|
|
200
|
+
toggleScreenCapturing(screenEnabled: boolean, audioShareEnabled: boolean): Promise<void>;
|
|
195
201
|
setVideoStream(stream: MediaStream, isScreen?: boolean): Promise<void>;
|
|
196
202
|
setAudioStream(stream: MediaStream): Promise<void>;
|
|
197
203
|
toggleLocalVideo(enabled: boolean): Promise<void>;
|
|
@@ -203,6 +209,7 @@ export default class Conversation extends EventEmitter {
|
|
|
203
209
|
requestKeyFrame(participantStreamDescription: ParticipantStreamDescription): Promise<void | SignalingMessage>;
|
|
204
210
|
requestTestMode(consumerCommand: string, producerCommand: string): Promise<void>;
|
|
205
211
|
updateDisplayLayout(layouts: ParticipantLayout[]): Promise<void>;
|
|
212
|
+
/** @async */
|
|
206
213
|
feedback(key: string): Promise<SignalingMessage>;
|
|
207
214
|
private _stopStreaming;
|
|
208
215
|
private _sendUpdateDisplayLayout;
|
|
@@ -210,13 +217,23 @@ export default class Conversation extends EventEmitter {
|
|
|
210
217
|
private _onParticipantSourcesUpdate;
|
|
211
218
|
private _onParticipantPromoted;
|
|
212
219
|
private _onChatRoomUpdated;
|
|
220
|
+
private _onSharedMovieUpdate;
|
|
221
|
+
private _onSharedMovieInfoStarted;
|
|
222
|
+
private _processSharedMovieInfos;
|
|
223
|
+
private _processSharedMovieInfo;
|
|
224
|
+
private _processConnectionSharedMovieInfo;
|
|
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>;
|
|
219
|
-
|
|
233
|
+
startAsr(): Promise<void>;
|
|
234
|
+
stopAsr(): Promise<void>;
|
|
235
|
+
muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia?: MediaOption[], roomId?: number): 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,15 +250,19 @@ 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:
|
|
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>;
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
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>;
|
|
265
|
+
recordSetRole(participantId: ParticipantId, role: RecordRole | null, roomId?: number | null): Promise<void>;
|
|
245
266
|
getStreamInfo(): Promise<{
|
|
246
267
|
movieId: any;
|
|
247
268
|
preview: any;
|
|
@@ -279,11 +300,13 @@ 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
|
* Клиент должен немедленно выключить микрофон и/или камеру
|
|
285
307
|
*/
|
|
286
308
|
private _onMuteParticipant;
|
|
309
|
+
applyMuteStates(muteStates: MuteStates, mediaOptions: MediaOption[], roomId?: number): Promise<void>;
|
|
287
310
|
private _processMuteState;
|
|
288
311
|
private _onPinParticipant;
|
|
289
312
|
private _onOptionsChanged;
|
|
@@ -309,8 +332,13 @@ export default class Conversation extends EventEmitter {
|
|
|
309
332
|
private _updateDisplayLayoutFromCache;
|
|
310
333
|
private _setParticipantsStatus;
|
|
311
334
|
private _onJoinLinkChanged;
|
|
335
|
+
private _onRoomsUpdated;
|
|
336
|
+
private _onRoomUpdated;
|
|
337
|
+
private _convertRoomToExternal;
|
|
338
|
+
private _onRoomParticipantsUpdated;
|
|
312
339
|
/** получили из сингналинга сообщение о реакции пользователей */
|
|
313
340
|
private _onFeedback;
|
|
341
|
+
private _isMe;
|
|
314
342
|
}
|
|
315
343
|
export declare class UpdateDisplayLayoutError extends Error {
|
|
316
344
|
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 './screenshare/SharingStatReport';
|
|
3
4
|
import { ParticipantIdRegistry } from './ParticipantIdRegistry';
|
|
4
5
|
import { PerfStatReport } from './transport/PerfStatReporter';
|
|
5
6
|
export declare class ProducerCommandSerializationService {
|
|
@@ -11,6 +12,7 @@ export declare class ProducerCommandSerializationService {
|
|
|
11
12
|
private writeLayout;
|
|
12
13
|
private writeStreamDesc;
|
|
13
14
|
serializePerfStatReport(sequenceNumber: number, report: PerfStatReport): ArrayBuffer;
|
|
15
|
+
serializeSharingStatReport(sequenceNumber: number, report: SharingStatReport): ArrayBuffer;
|
|
14
16
|
deserializeCommandResponse(data: BufferSource | Blob): Promise<SignalingMessage | undefined>;
|
|
15
17
|
private deserializeUpdateDisplayLayoutResponse;
|
|
16
18
|
private deserializeReportPerfStatResponse;
|
|
@@ -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,12 +69,12 @@ 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;
|
|
74
76
|
static _onSignalingStateChange(pc: RTCPeerConnection, event: any): void;
|
|
75
77
|
private _onConnectionStateChange;
|
|
76
78
|
private _onReplacedTrack;
|
|
77
|
-
private static _isUnifiedPlanSupported;
|
|
78
79
|
getStreamWaitingTimeMs(streamId: string, targetRtpTimestamp: number): number;
|
|
79
80
|
}
|
package/default/Api.d.ts
CHANGED
|
@@ -16,8 +16,12 @@ 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>;
|
|
21
25
|
private _preareStartConversationData;
|
|
22
26
|
private _startConversation;
|
|
23
27
|
createJoinLink(conversationId: string): Promise<{
|
|
@@ -27,7 +31,7 @@ export default class Api extends BaseApi {
|
|
|
27
31
|
success: boolean;
|
|
28
32
|
}>;
|
|
29
33
|
getAnonymTokenByLink(joinLink: string, username?: string): Promise<string>;
|
|
30
|
-
joinConversationByLink(joinLink: string, isVideo?: boolean, observedIds?: ExternalUserId[]): Promise<ConversationResponse>;
|
|
34
|
+
joinConversationByLink(joinLink: string, isVideo?: boolean, observedIds?: ExternalUserId[], payload?: string): Promise<ConversationResponse>;
|
|
31
35
|
/**
|
|
32
36
|
* NB: Не сохраняет порядок возвращаемых ID
|
|
33
37
|
* @hidden
|
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,12 +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';
|
|
16
18
|
import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
|
|
17
19
|
import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
|
|
18
20
|
import SignalingMessage from '../types/SignalingMessage';
|
|
19
21
|
import { WaitingParticipantId } from '../types/WaitingHall';
|
|
22
|
+
import { SharingStatReport } from '../classes/screenshare/SharingStatReport';
|
|
20
23
|
export default class Signaling extends BaseSignaling {
|
|
21
24
|
private socket;
|
|
22
25
|
protected sequence: number;
|
|
@@ -96,21 +99,27 @@ export default class Signaling extends BaseSignaling {
|
|
|
96
99
|
updateDisplayLayout(layouts: {
|
|
97
100
|
[streamDesc: string]: ParticipantLayout | StopStream | RequestKeyFrame;
|
|
98
101
|
}): Promise<SignalingMessage>;
|
|
99
|
-
addMovie(data:
|
|
100
|
-
updateMovie(data:
|
|
102
|
+
addMovie(data: IAddMovieParams): Promise<SignalingMessage>;
|
|
103
|
+
updateMovie(data: IUpdateMovieData): Promise<SignalingMessage>;
|
|
101
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>;
|
|
102
109
|
startStream(data: any): Promise<SignalingMessage>;
|
|
103
|
-
stopStream(): Promise<SignalingMessage>;
|
|
104
|
-
recordSetRole(participantId: ParticipantId, role: RecordRole | null): Promise<SignalingMessage>;
|
|
110
|
+
stopStream(data: any): Promise<SignalingMessage>;
|
|
111
|
+
recordSetRole(participantId: ParticipantId, role: RecordRole | null, roomId: number | null): Promise<SignalingMessage>;
|
|
105
112
|
getRecordStatus(): Promise<SignalingMessage>;
|
|
106
113
|
switchTopology(topology: TransportTopology, force?: boolean): Promise<SignalingMessage>;
|
|
107
114
|
requestRealloc(): Promise<SignalingMessage>;
|
|
108
115
|
reportPerfStat(report: PerfStatReport): Promise<SignalingMessage>;
|
|
116
|
+
reportSharingStat(report: SharingStatReport): Promise<SignalingMessage>;
|
|
109
117
|
chatMessage(message: string, participantId?: CompositeUserId | null): Promise<SignalingMessage>;
|
|
110
118
|
chatHistory(count: number): Promise<SignalingMessage>;
|
|
111
119
|
customData(data: JSONObject, participantId: ParticipantId | null): Promise<SignalingMessage>;
|
|
112
120
|
grantRoles(participantId: CompositeUserId, roles: UserRole[], revoke: boolean): Promise<SignalingMessage>;
|
|
113
|
-
muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia: MediaOption[]): Promise<SignalingMessage>;
|
|
121
|
+
muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia: MediaOption[], roomId?: number): Promise<SignalingMessage>;
|
|
122
|
+
enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<SignalingMessage>;
|
|
114
123
|
pinParticipant(participantId: ParticipantId, unpin: boolean): Promise<SignalingMessage>;
|
|
115
124
|
updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<SignalingMessage>;
|
|
116
125
|
changeOptions(changes: {
|
|
@@ -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;
|
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",
|
|
@@ -35,6 +37,14 @@ declare enum SignalingCommandType {
|
|
|
35
37
|
ADD_MOVIE = "add-movie",
|
|
36
38
|
UPDATE_MOVIE = "update-movie",
|
|
37
39
|
REMOVE_MOVIE = "remove-movie",
|
|
38
|
-
|
|
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"
|
|
39
49
|
}
|
|
40
50
|
export default SignalingCommandType;
|
|
@@ -36,6 +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
|
+
FEEDBACK = "feedback",
|
|
40
|
+
MOVIE_UPDATE_NOTIFICATION = "movie-update-notification",
|
|
41
|
+
MOVIE_SHARE_INFO = "movie-share-info",
|
|
42
|
+
MOVIE_SHARE_STARTED = "movie-share-started",
|
|
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"
|
|
40
50
|
}
|
|
41
51
|
export default SignalingNotification;
|