@vkontakte/calls-sdk 2.6.2-dev.f64ca50.0 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CallsSDK.d.ts +68 -11
- package/abstract/BaseApi.d.ts +7 -3
- package/abstract/BaseSignaling.d.ts +14 -2
- package/calls-sdk.cjs.js +8 -8
- package/calls-sdk.esm.js +8 -8
- package/classes/Conversation.d.ts +38 -5
- 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 +16 -1
- 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 -1
- package/default/Api.d.ts +8 -3
- package/default/Api.test.d.ts +1 -0
- package/default/Signaling.d.ts +14 -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 +12 -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 +124 -9
- package/static/Polyfills.d.ts +7 -0
- package/static/Utils.d.ts +6 -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 +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/MediaSettings.d.ts +5 -1
- package/types/MovieShare.d.ts +60 -0
- package/types/Participant.d.ts +2 -0
- package/types/ParticipantListChunk.d.ts +2 -0
- package/types/ParticipantStreamDescription.d.ts +2 -1
- package/types/Room.d.ts +60 -0
- package/types/SignalingMessage.d.ts +63 -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,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,19 +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
217
|
private _onParticipantSourcesUpdate;
|
|
207
218
|
private _onParticipantPromoted;
|
|
208
219
|
private _onChatRoomUpdated;
|
|
220
|
+
private _onSharedMovieUpdate;
|
|
221
|
+
private _onSharedMovieInfoStarted;
|
|
222
|
+
private _processSharedMovieInfos;
|
|
223
|
+
private _processSharedMovieInfo;
|
|
224
|
+
private _processConnectionSharedMovieInfo;
|
|
225
|
+
private _onSharedMovieInfoStopped;
|
|
226
|
+
private _onFeaturesPerRoleChanged;
|
|
209
227
|
private _waitForStreamIfNeeded;
|
|
210
228
|
private _matchStreamDescription;
|
|
211
229
|
private _getWaitingTime;
|
|
212
230
|
private _isCallAdmin;
|
|
213
231
|
private _checkAdminRole;
|
|
214
232
|
grantRoles(participantId: CompositeUserId, roles: UserRole[], revoke: boolean): Promise<void>;
|
|
233
|
+
startAsr(): Promise<void>;
|
|
234
|
+
stopAsr(): Promise<void>;
|
|
215
235
|
muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia?: MediaOption[]): Promise<void>;
|
|
236
|
+
enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<void>;
|
|
216
237
|
pinParticipant(participantId: ParticipantId, unpin: boolean): Promise<void>;
|
|
217
238
|
updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<void>;
|
|
218
239
|
changeOptions(changes: {
|
|
@@ -229,12 +250,16 @@ export default class Conversation extends EventEmitter {
|
|
|
229
250
|
customData(data: JSONObject, participantId?: ParticipantId | null): Promise<void>;
|
|
230
251
|
createJoinLink(): Promise<string>;
|
|
231
252
|
removeJoinLink(): Promise<never>;
|
|
232
|
-
addMovie(movieId:
|
|
253
|
+
addMovie({ movieId, gain, metadata }: IAddMovieParams): Promise<{
|
|
233
254
|
movieId: string;
|
|
234
255
|
streamType: string;
|
|
235
256
|
}>;
|
|
236
|
-
updateMovie(
|
|
257
|
+
updateMovie(params: IUpdateMovieData): Promise<void>;
|
|
237
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>;
|
|
238
263
|
startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null): Promise<SignalingMessage>;
|
|
239
264
|
stopStream(): Promise<SignalingMessage>;
|
|
240
265
|
recordSetRole(participantId: ParticipantId, role: RecordRole | null): Promise<void>;
|
|
@@ -275,6 +300,7 @@ export default class Conversation extends EventEmitter {
|
|
|
275
300
|
private _onChatMessage;
|
|
276
301
|
private _onCustomData;
|
|
277
302
|
private _onRecordInfo;
|
|
303
|
+
private _onAsrInfo;
|
|
278
304
|
private _onRolesChanged;
|
|
279
305
|
/**
|
|
280
306
|
* Клиент должен немедленно выключить микрофон и/или камеру
|
|
@@ -305,6 +331,13 @@ export default class Conversation extends EventEmitter {
|
|
|
305
331
|
private _updateDisplayLayoutFromCache;
|
|
306
332
|
private _setParticipantsStatus;
|
|
307
333
|
private _onJoinLinkChanged;
|
|
334
|
+
private _onRoomsUpdated;
|
|
335
|
+
private _onRoomUpdated;
|
|
336
|
+
private _convertRoomToExternal;
|
|
337
|
+
private _onRoomParticipantsUpdated;
|
|
338
|
+
/** получили из сингналинга сообщение о реакции пользователей */
|
|
339
|
+
private _onFeedback;
|
|
340
|
+
private _isMe;
|
|
308
341
|
}
|
|
309
342
|
export declare class UpdateDisplayLayoutError extends Error {
|
|
310
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 './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,9 +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;
|
|
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);
|
|
7
17
|
private _requestFrame;
|
|
8
18
|
private _wrapHeader;
|
|
9
19
|
private _stopPacket;
|
|
@@ -11,4 +21,9 @@ export default class ScreenCaptureSender {
|
|
|
11
21
|
private _sendChunk;
|
|
12
22
|
destroy(): void;
|
|
13
23
|
static isBrowserSupported(): boolean;
|
|
24
|
+
private _onCongestionCallback;
|
|
25
|
+
private _onResize;
|
|
26
|
+
private _calcMinMaxBitrate;
|
|
27
|
+
private _checkCcFeedback;
|
|
28
|
+
private _sendSharingStat;
|
|
14
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,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,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,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,9 +99,13 @@ 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
110
|
stopStream(): Promise<SignalingMessage>;
|
|
104
111
|
recordSetRole(participantId: ParticipantId, role: RecordRole | null): Promise<SignalingMessage>;
|
|
@@ -106,11 +113,13 @@ export default class Signaling extends BaseSignaling {
|
|
|
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
121
|
muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia: MediaOption[]): 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: {
|
|
@@ -118,6 +127,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
118
127
|
}): Promise<SignalingMessage>;
|
|
119
128
|
getWaitingHall(fromId?: WaitingParticipantId | null, count?: number, backward?: boolean): Promise<SignalingMessage>;
|
|
120
129
|
promoteParticipant(participantId: CompositeUserId, demote?: boolean): Promise<SignalingMessage>;
|
|
130
|
+
feedback(key: string): Promise<SignalingMessage>;
|
|
121
131
|
/**
|
|
122
132
|
* Close a connection with a signaling server
|
|
123
133
|
*/
|
|
@@ -131,6 +141,8 @@ export default class Signaling extends BaseSignaling {
|
|
|
131
141
|
readyToSend(): void;
|
|
132
142
|
getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<SignalingMessage>;
|
|
133
143
|
getParticipants(externalIds: SignalingMessage.ExternalId[]): Promise<SignalingMessage>;
|
|
144
|
+
startAsr(): Promise<SignalingMessage>;
|
|
145
|
+
stopAsr(): Promise<SignalingMessage>;
|
|
134
146
|
protected _connect(connectionType: SignalingConnectionType): void;
|
|
135
147
|
protected _disconnect(): void;
|
|
136
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;
|
|
@@ -35,6 +35,17 @@ declare enum SignalingNotification {
|
|
|
35
35
|
PROMOTE_PARTICIPANT = "promote-participant",
|
|
36
36
|
CHAT_ROOM_UPDATED = "chat-room-updated",
|
|
37
37
|
PROMOTION_APPROVED = "promotion-approved",
|
|
38
|
-
JOIN_LINK_CHANGED = "join-link-changed"
|
|
38
|
+
JOIN_LINK_CHANGED = "join-link-changed",
|
|
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"
|
|
39
50
|
}
|
|
40
51
|
export default SignalingNotification;
|