@vkontakte/calls-sdk 2.8.12-dev.26c45af4.0 → 2.8.12-dev.2d04df5e.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 +28 -7
- package/abstract/BaseApi.d.ts +3 -1
- package/abstract/BaseSignaling.d.ts +6 -5
- package/calls-sdk.cjs.js +7 -13
- package/calls-sdk.esm.js +3295 -2345
- 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} +52 -45
- 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} +4 -4
- 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 -5
- package/classes/transport/SimulcastSender.d.ts +27 -0
- package/classes/transport/Transport.d.ts +9 -1
- package/default/Api.d.ts +5 -3
- package/default/ApiExternal.d.ts +2 -1
- 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 +3 -3
- package/static/ApiTransport.d.ts +3 -0
- 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 +28 -11
- package/static/ParticipantConnectionStatusUtils.d.ts +1 -0
- package/static/Sdp.d.ts +3 -0
- package/static/SignalingCapabilities.d.ts +1 -1
- package/static/SimulcastInfo.d.ts +5 -3
- package/static/Utils.d.ts +1 -2
- package/static/WebRTCUtils.d.ts +8 -7
- package/types/Api.d.ts +9 -0
- package/types/Capabilities.d.ts +1 -0
- package/types/Conversation.d.ts +12 -2
- package/types/Participant.d.ts +1 -0
- package/types/SignalingMessage.d.ts +5 -1
- package/types/WebTransport.d.ts +17 -16
- package/utils/IceServers.d.ts +2 -0
- package/utils/NavigatorPermissions.d.ts +2 -2
- package/utils/SerializeLatest.d.ts +5 -0
|
@@ -42,12 +42,12 @@ export default class ServerTransport extends BaseTransport {
|
|
|
42
42
|
private _rtpReceiversByStreamId;
|
|
43
43
|
private _producerSessionId;
|
|
44
44
|
private _newAudioShareTrack;
|
|
45
|
-
private _simulcastInfo;
|
|
46
45
|
private readonly _debug;
|
|
47
46
|
private readonly _logger;
|
|
48
47
|
private readonly _statAggregator;
|
|
49
48
|
private readonly _codecStatsAggregator;
|
|
50
|
-
|
|
49
|
+
private readonly _simulcast;
|
|
50
|
+
constructor(signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null, onFirstMediaSent?: (() => void) | null);
|
|
51
51
|
updateStatisticsInterval(): void;
|
|
52
52
|
open(observer?: boolean): void;
|
|
53
53
|
close(error?: Error): void;
|
|
@@ -85,8 +85,6 @@ export default class ServerTransport extends BaseTransport {
|
|
|
85
85
|
private _detectStaleTracks;
|
|
86
86
|
private _allocateConsumer;
|
|
87
87
|
private _processOffer;
|
|
88
|
-
private _findFirstSimTransceiver;
|
|
89
|
-
private _setupSimulcastTransceiver;
|
|
90
88
|
private _acceptProducer;
|
|
91
89
|
private _replaceScreenShareTrack;
|
|
92
90
|
private _handleTracks;
|
|
@@ -101,7 +99,6 @@ export default class ServerTransport extends BaseTransport {
|
|
|
101
99
|
private _onReplacedTrack;
|
|
102
100
|
private _onSourcesChanged;
|
|
103
101
|
getStreamWaitingTimeMs(streamId: string, targetRtpTimestamp: number): number;
|
|
104
|
-
private _changeSimulcastInfo;
|
|
105
102
|
private _monitorRtpShare;
|
|
106
103
|
private _startMonitorRtpShareInterval;
|
|
107
104
|
private _stopMonitorRtpShareInterval;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
2
|
+
import { type DebugLogger } from '../../static/Debug';
|
|
3
|
+
import type VideoSettings from '../../types/VideoSettings';
|
|
4
|
+
import { MediaSource } from '../MediaSource';
|
|
5
|
+
import StatsLogger from '../StatsLogger';
|
|
6
|
+
export default class SimulcastSender {
|
|
7
|
+
private _pc;
|
|
8
|
+
private _transceiver;
|
|
9
|
+
private _simulcastInfo;
|
|
10
|
+
private readonly _signaling;
|
|
11
|
+
private readonly _mediaSource;
|
|
12
|
+
private readonly _getCameraSettings;
|
|
13
|
+
private readonly _debug;
|
|
14
|
+
private readonly _logger;
|
|
15
|
+
constructor(signaling: BaseSignaling, mediaSource: MediaSource, getCameraSettings: () => VideoSettings | null, debug?: DebugLogger, logger?: StatsLogger | null);
|
|
16
|
+
configureFromRemoteOffer(pc: RTCPeerConnection): Promise<void>;
|
|
17
|
+
finalizeAnswer(sdp: string): string;
|
|
18
|
+
sync({ force }?: {
|
|
19
|
+
force?: boolean;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
replaceTrack(track: MediaStreamTrack): boolean;
|
|
22
|
+
reset(): void;
|
|
23
|
+
private _findTransceiver;
|
|
24
|
+
private _findMediaSection;
|
|
25
|
+
private _getTrackConfig;
|
|
26
|
+
private _syncReplacedTrack;
|
|
27
|
+
}
|
|
@@ -48,13 +48,17 @@ 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
|
+
private _vadController;
|
|
54
|
+
constructor(topology: TransportTopology, signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings, debug?: DebugLogger, logger?: StatsLogger | null, statAggregator?: StatAggregator | null, codecStatsAggregator?: CodecStatsAggregator | null, onFirstMediaSent?: (() => void) | null);
|
|
52
55
|
updateSettings(settings: ServerSettings): void;
|
|
53
56
|
updateStatisticsInterval(): void;
|
|
54
57
|
allocate(participantId: ParticipantId, isMaster?: boolean): void;
|
|
55
58
|
open(participantIds: ParticipantId[], peerId?: string | null, observer?: boolean, force?: boolean): void;
|
|
56
59
|
close(participantId: ParticipantId): void;
|
|
57
60
|
destroy(): void;
|
|
61
|
+
stopFirstMediaSentProbe(): void;
|
|
58
62
|
holdClose(): void;
|
|
59
63
|
setRemoteHold(hold: boolean): void;
|
|
60
64
|
getTopology(): TransportTopology;
|
|
@@ -69,6 +73,8 @@ export declare class Transport extends EventEmitter {
|
|
|
69
73
|
private _setStates;
|
|
70
74
|
private _setLocalState;
|
|
71
75
|
private _onSignalingNotification;
|
|
76
|
+
private _handleFirstMediaSent;
|
|
77
|
+
private _getFirstMediaSentCallback;
|
|
72
78
|
private _onTopologyChanged;
|
|
73
79
|
private _createDirectTransport;
|
|
74
80
|
private _createServerTransport;
|
|
@@ -91,6 +97,8 @@ export declare class Transport extends EventEmitter {
|
|
|
91
97
|
private _onAnimojiStream;
|
|
92
98
|
/** Обработчик, досылающий MediaSourceEvent.SOURCE_CHANGED событие до аллокации транспортов */
|
|
93
99
|
private _onAnimojiStatus;
|
|
100
|
+
private _createVad;
|
|
101
|
+
private _updateVadTrack;
|
|
94
102
|
private _createAnimojiTransport;
|
|
95
103
|
private _removeAnimojiTransport;
|
|
96
104
|
getStreamWaitingTimeMs(streamId: string, targetRtpTimestamp: number): number;
|
package/default/Api.d.ts
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import BaseApi, { ClientStats } from '../abstract/BaseApi';
|
|
2
2
|
import CallType from '../enums/CallType';
|
|
3
3
|
import HangupType from '../enums/HangupType';
|
|
4
|
+
import { IHangupParams } from '../types/Api';
|
|
4
5
|
import ConversationParams from '../types/ConversationParams';
|
|
5
6
|
import ConversationResponse from '../types/ConversationResponse';
|
|
6
7
|
import { ExternalId, ExternalParticipantId, ExternalUserId } from '../types/ExternalId';
|
|
7
8
|
import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
|
|
8
9
|
import PushData from '../types/PushData';
|
|
9
10
|
export default class Api extends BaseApi {
|
|
10
|
-
private _userId;
|
|
11
11
|
private _uuid;
|
|
12
12
|
private _idCache;
|
|
13
13
|
private _callUnsafe;
|
|
14
|
-
protected _call(method: string, data?: any, noSession?: boolean): Promise<any>;
|
|
14
|
+
protected _call(method: string, data?: any, noSession?: boolean, allowReauthorize?: boolean): Promise<any>;
|
|
15
15
|
userId(participantId: ParticipantId): ExternalParticipantId;
|
|
16
16
|
authorize(): Promise<void>;
|
|
17
17
|
private _getAnonymLoginCacheKey;
|
|
18
18
|
private _getCachedAnonymLogin;
|
|
19
19
|
private _setCachedAnonymLogin;
|
|
20
20
|
private _removeCachedAnonymLogin;
|
|
21
|
+
private _reauthorize;
|
|
21
22
|
private _applyAnonymLogin;
|
|
23
|
+
private _sendClientStats;
|
|
22
24
|
logClientStats(items: ClientStats[]): void;
|
|
23
25
|
uploadDebugLogs(conversationId: string, startTime: number, endTime: number, log: string): Promise<void>;
|
|
24
26
|
joinConversation(conversationId: string, isVideo?: boolean, chatId?: string): Promise<ConversationResponse>;
|
|
@@ -56,7 +58,7 @@ export default class Api extends BaseApi {
|
|
|
56
58
|
getConversationParams(conversationId?: string): Promise<ConversationParams>;
|
|
57
59
|
getUserId(): OkUserId | null;
|
|
58
60
|
setUserId(userId: OkUserId): void;
|
|
59
|
-
hangupConversation(conversationId: string, reason?: HangupType): void;
|
|
61
|
+
hangupConversation(conversationId: string, reason?: HangupType, params?: Partial<IHangupParams>): void;
|
|
60
62
|
removeHistoryRecords(recordIds: number[]): Promise<void>;
|
|
61
63
|
cleanup(): void;
|
|
62
64
|
getServerTime(): Promise<number>;
|
package/default/ApiExternal.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IHangupParams } from '../types/Api';
|
|
1
2
|
import { IAPIBaseUrl, IApiEnv } from '../types/Params';
|
|
2
3
|
export declare class ApiExternal {
|
|
3
4
|
private readonly _uuid;
|
|
@@ -8,5 +9,5 @@ export declare class ApiExternal {
|
|
|
8
9
|
private _sessionKey;
|
|
9
10
|
constructor(apiEvn: IApiEnv, apiKey: string, callToken: string, baseApiUrl?: IAPIBaseUrl);
|
|
10
11
|
authorize(): Promise<boolean>;
|
|
11
|
-
hangupConversation(conversationId: string): Promise<void>;
|
|
12
|
+
hangupConversation(conversationId: string, params?: Partial<IHangupParams>): Promise<void>;
|
|
12
13
|
}
|
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.2d04df5e.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",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"**/*.d.ts"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@vkontakte/calls-audio-effects": "1.
|
|
17
|
+
"@vkontakte/calls-audio-effects": "1.4.1",
|
|
18
18
|
"@vkontakte/calls-video-effects": "2.2.3-beta.7",
|
|
19
19
|
"@vkontakte/calls-vmoji": "1.0.10-beta.17",
|
|
20
20
|
"@vkontakte/libvpx": "2.0.9",
|
|
@@ -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/ApiTransport.d.ts
CHANGED
|
@@ -7,4 +7,7 @@ export declare function sendBeakon(method: string, params?: {
|
|
|
7
7
|
export declare function request(method: string, params?: {
|
|
8
8
|
[key: string]: any;
|
|
9
9
|
}, noSession?: boolean, customEndpoint?: string): Promise<any>;
|
|
10
|
+
export declare function requestKeepalive(method: string, params?: {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}, noSession?: boolean): Promise<any>;
|
|
10
13
|
export declare function sendFormData(url: string, data: FormData): Promise<void>;
|
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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { VideoEffects } from '@vkontakte/calls-video-effects';
|
|
2
|
-
import type { EffectVoiceChange } from '@vkontakte/calls-audio-effects';
|
|
2
|
+
import type { EffectVoiceChange, VadControllerOptions, VadLib } from '@vkontakte/calls-audio-effects';
|
|
3
3
|
import type * as Vmoji from '@vkontakte/calls-vmoji';
|
|
4
4
|
import { IAsrData } from '../types/Asr';
|
|
5
5
|
import { ConversationData } from '../types/Conversation';
|
|
@@ -193,6 +193,14 @@ export type ParamsObject = {
|
|
|
193
193
|
* Можно установить позднее методом `setAudioEffects`
|
|
194
194
|
*/
|
|
195
195
|
audioEffects: EffectVoiceChange | null;
|
|
196
|
+
/**
|
|
197
|
+
* Namespace библиотеки VAD из `@vkontakte/calls-audio-effects`.
|
|
198
|
+
*
|
|
199
|
+
* Можно установить методом `setVad`
|
|
200
|
+
*/
|
|
201
|
+
vad: VadLib | null;
|
|
202
|
+
/** Настройки VAD (threshold, hangoverMs, enabled) */
|
|
203
|
+
vadOptions: VadControllerOptions;
|
|
196
204
|
/**
|
|
197
205
|
* Максимальная ширина видео в пикселях для видео эффекта
|
|
198
206
|
*
|
|
@@ -485,13 +493,6 @@ export type ParamsObject = {
|
|
|
485
493
|
* _По умолчанию: `false`_
|
|
486
494
|
*/
|
|
487
495
|
webtransport: boolean;
|
|
488
|
-
/**
|
|
489
|
-
* Включить поддержку webtransport для сигналинга в FireFox
|
|
490
|
-
* Отдельная ручка, так как есть проблемы сейчас с FF
|
|
491
|
-
*
|
|
492
|
-
* _По умолчанию: `false`_
|
|
493
|
-
*/
|
|
494
|
-
webtransportFF: boolean;
|
|
495
496
|
/**
|
|
496
497
|
* Ждать подтверждения от бэкенда для команд startStream/stopStream.
|
|
497
498
|
* При включении: reject без соединения, resolve/reject по ответу бэкенда,
|
|
@@ -512,6 +513,16 @@ export type ParamsObject = {
|
|
|
512
513
|
* _По умолчанию: `false`_
|
|
513
514
|
*/
|
|
514
515
|
enableSessionStateUpdates: boolean;
|
|
516
|
+
/**
|
|
517
|
+
* Использовать `<audio>` вместо `<video>` для воспроизведения звука в desktop Safari
|
|
518
|
+
* @hidden
|
|
519
|
+
*/
|
|
520
|
+
safariAudioElement: boolean;
|
|
521
|
+
/**
|
|
522
|
+
* Отправлять пустой ICE candidate (end-of-candidates) удалённому пиру
|
|
523
|
+
* @hidden
|
|
524
|
+
*/
|
|
525
|
+
forwardEmptyIceCandidate: boolean;
|
|
515
526
|
/**
|
|
516
527
|
* Получен локальный стрим с камеры/микрофона
|
|
517
528
|
*/
|
|
@@ -899,7 +910,7 @@ export type ParamsObject = {
|
|
|
899
910
|
/**
|
|
900
911
|
* Собеседник подключился к сигналлингу
|
|
901
912
|
*/
|
|
902
|
-
onPeerRegistered?: (conversationId?: string) => void;
|
|
913
|
+
onPeerRegistered?: (conversationId?: string, externalIds?: ExternalId[]) => void;
|
|
903
914
|
};
|
|
904
915
|
export default abstract class Params {
|
|
905
916
|
private static _params;
|
|
@@ -967,6 +978,10 @@ export default abstract class Params {
|
|
|
967
978
|
static get displaySurface(): DisplayCaptureSurfaceType;
|
|
968
979
|
static get audioEffects(): EffectVoiceChange | null;
|
|
969
980
|
static set audioEffects(value: EffectVoiceChange | null);
|
|
981
|
+
static get vad(): VadLib | null;
|
|
982
|
+
static set vad(value: VadLib | null);
|
|
983
|
+
static get vadOptions(): VadControllerOptions;
|
|
984
|
+
static set vadOptions(value: VadControllerOptions);
|
|
970
985
|
static get videoEffects(): VideoEffects | null;
|
|
971
986
|
static set videoEffects(value: VideoEffects | null);
|
|
972
987
|
static get videoEffectMaxWidth(): number;
|
|
@@ -1031,10 +1046,11 @@ export default abstract class Params {
|
|
|
1031
1046
|
static get enableVideoEffectsFpsDegradation(): boolean;
|
|
1032
1047
|
static get simulcast(): boolean;
|
|
1033
1048
|
static get webtransport(): boolean;
|
|
1034
|
-
static get webtransportFF(): boolean;
|
|
1035
1049
|
static get waitForRecordResponse(): boolean;
|
|
1036
1050
|
static get transparentAudio(): boolean;
|
|
1037
1051
|
static get enableSessionStateUpdates(): boolean;
|
|
1052
|
+
static get safariAudioElement(): boolean;
|
|
1053
|
+
static get forwardEmptyIceCandidate(): boolean;
|
|
1038
1054
|
static toJSON(): {
|
|
1039
1055
|
apiKey: string;
|
|
1040
1056
|
apiEnv: string;
|
|
@@ -1068,9 +1084,10 @@ export default abstract class Params {
|
|
|
1068
1084
|
switchVideoAtBadNetwork: boolean;
|
|
1069
1085
|
simulcast: boolean;
|
|
1070
1086
|
webtransport: boolean;
|
|
1071
|
-
webtransportFF: boolean;
|
|
1072
1087
|
waitForRecordResponse: boolean;
|
|
1073
1088
|
transparentAudio: boolean;
|
|
1074
1089
|
enableSessionStateUpdates: boolean;
|
|
1090
|
+
safariAudioElement: boolean;
|
|
1091
|
+
forwardEmptyIceCandidate: boolean;
|
|
1075
1092
|
};
|
|
1076
1093
|
}
|
|
@@ -11,6 +11,7 @@ declare namespace ParticipantConnectionStatusUtils {
|
|
|
11
11
|
function computeEffective(status: ParticipantConnectionStatus): ParticipantStatus;
|
|
12
12
|
function setSessionState(status: ParticipantConnectionStatus, sessionState?: ParticipantSessionState, sessionStateConnectedBySpeaker?: boolean): StatusTransition;
|
|
13
13
|
function setTransport(status: ParticipantConnectionStatus, transport: ParticipantStatus): StatusTransition;
|
|
14
|
+
function setStalled(status: ParticipantConnectionStatus, stalled: boolean): StatusTransition;
|
|
14
15
|
function setSessionStateApplicable(status: ParticipantConnectionStatus, applicable: boolean): StatusTransition;
|
|
15
16
|
}
|
|
16
17
|
export default ParticipantConnectionStatusUtils;
|
package/static/Sdp.d.ts
ADDED
|
@@ -6,8 +6,10 @@ export declare const SIMULCAST_DEFAULT: {
|
|
|
6
6
|
BITRATE: number;
|
|
7
7
|
};
|
|
8
8
|
export declare const SIMULCAST_SCALABILITY_MODE = "L1T2";
|
|
9
|
-
export declare const MAP_RID_TO_SCALE_RESOLUTION_DOWN_BY: Record<string, number>;
|
|
10
9
|
export declare function isEqualSimulcastInfo(si1: ISimulcastInfo | null, si2: ISimulcastInfo | null): boolean;
|
|
11
10
|
export declare function findBitrateAsc(maxDimension: number, bitrates: VideoBitrateSettings[]): number;
|
|
12
|
-
export declare function calculateSimulcastInfo(width?: number, height?: number, bitrates?: VideoBitrateSettings[]):
|
|
13
|
-
|
|
11
|
+
export declare function calculateSimulcastInfo(width?: number, height?: number, bitrates?: VideoBitrateSettings[], fps?: number): {
|
|
12
|
+
streams: import("../types/SimulcastInfo").SimulcastStreamInfo[];
|
|
13
|
+
};
|
|
14
|
+
export declare function findScaleResolutionDownBy(rid: string | undefined, simulcastInfo: ISimulcastInfo): number;
|
|
15
|
+
export declare function applySimulcastInfoToEncodings(encodings: RTCRtpEncodingParameters[], simulcastInfo: ISimulcastInfo, maxDimension?: number, maxBitrate?: number): void;
|
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<{
|
|
@@ -77,6 +77,5 @@ declare namespace Utils {
|
|
|
77
77
|
function objectReduce<R, T extends object>(obj: T, callback: (acc: R, value: T[keyof T], key: keyof T) => R, initialValue: R): R;
|
|
78
78
|
const setImmediate: (fn: VoidFunction) => VoidFunction;
|
|
79
79
|
function isObject(obj: unknown): obj is object;
|
|
80
|
-
function patchSimulcastAnswerSdp(sdp: string, trans: RTCRtpTransceiver, width: number, height: number): string;
|
|
81
80
|
}
|
|
82
81
|
export default Utils;
|
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/Api.d.ts
ADDED
package/types/Capabilities.d.ts
CHANGED
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
|
};
|