@vkontakte/calls-sdk 2.8.6-dev.708b0190.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 +5 -3
- package/calls-sdk.cjs.js +8 -8
- package/calls-sdk.esm.js +8 -8
- package/classes/Conversation.d.ts +19 -10
- package/classes/Logger.d.ts +3 -0
- package/classes/MediaSource.d.ts +5 -0
- package/classes/ParticipantIdRegistry.d.ts +1 -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 +3 -0
- package/classes/transport/Statistics.d.ts +23 -10
- package/default/Api.d.ts +2 -1
- package/default/Signaling.d.ts +20 -12
- package/enums/ChatRoomEventType.d.ts +1 -1
- package/enums/ConversationOption.d.ts +3 -3
- package/enums/RecordRole.d.ts +1 -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 +57 -15
- package/static/SimulcastInfo.d.ts +1 -1
- package/static/Utils.d.ts +1 -1
- package/static/WebRTCUtils.d.ts +4 -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/MovieShare.d.ts +4 -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/Statistics.d.ts +147 -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
package/static/Params.d.ts
CHANGED
|
@@ -82,6 +82,8 @@ export type ParamsObject = {
|
|
|
82
82
|
/** @hidden */
|
|
83
83
|
wssBase: string;
|
|
84
84
|
/** @hidden */
|
|
85
|
+
wtsBase: string;
|
|
86
|
+
/** @hidden */
|
|
85
87
|
wssToken: string;
|
|
86
88
|
/** @hidden */
|
|
87
89
|
signalingReconnectDelay: number;
|
|
@@ -440,6 +442,18 @@ export type ParamsObject = {
|
|
|
440
442
|
fastScreenShareWidth: number;
|
|
441
443
|
/** @hidden */
|
|
442
444
|
fastScreenShareHeight: number;
|
|
445
|
+
/**
|
|
446
|
+
* Включить отправку быстрой шары с клиента по RTP
|
|
447
|
+
*
|
|
448
|
+
* _По умолчанию: `false`_
|
|
449
|
+
*/
|
|
450
|
+
consumerFastScreenShare: boolean;
|
|
451
|
+
/**
|
|
452
|
+
* Включает отправку сервером нотификации video-quality-update
|
|
453
|
+
*
|
|
454
|
+
* _По умолчанию: `false`_
|
|
455
|
+
*/
|
|
456
|
+
consumerFastScreenShareQualityOnDemand: boolean;
|
|
443
457
|
/**
|
|
444
458
|
* Использовать новые правила allMute для админа
|
|
445
459
|
*/
|
|
@@ -461,6 +475,38 @@ export type ParamsObject = {
|
|
|
461
475
|
* _По умолчанию: `false`_
|
|
462
476
|
*/
|
|
463
477
|
enableLogPerfStatReport: boolean;
|
|
478
|
+
/**
|
|
479
|
+
* Поддержка переключения качества видео в зависимости от сети
|
|
480
|
+
* Только для режима p2p
|
|
481
|
+
*
|
|
482
|
+
* _По умолчанию: `false`_
|
|
483
|
+
*/
|
|
484
|
+
switchVideoAtBadNetwork: boolean;
|
|
485
|
+
/**
|
|
486
|
+
* Включает деградацию фпс для видео с камеры при низком фпс с включенными вирт фонами
|
|
487
|
+
*
|
|
488
|
+
* _По умолчанию: `false`_
|
|
489
|
+
*/
|
|
490
|
+
enableVideoEffectsFpsDegradation: boolean;
|
|
491
|
+
/**
|
|
492
|
+
* Включить поддержку simulcast на отправке
|
|
493
|
+
*
|
|
494
|
+
* _По умолчанию: `false`_
|
|
495
|
+
*/
|
|
496
|
+
simulcast: boolean;
|
|
497
|
+
/**
|
|
498
|
+
* Включить поддержку webtransport для сигналинга
|
|
499
|
+
*
|
|
500
|
+
* _По умолчанию: `false`_
|
|
501
|
+
*/
|
|
502
|
+
webtransport: boolean;
|
|
503
|
+
/**
|
|
504
|
+
* Включить поддержку webtransport для сигналинга в FireFox
|
|
505
|
+
* Отдельная ручка, так как есть проблемы сейчас с FF
|
|
506
|
+
*
|
|
507
|
+
* _По умолчанию: `false`_
|
|
508
|
+
*/
|
|
509
|
+
webtransportFF: boolean;
|
|
464
510
|
/**
|
|
465
511
|
* Получен локальный стрим с камеры/микрофона
|
|
466
512
|
*/
|
|
@@ -834,21 +880,6 @@ export type ParamsObject = {
|
|
|
834
880
|
* Собеседник подключился к сигналлингу
|
|
835
881
|
*/
|
|
836
882
|
onPeerRegistered?: () => void;
|
|
837
|
-
/**
|
|
838
|
-
* Поддержка переключения качества видео в зависимости от сети
|
|
839
|
-
* Только для режима p2p
|
|
840
|
-
*
|
|
841
|
-
* _По умолчанию: `false`_
|
|
842
|
-
*/
|
|
843
|
-
switchVideoAtBadNetwork: boolean;
|
|
844
|
-
/** включает деградацию фпс для видео с камеры при низком фпс с включенными вирт фонами */
|
|
845
|
-
enableVideoEffectsFpsDegradation: boolean;
|
|
846
|
-
/**
|
|
847
|
-
* Включить поддержку simulcast на отправке
|
|
848
|
-
*
|
|
849
|
-
* _По умолчанию: `false`_
|
|
850
|
-
*/
|
|
851
|
-
simulcast: boolean;
|
|
852
883
|
};
|
|
853
884
|
export default abstract class Params {
|
|
854
885
|
private static _params;
|
|
@@ -885,6 +916,8 @@ export default abstract class Params {
|
|
|
885
916
|
static set iceServers(value: IceServer[]);
|
|
886
917
|
static get wssBase(): string;
|
|
887
918
|
static set wssBase(value: string);
|
|
919
|
+
static get wtsBase(): string;
|
|
920
|
+
static set wtsBase(value: string);
|
|
888
921
|
static get wssToken(): string;
|
|
889
922
|
static set wssToken(value: string);
|
|
890
923
|
static get signalingReconnectDelay(): number;
|
|
@@ -970,6 +1003,8 @@ export default abstract class Params {
|
|
|
970
1003
|
static get screenShareCongestionControlThreshold(): number;
|
|
971
1004
|
static get fastScreenShareWidth(): number;
|
|
972
1005
|
static get fastScreenShareHeight(): number;
|
|
1006
|
+
static get consumerFastScreenShare(): boolean;
|
|
1007
|
+
static get consumerFastScreenShareQualityOnDemand(): boolean;
|
|
973
1008
|
static get newMuteRules(): boolean;
|
|
974
1009
|
static get videoSuspend(): boolean;
|
|
975
1010
|
static get enumerateDevicesDelay(): number;
|
|
@@ -978,6 +1013,10 @@ export default abstract class Params {
|
|
|
978
1013
|
static get enableVideoEffectsFpsDegradation(): boolean;
|
|
979
1014
|
static get simulcast(): boolean;
|
|
980
1015
|
static set simulcast(value: boolean);
|
|
1016
|
+
static get webtransport(): boolean;
|
|
1017
|
+
static set webtransport(value: boolean);
|
|
1018
|
+
static get webtransportFF(): boolean;
|
|
1019
|
+
static set webtransportFF(value: boolean);
|
|
981
1020
|
static toJSON(): {
|
|
982
1021
|
apiKey: string;
|
|
983
1022
|
apiEnv: string;
|
|
@@ -1006,5 +1045,8 @@ export default abstract class Params {
|
|
|
1006
1045
|
clientStatsPlatform: string;
|
|
1007
1046
|
consumerScreenDataChannelPacketSize: number;
|
|
1008
1047
|
switchVideoAtBadNetwork: boolean;
|
|
1048
|
+
simulcast: boolean;
|
|
1049
|
+
webtransport: boolean;
|
|
1050
|
+
webtransportFF: boolean;
|
|
1009
1051
|
};
|
|
1010
1052
|
}
|
|
@@ -10,4 +10,4 @@ export declare const MAP_RID_TO_SCALE_RESOLUTION_DOWN_BY: Record<string, number>
|
|
|
10
10
|
export declare function isEqualSimulcastInfo(si1: ISimulcastInfo | null, si2: ISimulcastInfo | null): boolean;
|
|
11
11
|
export declare function findBitrateAsc(maxDimension: number, bitrates: VideoBitrateSettings[]): number;
|
|
12
12
|
export declare function calculateSimulcastInfo(width?: number, height?: number, bitrates?: VideoBitrateSettings[]): ISimulcastInfo;
|
|
13
|
-
export declare function findScaleResolutionDownBy(rid
|
|
13
|
+
export declare function findScaleResolutionDownBy(rid?: string): number;
|
package/static/Utils.d.ts
CHANGED
|
@@ -71,7 +71,7 @@ declare namespace Utils {
|
|
|
71
71
|
function participantMarkerCompare(marker1: ExternalParticipantListMarker | undefined, marker2: ExternalParticipantListMarker | undefined): number;
|
|
72
72
|
/** убирает все ключи со значением `V` на 1 уровне */
|
|
73
73
|
function objectFilterOutValues<T extends Record<string, V>, V = unknown>(obj: T, value?: unknown | unknown[]): Partial<T>;
|
|
74
|
-
function objectReduce<R, T extends
|
|
74
|
+
function objectReduce<R, T extends object>(obj: T, callback: (acc: R, value: T[keyof T], key: keyof T) => R, initialValue: R): R;
|
|
75
75
|
const setImmediate: (fn: VoidFunction) => VoidFunction;
|
|
76
76
|
function isObject(obj: unknown): obj is object;
|
|
77
77
|
function patchSimulcastAnswerSdp(sdp: string, trans: RTCRtpTransceiver, width: number, height: number): string;
|
package/static/WebRTCUtils.d.ts
CHANGED
|
@@ -143,6 +143,10 @@ declare namespace WebRTCUtils {
|
|
|
143
143
|
* Может ли браузер делать H264 приоритетным
|
|
144
144
|
*/
|
|
145
145
|
function canPreferH264(): boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Некоторые браузеры (Firefox, Safari) некорректно поддерживают симулкаст
|
|
148
|
+
*/
|
|
149
|
+
function isSimulcastSupportedByBrowser(): boolean;
|
|
146
150
|
/**
|
|
147
151
|
* Имя операционной системы
|
|
148
152
|
*/
|
package/types/Conversation.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { TransportTopology } from '../classes/transport/Transport';
|
|
2
2
|
import CallDirection from '../enums/CallDirection';
|
|
3
|
+
import CallType from '../enums/CallType';
|
|
3
4
|
import ConversationFeature from '../enums/ConversationFeature';
|
|
4
5
|
import ConversationOption from '../enums/ConversationOption';
|
|
6
|
+
import MediaOption from '../enums/MediaOption';
|
|
5
7
|
import UserRole from '../enums/UserRole';
|
|
6
8
|
import { AsrInfo } from './Asr';
|
|
7
9
|
import { IFeaturesPerRole } from './ConversationFeature';
|
|
8
|
-
import { ExternalParticipantId } from './ExternalId';
|
|
10
|
+
import { ExternalId, ExternalParticipantId } from './ExternalId';
|
|
11
|
+
import { FastStartHandler } from './FastStart';
|
|
9
12
|
import MediaModifiers from './MediaModifiers';
|
|
10
13
|
import MuteStates from './MuteStates';
|
|
11
14
|
import { OkUserId, ParticipantId } from './Participant';
|
|
@@ -68,3 +71,27 @@ export type ConversationData = {
|
|
|
68
71
|
/** @hidden */
|
|
69
72
|
urlSharingInfoByRoom: Map<IRoomId, RoomUrlSharingInfo>;
|
|
70
73
|
};
|
|
74
|
+
export type ConversationOnStartParams = {
|
|
75
|
+
opponentIds?: OkUserId[];
|
|
76
|
+
opponentType: CallType;
|
|
77
|
+
mediaOptions: MediaOption[];
|
|
78
|
+
payload?: string;
|
|
79
|
+
joiningAllowed?: boolean;
|
|
80
|
+
requireAuthToJoin?: boolean;
|
|
81
|
+
onlyAdminCanShareMovie?: boolean;
|
|
82
|
+
externalIds?: ExternalId[];
|
|
83
|
+
onFastStart?: FastStartHandler;
|
|
84
|
+
};
|
|
85
|
+
export type StartConversationParams = {
|
|
86
|
+
opponentIds?: OkUserId[];
|
|
87
|
+
opponentType: CallType;
|
|
88
|
+
direction: CallDirection;
|
|
89
|
+
mediaOptions: MediaOption[];
|
|
90
|
+
payload?: string;
|
|
91
|
+
joiningAllowed?: boolean;
|
|
92
|
+
requireAuthToJoin?: boolean;
|
|
93
|
+
onlyAdminCanShareMovie?: boolean;
|
|
94
|
+
externalIds?: ExternalId[];
|
|
95
|
+
startedTime: number;
|
|
96
|
+
onFastStart?: FastStartHandler;
|
|
97
|
+
};
|
|
@@ -2,6 +2,7 @@ import IceServer from './IceServer';
|
|
|
2
2
|
type ConversationParams = {
|
|
3
3
|
token: string;
|
|
4
4
|
endpoint: string;
|
|
5
|
+
wt_endpoint?: string;
|
|
5
6
|
turn_server?: IceServer;
|
|
6
7
|
stun_server?: IceServer;
|
|
7
8
|
client_type?: string;
|
|
@@ -10,6 +11,18 @@ type ConversationParams = {
|
|
|
10
11
|
isp_as_org?: string;
|
|
11
12
|
loc_cc?: string;
|
|
12
13
|
loc_reg?: string;
|
|
13
|
-
external_user_type
|
|
14
|
+
external_user_type?: string;
|
|
15
|
+
};
|
|
16
|
+
export type ExternalConversationParams = {
|
|
17
|
+
et: number;
|
|
18
|
+
iv: boolean;
|
|
19
|
+
srcp: string;
|
|
20
|
+
stne: string;
|
|
21
|
+
tkn: string;
|
|
22
|
+
trne: string;
|
|
23
|
+
trnp: string;
|
|
24
|
+
trnu: string;
|
|
25
|
+
wse: string;
|
|
26
|
+
wte: string;
|
|
14
27
|
};
|
|
15
28
|
export default ConversationParams;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import HangupType from '../enums/HangupType';
|
|
2
|
+
import IceServer from './IceServer';
|
|
2
3
|
/**
|
|
3
4
|
* Начальные данные создания звонка
|
|
4
5
|
* @hidden
|
|
@@ -12,6 +13,10 @@ type ConversationResponse = {
|
|
|
12
13
|
* URL для подключения
|
|
13
14
|
*/
|
|
14
15
|
endpoint: string;
|
|
16
|
+
/**
|
|
17
|
+
* URL для подключения по WebTransport
|
|
18
|
+
*/
|
|
19
|
+
wt_endpoint?: string;
|
|
15
20
|
/**
|
|
16
21
|
* Токен комнаты для подключения к звонку по ссылке
|
|
17
22
|
*/
|
|
@@ -27,5 +32,9 @@ type ConversationResponse = {
|
|
|
27
32
|
* Порядковый номер, присвоенный устройству при входе в звонок
|
|
28
33
|
*/
|
|
29
34
|
device_idx?: number;
|
|
35
|
+
turn_server?: IceServer;
|
|
36
|
+
stun_server?: IceServer;
|
|
37
|
+
client_type?: string;
|
|
38
|
+
token: string;
|
|
30
39
|
};
|
|
31
40
|
export default ConversationResponse;
|
package/types/ExternalId.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export declare namespace ExternalIdUtils {
|
|
|
19
19
|
function fromId(id: ExternalUserId, type?: ExternalIdType, deviceIdx?: number): ExternalParticipantId;
|
|
20
20
|
function fromSignalingParticipant(participant: SignalingMessage.Participant, useDecorative?: boolean): ExternalParticipantId | undefined;
|
|
21
21
|
function fromSignaling(signalingId: SignalingMessage.ExternalId, deviceIdx?: number): ExternalParticipantId;
|
|
22
|
+
function toSignaling(externalId: ExternalId): string;
|
|
22
23
|
function toString(externalId: ExternalId): ExternalIdString;
|
|
23
24
|
function fromIdToString(id: ExternalUserId, type?: ExternalIdType, deviceIdx?: number): ExternalIdString;
|
|
24
25
|
function fromString(stringId: ExternalIdString): ExternalParticipantId;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { HangupType, IceServer } from '../CallsSDK';
|
|
2
|
+
import CallType from '../enums/CallType';
|
|
3
|
+
import MediaOption from '../enums/MediaOption';
|
|
4
|
+
import { ExternalId } from './ExternalId';
|
|
5
|
+
/**
|
|
6
|
+
* Параметры, которые нужно вернуть для создания fastStart
|
|
7
|
+
*/
|
|
8
|
+
export interface InternalParams {
|
|
9
|
+
platform: string;
|
|
10
|
+
sdkVersion: string;
|
|
11
|
+
clientAppKey: string;
|
|
12
|
+
deviceId: string;
|
|
13
|
+
protocolVersion: number;
|
|
14
|
+
domainId?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface InternalCallerParams {
|
|
17
|
+
id: ID;
|
|
18
|
+
isConcurrent: boolean;
|
|
19
|
+
endpoint: string;
|
|
20
|
+
wtEndpoint: string;
|
|
21
|
+
clientType: string;
|
|
22
|
+
turn: IceServer;
|
|
23
|
+
stun: IceServer;
|
|
24
|
+
}
|
|
25
|
+
export interface ID {
|
|
26
|
+
internal: number;
|
|
27
|
+
external: string;
|
|
28
|
+
}
|
|
29
|
+
export interface FastStartParams {
|
|
30
|
+
conversationId: string;
|
|
31
|
+
internalParams: string;
|
|
32
|
+
externalIds?: ExternalId[];
|
|
33
|
+
opponentType: CallType;
|
|
34
|
+
mediaOptions: MediaOption[];
|
|
35
|
+
joiningAllowed?: boolean;
|
|
36
|
+
requireAuthToJoin?: boolean;
|
|
37
|
+
isVideo?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface FastStartResponse {
|
|
40
|
+
internalCallerParams: string;
|
|
41
|
+
rejectedParticipants: {
|
|
42
|
+
id: string;
|
|
43
|
+
status: HangupType;
|
|
44
|
+
}[];
|
|
45
|
+
}
|
|
46
|
+
export type FastStartHandler = (params: FastStartParams) => Promise<FastStartResponse>;
|
package/types/MovieShare.d.ts
CHANGED
|
@@ -47,6 +47,10 @@ export interface IAddMovieParams {
|
|
|
47
47
|
* MetaData ролика
|
|
48
48
|
*/
|
|
49
49
|
metadata?: IMovieMetaData;
|
|
50
|
+
/**
|
|
51
|
+
* Локаль пользователя, необходимо для корректного перевода, если ролик с дефолтным названием
|
|
52
|
+
*/
|
|
53
|
+
lang?: string;
|
|
50
54
|
}
|
|
51
55
|
export type ISharedMovieStateResponse = [
|
|
52
56
|
number,
|
package/types/Participant.d.ts
CHANGED
|
@@ -86,3 +86,12 @@ export interface Participant {
|
|
|
86
86
|
export interface IGetParticipantsParameters {
|
|
87
87
|
externalIds: ExternalId[];
|
|
88
88
|
}
|
|
89
|
+
export type ParticipantStateDataKey = 'hand' | 'drat';
|
|
90
|
+
export declare enum ParticipantStateDataValue {
|
|
91
|
+
OFF = "0",
|
|
92
|
+
ON = "1"
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Список состояний в виде ключ-значение. Максимальная длина ключей и значений - 5 символов. Пустые значения будут пропущены
|
|
96
|
+
*/
|
|
97
|
+
export type ParticipantStateData = Partial<Record<ParticipantStateDataKey, ParticipantStateDataValue>>;
|
|
@@ -6,12 +6,14 @@ import VideoSettings from './VideoSettings';
|
|
|
6
6
|
export type ServerSettings = {
|
|
7
7
|
camera: VideoSettings | null;
|
|
8
8
|
screenSharing: VideoSettings | null;
|
|
9
|
+
fastScreenSharing: VideoSettings | null;
|
|
9
10
|
};
|
|
10
11
|
export default ServerSettings;
|
|
11
12
|
export declare function compareServerSettings(ss1: ServerSettings, ss2: ServerSettings): boolean;
|
|
12
13
|
export declare function merge(ss: ServerSettings, other: ServerSettings): {
|
|
13
14
|
camera: VideoSettings;
|
|
14
15
|
screenSharing: VideoSettings;
|
|
16
|
+
fastScreenSharing: VideoSettings;
|
|
15
17
|
};
|
|
16
18
|
export declare function createEmptyServerSettings(): ServerSettings;
|
|
17
19
|
export declare function clone(ss: ServerSettings): ServerSettings;
|
|
@@ -20,7 +20,7 @@ import MediaSettings from './MediaSettings';
|
|
|
20
20
|
import { ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from './MovieShare';
|
|
21
21
|
import MuteStates from './MuteStates';
|
|
22
22
|
import { CompositeUserId, OkUserId, ParticipantId, ParticipantListMarker as ParticipantParticipantListMarker, ParticipantListMarkers, ParticipantListType as ParticipantParticipantListType } from './Participant';
|
|
23
|
-
import { ParticipantStreamDescription } from './ParticipantStreamDescription';
|
|
23
|
+
import { MediaType, ParticipantStreamDescription } from './ParticipantStreamDescription';
|
|
24
24
|
import { IRoomId } from './Room';
|
|
25
25
|
import VideoSettings from './VideoSettings';
|
|
26
26
|
import { ChatRoom } from './WaitingHall';
|
|
@@ -133,6 +133,7 @@ declare namespace SignalingMessage {
|
|
|
133
133
|
muteStates?: MuteStates;
|
|
134
134
|
asrInfo?: AsrInfo;
|
|
135
135
|
urlSharingInfo?: RoomUrlSharingInfo;
|
|
136
|
+
joinLink?: string;
|
|
136
137
|
}
|
|
137
138
|
export interface Room {
|
|
138
139
|
active?: boolean;
|
|
@@ -308,6 +309,7 @@ declare namespace SignalingMessage {
|
|
|
308
309
|
export interface SettingsUpdate extends Notification {
|
|
309
310
|
camera: VideoSettings;
|
|
310
311
|
screenSharing: VideoSettings;
|
|
312
|
+
fastScreenSharing: VideoSettings;
|
|
311
313
|
settings: Record<string, any>;
|
|
312
314
|
}
|
|
313
315
|
export interface StalledActivity extends Notification {
|
|
@@ -349,6 +351,7 @@ declare namespace SignalingMessage {
|
|
|
349
351
|
maxBitrate: number;
|
|
350
352
|
maxDimension: number;
|
|
351
353
|
};
|
|
354
|
+
mediaType?: MediaType;
|
|
352
355
|
}
|
|
353
356
|
export interface CustomData extends Notification {
|
|
354
357
|
participantId: OkUserId;
|
package/types/Statistics.d.ts
CHANGED
|
@@ -27,47 +27,194 @@ export interface ILocalIceCandidateStat extends IRemoteIceCandidateStat {
|
|
|
27
27
|
interface StatRtpOutboundVideo {
|
|
28
28
|
frameHeight?: number;
|
|
29
29
|
frameWidth?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Идентификатор потока RTP (RID).
|
|
32
|
+
*
|
|
33
|
+
* Используется для идентификации различных потоков видео (например, simulcast) в сессиях WebRTC.
|
|
34
|
+
*/
|
|
30
35
|
rid?: string;
|
|
31
36
|
framesSent?: number;
|
|
32
37
|
framesPerSecond?: number;
|
|
33
38
|
targetBitrate?: number;
|
|
34
39
|
}
|
|
35
40
|
export interface StatRtp extends StatRtpOutboundVideo {
|
|
41
|
+
/**
|
|
42
|
+
* Уникальный идентификатор источника синхронизации RTP
|
|
43
|
+
*/
|
|
36
44
|
ssrc: number;
|
|
45
|
+
/**
|
|
46
|
+
* Идентификатор медиалинии (MID)
|
|
47
|
+
*
|
|
48
|
+
* Используется для уникальной идентификации медиалинии в рамках WebRTC-сессии.
|
|
49
|
+
* MID помогает сопоставлять медиапотоки с их соответствующими трансиверами.
|
|
50
|
+
*/
|
|
51
|
+
mid?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Тип статистики (например, inbound-rtp, outbound-rtp)
|
|
54
|
+
*/
|
|
37
55
|
type: string;
|
|
56
|
+
/**
|
|
57
|
+
* Тип медиа (например, audio, video)
|
|
58
|
+
*/
|
|
38
59
|
kind: string;
|
|
60
|
+
/**
|
|
61
|
+
* Общее количество байтов, полученных по этому потоку
|
|
62
|
+
*/
|
|
39
63
|
bytesReceived: number;
|
|
64
|
+
/**
|
|
65
|
+
* Общее количество байтов, отправленных по этому потоку
|
|
66
|
+
*/
|
|
40
67
|
bytesSent: number;
|
|
68
|
+
/**
|
|
69
|
+
* Общее количество байтов заголовков, полученных по этому потоку
|
|
70
|
+
*/
|
|
41
71
|
headerBytesReceived: number;
|
|
72
|
+
/**
|
|
73
|
+
* Общее количество байтов заголовков, отправленных по этому потоку
|
|
74
|
+
*/
|
|
42
75
|
headerBytesSent: number;
|
|
76
|
+
/**
|
|
77
|
+
* Среднее значение джиттера в секундах
|
|
78
|
+
* Джиттер — это вариация задержки в получении пакетов данных.
|
|
79
|
+
*/
|
|
43
80
|
jitter: number;
|
|
81
|
+
/**
|
|
82
|
+
* Общее количество потерянных пакетов
|
|
83
|
+
*/
|
|
44
84
|
packetsLost: number;
|
|
85
|
+
/**
|
|
86
|
+
* Общее количество полученных пакетов
|
|
87
|
+
*/
|
|
45
88
|
packetsReceived: number;
|
|
89
|
+
/**
|
|
90
|
+
* Общее количество отправленных пакетов
|
|
91
|
+
*/
|
|
46
92
|
packetsSent: number;
|
|
93
|
+
/**
|
|
94
|
+
* Доля потерянных пакетов
|
|
95
|
+
*/
|
|
47
96
|
fractionLost: number;
|
|
97
|
+
/**
|
|
98
|
+
* Количество Picture Loss Indication (PLI) сообщений
|
|
99
|
+
* PLI — это сообщения, указывающие на потерю кадров изображения.
|
|
100
|
+
*/
|
|
48
101
|
pliCount: number;
|
|
102
|
+
/**
|
|
103
|
+
* Количество Full Intra Request (FIR) сообщений
|
|
104
|
+
* FIR — это запросы на отправку полного внутрикодированного кадра.
|
|
105
|
+
*/
|
|
49
106
|
firCount: number;
|
|
107
|
+
/**
|
|
108
|
+
* Количество Negative ACKnowledgement (NACK) сообщений
|
|
109
|
+
* NACK — это сообщения, указывающие на потерю пакетов данных.
|
|
110
|
+
*/
|
|
50
111
|
nackCount: number;
|
|
112
|
+
/**
|
|
113
|
+
* Идентификатор пользователя, связанный с этим потоком
|
|
114
|
+
*/
|
|
51
115
|
userId?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Пропускная способность в битах в секунду
|
|
118
|
+
*/
|
|
52
119
|
bandwidth?: number;
|
|
120
|
+
/**
|
|
121
|
+
* Процент потерянных пакетов
|
|
122
|
+
*/
|
|
53
123
|
packetLoss?: number;
|
|
124
|
+
/**
|
|
125
|
+
* Частота дискретизации в герцах
|
|
126
|
+
* Частота дискретизации определяет качество звука.
|
|
127
|
+
*/
|
|
54
128
|
clockRate?: number;
|
|
129
|
+
/**
|
|
130
|
+
* Название кодека
|
|
131
|
+
* @example audio/opus, video/vp8
|
|
132
|
+
*/
|
|
55
133
|
mimeType?: string;
|
|
134
|
+
/**
|
|
135
|
+
* Библиотека, которая используется для кодека
|
|
136
|
+
*/
|
|
137
|
+
encoderImplementation?: string;
|
|
138
|
+
/**
|
|
139
|
+
* Библиотека, которая используется для декодера
|
|
140
|
+
*/
|
|
141
|
+
decoderImplementation?: string;
|
|
142
|
+
/**
|
|
143
|
+
* Параметры кодека, есть только у audio кодеков
|
|
144
|
+
*/
|
|
145
|
+
sdpFmtpLine?: string;
|
|
146
|
+
/**
|
|
147
|
+
* Общее количество декодированных кадров
|
|
148
|
+
*/
|
|
56
149
|
framesDecoded?: number;
|
|
150
|
+
/**
|
|
151
|
+
* Общее количество полученных кадров
|
|
152
|
+
*/
|
|
57
153
|
framesReceived?: number;
|
|
154
|
+
/**
|
|
155
|
+
* Общее количество отброшенных кадров
|
|
156
|
+
*/
|
|
58
157
|
framesDropped?: number;
|
|
158
|
+
/**
|
|
159
|
+
* Изменение количества отброшенных кадров
|
|
160
|
+
*/
|
|
59
161
|
framesDroppedDelta?: number;
|
|
162
|
+
/**
|
|
163
|
+
* Изменение задержки между кадрами
|
|
164
|
+
*/
|
|
60
165
|
interframeDelayVariance?: number;
|
|
166
|
+
/**
|
|
167
|
+
* Общее количество полученных аудиосэмплов
|
|
168
|
+
*/
|
|
61
169
|
totalSamplesReceived?: number;
|
|
170
|
+
/**
|
|
171
|
+
* Общее время кодирования видео в секундах.
|
|
172
|
+
*
|
|
173
|
+
* Показывает, сколько времени было потрачено на кодирование видео кадров.
|
|
174
|
+
* Не применяется для аудио.
|
|
175
|
+
*/
|
|
176
|
+
totalEncodeTime?: number;
|
|
177
|
+
/**
|
|
178
|
+
* Общее количество замаскированных сэмплов
|
|
179
|
+
*/
|
|
62
180
|
concealedSamples?: number;
|
|
181
|
+
/**
|
|
182
|
+
* Количество вставленных сэмплов для замедления
|
|
183
|
+
*/
|
|
63
184
|
insertedSamplesForDeceleration?: number;
|
|
185
|
+
/**
|
|
186
|
+
* Количество удаленных сэмплов для ускорения
|
|
187
|
+
*/
|
|
64
188
|
removedSamplesForAcceleration?: number;
|
|
189
|
+
/**
|
|
190
|
+
* Количество замаскированных беззвучных сэмплов
|
|
191
|
+
*/
|
|
65
192
|
silentConcealedSamples?: number;
|
|
193
|
+
/**
|
|
194
|
+
* Количество событий маскировки
|
|
195
|
+
*/
|
|
66
196
|
concealmentEvents?: number;
|
|
197
|
+
/**
|
|
198
|
+
* Общее количество аудиоэнергии
|
|
199
|
+
* Аудиоэнергия — это мера мощности аудиосигнала.
|
|
200
|
+
*/
|
|
67
201
|
totalAudioEnergy?: number;
|
|
202
|
+
/**
|
|
203
|
+
* Общее время замерзания в секундах
|
|
204
|
+
*/
|
|
68
205
|
totalFreezesDuration: number;
|
|
206
|
+
/**
|
|
207
|
+
* Изменение общего времени замерзания
|
|
208
|
+
* Время замерзания — это период, в течение которого поток временно останавливается.
|
|
209
|
+
*/
|
|
69
210
|
totalFreezesDurationDelta?: number;
|
|
211
|
+
/**
|
|
212
|
+
* Количество событий замерзания
|
|
213
|
+
*/
|
|
70
214
|
freezeCount: number;
|
|
215
|
+
/**
|
|
216
|
+
* Изменение количества событий замерзания
|
|
217
|
+
*/
|
|
71
218
|
freezeCountDelta?: number;
|
|
72
219
|
}
|
|
73
220
|
export type StatItem = {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { WebTransportOptions } from '@fails-components/webtransport';
|
|
2
|
+
declare class WebTransportEventual {
|
|
3
|
+
private webTransport;
|
|
4
|
+
private stream;
|
|
5
|
+
private writer;
|
|
6
|
+
private reader;
|
|
7
|
+
private readonly url;
|
|
8
|
+
private readonly options;
|
|
9
|
+
private readonly compression;
|
|
10
|
+
private encoder;
|
|
11
|
+
private decoder;
|
|
12
|
+
onopen: ((this: WebTransportEventual, ev: Event) => any) | null;
|
|
13
|
+
onmessage: ((this: WebTransportEventual, ev: MessageEvent) => any) | null;
|
|
14
|
+
onerror: ((this: WebTransportEventual, ev: Event) => any) | null;
|
|
15
|
+
onclose: ((this: WebTransportEventual, ev: CloseEvent) => any) | null;
|
|
16
|
+
readyState: number;
|
|
17
|
+
constructor(url: string, options?: WebTransportOptions);
|
|
18
|
+
private getCompressionTypeFromUrl;
|
|
19
|
+
private connect;
|
|
20
|
+
private readLoop;
|
|
21
|
+
send(data: string): Promise<void>;
|
|
22
|
+
close(code?: number, reason?: string): void;
|
|
23
|
+
static isBrowserSupported(): boolean;
|
|
24
|
+
}
|
|
25
|
+
export { WebTransportEventual as WebTransport };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encodes a string into a Uint8Array, prepending the length of the string as a variable-length integer and optionally compressing it.
|
|
3
|
+
*/
|
|
4
|
+
declare class LengthPrefixedTextEncoder {
|
|
5
|
+
private readonly encoder;
|
|
6
|
+
private readonly compression;
|
|
7
|
+
private readonly lengthEncoder;
|
|
8
|
+
constructor(compression?: 'gzip' | 'deflate' | 'deflate-raw' | null);
|
|
9
|
+
/**
|
|
10
|
+
* Encodes the given string into a Uint8Array.
|
|
11
|
+
*
|
|
12
|
+
* @param data The string to encode.
|
|
13
|
+
* @returns A Uint8Array containing the length-prefixed and optionally compressed encoded string.
|
|
14
|
+
* @throws {RangeError} If the string length exceeds the maximum representable value.
|
|
15
|
+
*/
|
|
16
|
+
encode(data: string): Uint8Array;
|
|
17
|
+
private compress;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Decodes a stream of Uint8Arrays into strings, where each string
|
|
21
|
+
* is prefixed by its length as a variable-length integer and optionally decompressed.
|
|
22
|
+
*/
|
|
23
|
+
declare class LengthPrefixedTextDecoder {
|
|
24
|
+
private readonly decoder;
|
|
25
|
+
private readonly compression;
|
|
26
|
+
private readonly lengthDecoder;
|
|
27
|
+
private buffer;
|
|
28
|
+
private expectedLength;
|
|
29
|
+
private offset;
|
|
30
|
+
private lengthPrefixLength;
|
|
31
|
+
constructor(compression?: 'gzip' | 'deflate' | 'deflate-raw' | null);
|
|
32
|
+
/**
|
|
33
|
+
* Decodes a Uint8Array into a list of strings.
|
|
34
|
+
*
|
|
35
|
+
* @param data The Uint8Array to decode.
|
|
36
|
+
* @returns An array of decoded strings.
|
|
37
|
+
*/
|
|
38
|
+
decode(data: Uint8Array): string[];
|
|
39
|
+
/**
|
|
40
|
+
* Reads the length prefix from the beginning of the data.
|
|
41
|
+
*
|
|
42
|
+
* @param data The Uint8Array containing the length prefix.
|
|
43
|
+
* @returns The length of the message, or null if there's not enough data to read the length.
|
|
44
|
+
*/
|
|
45
|
+
private readLength;
|
|
46
|
+
private decompress;
|
|
47
|
+
}
|
|
48
|
+
export { LengthPrefixedTextEncoder, LengthPrefixedTextDecoder };
|
package/utils/Lz4.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function lz4Decompress(input: Uint8Array, outputLength: number): Uint8Array<ArrayBuffer>;
|
|
@@ -13,7 +13,7 @@ export declare function createWriteBuffer(): {
|
|
|
13
13
|
putUi32(v: number): void;
|
|
14
14
|
putUi64(v: number): void;
|
|
15
15
|
putF(v: number): void;
|
|
16
|
-
ui8array(): Uint8Array
|
|
16
|
+
ui8array(): Uint8Array<ArrayBuffer>;
|
|
17
17
|
};
|
|
18
18
|
export declare function createReadBuffer(buf: BufferSource): {
|
|
19
19
|
peek(): number;
|