@vkontakte/calls-sdk 2.8.6-dev.77dd3c9d.0 → 2.8.6-dev.785c0ce9.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 +23 -8
- package/abstract/BaseApi.d.ts +2 -1
- package/abstract/BaseSignaling.d.ts +7 -3
- package/calls-sdk.cjs.js +8 -8
- package/calls-sdk.esm.js +8 -8
- package/classes/Conversation.d.ts +20 -11
- package/classes/Logger.d.ts +3 -0
- package/classes/MediaSource.d.ts +13 -0
- package/classes/ParticipantIdRegistry.d.ts +1 -0
- package/classes/ProducerCommandSerializationService.d.ts +2 -0
- package/classes/SignalingActor.d.ts +9 -0
- package/classes/codec/IEncoder.d.ts +0 -1
- package/classes/screenshare/BaseStreamBuilder.d.ts +1 -1
- package/classes/stat/CodecStatsAggregator.d.ts +19 -0
- package/classes/stat/EventMetricsService.d.ts +9 -0
- package/classes/transport/ServerTransport.d.ts +8 -0
- package/classes/transport/Statistics.d.ts +23 -10
- package/classes/transport/Transport.d.ts +1 -0
- package/default/Api.d.ts +2 -1
- package/default/Signaling.d.ts +21 -11
- package/enums/ChatRoomEventType.d.ts +1 -1
- package/enums/ConversationOption.d.ts +3 -3
- package/enums/RecordRole.d.ts +1 -1
- package/enums/SignalingCommandType.d.ts +2 -1
- package/enums/SignalingTransportStat.d.ts +17 -0
- package/enums/Stat.d.ts +36 -21
- package/package.json +7 -3
- package/static/ApiTransport.d.ts +1 -1
- package/static/Params.d.ts +59 -9
- package/static/SimulcastInfo.d.ts +13 -0
- package/static/Utils.d.ts +3 -2
- package/static/WebRTCUtils.d.ts +5 -0
- package/types/ChangeSimulcast.d.ts +6 -0
- package/types/Conversation.d.ts +28 -1
- package/types/ConversationParams.d.ts +14 -1
- package/types/ConversationResponse.d.ts +9 -0
- package/types/ExternalId.d.ts +1 -0
- package/types/FastStart.d.ts +46 -0
- package/types/Participant.d.ts +9 -0
- package/types/PerfStatReporter.d.ts +1 -0
- package/types/ServerSettings.d.ts +2 -0
- package/types/SignalingMessage.d.ts +4 -1
- package/types/SimulcastInfo.d.ts +10 -0
- package/types/Statistics.d.ts +158 -4
- package/types/VideoSettings.d.ts +12 -0
- package/types/WebTransport.d.ts +25 -0
- package/utils/LengthPrefixed.d.ts +48 -0
- package/utils/Lz4.d.ts +1 -0
- package/utils/MsgPackerBufferUtils.d.ts +1 -1
- package/utils/VariableLengthInteger.d.ts +18 -0
- package/worker/LibVPxDecoderWorker.d.ts +0 -1
- package/worker/LibVPxEncoderWorker.d.ts +0 -1
- package/worker/WebCodecsDecoderWorker.d.ts +0 -1
- package/worker/WebCodecsEncoderWorker.d.ts +0 -1
|
@@ -3,7 +3,6 @@ import type { RGBTuple } from '@vkontakte/calls-vmoji';
|
|
|
3
3
|
import BaseApi from '../abstract/BaseApi';
|
|
4
4
|
import BaseLogger from '../abstract/BaseLogger';
|
|
5
5
|
import { AddParticipantParams } from '../abstract/BaseSignaling';
|
|
6
|
-
import CallType from '../enums/CallType';
|
|
7
6
|
import ConversationFeature from '../enums/ConversationFeature';
|
|
8
7
|
import ConversationOption from '../enums/ConversationOption';
|
|
9
8
|
import MediaOption from '../enums/MediaOption';
|
|
@@ -13,13 +12,13 @@ import UserType from '../enums/UserType';
|
|
|
13
12
|
import { JSONObject } from '../static/Json';
|
|
14
13
|
import { IAsrStartParams, IAsrStopParams } from '../types/Asr';
|
|
15
14
|
import { AudienceModeHandsResponse } from '../types/AudienceMode';
|
|
16
|
-
import { ConversationData } from '../types/Conversation';
|
|
15
|
+
import { ConversationData, ConversationOnStartParams } from '../types/Conversation';
|
|
17
16
|
import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalUserId } from '../types/ExternalId';
|
|
18
17
|
import MediaModifiers from '../types/MediaModifiers';
|
|
19
18
|
import { IVideoDimentions } from '../types/MediaSettings';
|
|
20
19
|
import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
|
|
21
20
|
import MuteStates from '../types/MuteStates';
|
|
22
|
-
import { CompositeUserId, IGetParticipantsParameters,
|
|
21
|
+
import { CompositeUserId, IGetParticipantsParameters, ParticipantId, ParticipantStateData } from '../types/Participant';
|
|
23
22
|
import { ParticipantLayout } from '../types/ParticipantLayout';
|
|
24
23
|
import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
|
|
25
24
|
import ParticipantPriority from '../types/ParticipantPriority';
|
|
@@ -31,12 +30,14 @@ import EventEmitter from './EventEmitter';
|
|
|
31
30
|
export default class Conversation extends EventEmitter {
|
|
32
31
|
private readonly _api;
|
|
33
32
|
private readonly _signaling;
|
|
33
|
+
private readonly _signalingActor;
|
|
34
34
|
private _mediaSource;
|
|
35
35
|
private _conversation;
|
|
36
36
|
private _myLastRequestedLayouts;
|
|
37
37
|
private _state;
|
|
38
38
|
private _participantState;
|
|
39
39
|
private _participants;
|
|
40
|
+
private _pendingParticipants;
|
|
40
41
|
private _transport;
|
|
41
42
|
private _debugInfo;
|
|
42
43
|
private _volumesDetector;
|
|
@@ -66,7 +67,7 @@ export default class Conversation extends EventEmitter {
|
|
|
66
67
|
static current(): Conversation | null;
|
|
67
68
|
static hangupAfterInit(): void;
|
|
68
69
|
static id(): string | null;
|
|
69
|
-
onStart(opponentIds
|
|
70
|
+
onStart({ opponentIds, opponentType, mediaOptions, payload, joiningAllowed, requireAuthToJoin, onlyAdminCanShareMovie, externalIds, onFastStart }: ConversationOnStartParams): Promise<ConversationData>;
|
|
70
71
|
onJoin(joinArgs: {
|
|
71
72
|
conversationId?: string;
|
|
72
73
|
mediaOptions: MediaOption[];
|
|
@@ -78,24 +79,28 @@ export default class Conversation extends EventEmitter {
|
|
|
78
79
|
private _onJoinPart2;
|
|
79
80
|
private _extractExternalRooms;
|
|
80
81
|
private _extractExternalRoomsData;
|
|
81
|
-
onPush(conversationId: string, type?: UserType, peerId?: number): Promise<void>;
|
|
82
|
+
onPush(conversationId: string, type?: UserType, peerId?: number, conversationParams?: string, wsEndpoint?: string): Promise<void>;
|
|
82
83
|
private _isInWaitingHall;
|
|
83
84
|
private _isRestricted;
|
|
84
85
|
private _isAudienceMode;
|
|
85
86
|
private _isAudienceModeListener;
|
|
86
87
|
private _acceptConcurrent;
|
|
87
88
|
private _getMainRoomParticipants;
|
|
89
|
+
private _decodeExternalConversationParams;
|
|
90
|
+
private _logCallStartEvent;
|
|
88
91
|
accept(mediaOptions: MediaOption[]): Promise<ConversationData>;
|
|
89
92
|
decline(): Promise<void>;
|
|
90
93
|
hangup(): Promise<void>;
|
|
91
|
-
addParticipant(participantIds:
|
|
94
|
+
addParticipant(participantIds: ExternalId[], params?: AddParticipantParams): Promise<void>;
|
|
95
|
+
addParticipantLegacy(participantIds: CompositeUserId[], params?: AddParticipantParams): Promise<void>;
|
|
92
96
|
removeParticipant(participantId: CompositeUserId, ban?: boolean): Promise<void>;
|
|
93
97
|
setVolume(volume: number): void;
|
|
94
98
|
updateStatisticsInterval(): void;
|
|
95
99
|
private _openTransport;
|
|
96
100
|
private _close;
|
|
97
|
-
destroy(): void
|
|
101
|
+
destroy(): Promise<void>;
|
|
98
102
|
private _getConversationParams;
|
|
103
|
+
private _setConversationParams;
|
|
99
104
|
private _addGeoParamsToEndpoint;
|
|
100
105
|
/**
|
|
101
106
|
* @throws ErrorEvent
|
|
@@ -189,7 +194,7 @@ export default class Conversation extends EventEmitter {
|
|
|
189
194
|
* @deprecated Use updateDisplayLayout instead
|
|
190
195
|
*/
|
|
191
196
|
changePriorities(priorities: ParticipantPriority[]): Promise<void>;
|
|
192
|
-
changeParticipantState(state:
|
|
197
|
+
changeParticipantState(state: ParticipantStateData, compositeUserId?: CompositeUserId): Promise<void>;
|
|
193
198
|
putHandsDown(): Promise<void>;
|
|
194
199
|
requestKeyFrame(participantStreamDescription: ParticipantStreamDescription): Promise<void | SignalingMessage>;
|
|
195
200
|
requestTestMode(consumerCommand: string, producerCommand: string): Promise<void>;
|
|
@@ -216,6 +221,7 @@ export default class Conversation extends EventEmitter {
|
|
|
216
221
|
private _onUrlSharingInfoUpdated;
|
|
217
222
|
private _onFeaturesPerRoleChanged;
|
|
218
223
|
private _waitForStreamIfNeeded;
|
|
224
|
+
private _getStreamDescriptionById;
|
|
219
225
|
private _matchStreamDescription;
|
|
220
226
|
private _getWaitingTime;
|
|
221
227
|
private _isCallAdmin;
|
|
@@ -225,7 +231,7 @@ export default class Conversation extends EventEmitter {
|
|
|
225
231
|
startAsr(params: IAsrStartParams): Promise<void>;
|
|
226
232
|
stopAsr(params?: IAsrStopParams): Promise<void>;
|
|
227
233
|
requestAsr(request: boolean): Promise<void>;
|
|
228
|
-
muteParticipant(participantId:
|
|
234
|
+
muteParticipant(participantId: (ParticipantId | null) | undefined, muteStates: MuteStates, requestedMedia?: MediaOption[], roomId?: number | null): Promise<void>;
|
|
229
235
|
enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<void>;
|
|
230
236
|
pinParticipant(participantId: ParticipantId, unpin: boolean, roomId?: number | null): Promise<void>;
|
|
231
237
|
updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<void>;
|
|
@@ -249,7 +255,7 @@ export default class Conversation extends EventEmitter {
|
|
|
249
255
|
customData(data: JSONObject, participantId?: ParticipantId | null): Promise<void>;
|
|
250
256
|
createJoinLink(): Promise<string>;
|
|
251
257
|
removeJoinLink(): Promise<undefined>;
|
|
252
|
-
addMovie({ movieId, gain, metadata }: IAddMovieParams): Promise<{
|
|
258
|
+
addMovie({ movieId, gain, metadata, lang }: IAddMovieParams): Promise<{
|
|
253
259
|
movieId: number;
|
|
254
260
|
streamType: string;
|
|
255
261
|
}>;
|
|
@@ -272,7 +278,7 @@ export default class Conversation extends EventEmitter {
|
|
|
272
278
|
setLocalResolution({ video, effect }: {
|
|
273
279
|
video: IVideoDimentions;
|
|
274
280
|
effect?: IVideoDimentions;
|
|
275
|
-
}): Promise<void
|
|
281
|
+
}): Promise<void>;
|
|
276
282
|
videoEffect(effect: IEffect | null): Promise<void | undefined>;
|
|
277
283
|
audioEffect(effects: string[] | null, isPreset?: boolean): Promise<void | undefined>;
|
|
278
284
|
_convertExternalIdsToServerExternalIds(externalIds: ExternalId[]): SignalingMessage.ExternalId[];
|
|
@@ -380,6 +386,9 @@ export default class Conversation extends EventEmitter {
|
|
|
380
386
|
private _getMuteStatesForCurrentRoom;
|
|
381
387
|
private _setMuteStatesForRoomId;
|
|
382
388
|
private _forceOpenTransportForAloneInCall;
|
|
389
|
+
private _registerParticipant;
|
|
390
|
+
private _getParticipants;
|
|
391
|
+
private _getParticipant;
|
|
383
392
|
}
|
|
384
393
|
export declare class UpdateDisplayLayoutError extends Error {
|
|
385
394
|
readonly participantErrors: {
|
package/classes/Logger.d.ts
CHANGED
|
@@ -11,7 +11,10 @@ export default class Logger extends BaseLogger {
|
|
|
11
11
|
private _batchTimeout;
|
|
12
12
|
private _serverTimeDelta;
|
|
13
13
|
private static _instance;
|
|
14
|
+
private static _conversationIdProvider;
|
|
14
15
|
constructor(api: BaseApi, externalLogger: BaseLogger | null);
|
|
16
|
+
static setConversationIdProvider(provider: () => string | null): void;
|
|
17
|
+
private _getConversationId;
|
|
15
18
|
private _sendLogItems;
|
|
16
19
|
private _sendClientStats;
|
|
17
20
|
private _sendClientEvents;
|
package/classes/MediaSource.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import MediaSettings, { IVideoDimentions } from '../types/MediaSettings';
|
|
|
5
5
|
import { ScreenCaptureSettings } from '../types/ScreenCaptureSettings';
|
|
6
6
|
export declare const enum MediaSourceEvent {
|
|
7
7
|
SOURCE_CHANGED = "SOURCE_CHANGED",
|
|
8
|
+
SOURCE_READY = "SOURCE_READY",
|
|
8
9
|
TRACK_REPLACED = "TRACK_REPLACED",
|
|
9
10
|
SCREEN_STATUS = "SCREEN_STATUS",
|
|
10
11
|
ANIMOJI_STATUS = "ANIMOJI_STATUS"
|
|
@@ -22,11 +23,19 @@ interface AudioEffectParams {
|
|
|
22
23
|
effects: string[];
|
|
23
24
|
isPreset?: boolean;
|
|
24
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* тип источника (для сервера)
|
|
28
|
+
*/
|
|
29
|
+
export declare enum MediaSourceType {
|
|
30
|
+
CAMERA = 1,
|
|
31
|
+
SCREEN = 2
|
|
32
|
+
}
|
|
25
33
|
export declare class MediaSource extends EventEmitter {
|
|
26
34
|
/** Стрим с камеры и микрофона пользователя */
|
|
27
35
|
protected _stream: MediaStream | null;
|
|
28
36
|
private _screenTrack;
|
|
29
37
|
private _audioShareTrack;
|
|
38
|
+
private _screenShareTrack;
|
|
30
39
|
/** Трек для отправки в медиа-канал. Может отличаться при скриншаринге в дата-канал */
|
|
31
40
|
private _sendVideoTrack;
|
|
32
41
|
/** Трек с камеры. В стриме будет другой трек при включенных видео эффектах */
|
|
@@ -44,6 +53,7 @@ export declare class MediaSource extends EventEmitter {
|
|
|
44
53
|
private _animojiEnabled;
|
|
45
54
|
/** вычисляем низкую производительность видео эффектов */
|
|
46
55
|
private readonly _videoEffectsFpsLimiter?;
|
|
56
|
+
private _deviceChangeListener;
|
|
47
57
|
constructor();
|
|
48
58
|
request(mediaOptions?: MediaOption[], needEmptyTracks?: boolean): Promise<void>;
|
|
49
59
|
getStream(): MediaStream | null;
|
|
@@ -76,6 +86,7 @@ export declare class MediaSource extends EventEmitter {
|
|
|
76
86
|
private stopAudioShareTrack;
|
|
77
87
|
private _applyAudioEffect;
|
|
78
88
|
protected getSilentAudioShareTrack(): MediaStreamTrack;
|
|
89
|
+
protected getBlackScreenShareTrack(): MediaStreamTrack;
|
|
79
90
|
protected _replaceLocalTrack(newTrack: MediaStreamTrack, sendTrack?: MediaStreamTrack): Promise<void>;
|
|
80
91
|
private _setEffect;
|
|
81
92
|
private _stopEffect;
|
|
@@ -90,6 +101,7 @@ export declare class MediaSource extends EventEmitter {
|
|
|
90
101
|
video: IVideoDimentions;
|
|
91
102
|
effect?: IVideoDimentions;
|
|
92
103
|
}): Promise<void>;
|
|
104
|
+
getCameraVideoTrack(): MediaStreamTrack | null;
|
|
93
105
|
updateNoiseSuppression(): Promise<void>;
|
|
94
106
|
videoEffect(effect: IEffect | null): Promise<void>;
|
|
95
107
|
audioEffect(audioEffectParams: AudioEffectParams | null): Promise<void>;
|
|
@@ -97,5 +109,6 @@ export declare class MediaSource extends EventEmitter {
|
|
|
97
109
|
private handleVideoEffectsLowFps;
|
|
98
110
|
private get _frameRate();
|
|
99
111
|
private _applyVideoConstraints;
|
|
112
|
+
getScreenShareTrack(): MediaStreamTrack | null;
|
|
100
113
|
}
|
|
101
114
|
export {};
|
|
@@ -6,5 +6,6 @@ export declare class ParticipantIdRegistry {
|
|
|
6
6
|
getStreamDescription(compactedId: number): ParticipantStreamDescription | undefined;
|
|
7
7
|
getCompactId(streamDescription: string): number | undefined;
|
|
8
8
|
handleMessage(data: ArrayBuffer): SignalingMessage | null;
|
|
9
|
+
private _decodeMediaType;
|
|
9
10
|
private _createParticipantSourcesUpdateNotification;
|
|
10
11
|
}
|
|
@@ -5,6 +5,7 @@ import { EnableVideoSuspend } from '../types/EnableVideoSuspend';
|
|
|
5
5
|
import { EnableVideoSuspendSuggest } from '../types/EnableVideoSuspendSuggest';
|
|
6
6
|
import SignalingMessage from '../types/SignalingMessage';
|
|
7
7
|
import { PerfStatReport } from '../types/PerfStatReporter';
|
|
8
|
+
import { ChangeSimulcast } from '../types/ChangeSimulcast';
|
|
8
9
|
import { SharingStatReport } from './screenshare/SharingStatReport';
|
|
9
10
|
import { ParticipantIdRegistry } from './ParticipantIdRegistry';
|
|
10
11
|
export declare class ProducerCommandSerializationService {
|
|
@@ -21,6 +22,7 @@ export declare class ProducerCommandSerializationService {
|
|
|
21
22
|
serializeNetworkStatReport(sequenceNumber: number, report: NetworkStatReport): ArrayBuffer;
|
|
22
23
|
serializeEnableVideoSuspend(sequenceNumber: number, params: EnableVideoSuspend): ArrayBuffer;
|
|
23
24
|
serializeEnableVideoSuspendSuggest(sequenceNumber: number, params: EnableVideoSuspendSuggest): ArrayBuffer;
|
|
25
|
+
serializeChangeSimulcast(sequenceNumber: number, params: ChangeSimulcast): ArrayBuffer;
|
|
24
26
|
deserializeCommandResponse(data: BufferSource | Blob): Promise<SignalingMessage | undefined>;
|
|
25
27
|
private deserializeUpdateDisplayLayoutResponse;
|
|
26
28
|
private deserializeReportPerfStatResponse;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import SignalingMessage from '../types/SignalingMessage';
|
|
2
|
+
export declare class SignalingActor {
|
|
3
|
+
private processor;
|
|
4
|
+
private queue;
|
|
5
|
+
private isProcessing;
|
|
6
|
+
constructor(processor: (message: SignalingMessage) => Promise<unknown> | unknown);
|
|
7
|
+
add(message: SignalingMessage): void;
|
|
8
|
+
private processQueue;
|
|
9
|
+
}
|
|
@@ -15,7 +15,7 @@ export declare abstract class BaseStreamBuilder {
|
|
|
15
15
|
destroy(): void;
|
|
16
16
|
protected abstract _processFrame(frame: FrameData): void;
|
|
17
17
|
private _processFrameData;
|
|
18
|
-
static getFrameSize(frameData: Uint8Array): {
|
|
18
|
+
static getFrameSize(frameData: Uint8Array<ArrayBuffer>): {
|
|
19
19
|
width: number;
|
|
20
20
|
height: number;
|
|
21
21
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { StatItem } from '../../types/Statistics';
|
|
2
|
+
import { TransportTopology } from '../transport/Transport';
|
|
3
|
+
export type CodecKind = 'audio' | 'video';
|
|
4
|
+
/**
|
|
5
|
+
* Собирает стату по использованию кодеков в webrtc
|
|
6
|
+
* Каждый раз когда обновляется кодек или завершается звонок,
|
|
7
|
+
* отправляется репорт об использовании кодеков
|
|
8
|
+
*/
|
|
9
|
+
export declare class CodecStatsAggregator {
|
|
10
|
+
private static _instance;
|
|
11
|
+
private readonly _codecUsages;
|
|
12
|
+
private getCurrentTransportTopology;
|
|
13
|
+
static create(getCurrentTransportTopology: () => TransportTopology | undefined): void;
|
|
14
|
+
static reportUsage(stat: StatItem): void;
|
|
15
|
+
private saveUsage;
|
|
16
|
+
private report;
|
|
17
|
+
static destroy(): void;
|
|
18
|
+
private _destroy;
|
|
19
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import HangupReason from '../HangupReason';
|
|
2
|
+
import { TransportTopology } from '../transport/Transport';
|
|
3
|
+
/**
|
|
4
|
+
* Класс для работы с событийными метриками, обертка для правильной отправки событий
|
|
5
|
+
*/
|
|
6
|
+
export declare class EventMetricsService {
|
|
7
|
+
private static correctHangupReason;
|
|
8
|
+
static sendHangupEvent(reason: HangupReason, topology?: TransportTopology): void;
|
|
9
|
+
}
|
|
@@ -27,6 +27,7 @@ export default class ServerTransport extends BaseTransport {
|
|
|
27
27
|
private _lastStat;
|
|
28
28
|
private _serverSettings;
|
|
29
29
|
private _prevConsumerSettings;
|
|
30
|
+
private _prevConsumerFastSharingSettings;
|
|
30
31
|
private _asrTrack;
|
|
31
32
|
private _captureSender;
|
|
32
33
|
private _captureReceiver;
|
|
@@ -35,6 +36,7 @@ export default class ServerTransport extends BaseTransport {
|
|
|
35
36
|
private _rtpReceiversByStreamId;
|
|
36
37
|
private _producerSessionId;
|
|
37
38
|
private _newAudioShareTrack;
|
|
39
|
+
private _simulcastInfo;
|
|
38
40
|
constructor(signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings);
|
|
39
41
|
updateStatisticsInterval(): void;
|
|
40
42
|
open(observer?: boolean): void;
|
|
@@ -44,6 +46,7 @@ export default class ServerTransport extends BaseTransport {
|
|
|
44
46
|
allowRestart(): void;
|
|
45
47
|
updateSettings(settings: ServerSettings): void;
|
|
46
48
|
setAnimojiTransport(receiver: AnimojiReceiver, sender: AnimojiSender): void;
|
|
49
|
+
onCameraResolutionChanged(): Promise<void>;
|
|
47
50
|
private _createPerfStatsReporter;
|
|
48
51
|
private _closeConnection;
|
|
49
52
|
private static _closeDataChannel;
|
|
@@ -72,7 +75,10 @@ export default class ServerTransport extends BaseTransport {
|
|
|
72
75
|
private _detectStaleTracks;
|
|
73
76
|
private _allocateConsumer;
|
|
74
77
|
private _processOffer;
|
|
78
|
+
private _findFirstSimTransceiver;
|
|
79
|
+
private _setupSimulcastTransceiver;
|
|
75
80
|
private _acceptProducer;
|
|
81
|
+
private _replaceScreenShareTrack;
|
|
76
82
|
private _handleTracks;
|
|
77
83
|
private _onSignalingNotification;
|
|
78
84
|
private _onAsrTranscription;
|
|
@@ -81,5 +87,7 @@ export default class ServerTransport extends BaseTransport {
|
|
|
81
87
|
static _onSignalingStateChange(pc: RTCPeerConnection, event: any): void;
|
|
82
88
|
private _onConnectionStateChange;
|
|
83
89
|
private _onReplacedTrack;
|
|
90
|
+
private _onSourcesChanged;
|
|
84
91
|
getStreamWaitingTimeMs(streamId: string, targetRtpTimestamp: number): number;
|
|
92
|
+
private _changeSimulcastInfo;
|
|
85
93
|
}
|
|
@@ -1,25 +1,38 @@
|
|
|
1
1
|
import { ParticipantId } from '../../types/Participant';
|
|
2
2
|
import { StatItem, StatRtp, StatTransport } from '../../types/Statistics';
|
|
3
3
|
export declare const NO_STAT_REQUEST_DELAY = 1000;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
declare function distinctById(items: RTCStats[]): RTCStats[];
|
|
5
|
+
declare function rtcStatsToArray(stats: RTCStatsReport[]): RTCStats[];
|
|
6
6
|
/**
|
|
7
7
|
* Extracts transport statistics from the gives stats
|
|
8
8
|
* @hidden
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
declare function extractTransport(stats: RTCStats[]): StatTransport;
|
|
11
11
|
/**
|
|
12
12
|
* Extracts media statistics from the given stats
|
|
13
13
|
* @hidden
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
declare function extractRtps(stats: RTCStats[], ssrcMap: Record<string, string>, needToExtractRemote?: boolean): StatRtp[];
|
|
16
16
|
/**
|
|
17
17
|
* Computes delta (the difference) between two stat reports.
|
|
18
18
|
* @hidden
|
|
19
19
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
declare function delta(current: StatItem, previous: StatItem, needToExtractRemote?: boolean): StatItem;
|
|
21
|
+
declare function collectStats(pc: RTCPeerConnection, previous: StatItem | null, ssrcMap?: Record<string, string>, needToExtractRemote?: boolean): Promise<StatItem>;
|
|
22
|
+
declare function setMark(name: string): void;
|
|
23
|
+
declare function clearMark(name: string): void;
|
|
24
|
+
declare function measureMark(name: string): null | number;
|
|
25
|
+
declare function getMarkNameScreenshareFirstFrame(uid: ParticipantId): string;
|
|
26
|
+
declare const _default: {
|
|
27
|
+
distinctById: typeof distinctById;
|
|
28
|
+
rtcStatsToArray: typeof rtcStatsToArray;
|
|
29
|
+
extractTransport: typeof extractTransport;
|
|
30
|
+
extractRtps: typeof extractRtps;
|
|
31
|
+
delta: typeof delta;
|
|
32
|
+
collectStats: typeof collectStats;
|
|
33
|
+
setMark: typeof setMark;
|
|
34
|
+
clearMark: typeof clearMark;
|
|
35
|
+
measureMark: typeof measureMark;
|
|
36
|
+
getMarkNameScreenshareFirstFrame: typeof getMarkNameScreenshareFirstFrame;
|
|
37
|
+
};
|
|
38
|
+
export default _default;
|
|
@@ -66,6 +66,7 @@ export declare class Transport extends EventEmitter {
|
|
|
66
66
|
getStates(): Record<string, TransportState>;
|
|
67
67
|
setAnimojiSvg(participantId: ParticipantId, svgData: AnimojiSvgData): void;
|
|
68
68
|
setAnimojiFill(fill: RGBTuple | string): void;
|
|
69
|
+
onCameraResolutionChanged(): Promise<void>;
|
|
69
70
|
private _setStates;
|
|
70
71
|
private _setLocalState;
|
|
71
72
|
private _onSignalingNotification;
|
package/default/Api.d.ts
CHANGED
|
@@ -26,8 +26,9 @@ export default class Api extends BaseApi {
|
|
|
26
26
|
}, speakerIds?: OkUserId[]): Promise<ConversationResponse>;
|
|
27
27
|
startConversation(conversationId: string, ids?: OkUserId[], type?: CallType, isVideo?: boolean, payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean, { onlyAdminCanShareMovie }?: {
|
|
28
28
|
onlyAdminCanShareMovie?: boolean;
|
|
29
|
-
}): Promise<ConversationResponse>;
|
|
29
|
+
}, externalIds?: ExternalId[]): Promise<ConversationResponse>;
|
|
30
30
|
protected _ensureUuid(): void;
|
|
31
|
+
deviceId(): string;
|
|
31
32
|
private _preareStartConversationData;
|
|
32
33
|
private _startConversation;
|
|
33
34
|
createJoinLink(conversationId: string): Promise<{
|
package/default/Signaling.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import BaseSignaling, { AddParticipantParams } from '../abstract/BaseSignaling';
|
|
2
2
|
import { ParticipantIdRegistry } from '../classes/ParticipantIdRegistry';
|
|
3
3
|
import { SharingStatReport } from '../classes/screenshare/SharingStatReport';
|
|
4
|
-
import { NetworkStatReport } from '../types/NetworkStatReport';
|
|
5
4
|
import { TransportTopology } from '../classes/transport/Transport';
|
|
6
5
|
import ConversationFeature from '../enums/ConversationFeature';
|
|
7
6
|
import ConversationOption from '../enums/ConversationOption';
|
|
@@ -11,11 +10,13 @@ import SignalingConnectionType from '../enums/SignalingConnectionType';
|
|
|
11
10
|
import UserRole from '../enums/UserRole';
|
|
12
11
|
import { JSONObject } from '../static/Json';
|
|
13
12
|
import { IAsrStartParams, IAsrStopParams } from '../types/Asr';
|
|
13
|
+
import { ChangeSimulcast } from '../types/ChangeSimulcast';
|
|
14
14
|
import MediaModifiers from '../types/MediaModifiers';
|
|
15
15
|
import MediaSettings from '../types/MediaSettings';
|
|
16
16
|
import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
|
|
17
17
|
import MuteStates from '../types/MuteStates';
|
|
18
|
-
import {
|
|
18
|
+
import { NetworkStatReport } from '../types/NetworkStatReport';
|
|
19
|
+
import { CompositeUserId, ParticipantId, ParticipantStateData } from '../types/Participant';
|
|
19
20
|
import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
|
|
20
21
|
import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
|
|
21
22
|
import { StreamDescriptionString } from '../types/ParticipantStreamDescription';
|
|
@@ -30,8 +31,10 @@ export default class Signaling extends BaseSignaling {
|
|
|
30
31
|
private datachannelCommandsQueue;
|
|
31
32
|
private incomingCache;
|
|
32
33
|
private responseHandlers;
|
|
34
|
+
private connectionType;
|
|
33
35
|
private reconnectCount;
|
|
34
36
|
private endpoint;
|
|
37
|
+
private wtEndpoint;
|
|
35
38
|
protected conversationResolve: Function | null;
|
|
36
39
|
protected conversationReject: Function | null;
|
|
37
40
|
private connected;
|
|
@@ -47,15 +50,16 @@ export default class Signaling extends BaseSignaling {
|
|
|
47
50
|
private producerCommandDataChannel;
|
|
48
51
|
private producerCommandDataChannelEnabled;
|
|
49
52
|
private producerCommandSerializationService;
|
|
50
|
-
private static
|
|
51
|
-
private static
|
|
52
|
-
private static
|
|
53
|
-
private static
|
|
54
|
-
private static
|
|
55
|
-
private static
|
|
53
|
+
private static get RECONNECT_DELAY();
|
|
54
|
+
private static get RECONNECT_MAX_DELAY();
|
|
55
|
+
private static get RECONNECT_MAX_COUNT();
|
|
56
|
+
private static get WAIT_CONNECTION_DELAY();
|
|
57
|
+
private static get WAIT_RESPONSE_DELAY();
|
|
58
|
+
private static get WAIT_MESSAGE_DELAY();
|
|
56
59
|
private static _getCapabilityFlags;
|
|
57
60
|
get ready(): boolean;
|
|
58
61
|
setEndpoint(endpoint: string): void;
|
|
62
|
+
setWebTransportEndpoint(endpoint: string | null): void;
|
|
59
63
|
setConversationId(conversationId: string): void;
|
|
60
64
|
setParticipantIdRegistry(participantIdRegistry: ParticipantIdRegistry): void;
|
|
61
65
|
setProducerNotificationDataChannel(dataChannel: RTCDataChannel): void;
|
|
@@ -85,9 +89,10 @@ export default class Signaling extends BaseSignaling {
|
|
|
85
89
|
sendSdp(participantId: ParticipantId, sdp: RTCSessionDescriptionInit, extraPayload?: Record<string, any>): Promise<SignalingMessage>;
|
|
86
90
|
acceptCall(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
87
91
|
changeMediaSettings(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
88
|
-
changeParticipantState(state:
|
|
92
|
+
changeParticipantState(state: ParticipantStateData, compositeUserId?: CompositeUserId): Promise<SignalingMessage>;
|
|
89
93
|
putHandsDown(): Promise<SignalingMessage>;
|
|
90
|
-
addParticipant(
|
|
94
|
+
addParticipant(externalIds: CompositeUserId[], params?: AddParticipantParams): Promise<SignalingMessage>;
|
|
95
|
+
addParticipantLegacy(participantIds: CompositeUserId[], params?: AddParticipantParams): Promise<SignalingMessage>;
|
|
91
96
|
removeParticipant(participantId: CompositeUserId, ban?: boolean): Promise<SignalingMessage>;
|
|
92
97
|
allocateConsumer(description: RTCSessionDescription | null, capabilities: {
|
|
93
98
|
[key: string]: number | boolean | string;
|
|
@@ -132,6 +137,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
132
137
|
updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<SignalingMessage>;
|
|
133
138
|
enableVideoSuspend(enabled: boolean): Promise<SignalingMessage>;
|
|
134
139
|
enableVideoSuspendSuggest(enabled: boolean): Promise<SignalingMessage>;
|
|
140
|
+
changeSimulcast(changeSimulcast: ChangeSimulcast): Promise<SignalingMessage>;
|
|
135
141
|
changeOptions(changes: {
|
|
136
142
|
[key in ConversationOption]?: boolean;
|
|
137
143
|
}): Promise<SignalingMessage>;
|
|
@@ -158,7 +164,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
158
164
|
startAsr(params: IAsrStartParams): Promise<SignalingMessage>;
|
|
159
165
|
stopAsr(params?: IAsrStopParams): Promise<SignalingMessage>;
|
|
160
166
|
requestAsr(request: boolean): Promise<SignalingMessage>;
|
|
161
|
-
protected _connect(connectionType: SignalingConnectionType): void;
|
|
167
|
+
protected _connect(connectionType: SignalingConnectionType, useWebTransport: boolean): void;
|
|
162
168
|
protected _disconnect(code?: number): void;
|
|
163
169
|
private _onOpen;
|
|
164
170
|
private _onMessage;
|
|
@@ -180,4 +186,8 @@ export default class Signaling extends BaseSignaling {
|
|
|
180
186
|
protected _stopWaitConnectionMessage(): void;
|
|
181
187
|
private _startDoctor;
|
|
182
188
|
private _stopDoctor;
|
|
189
|
+
private isWebTransportAvailable;
|
|
190
|
+
private _getSocketType;
|
|
191
|
+
private _markTransportStat;
|
|
192
|
+
private _logTransportStat;
|
|
183
193
|
}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
declare enum ConversationOption {
|
|
5
5
|
REQUIRE_AUTH_TO_JOIN = "REQUIRE_AUTH_TO_JOIN",
|
|
6
|
-
AUDIENCE_MODE = "AUDIENCE_MODE"
|
|
7
|
-
WAITING_HALL = "WAITING_HALL"
|
|
6
|
+
AUDIENCE_MODE = "AUDIENCE_MODE",// Stereo chat room
|
|
7
|
+
WAITING_HALL = "WAITING_HALL",// Waiting Hall is ON
|
|
8
8
|
ASR = "ASR",
|
|
9
|
-
FEEDBACK = "FEEDBACK"
|
|
9
|
+
FEEDBACK = "FEEDBACK",// Reactions (default = off)
|
|
10
10
|
RECURRING = "RECURRING"
|
|
11
11
|
}
|
|
12
12
|
export default ConversationOption;
|
package/enums/RecordRole.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ declare enum SignalingCommandType {
|
|
|
55
55
|
GET_HAND_QUEUE = "get-hand-queue",
|
|
56
56
|
ENABLE_VIDEO_SUSPEND = "enable-video-suspend",
|
|
57
57
|
ENABLE_VIDEO_SUSPEND_SUGGEST = "enable-video-suspend-suggest",
|
|
58
|
-
PUT_HANDS_DOWN = "put-hands-down"
|
|
58
|
+
PUT_HANDS_DOWN = "put-hands-down",
|
|
59
|
+
CHANGE_SIMULCAST = "change-simulcast"
|
|
59
60
|
}
|
|
60
61
|
export default SignalingCommandType;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Stat from './Stat';
|
|
2
|
+
export declare const enum SignalingTransportType {
|
|
3
|
+
WEBSOCKET = "ws",
|
|
4
|
+
WEBTRANSPORT = "wt"
|
|
5
|
+
}
|
|
6
|
+
export declare const enum SignalingTransportStat {
|
|
7
|
+
CONNECTED = "connected",
|
|
8
|
+
RECONNECTED = "reconnected",
|
|
9
|
+
FAILED_PINGS = "failed_pings",
|
|
10
|
+
FAILED_EXCEPTIONS = "failed_exception",
|
|
11
|
+
TIMEOUT = "timeout",
|
|
12
|
+
RESTART = "restart"
|
|
13
|
+
}
|
|
14
|
+
export declare const SOCKET_STAT: Record<SignalingTransportStat, {
|
|
15
|
+
[SignalingTransportType.WEBSOCKET]: Stat;
|
|
16
|
+
[SignalingTransportType.WEBTRANSPORT]: Stat;
|
|
17
|
+
}>;
|
package/enums/Stat.d.ts
CHANGED
|
@@ -1,40 +1,55 @@
|
|
|
1
1
|
declare const enum Stat {
|
|
2
2
|
ERROR = "callError",
|
|
3
|
-
DEVICES = "callDevices"
|
|
4
|
-
CALL_SPEC_ERROR = "callSpecError"
|
|
5
|
-
ICE_CONNECTION_STATE = "callIceConnectionState"
|
|
6
|
-
ICE_CONNECTION_TYPE = "callIceConnectionType"
|
|
7
|
-
ICE_RESTART = "callIceRestart"
|
|
8
|
-
PUSH = "callPush"
|
|
9
|
-
OUTGOING_CALL = "callStart"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
DEVICES = "callDevices",// залогировать количество %d_%d
|
|
4
|
+
CALL_SPEC_ERROR = "callSpecError",// ошибки WebRTC
|
|
5
|
+
ICE_CONNECTION_STATE = "callIceConnectionState",// state
|
|
6
|
+
ICE_CONNECTION_TYPE = "callIceConnectionType",// type
|
|
7
|
+
ICE_RESTART = "callIceRestart",// без параметров
|
|
8
|
+
PUSH = "callPush",// busy / rejected / accepted
|
|
9
|
+
OUTGOING_CALL = "callStart",// video/audio
|
|
10
|
+
CALL_FINISH = "call_finish",// событие отправляемое в конце звонка
|
|
11
|
+
OUTGOING_MULTIPARTY_CALL = "callStartMultiparty",// video/audio
|
|
12
|
+
JOIN_CONVERSATION = "callJoinConversation",// video/audio
|
|
13
|
+
ACCEPTED_OUTGOING = "callAcceptedOutgoing",// video/audio
|
|
14
|
+
ACCEPT_INCOMING = "callAcceptIncoming",// video/audio
|
|
14
15
|
DECLINE_INCOMING = "callDeclineIncoming",
|
|
15
|
-
ACCEPT_CONCURRENT = "callAcceptConcurrent"
|
|
16
|
+
ACCEPT_CONCURRENT = "callAcceptConcurrent",// video/audio
|
|
16
17
|
HANGUP = "callHangup",
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
CODEC_USAGE = "codec_usage",// событие когда меняется кодек
|
|
19
|
+
MEDIA_STATUS = "callMediaStatus",// изменение video_1, audio_0
|
|
20
|
+
DEVICE_CHANGED = "callDeviceChanged",// смена камеры video/audio/screen
|
|
19
21
|
SOCKET_ACTION = "callSocketAction",
|
|
20
22
|
ADD_PARTICIPANT = "callAddParticipant",
|
|
21
23
|
REMOVE_PARTICIPANT = "callRemoveParticipant",
|
|
22
|
-
POOR_CONNECTION = "callPoorConnection"
|
|
24
|
+
POOR_CONNECTION = "callPoorConnection",// video / audio
|
|
23
25
|
TOPOLOGY_CHANGE_REQUESTED = "callTopologyChangeRequested",
|
|
24
|
-
RELAY_POLICY = "callForceRelay"
|
|
26
|
+
RELAY_POLICY = "callForceRelay",// 1 / 0
|
|
25
27
|
PAT_ALLOCATED = "patAllocate",
|
|
26
28
|
PAT_DEALLOCATED = "patDeallocate",
|
|
27
29
|
PAT_ERROR = "patError",
|
|
28
30
|
PAT_WAITING_TIME_ERROR = "patWaitingTimeError",
|
|
29
31
|
PAT_OUTDATED_RESPONSE = "patOutdatedResponse",
|
|
30
|
-
SIGNALING_CONNECTED = "signaling_connected"
|
|
31
|
-
RECONNECT = "callReconnect"
|
|
32
|
-
SCREENSHARE_FIRST_FRAME = "screen_share_first_frame"
|
|
33
|
-
SCREENSHARE_FREEZE_DURATION = "callScreenshareFreezeDuration"
|
|
32
|
+
SIGNALING_CONNECTED = "signaling_connected",// measure
|
|
33
|
+
RECONNECT = "callReconnect",// measure
|
|
34
|
+
SCREENSHARE_FIRST_FRAME = "screen_share_first_frame",// measure
|
|
35
|
+
SCREENSHARE_FREEZE_DURATION = "callScreenshareFreezeDuration",// measure
|
|
34
36
|
/** Объединение callFirstDataReceivedP2P и callFirstAudioMixDataReceived */
|
|
35
37
|
FIRST_MEDIA_RECEIVED = "first_media_received",
|
|
36
38
|
CALL_EVENTUAL_STAT = "callEventualStat",
|
|
37
39
|
CALL_DECLINED_OR_HANGED_LOCALLY = "CallDeclinedOrHangedLocally",
|
|
38
|
-
USER_FEEDBACK_RECEIVED = "UserFeedbackReceived"
|
|
40
|
+
USER_FEEDBACK_RECEIVED = "UserFeedbackReceived",
|
|
41
|
+
CALL_START = "call_start",
|
|
42
|
+
WEBSOCKET_CONNECTED = "websocket_connected",
|
|
43
|
+
WEBSOCKET_RECONNECTED = "websocket_reconnected",
|
|
44
|
+
WEBSOCKET_FAILED_PINGS = "websocket_failed_pings",
|
|
45
|
+
WEBSOCKET_FAILED_EXCEPTION = "websocket_failed_exception",
|
|
46
|
+
WEBSOCKET_TIMEOUT = "websocket_timeout",
|
|
47
|
+
WEBSOCKET_RESTART = "websocket_restart",
|
|
48
|
+
WEBTRANSPORT_CONNECTED = "webtransport_connected",
|
|
49
|
+
WEBTRANSPORT_RECONNECTED = "webtransport_reconnected",
|
|
50
|
+
WEBTRANSPORT_FAILED_PINGS = "webtransport_failed_pings",
|
|
51
|
+
WEBTRANSPORT_FAILED_EXCEPTION = "webtransport_failed_exception",
|
|
52
|
+
WEBTRANSPORT_TIMEOUT = "webtransport_timeout",
|
|
53
|
+
WEBTRANSPORT_RESTART = "webtransport_restart"
|
|
39
54
|
}
|
|
40
55
|
export default Stat;
|