@vkontakte/calls-sdk 2.8.12-dev.e23c81f4.0 → 2.8.12-dev.ecf77be8.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 +20 -6
- package/abstract/BaseApi.d.ts +1 -0
- package/abstract/BaseSignaling.d.ts +6 -5
- package/calls-sdk.cjs.js +10 -10
- package/calls-sdk.esm.js +3126 -2321
- package/classes/CallRegistry.d.ts +5 -1
- package/classes/ExternalIdCache.d.ts +1 -0
- package/classes/MediaSource.d.ts +4 -0
- package/classes/StatsLogger.d.ts +17 -2
- package/classes/{Conversation.d.ts → conversation/Conversation.d.ts} +50 -47
- package/classes/conversation/Conversation.testUtils.d.ts +148 -0
- package/classes/{ConversationResponseValidator.d.ts → conversation/ConversationResponseValidator.d.ts} +1 -1
- package/classes/{DisplayLayoutRequester.d.ts → conversation/DisplayLayoutRequester.d.ts} +5 -5
- package/classes/conversation/index.d.ts +1 -0
- package/classes/stat/CallFinishClassifier.d.ts +11 -0
- package/classes/stat/CallLifecycleStats.d.ts +42 -0
- package/classes/stat/ConversationStats.d.ts +5 -4
- package/classes/stat/FirstMediaSentProbe.d.ts +13 -0
- package/classes/stat/StatAggregator.d.ts +4 -0
- package/classes/stat/StatPings.d.ts +1 -2
- package/classes/stat/StatSignalingCommands.d.ts +1 -2
- package/classes/transport/BaseTransport.d.ts +7 -1
- package/classes/transport/DirectTransport.d.ts +2 -1
- package/classes/transport/ServerTransport.d.ts +2 -1
- package/classes/transport/Transport.d.ts +6 -1
- package/default/Api.d.ts +1 -2
- package/default/Signaling.d.ts +12 -15
- package/default/SignalingTransport.d.ts +10 -2
- package/enums/ClientHangupReason.d.ts +7 -0
- package/enums/HangupType.d.ts +0 -1
- package/enums/Stat.d.ts +5 -1
- package/package.json +2 -2
- package/static/AuthData.d.ts +10 -0
- package/static/Debug.d.ts +1 -0
- package/static/External.d.ts +1 -1
- package/static/Params.d.ts +15 -10
- package/static/Utils.d.ts +1 -1
- package/static/WebRTCUtils.d.ts +8 -7
- package/types/Conversation.d.ts +12 -2
- package/types/SignalingMessage.d.ts +4 -1
- package/types/WebTransport.d.ts +17 -16
- package/utils/IceServers.d.ts +2 -0
- package/utils/NavigatorPermissions.d.ts +2 -2
|
@@ -43,11 +43,12 @@ export default class ServerTransport extends BaseTransport {
|
|
|
43
43
|
private _producerSessionId;
|
|
44
44
|
private _newAudioShareTrack;
|
|
45
45
|
private _simulcastInfo;
|
|
46
|
+
private _isSimulcastNegotiated;
|
|
46
47
|
private readonly _debug;
|
|
47
48
|
private readonly _logger;
|
|
48
49
|
private readonly _statAggregator;
|
|
49
50
|
private readonly _codecStatsAggregator;
|
|
50
|
-
constructor(signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null);
|
|
51
|
+
constructor(signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null, onFirstMediaSent?: (() => void) | null);
|
|
51
52
|
updateStatisticsInterval(): void;
|
|
52
53
|
open(observer?: boolean): void;
|
|
53
54
|
close(error?: Error): void;
|
|
@@ -48,13 +48,16 @@ export declare class Transport extends EventEmitter {
|
|
|
48
48
|
private readonly _logger;
|
|
49
49
|
private readonly _statAggregator;
|
|
50
50
|
private readonly _codecStatsAggregator;
|
|
51
|
-
|
|
51
|
+
private readonly _onFirstMediaSent;
|
|
52
|
+
private _firstMediaSentProbeStopped;
|
|
53
|
+
constructor(topology: TransportTopology, signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null, onFirstMediaSent?: (() => void) | null);
|
|
52
54
|
updateSettings(settings: ServerSettings): void;
|
|
53
55
|
updateStatisticsInterval(): void;
|
|
54
56
|
allocate(participantId: ParticipantId, isMaster?: boolean): void;
|
|
55
57
|
open(participantIds: ParticipantId[], peerId?: string | null, observer?: boolean, force?: boolean): void;
|
|
56
58
|
close(participantId: ParticipantId): void;
|
|
57
59
|
destroy(): void;
|
|
60
|
+
stopFirstMediaSentProbe(): void;
|
|
58
61
|
holdClose(): void;
|
|
59
62
|
setRemoteHold(hold: boolean): void;
|
|
60
63
|
getTopology(): TransportTopology;
|
|
@@ -69,6 +72,8 @@ export declare class Transport extends EventEmitter {
|
|
|
69
72
|
private _setStates;
|
|
70
73
|
private _setLocalState;
|
|
71
74
|
private _onSignalingNotification;
|
|
75
|
+
private _handleFirstMediaSent;
|
|
76
|
+
private _getFirstMediaSentCallback;
|
|
72
77
|
private _onTopologyChanged;
|
|
73
78
|
private _createDirectTransport;
|
|
74
79
|
private _createServerTransport;
|
package/default/Api.d.ts
CHANGED
|
@@ -7,11 +7,10 @@ import { ExternalId, ExternalParticipantId, ExternalUserId } from '../types/Exte
|
|
|
7
7
|
import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
|
|
8
8
|
import PushData from '../types/PushData';
|
|
9
9
|
export default class Api extends BaseApi {
|
|
10
|
-
private _userId;
|
|
11
10
|
private _uuid;
|
|
12
11
|
private _idCache;
|
|
13
12
|
private _callUnsafe;
|
|
14
|
-
protected _call(method: string, data?: any, noSession?: boolean): Promise<any>;
|
|
13
|
+
protected _call(method: string, data?: any, noSession?: boolean, allowReauthorize?: boolean): Promise<any>;
|
|
15
14
|
userId(participantId: ParticipantId): ExternalParticipantId;
|
|
16
15
|
authorize(): Promise<void>;
|
|
17
16
|
private _getAnonymLoginCacheKey;
|
package/default/Signaling.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import BaseSignaling, { AddParticipantParams } from '../abstract/BaseSignaling';
|
|
2
|
-
import StatsLogger from '../classes/StatsLogger';
|
|
3
2
|
import { ParticipantIdRegistry } from '../classes/ParticipantIdRegistry';
|
|
4
3
|
import { SharingStatReport } from '../classes/screenshare/SharingStatReport';
|
|
5
4
|
import { StatAggregator } from '../classes/stat/StatAggregator';
|
|
6
5
|
import { StatPings } from '../classes/stat/StatPings';
|
|
7
6
|
import { StatSignalingCommands } from '../classes/stat/StatSignalingCommands';
|
|
8
|
-
import
|
|
7
|
+
import StatsLogger from '../classes/StatsLogger';
|
|
9
8
|
import ConversationFeature from '../enums/ConversationFeature';
|
|
10
9
|
import ConversationOption from '../enums/ConversationOption';
|
|
11
10
|
import MediaOption from '../enums/MediaOption';
|
|
12
11
|
import SignalingConnectionType from '../enums/SignalingConnectionType';
|
|
12
|
+
import TransportTopology from '../enums/TransportTopology';
|
|
13
13
|
import UserRole from '../enums/UserRole';
|
|
14
14
|
import { type DebugLogger } from '../static/Debug';
|
|
15
15
|
import { JSONObject } from '../static/Json';
|
|
@@ -35,13 +35,13 @@ export default class Signaling extends BaseSignaling {
|
|
|
35
35
|
private datachannelCommandsQueue;
|
|
36
36
|
private incomingCache;
|
|
37
37
|
private responseHandlers;
|
|
38
|
+
private disposed;
|
|
38
39
|
private connectionType;
|
|
39
40
|
private conversationResolve;
|
|
40
41
|
private conversationReject;
|
|
41
42
|
private connected;
|
|
42
43
|
private listenersReady;
|
|
43
44
|
private peerId;
|
|
44
|
-
private conversationId;
|
|
45
45
|
private connectionMessageWaitTimer;
|
|
46
46
|
private participantIdRegistry;
|
|
47
47
|
private producerNotificationDataChannel;
|
|
@@ -60,22 +60,17 @@ export default class Signaling extends BaseSignaling {
|
|
|
60
60
|
setAbortSignal(signal: AbortSignal | undefined): void;
|
|
61
61
|
setEndpoint(endpoint: string): void;
|
|
62
62
|
setWebTransportEndpoint(endpoint: string | null): void;
|
|
63
|
-
setConversationId(conversationId: string): void;
|
|
64
63
|
setParticipantIdRegistry(participantIdRegistry: ParticipantIdRegistry): void;
|
|
65
64
|
setProducerNotificationDataChannel(dataChannel: RTCDataChannel): void;
|
|
66
65
|
setProducerCommandDataChannel(dataChannel: RTCDataChannel): void;
|
|
67
66
|
useCommandDataChannel(status: boolean): void;
|
|
68
|
-
/**
|
|
69
|
-
* Free used resources
|
|
70
|
-
*/
|
|
71
|
-
cleanup(): void;
|
|
72
67
|
/**
|
|
73
68
|
* Open a connection with a signaling server
|
|
74
69
|
*/
|
|
75
70
|
connect(connectionType: SignalingConnectionType): Promise<SignalingMessage.Connection>;
|
|
76
71
|
getNextCommandSequenceNumber(): number;
|
|
77
|
-
hangup(reason: string): Promise<SignalingMessage
|
|
78
|
-
sendCandidate(participantId: ParticipantId, candidate:
|
|
72
|
+
hangup(reason: string): Promise<SignalingMessage>;
|
|
73
|
+
sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidateInit): Promise<SignalingMessage>;
|
|
79
74
|
requestTestMode(consumerCommand: string, producerCommand: string | null): Promise<SignalingMessage>;
|
|
80
75
|
sendSdp(participantId: ParticipantId, sdp: RTCSessionDescriptionInit, extraPayload?: Record<string, any>): Promise<SignalingMessage>;
|
|
81
76
|
acceptCall(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
@@ -138,10 +133,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
138
133
|
acceptPromotion(reject?: boolean): Promise<SignalingMessage>;
|
|
139
134
|
feedback(key: string): Promise<SignalingMessage>;
|
|
140
135
|
getHandQueue(): Promise<SignalingMessage>;
|
|
141
|
-
|
|
142
|
-
* Close a connection with a signaling server
|
|
143
|
-
*/
|
|
144
|
-
close(): void;
|
|
136
|
+
dispose(cause?: Error): void;
|
|
145
137
|
/**
|
|
146
138
|
* Этот метод нужен т.к. после получения сообщения "connected" устанавливается транспорт
|
|
147
139
|
* и подписывается на сигналинг. Данные приходят очень быстро и транспорт пропускает
|
|
@@ -173,20 +165,25 @@ export default class Signaling extends BaseSignaling {
|
|
|
173
165
|
private _onError;
|
|
174
166
|
private _serializeErrorEvent;
|
|
175
167
|
private _onClose;
|
|
176
|
-
private
|
|
168
|
+
private _terminate;
|
|
169
|
+
private _fail;
|
|
177
170
|
private _isRecordCommand;
|
|
178
171
|
private _resolvePendingRecordCommands;
|
|
179
172
|
private _handleCommandResponse;
|
|
180
173
|
private _handleCommandsQueue;
|
|
181
174
|
private _startResponseTimer;
|
|
175
|
+
private _resolveCommandWithoutResponse;
|
|
182
176
|
private _serializeBinary;
|
|
183
177
|
private _serializeJson;
|
|
184
178
|
private _convertDisplayLayout;
|
|
185
179
|
private _waitConnectionMessage;
|
|
186
180
|
private _stopWaitConnectionMessage;
|
|
181
|
+
private _onTransportConnecting;
|
|
187
182
|
private _onTransportFailed;
|
|
188
183
|
private _onTransportReconnectScheduled;
|
|
189
184
|
private _onTransportConnectionDead;
|
|
185
|
+
private _attachNotificationCallError;
|
|
186
|
+
private _createSignalingCallError;
|
|
190
187
|
private _getSocketType;
|
|
191
188
|
private _markTransportStat;
|
|
192
189
|
private _logTransportStat;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import SignalingConnectionType from '../enums/SignalingConnectionType';
|
|
2
2
|
import { SignalingTransportType } from '../enums/SignalingTransportStat';
|
|
3
|
+
import { DebugLogger } from '../static/Debug';
|
|
3
4
|
export declare enum SignalingTransportFailure {
|
|
4
5
|
EMPTY_ENDPOINT = "EMPTY_ENDPOINT",
|
|
5
6
|
NETWORK_ERROR = "NETWORK_ERROR",
|
|
@@ -8,13 +9,19 @@ export declare enum SignalingTransportFailure {
|
|
|
8
9
|
export type SignalingTransportFailedEvent = {
|
|
9
10
|
failure: SignalingTransportFailure;
|
|
10
11
|
message: string;
|
|
12
|
+
source: SignalingTransportType;
|
|
11
13
|
remote?: boolean;
|
|
12
14
|
};
|
|
13
15
|
export type SignalingTransportReconnectEvent = {
|
|
14
16
|
count: number;
|
|
15
17
|
delay: number;
|
|
16
18
|
};
|
|
19
|
+
export type SignalingTransportConnectingEvent = {
|
|
20
|
+
connectionType: SignalingConnectionType;
|
|
21
|
+
source: SignalingTransportType;
|
|
22
|
+
};
|
|
17
23
|
export type SignalingTransportHandlers = {
|
|
24
|
+
onConnecting: (event: SignalingTransportConnectingEvent) => void;
|
|
18
25
|
onOpen: () => void;
|
|
19
26
|
onMessage: (event: MessageEvent) => void;
|
|
20
27
|
onError: (event: Event) => void;
|
|
@@ -38,7 +45,8 @@ export default class SignalingTransport {
|
|
|
38
45
|
private abortSignal;
|
|
39
46
|
private manualClose;
|
|
40
47
|
private currentType;
|
|
41
|
-
|
|
48
|
+
private readonly _debug;
|
|
49
|
+
constructor(debug: DebugLogger | undefined, handlers: SignalingTransportHandlers);
|
|
42
50
|
get readyState(): number | null;
|
|
43
51
|
get type(): SignalingTransportType;
|
|
44
52
|
setEndpoint(endpoint: string): void;
|
|
@@ -49,7 +57,7 @@ export default class SignalingTransport {
|
|
|
49
57
|
resetReconnectCount(): void;
|
|
50
58
|
connect(connectionType: SignalingConnectionType): void;
|
|
51
59
|
close(code?: number): void;
|
|
52
|
-
send(data: string | ArrayBuffer): void
|
|
60
|
+
send(data: string | ArrayBuffer): Promise<void>;
|
|
53
61
|
private _connect;
|
|
54
62
|
private _connectWebTransport;
|
|
55
63
|
private _connectWebSocket;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import HangupType from './HangupType';
|
|
2
|
+
/**
|
|
3
|
+
* Причины завершения звонка, которые клиент может передать в {@link hangup}/{@link declineCall}
|
|
4
|
+
* и пробросить в сигналинг без маппинга.
|
|
5
|
+
*/
|
|
6
|
+
export type ClientHangupReason = HangupType.HUNGUP | HangupType.CANCELED | HangupType.REJECTED | HangupType.BUSY | HangupType.MISSED | HangupType.CALL_TIMEOUT;
|
|
7
|
+
export default ClientHangupReason;
|
package/enums/HangupType.d.ts
CHANGED
|
@@ -20,7 +20,6 @@ declare enum HangupType {
|
|
|
20
20
|
CALLER_IS_REJECTED = "CALLER_IS_REJECTED",
|
|
21
21
|
UNKNOWN_ERROR = "UNKNOWN_ERROR",
|
|
22
22
|
UNSUPPORTED = "UNSUPPORTED",
|
|
23
|
-
OLD_VERSION = "OLD_VERSION",
|
|
24
23
|
SERVICE_DISABLED = "SERVICE_DISABLED",
|
|
25
24
|
SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE",
|
|
26
25
|
EXTERNAL_API_ERROR = "EXTERNAL_API_ERROR",
|
package/enums/Stat.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
declare const enum Stat {
|
|
2
|
+
CALL_INIT = "call_init",
|
|
3
|
+
CALL_START = "call_start",
|
|
4
|
+
CALL_ACCEPTED_OUTGOING = "call_accepted_outgoing",
|
|
5
|
+
CALL_ACCEPTED_INCOMING = "call_accepted_incoming",
|
|
6
|
+
FIRST_MEDIA_SENT = "first_media_sent",
|
|
2
7
|
CALL_FINISH = "call_finish",// событие отправляемое в конце звонка
|
|
3
8
|
CODEC_USAGE = "codec_usage",// событие когда меняется кодек
|
|
4
9
|
SIGNALING_CONNECTED = "signaling_connected",// measure
|
|
@@ -7,7 +12,6 @@ declare const enum Stat {
|
|
|
7
12
|
FIRST_MEDIA_RECEIVED = "first_media_received",
|
|
8
13
|
CALL_DECLINED_OR_HANGED_LOCALLY = "CallDeclinedOrHangedLocally",
|
|
9
14
|
USER_FEEDBACK_RECEIVED = "UserFeedbackReceived",
|
|
10
|
-
CALL_START = "call_start",
|
|
11
15
|
SIGNALING_PING_SUMMARY = "signaling_ping_summary",
|
|
12
16
|
SIGNALING_COMMAND_SUMMARY = "signaling_command_summary",
|
|
13
17
|
WEBSOCKET_CONNECTED = "websocket_connected",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/calls-sdk",
|
|
3
|
-
"version": "2.8.12-dev.
|
|
3
|
+
"version": "2.8.12-dev.ecf77be8.0",
|
|
4
4
|
"author": "vk.com",
|
|
5
5
|
"description": "Library for video calls based on the vk.com platform",
|
|
6
6
|
"homepage": "https://vk.com",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"fflate": "^0.8.2",
|
|
23
23
|
"messagepack": "1.1.12",
|
|
24
24
|
"simple-ebml-builder": "0.2.2",
|
|
25
|
-
"webrtc-adapter": "
|
|
25
|
+
"webrtc-adapter": "9.0.5"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/static/AuthData.d.ts
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
|
+
import type { OkUserId } from '../types/Participant';
|
|
1
2
|
export default abstract class AuthData {
|
|
2
3
|
private static _sessionKey;
|
|
3
4
|
private static _sessionSecretKey;
|
|
4
5
|
private static _accessToken;
|
|
6
|
+
private static _userId;
|
|
7
|
+
private static _reauthorizePromise;
|
|
5
8
|
static get sessionKey(): string | undefined;
|
|
6
9
|
static set sessionKey(value: string | undefined);
|
|
7
10
|
static get sessionSecretKey(): string | undefined;
|
|
8
11
|
static set sessionSecretKey(value: string | undefined);
|
|
9
12
|
static get accessToken(): string | undefined;
|
|
10
13
|
static set accessToken(value: string | undefined);
|
|
14
|
+
static get userId(): OkUserId | null;
|
|
15
|
+
static set userId(value: OkUserId | null);
|
|
11
16
|
static isEmpty(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Дедуплицирует одновременные попытки реавторизации из разных инстансов Api.
|
|
19
|
+
* Первый вызов выполняет authorizeFn, остальные ждут того же промиса.
|
|
20
|
+
*/
|
|
21
|
+
static reauthorize(authorizeFn: () => Promise<void>): Promise<void>;
|
|
12
22
|
}
|
package/static/Debug.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export type DebugSessionLogger = DebugLogger & {
|
|
|
21
21
|
readonly sessionId: string | null;
|
|
22
22
|
readonly conversationId: string | null;
|
|
23
23
|
setConversationId(conversationId: string | null): void;
|
|
24
|
+
send(type: DebugMessageType, ...args: any[]): void;
|
|
24
25
|
};
|
|
25
26
|
declare namespace Debug {
|
|
26
27
|
type ContextProvider = () => DebugMessageContext;
|
package/static/External.d.ts
CHANGED
|
@@ -637,6 +637,6 @@ declare namespace External {
|
|
|
637
637
|
/**
|
|
638
638
|
* Собеседник подключился к сигналлингу
|
|
639
639
|
*/
|
|
640
|
-
function onPeerRegistered(conversationId?: string): void;
|
|
640
|
+
function onPeerRegistered(conversationId?: string, externalIds?: ExternalId[]): void;
|
|
641
641
|
}
|
|
642
642
|
export default External;
|
package/static/Params.d.ts
CHANGED
|
@@ -485,13 +485,6 @@ export type ParamsObject = {
|
|
|
485
485
|
* _По умолчанию: `false`_
|
|
486
486
|
*/
|
|
487
487
|
webtransport: boolean;
|
|
488
|
-
/**
|
|
489
|
-
* Включить поддержку webtransport для сигналинга в FireFox
|
|
490
|
-
* Отдельная ручка, так как есть проблемы сейчас с FF
|
|
491
|
-
*
|
|
492
|
-
* _По умолчанию: `false`_
|
|
493
|
-
*/
|
|
494
|
-
webtransportFF: boolean;
|
|
495
488
|
/**
|
|
496
489
|
* Ждать подтверждения от бэкенда для команд startStream/stopStream.
|
|
497
490
|
* При включении: reject без соединения, resolve/reject по ответу бэкенда,
|
|
@@ -512,6 +505,16 @@ export type ParamsObject = {
|
|
|
512
505
|
* _По умолчанию: `false`_
|
|
513
506
|
*/
|
|
514
507
|
enableSessionStateUpdates: boolean;
|
|
508
|
+
/**
|
|
509
|
+
* Использовать `<audio>` вместо `<video>` для воспроизведения звука в desktop Safari
|
|
510
|
+
* @hidden
|
|
511
|
+
*/
|
|
512
|
+
safariAudioElement: boolean;
|
|
513
|
+
/**
|
|
514
|
+
* Отправлять пустой ICE candidate (end-of-candidates) удалённому пиру
|
|
515
|
+
* @hidden
|
|
516
|
+
*/
|
|
517
|
+
forwardEmptyIceCandidate: boolean;
|
|
515
518
|
/**
|
|
516
519
|
* Получен локальный стрим с камеры/микрофона
|
|
517
520
|
*/
|
|
@@ -899,7 +902,7 @@ export type ParamsObject = {
|
|
|
899
902
|
/**
|
|
900
903
|
* Собеседник подключился к сигналлингу
|
|
901
904
|
*/
|
|
902
|
-
onPeerRegistered?: (conversationId?: string) => void;
|
|
905
|
+
onPeerRegistered?: (conversationId?: string, externalIds?: ExternalId[]) => void;
|
|
903
906
|
};
|
|
904
907
|
export default abstract class Params {
|
|
905
908
|
private static _params;
|
|
@@ -1031,10 +1034,11 @@ export default abstract class Params {
|
|
|
1031
1034
|
static get enableVideoEffectsFpsDegradation(): boolean;
|
|
1032
1035
|
static get simulcast(): boolean;
|
|
1033
1036
|
static get webtransport(): boolean;
|
|
1034
|
-
static get webtransportFF(): boolean;
|
|
1035
1037
|
static get waitForRecordResponse(): boolean;
|
|
1036
1038
|
static get transparentAudio(): boolean;
|
|
1037
1039
|
static get enableSessionStateUpdates(): boolean;
|
|
1040
|
+
static get safariAudioElement(): boolean;
|
|
1041
|
+
static get forwardEmptyIceCandidate(): boolean;
|
|
1038
1042
|
static toJSON(): {
|
|
1039
1043
|
apiKey: string;
|
|
1040
1044
|
apiEnv: string;
|
|
@@ -1068,9 +1072,10 @@ export default abstract class Params {
|
|
|
1068
1072
|
switchVideoAtBadNetwork: boolean;
|
|
1069
1073
|
simulcast: boolean;
|
|
1070
1074
|
webtransport: boolean;
|
|
1071
|
-
webtransportFF: boolean;
|
|
1072
1075
|
waitForRecordResponse: boolean;
|
|
1073
1076
|
transparentAudio: boolean;
|
|
1074
1077
|
enableSessionStateUpdates: boolean;
|
|
1078
|
+
safariAudioElement: boolean;
|
|
1079
|
+
forwardEmptyIceCandidate: boolean;
|
|
1075
1080
|
};
|
|
1076
1081
|
}
|
package/static/Utils.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare const DEVICE_IDX_PARAMETER = "d";
|
|
|
9
9
|
/** @hidden */
|
|
10
10
|
declare namespace Utils {
|
|
11
11
|
function patchLocalSDP(sdp: string, preferH264: boolean, brokenH264Decoder: boolean, preferVP9: boolean, isAudioNack?: boolean): string;
|
|
12
|
-
function patchRemoteSDP(sdp: string,
|
|
12
|
+
function patchRemoteSDP(sdp: string, preferH264: boolean, brokenH264: boolean, preferVP9: boolean, brokenVP9Encoder: boolean, brokenVP9Decoder: boolean): string;
|
|
13
13
|
function getPeerIdString(peerId: SignalingMessage.PeerId): string;
|
|
14
14
|
function comparePeerId(peerId1: SignalingMessage.PeerId, peerId2: SignalingMessage.PeerId): boolean;
|
|
15
15
|
function getPeerConnectionHostInfo(pc: RTCPeerConnection): Promise<{
|
package/static/WebRTCUtils.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare enum FacingMode {
|
|
|
20
20
|
/**
|
|
21
21
|
* Известные браузеры
|
|
22
22
|
*/
|
|
23
|
-
export type BrowserName = '
|
|
23
|
+
export type BrowserName = 'Edge' | 'Chrome' | 'Firefox' | 'Yandex' | 'Opera' | 'Sferum';
|
|
24
24
|
declare namespace WebRTCUtils {
|
|
25
25
|
/**
|
|
26
26
|
* До вызова этого метода бесполезно опрашивать другие публичные методы.
|
|
@@ -122,6 +122,10 @@ declare namespace WebRTCUtils {
|
|
|
122
122
|
* Проверяет поддержку WebRTC браузером
|
|
123
123
|
*/
|
|
124
124
|
function isBrowserSupported(): boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Возвращает первую отсутствующую capability в стабильном порядке.
|
|
127
|
+
*/
|
|
128
|
+
function getBrowserSupportFailure(): BrowserSupportFailure | null;
|
|
125
129
|
/**
|
|
126
130
|
* Проверяет поддержку шаринга экрана браузером
|
|
127
131
|
*/
|
|
@@ -139,17 +143,14 @@ declare namespace WebRTCUtils {
|
|
|
139
143
|
* В некоторых браузерах VP9 decoder сломан
|
|
140
144
|
*/
|
|
141
145
|
function isBrokenVP9Decoder(): boolean;
|
|
142
|
-
/**
|
|
143
|
-
* Изменился формат описания датаканала в SDP
|
|
144
|
-
* @link https://blog.mozilla.org/webrtc/how-to-avoid-data-channel-breaking/
|
|
145
|
-
*/
|
|
146
|
-
function isOldDataChannelDescription(): boolean;
|
|
147
146
|
/**
|
|
148
147
|
* Может ли браузер делать H264 приоритетным
|
|
149
148
|
*/
|
|
150
149
|
function canPreferH264(): boolean;
|
|
151
150
|
/**
|
|
152
|
-
*
|
|
151
|
+
* Поддержка simulcast браузером.
|
|
152
|
+
* Safari корректно поддерживает simulcast начиная с версии 18.
|
|
153
|
+
* Firefox поддерживает simulcast с VP8 начиная с версии 134.
|
|
153
154
|
*/
|
|
154
155
|
function isSimulcastSupportedByBrowser(): boolean;
|
|
155
156
|
/**
|
package/types/Conversation.d.ts
CHANGED
|
@@ -7,7 +7,8 @@ import MediaOption from '../enums/MediaOption';
|
|
|
7
7
|
import UserRole from '../enums/UserRole';
|
|
8
8
|
import { AsrInfo } from './Asr';
|
|
9
9
|
import { IFeaturesPerRole } from './ConversationFeature';
|
|
10
|
-
import { ExternalId, ExternalParticipantId } from './ExternalId';
|
|
10
|
+
import { ExternalId, ExternalParticipantId, ExternalUserId } from './ExternalId';
|
|
11
|
+
import { FastJoinHandler } from './FastJoin';
|
|
11
12
|
import { FastStartHandler } from './FastStart';
|
|
12
13
|
import MediaModifiers from './MediaModifiers';
|
|
13
14
|
import MuteStates from './MuteStates';
|
|
@@ -84,6 +85,16 @@ export type ConversationOnStartParams = {
|
|
|
84
85
|
onFastStart?: FastStartHandler;
|
|
85
86
|
conversationId?: string;
|
|
86
87
|
};
|
|
88
|
+
export type ConversationOnJoinParams = {
|
|
89
|
+
conversationId?: string;
|
|
90
|
+
mediaOptions: MediaOption[];
|
|
91
|
+
chatId?: string;
|
|
92
|
+
joinLink?: string;
|
|
93
|
+
observedIds?: ExternalUserId[];
|
|
94
|
+
payload?: string;
|
|
95
|
+
onFastJoin?: FastJoinHandler;
|
|
96
|
+
anonymous?: boolean;
|
|
97
|
+
};
|
|
87
98
|
export type StartConversationParams = {
|
|
88
99
|
opponentIds?: OkUserId[];
|
|
89
100
|
opponentType: CallType;
|
|
@@ -94,7 +105,6 @@ export type StartConversationParams = {
|
|
|
94
105
|
requireAuthToJoin?: boolean;
|
|
95
106
|
onlyAdminCanShareMovie?: boolean;
|
|
96
107
|
externalIds?: ExternalId[];
|
|
97
|
-
startedTime: number;
|
|
98
108
|
onFastStart?: FastStartHandler;
|
|
99
109
|
conversationId?: string;
|
|
100
110
|
};
|
|
@@ -34,8 +34,11 @@ export type RecordInfo = {
|
|
|
34
34
|
recordExternalOwnerId?: string;
|
|
35
35
|
};
|
|
36
36
|
export interface SignalingResponse extends SignalingMessage {
|
|
37
|
-
response?: SignalingCommandType;
|
|
38
37
|
error?: string;
|
|
38
|
+
errorCode?: string;
|
|
39
|
+
errorMessage?: string;
|
|
40
|
+
message?: string;
|
|
41
|
+
response?: SignalingCommandType;
|
|
39
42
|
reason?: HangupType | FatalError;
|
|
40
43
|
sequence?: number;
|
|
41
44
|
type: 'response' | 'error' | 'timeout';
|
package/types/WebTransport.d.ts
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
import { WebTransportOptions } from '@fails-components/webtransport';
|
|
2
|
+
import { DebugLogger } from '../static/Debug';
|
|
2
3
|
declare class WebTransportEventual {
|
|
4
|
+
static isBrowserSupported(): boolean;
|
|
5
|
+
onopen: ((this: WebTransportEventual, ev: Event) => any) | null;
|
|
6
|
+
onmessage: ((this: WebTransportEventual, ev: MessageEvent) => any) | null;
|
|
7
|
+
onerror: ((this: WebTransportEventual, ev: Event) => any) | null;
|
|
8
|
+
onclose: ((this: WebTransportEventual, ev: CloseEvent) => any) | null;
|
|
9
|
+
readyState: number;
|
|
3
10
|
private webTransport;
|
|
4
|
-
private stream;
|
|
5
11
|
private writer;
|
|
6
|
-
private reader;
|
|
7
12
|
private readonly url;
|
|
8
13
|
private readonly options;
|
|
9
14
|
private readonly compression;
|
|
10
|
-
private closeRequested;
|
|
11
|
-
private closeEventEmitted;
|
|
12
15
|
private encoder;
|
|
13
16
|
private decoder;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
readyState: number;
|
|
19
|
-
constructor(url: string, options?: WebTransportOptions);
|
|
17
|
+
private readonly _debug;
|
|
18
|
+
constructor(url: string, options?: WebTransportOptions, debug?: DebugLogger);
|
|
19
|
+
send(data: string): Promise<void>;
|
|
20
|
+
close(code?: number, reason?: string): void;
|
|
20
21
|
private getCompressionTypeFromUrl;
|
|
21
22
|
private connect;
|
|
22
|
-
private
|
|
23
|
+
private observeClosed;
|
|
23
24
|
private readLoop;
|
|
24
|
-
|
|
25
|
+
private fail;
|
|
26
|
+
private handleStreamError;
|
|
27
|
+
private requestNativeClose;
|
|
28
|
+
private finishClose;
|
|
29
|
+
private emitEvent;
|
|
25
30
|
private createErrorEvent;
|
|
26
|
-
close(code?: number, reason?: string): void;
|
|
27
|
-
private closeConnectedTransport;
|
|
28
|
-
private emitClose;
|
|
29
|
-
static isBrowserSupported(): boolean;
|
|
30
31
|
}
|
|
31
32
|
export { WebTransportEventual as WebTransport };
|
|
@@ -2,8 +2,8 @@ type Device = 'camera' | 'microphone';
|
|
|
2
2
|
type PermissionStatusState = typeof PermissionStatus.prototype.state;
|
|
3
3
|
type EventListener = (name: Device, state: PermissionStatusState) => void;
|
|
4
4
|
export declare class NavigatorPermissions {
|
|
5
|
-
private _cameraPermissionStatus
|
|
6
|
-
private _microphonePermissionStatus
|
|
5
|
+
private _cameraPermissionStatus?;
|
|
6
|
+
private _microphonePermissionStatus?;
|
|
7
7
|
private _listener;
|
|
8
8
|
static isSupported(): boolean;
|
|
9
9
|
init(listener: EventListener): Promise<void>;
|