@vkontakte/calls-sdk 2.8.12-dev.d694e8d3.0 → 2.8.12-dev.dbe4e248.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 +16 -3
- package/abstract/BaseSignaling.d.ts +5 -4
- package/calls-sdk.cjs.js +10 -10
- package/calls-sdk.esm.js +1030 -1030
- package/classes/CallRegistry.d.ts +1 -1
- package/classes/{Conversation.d.ts → conversation/Conversation.d.ts} +37 -34
- 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/CallLifecycleStats.d.ts +0 -4
- package/classes/transport/DirectTransport.d.ts +1 -0
- package/classes/transport/ServerTransport.d.ts +1 -0
- package/default/Signaling.d.ts +7 -12
- package/default/SignalingTransport.d.ts +6 -1
- package/enums/ClientHangupReason.d.ts +7 -0
- package/enums/Stat.d.ts +0 -1
- package/package.json +2 -2
- package/static/Utils.d.ts +1 -1
- package/static/WebRTCUtils.d.ts +1 -6
- package/utils/IceServers.d.ts +2 -0
- package/utils/NavigatorPermissions.d.ts +2 -2
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
import type { IEffect } from '@vkontakte/calls-video-effects';
|
|
2
2
|
import type { RGBTuple } from '@vkontakte/calls-vmoji';
|
|
3
|
-
import BaseApi from '
|
|
4
|
-
import BaseLogger from '
|
|
5
|
-
import { AddParticipantParams } from '
|
|
6
|
-
import ConversationFeature from '
|
|
7
|
-
import ConversationOption from '
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import {
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
3
|
+
import BaseApi from '../../abstract/BaseApi';
|
|
4
|
+
import BaseLogger from '../../abstract/BaseLogger';
|
|
5
|
+
import { AddParticipantParams } from '../../abstract/BaseSignaling';
|
|
6
|
+
import ConversationFeature from '../../enums/ConversationFeature';
|
|
7
|
+
import ConversationOption from '../../enums/ConversationOption';
|
|
8
|
+
import type ClientHangupReason from '../../enums/ClientHangupReason';
|
|
9
|
+
import MediaOption from '../../enums/MediaOption';
|
|
10
|
+
import UpdateDisplayLayoutErrorReason from '../../enums/UpdateDisplayLayoutErrorReason';
|
|
11
|
+
import UserRole from '../../enums/UserRole';
|
|
12
|
+
import UserType from '../../enums/UserType';
|
|
13
|
+
import { DebugMessageType } from '../../static/Debug';
|
|
14
|
+
import { JSONObject } from '../../static/Json';
|
|
15
|
+
import { IAsrStartParams, IAsrStopParams } from '../../types/Asr';
|
|
16
|
+
import { AudienceModeHandsResponse } from '../../types/AudienceMode';
|
|
17
|
+
import { ConversationData, ConversationOnJoinParams, ConversationOnStartParams } from '../../types/Conversation';
|
|
18
|
+
import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk } from '../../types/ExternalId';
|
|
19
|
+
import MediaModifiers from '../../types/MediaModifiers';
|
|
20
|
+
import MediaSettings, { IVideoDimentions } from '../../types/MediaSettings';
|
|
21
|
+
import { IAddMovieParams, IUpdateMovieData } from '../../types/MovieShare';
|
|
22
|
+
import MuteStates from '../../types/MuteStates';
|
|
23
|
+
import { CompositeUserId, IGetParticipantsParameters, OkUserId, ParticipantId, ParticipantStateData } from '../../types/Participant';
|
|
24
|
+
import { DisplayLayoutRequest, ParticipantLayout } from '../../types/ParticipantLayout';
|
|
25
|
+
import { ParticipantListChunkParameters } from '../../types/ParticipantListChunk';
|
|
26
|
+
import ParticipantPriority from '../../types/ParticipantPriority';
|
|
27
|
+
import { ParticipantStreamDescription } from '../../types/ParticipantStreamDescription';
|
|
28
|
+
import { ScreenCaptureSettings } from '../../types/ScreenCaptureSettings';
|
|
29
|
+
import SignalingMessage from '../../types/SignalingMessage';
|
|
30
|
+
import { WaitingHallResponse } from '../../types/WaitingHall';
|
|
31
|
+
import EventEmitter from '../EventEmitter';
|
|
31
32
|
export default class Conversation extends EventEmitter {
|
|
32
33
|
private readonly _api;
|
|
33
34
|
private readonly _signaling;
|
|
@@ -42,7 +43,6 @@ export default class Conversation extends EventEmitter {
|
|
|
42
43
|
private _waitingHallHoldPending;
|
|
43
44
|
private _participantState;
|
|
44
45
|
private _participants;
|
|
45
|
-
private _pendingParticipants;
|
|
46
46
|
private _directTransportIsMaster?;
|
|
47
47
|
private _transport;
|
|
48
48
|
private _debugInfo;
|
|
@@ -57,6 +57,8 @@ export default class Conversation extends EventEmitter {
|
|
|
57
57
|
private _serverSettings;
|
|
58
58
|
private _serverTimeOffset;
|
|
59
59
|
private _delayedHangup;
|
|
60
|
+
private _hangupEmitted;
|
|
61
|
+
private _hangupPromise;
|
|
60
62
|
private _abortController;
|
|
61
63
|
private _registeredPeerReceived;
|
|
62
64
|
private _calleeUnavailableTimer;
|
|
@@ -103,8 +105,8 @@ export default class Conversation extends EventEmitter {
|
|
|
103
105
|
private _getMainRoomParticipants;
|
|
104
106
|
private _decodeExternalConversationParams;
|
|
105
107
|
accept(mediaOptions: MediaOption[]): Promise<ConversationData>;
|
|
106
|
-
decline(): Promise<void>;
|
|
107
|
-
hangup(): Promise<void>;
|
|
108
|
+
decline(reason?: ClientHangupReason): Promise<void>;
|
|
109
|
+
hangup(reason?: ClientHangupReason): Promise<void>;
|
|
108
110
|
addParticipant(participantIds: ExternalId[], params?: AddParticipantParams): Promise<void>;
|
|
109
111
|
addParticipantLegacy(participantIds: CompositeUserId[], params?: AddParticipantParams): Promise<void>;
|
|
110
112
|
removeParticipant(participantId: CompositeUserId, ban?: boolean): Promise<void>;
|
|
@@ -113,8 +115,10 @@ export default class Conversation extends EventEmitter {
|
|
|
113
115
|
private _openTransport;
|
|
114
116
|
private _allocateParticipantTransport;
|
|
115
117
|
private _cleanupRegistry;
|
|
118
|
+
private _emitHangupOnce;
|
|
116
119
|
private _close;
|
|
117
120
|
destroy(): void;
|
|
121
|
+
private _destroy;
|
|
118
122
|
private _getConversationParams;
|
|
119
123
|
private _setConversationParams;
|
|
120
124
|
private _buildSignalingEndpoint;
|
|
@@ -199,7 +203,7 @@ export default class Conversation extends EventEmitter {
|
|
|
199
203
|
private _cleanupTransportForHold;
|
|
200
204
|
private _cleanupSpeakerDetector;
|
|
201
205
|
private _cleanupSpecListener;
|
|
202
|
-
private
|
|
206
|
+
private _disposeSignaling;
|
|
203
207
|
private _onAddParticipant;
|
|
204
208
|
private _onRemoveParticipant;
|
|
205
209
|
changeDevice(kind: MediaDeviceKind): Promise<void>;
|
|
@@ -232,7 +236,7 @@ export default class Conversation extends EventEmitter {
|
|
|
232
236
|
private _getWaitingForPromotionStatus;
|
|
233
237
|
putHandsDown(): Promise<void>;
|
|
234
238
|
requestKeyFrame(participantStreamDescription: ParticipantStreamDescription): Promise<void | SignalingMessage>;
|
|
235
|
-
requestTestMode(consumerCommand: string, producerCommand: string): Promise<void>;
|
|
239
|
+
requestTestMode(consumerCommand: string, producerCommand: string): Promise<void | SignalingMessage>;
|
|
236
240
|
updateDisplayLayout(layouts: ParticipantLayout[]): Promise<void>;
|
|
237
241
|
requestDisplayLayout(requests: DisplayLayoutRequest[]): Promise<void>;
|
|
238
242
|
feedback(key: string): Promise<SignalingMessage>;
|
|
@@ -436,7 +440,6 @@ export default class Conversation extends EventEmitter {
|
|
|
436
440
|
private _setMuteStatesForRoomId;
|
|
437
441
|
private _forceOpenTransportForAloneInCall;
|
|
438
442
|
private _registerParticipant;
|
|
439
|
-
private _getParticipants;
|
|
440
443
|
private _getParticipant;
|
|
441
444
|
}
|
|
442
445
|
declare function _resetPendingInstance(): void;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { FetchMock } from 'vitest-fetch-mock';
|
|
2
|
+
import { Mock } from 'vitest';
|
|
3
|
+
import { Client, Server } from 'mock-socket';
|
|
4
|
+
import { ISharedMovieInfo, OkUserId } from '../../CallsSDK';
|
|
5
|
+
import Api from '../../default/Api';
|
|
6
|
+
import CallDirection from '../../enums/CallDirection';
|
|
7
|
+
import ConversationOption from '../../enums/ConversationOption';
|
|
8
|
+
import TransportState from '../../enums/TransportState';
|
|
9
|
+
import TransportTopology from '../../enums/TransportTopology';
|
|
10
|
+
import { ParticipantStatus } from '../../static/External';
|
|
11
|
+
import { ExternalParticipantId } from '../../types/ExternalId';
|
|
12
|
+
import { ParticipantListMarkers } from '../../types/Participant';
|
|
13
|
+
import SignalingMessage from '../../types/SignalingMessage';
|
|
14
|
+
import Conversation from './Conversation';
|
|
15
|
+
declare function createParams(): {
|
|
16
|
+
apiKey: string;
|
|
17
|
+
apiEnv: string;
|
|
18
|
+
onLocalStream: Mock<import("@vitest/spy").Procedure>;
|
|
19
|
+
onLocalStatus: Mock<import("@vitest/spy").Procedure>;
|
|
20
|
+
onConversation: Mock<import("@vitest/spy").Procedure>;
|
|
21
|
+
onLocalSharedMovieInfo: Mock<import("@vitest/spy").Procedure>;
|
|
22
|
+
onRemoteSharedMovieInfo: Mock<import("@vitest/spy").Procedure>;
|
|
23
|
+
onRemoteSharedUrl: Mock<import("@vitest/spy").Procedure>;
|
|
24
|
+
onCallState: Mock<import("@vitest/spy").Procedure>;
|
|
25
|
+
onOptionsChanged: Mock<import("@vitest/spy").Procedure>;
|
|
26
|
+
onPinnedParticipant: Mock<import("@vitest/spy").Procedure>;
|
|
27
|
+
onRemoteMediaSettings: Mock<import("@vitest/spy").Procedure>;
|
|
28
|
+
onRemoteParticipantState: Mock<import("@vitest/spy").Procedure>;
|
|
29
|
+
onLocalPin: Mock<import("@vitest/spy").Procedure>;
|
|
30
|
+
onDebugMessage: Mock<import("@vitest/spy").Procedure>;
|
|
31
|
+
onHangup: Mock<import("@vitest/spy").Procedure>;
|
|
32
|
+
onRemoteRemoved: Mock<import("@vitest/spy").Procedure>;
|
|
33
|
+
onConversationParticipantListChunk: Mock<import("@vitest/spy").Procedure>;
|
|
34
|
+
onRoomParticipantsUpdated: Mock<import("@vitest/spy").Procedure>;
|
|
35
|
+
onChatRoomUpdated: Mock<import("@vitest/spy").Procedure>;
|
|
36
|
+
onRemoteStatus: Mock<import("@vitest/spy").Procedure>;
|
|
37
|
+
onSpeakerChanged: Mock<import("@vitest/spy").Procedure>;
|
|
38
|
+
};
|
|
39
|
+
export type ConversationTestParams = ReturnType<typeof createParams>;
|
|
40
|
+
export type ConversationTestTools = {
|
|
41
|
+
readonly endpointURL: string;
|
|
42
|
+
readonly fetchMocker: FetchMock;
|
|
43
|
+
readonly params: ConversationTestParams;
|
|
44
|
+
readonly server: Server;
|
|
45
|
+
readonly wsBaseURL: string;
|
|
46
|
+
createConnectionMessage(data?: Partial<SignalingMessage.Connection>): SignalingMessage.Connection;
|
|
47
|
+
createConversation(options?: {
|
|
48
|
+
api?: Api;
|
|
49
|
+
}): Conversation;
|
|
50
|
+
createExternalIdMock(id: string, data?: Partial<ExternalParticipantId>): ExternalParticipantId;
|
|
51
|
+
createMarkers(data?: Partial<ParticipantListMarkers>): ParticipantListMarkers;
|
|
52
|
+
createMovieShareInfo(initiatorId: string, data?: Partial<ISharedMovieInfo> | null): ISharedMovieInfo;
|
|
53
|
+
createParticipant(id: number, data?: Partial<SignalingMessage.Participant>): SignalingMessage.Participant & Required<Pick<SignalingMessage.Participant, 'markers'>>;
|
|
54
|
+
createParticipantWithMarkers(id: number, data?: Partial<SignalingMessage.Participant>): SignalingMessage.Participant & Required<Pick<SignalingMessage.Participant, 'markers'>>;
|
|
55
|
+
createPromoteParticipantMessage(): SignalingMessage.PromoteParticipant;
|
|
56
|
+
createSignallingConversation(okUserId: OkUserId, peerId: SignalingMessage.PeerId, data?: Partial<SignalingMessage.Conversation>): SignalingMessage.Conversation;
|
|
57
|
+
createWaitingHallConversationData(): ReturnType<typeof createWaitingHallConversationData>;
|
|
58
|
+
emitMessageOnConnection(wsServer: Server, message?: SignalingMessage.Connection): void;
|
|
59
|
+
enableParticipantListChunk(): void;
|
|
60
|
+
expectRemoteStatus(status: ParticipantStatus, participantId?: string): Promise<void>;
|
|
61
|
+
expectRemoteStatusCall(status: ParticipantStatus, participantId?: string): void;
|
|
62
|
+
forgetConversation(conversation: Conversation): void;
|
|
63
|
+
getActiveSocket(wsServer: Server): Client;
|
|
64
|
+
hasRemoteStatusCall(status: ParticipantStatus, participantId?: string): boolean;
|
|
65
|
+
isCapabilityEnabled(predicateIndex: number, wsServer: Server): boolean;
|
|
66
|
+
parseUrlSearch(search: string): Record<string, string>;
|
|
67
|
+
resetRemoteStatusCallbacks(): void;
|
|
68
|
+
respondOnGetParticipantListChunkWith(data: Partial<SignalingMessage.ParticipantListChunk>): void;
|
|
69
|
+
sendAcceptedCall(participant: SignalingMessage.Participant): void;
|
|
70
|
+
sendHungup(participant: SignalingMessage.Participant): void;
|
|
71
|
+
sendSessionState(participant: SignalingMessage.Participant | number, connected: boolean, data?: Partial<SignalingMessage.SessionState>): void;
|
|
72
|
+
setApiAuth(data?: {
|
|
73
|
+
sessionKey?: string;
|
|
74
|
+
sessionSecretKey?: string;
|
|
75
|
+
}): void;
|
|
76
|
+
setTransportState(conversation: Conversation, state: TransportState): void;
|
|
77
|
+
socketRespondWith(socket: Client, command: string, response: SignalingMessage): void;
|
|
78
|
+
socketSendNotification(socket: Client, notification: string, response?: SignalingMessage): void;
|
|
79
|
+
startConversation(message?: SignalingMessage.Connection): Promise<Conversation>;
|
|
80
|
+
startConversationWithParticipants(participants: SignalingMessage.Participant[], peerId?: SignalingMessage.PeerId): Promise<Conversation>;
|
|
81
|
+
startConversationWithRemoteParticipant(remoteParticipantData?: Partial<SignalingMessage.Participant>): Promise<{
|
|
82
|
+
conversation: Conversation;
|
|
83
|
+
meParticipant: SignalingMessage.Participant;
|
|
84
|
+
remoteParticipant: SignalingMessage.Participant;
|
|
85
|
+
}>;
|
|
86
|
+
stubApiRequest(endpoint: string, method: string, data: object): void;
|
|
87
|
+
waitFor(fn: () => Promise<boolean> | boolean, message?: string, timeout?: number): Promise<true>;
|
|
88
|
+
flushSdkCallbacks(): Promise<null>;
|
|
89
|
+
};
|
|
90
|
+
export declare function defineConversationTests(name: string, defineTests: (tools: ConversationTestTools) => void): void;
|
|
91
|
+
export declare function createExternalIdMock(id: string, data?: Partial<ExternalParticipantId>): ExternalParticipantId;
|
|
92
|
+
export declare function enableParticipantListChunk(): void;
|
|
93
|
+
export declare function setApiAuth(data?: {
|
|
94
|
+
sessionKey?: string;
|
|
95
|
+
sessionSecretKey?: string;
|
|
96
|
+
}): void;
|
|
97
|
+
export declare function setTransportState(conversation: Conversation, state: TransportState): void;
|
|
98
|
+
export declare function socketRespondWith(socket: Client, command: string, response: SignalingMessage): void;
|
|
99
|
+
export declare function socketSendNotification(socket: Client, notification: string, response?: SignalingMessage): void;
|
|
100
|
+
export declare function createWaitingHallConversationData(): {
|
|
101
|
+
acceptTime: null;
|
|
102
|
+
asrInfo: null;
|
|
103
|
+
asrInfoByRoom: Map<any, any>;
|
|
104
|
+
audienceMode: boolean;
|
|
105
|
+
chatId: null;
|
|
106
|
+
compositeUserId: string;
|
|
107
|
+
concurrent: boolean;
|
|
108
|
+
direction: CallDirection;
|
|
109
|
+
externalId: ExternalParticipantId;
|
|
110
|
+
features: never[];
|
|
111
|
+
featuresPerRole: null;
|
|
112
|
+
id: string;
|
|
113
|
+
mediaModifiers: {
|
|
114
|
+
denoise: boolean;
|
|
115
|
+
denoiseAnn: boolean;
|
|
116
|
+
};
|
|
117
|
+
muteStates: Map<any, any>;
|
|
118
|
+
muteStatesPersonal: {};
|
|
119
|
+
needRate: boolean;
|
|
120
|
+
networkRating: number;
|
|
121
|
+
observer: boolean;
|
|
122
|
+
options: ConversationOption[];
|
|
123
|
+
participantsLimit: number;
|
|
124
|
+
pinnedParticipantIdByRoom: Map<any, any>;
|
|
125
|
+
recordsInfoByRoom: Map<any, any>;
|
|
126
|
+
restricted: boolean;
|
|
127
|
+
roles: never[];
|
|
128
|
+
roomId: number | null;
|
|
129
|
+
topology: TransportTopology;
|
|
130
|
+
urlSharingInfoByRoom: Map<any, any>;
|
|
131
|
+
userId: number;
|
|
132
|
+
waitForAdmin: boolean;
|
|
133
|
+
waitingHall: boolean;
|
|
134
|
+
};
|
|
135
|
+
export declare function createPromoteParticipantMessage(): SignalingMessage.PromoteParticipant;
|
|
136
|
+
export declare function emitMessageOnConnection(wsServer: Server, message?: SignalingMessage.Connection): void;
|
|
137
|
+
export declare function getActiveSocket(wsServer: Server): Client;
|
|
138
|
+
export declare function isCapabilityEnabled(predicateIndex: number, wsServer: Server): boolean;
|
|
139
|
+
export declare function parseUrlSearch(search: string): Record<string, string>;
|
|
140
|
+
export declare function flushSdkCallbacks(): Promise<null>;
|
|
141
|
+
export declare function waitFor(fn: () => Promise<boolean> | boolean, message?: string, timeout?: number): Promise<true>;
|
|
142
|
+
export declare function createSignallingConversation(okUserId: OkUserId, peerId: SignalingMessage.PeerId, data?: Partial<SignalingMessage.Conversation>): SignalingMessage.Conversation;
|
|
143
|
+
export declare function createConnectionMessage(data?: Partial<SignalingMessage.Connection>): SignalingMessage.Connection;
|
|
144
|
+
export declare function createParticipant(id: number, data?: Partial<SignalingMessage.Participant>): SignalingMessage.Participant & Required<Pick<SignalingMessage.Participant, 'markers'>>;
|
|
145
|
+
export declare function createParticipantWithMarkers(id: number, data?: Partial<SignalingMessage.Participant>): SignalingMessage.Participant & Required<Pick<SignalingMessage.Participant, 'markers'>>;
|
|
146
|
+
export declare function createMarkers(data?: Partial<ParticipantListMarkers>): ParticipantListMarkers;
|
|
147
|
+
export declare function createMovieShareInfo(initiatorId: string, data?: Partial<ISharedMovieInfo> | null): ISharedMovieInfo;
|
|
148
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import ConversationResponse from '
|
|
1
|
+
import ConversationResponse from '../../types/ConversationResponse';
|
|
2
2
|
export type ConversationResponseSource = 'startConversation' | 'joinConversation' | 'joinConversationByLink' | 'fastStart' | 'fastJoin';
|
|
3
3
|
export declare function assertValidConversationResponse(response: ConversationResponse | null | undefined, source: ConversationResponseSource): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import BaseApi from '
|
|
2
|
-
import type { DebugLogger } from '
|
|
3
|
-
import { DisplayLayoutRequest, ParticipantLayout } from '
|
|
4
|
-
import { Participant, ParticipantId } from '
|
|
1
|
+
import BaseApi from '../../abstract/BaseApi';
|
|
2
|
+
import type { DebugLogger } from '../../static/Debug';
|
|
3
|
+
import { DisplayLayoutRequest, ParticipantLayout } from '../../types/ParticipantLayout';
|
|
4
|
+
import { Participant, ParticipantId } from '../../types/Participant';
|
|
5
5
|
type DisplayLayoutRequesterParams = {
|
|
6
6
|
api: BaseApi;
|
|
7
7
|
debug: DebugLogger;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Conversation';
|
|
@@ -14,9 +14,7 @@ export declare class CallLifecycleStats {
|
|
|
14
14
|
private _conversationId;
|
|
15
15
|
private _callStartLabel;
|
|
16
16
|
private _lifecycleStartedAtMonotonic;
|
|
17
|
-
private _warmupStartedAtMonotonic;
|
|
18
17
|
private _pendingEvents;
|
|
19
|
-
private _warmupCompleted;
|
|
20
18
|
private _callStarted;
|
|
21
19
|
private _accepted;
|
|
22
20
|
private _firstMediaSent;
|
|
@@ -27,8 +25,6 @@ export declare class CallLifecycleStats {
|
|
|
27
25
|
get terminated(): boolean;
|
|
28
26
|
markInitializationStarted({ source, conversationId }: CallLifecycleInitializationParams): void;
|
|
29
27
|
bindConversationId(conversationId: string): void;
|
|
30
|
-
markWarmupStarted(): void;
|
|
31
|
-
markWarmupCompleted(): void;
|
|
32
28
|
markCallStarted(): void;
|
|
33
29
|
markOutgoingAccepted(): void;
|
|
34
30
|
markIncomingAccepted(concurrent: boolean): void;
|
|
@@ -57,6 +57,7 @@ export default class DirectTransport extends BaseTransport {
|
|
|
57
57
|
private _disposePeerConnection;
|
|
58
58
|
setAnimojiTransport(receiver: AnimojiReceiver, sender: AnimojiSender): void;
|
|
59
59
|
close(error?: Error): void;
|
|
60
|
+
private _finishClose;
|
|
60
61
|
private _setState;
|
|
61
62
|
private _onSignalingNotification;
|
|
62
63
|
private _handleTransmittedData;
|
|
@@ -43,6 +43,7 @@ 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;
|
package/default/Signaling.d.ts
CHANGED
|
@@ -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,21 +60,16 @@ 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
|
|
72
|
+
hangup(reason: string): Promise<SignalingMessage>;
|
|
78
73
|
sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidate): 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>;
|
|
@@ -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,17 +165,20 @@ 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;
|
|
@@ -16,7 +16,12 @@ export type SignalingTransportReconnectEvent = {
|
|
|
16
16
|
count: number;
|
|
17
17
|
delay: number;
|
|
18
18
|
};
|
|
19
|
+
export type SignalingTransportConnectingEvent = {
|
|
20
|
+
connectionType: SignalingConnectionType;
|
|
21
|
+
source: SignalingTransportType;
|
|
22
|
+
};
|
|
19
23
|
export type SignalingTransportHandlers = {
|
|
24
|
+
onConnecting: (event: SignalingTransportConnectingEvent) => void;
|
|
20
25
|
onOpen: () => void;
|
|
21
26
|
onMessage: (event: MessageEvent) => void;
|
|
22
27
|
onError: (event: Event) => void;
|
|
@@ -52,7 +57,7 @@ export default class SignalingTransport {
|
|
|
52
57
|
resetReconnectCount(): void;
|
|
53
58
|
connect(connectionType: SignalingConnectionType): void;
|
|
54
59
|
close(code?: number): void;
|
|
55
|
-
send(data: string | ArrayBuffer): void
|
|
60
|
+
send(data: string | ArrayBuffer): Promise<void>;
|
|
56
61
|
private _connect;
|
|
57
62
|
private _connectWebTransport;
|
|
58
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/Stat.d.ts
CHANGED
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.dbe4e248.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": "7.7.0"
|
|
26
26
|
}
|
|
27
27
|
}
|
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
|
* До вызова этого метода бесполезно опрашивать другие публичные методы.
|
|
@@ -143,11 +143,6 @@ declare namespace WebRTCUtils {
|
|
|
143
143
|
* В некоторых браузерах VP9 decoder сломан
|
|
144
144
|
*/
|
|
145
145
|
function isBrokenVP9Decoder(): boolean;
|
|
146
|
-
/**
|
|
147
|
-
* Изменился формат описания датаканала в SDP
|
|
148
|
-
* @link https://blog.mozilla.org/webrtc/how-to-avoid-data-channel-breaking/
|
|
149
|
-
*/
|
|
150
|
-
function isOldDataChannelDescription(): boolean;
|
|
151
146
|
/**
|
|
152
147
|
* Может ли браузер делать H264 приоритетным
|
|
153
148
|
*/
|
|
@@ -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>;
|