@vkontakte/calls-sdk 2.8.12-dev.2d04df5e.0 → 2.8.12-dev.2e0e572e.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 -13
- package/abstract/BaseApi.d.ts +7 -9
- package/calls-sdk.cjs.js +13 -7
- package/calls-sdk.esm.js +1405 -1420
- package/classes/ExternalIdCache.d.ts +10 -12
- package/classes/conversation/Conversation.d.ts +14 -12
- package/classes/conversation/Conversation.testUtils.d.ts +2 -0
- package/classes/conversation/DisplayLayoutRequester.d.ts +3 -1
- package/classes/transport/ServerTransport.d.ts +5 -1
- package/default/Api.d.ts +7 -9
- package/package.json +1 -1
- package/static/External.d.ts +10 -0
- package/static/Params.d.ts +7 -0
- package/static/ParticipantConnectionStatusUtils.d.ts +0 -1
- package/static/SignalingCapabilities.d.ts +1 -1
- package/static/SimulcastInfo.d.ts +3 -5
- package/static/Utils.d.ts +1 -0
- package/types/Capabilities.d.ts +0 -1
- package/types/FastHangup.d.ts +66 -0
- package/types/Participant.d.ts +0 -1
- package/classes/transport/SimulcastSender.d.ts +0 -27
- package/static/Sdp.d.ts +0 -3
- package/utils/SerializeLatest.d.ts +0 -5
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { ExternalId, ExternalParticipantId } from '../types/ExternalId';
|
|
2
|
-
import {
|
|
2
|
+
import { ParticipantId } from '../types/Participant';
|
|
3
3
|
export declare class ExternalIdCache {
|
|
4
4
|
private static _normalizeType;
|
|
5
|
-
private
|
|
6
|
-
private
|
|
5
|
+
private _participantIdToExternalId;
|
|
6
|
+
private _externalIdToParticipantId;
|
|
7
7
|
private _decorativeIdToInitialId;
|
|
8
8
|
private _initialIdToDecorativeId;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
getExternalId(participantId: ParticipantId): ExternalParticipantId | null;
|
|
10
|
+
getParticipantId(externalId: ExternalId): ParticipantId | null;
|
|
11
11
|
hasByExternalId(externalId: ExternalId): boolean;
|
|
12
|
-
|
|
13
|
-
cache(participantId:
|
|
14
|
-
mapDecorativeId(decorativeId:
|
|
15
|
-
unmapDecorativeId(initialId:
|
|
16
|
-
getDecorativeIdByInitialId(initialId:
|
|
17
|
-
replaceByInitialIdIdIfExists(id: OkUserId | CompositeUserId | ParticipantId): OkUserId;
|
|
18
|
-
getParticipantIdByExternalId(externalId: ExternalId): ParticipantId | null;
|
|
12
|
+
hasByParticipantId(participantId: ParticipantId): boolean;
|
|
13
|
+
cache(participantId: ParticipantId, externalId: ExternalParticipantId): void;
|
|
14
|
+
mapDecorativeId(decorativeId: ParticipantId, initialId: ParticipantId): void;
|
|
15
|
+
unmapDecorativeId(initialId: ParticipantId): void;
|
|
16
|
+
getDecorativeIdByInitialId(initialId: ParticipantId): ParticipantId | undefined;
|
|
19
17
|
clear(): void;
|
|
20
18
|
}
|
|
@@ -5,7 +5,6 @@ import BaseLogger from '../../abstract/BaseLogger';
|
|
|
5
5
|
import { AddParticipantParams } from '../../abstract/BaseSignaling';
|
|
6
6
|
import ConversationFeature from '../../enums/ConversationFeature';
|
|
7
7
|
import ConversationOption from '../../enums/ConversationOption';
|
|
8
|
-
import type ClientHangupReason from '../../enums/ClientHangupReason';
|
|
9
8
|
import MediaOption from '../../enums/MediaOption';
|
|
10
9
|
import UpdateDisplayLayoutErrorReason from '../../enums/UpdateDisplayLayoutErrorReason';
|
|
11
10
|
import UserRole from '../../enums/UserRole';
|
|
@@ -16,11 +15,12 @@ import { IAsrStartParams, IAsrStopParams } from '../../types/Asr';
|
|
|
16
15
|
import { AudienceModeHandsResponse } from '../../types/AudienceMode';
|
|
17
16
|
import { ConversationData, ConversationOnJoinParams, ConversationOnStartParams } from '../../types/Conversation';
|
|
18
17
|
import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk } from '../../types/ExternalId';
|
|
18
|
+
import type { FastHangupHandler, HangupParams } from '../../types/FastHangup';
|
|
19
19
|
import MediaModifiers from '../../types/MediaModifiers';
|
|
20
20
|
import MediaSettings, { IVideoDimentions } from '../../types/MediaSettings';
|
|
21
21
|
import { IAddMovieParams, IUpdateMovieData } from '../../types/MovieShare';
|
|
22
22
|
import MuteStates from '../../types/MuteStates';
|
|
23
|
-
import { CompositeUserId, IGetParticipantsParameters,
|
|
23
|
+
import { CompositeUserId, IGetParticipantsParameters, ParticipantId, ParticipantStateData } from '../../types/Participant';
|
|
24
24
|
import { DisplayLayoutRequest, ParticipantLayout } from '../../types/ParticipantLayout';
|
|
25
25
|
import { ParticipantListChunkParameters } from '../../types/ParticipantListChunk';
|
|
26
26
|
import ParticipantPriority from '../../types/ParticipantPriority';
|
|
@@ -57,6 +57,7 @@ export default class Conversation extends EventEmitter {
|
|
|
57
57
|
private _serverSettings;
|
|
58
58
|
private _serverTimeOffset;
|
|
59
59
|
private _delayedHangup;
|
|
60
|
+
private _onFastHangup?;
|
|
60
61
|
private _hangupEmitted;
|
|
61
62
|
private _hangupPromise;
|
|
62
63
|
private _abortController;
|
|
@@ -78,7 +79,7 @@ export default class Conversation extends EventEmitter {
|
|
|
78
79
|
private readonly _statFirstMediaReceived;
|
|
79
80
|
constructor(api: BaseApi, externalLogger: BaseLogger | null);
|
|
80
81
|
static current(): Conversation | null;
|
|
81
|
-
static hangupAfterInit(): void;
|
|
82
|
+
static hangupAfterInit(onFastHangup?: FastHangupHandler): void;
|
|
82
83
|
static id(): string | null;
|
|
83
84
|
get id(): string;
|
|
84
85
|
get externalId(): ExternalParticipantId | undefined;
|
|
@@ -89,7 +90,9 @@ export default class Conversation extends EventEmitter {
|
|
|
89
90
|
static debugMessageWithContext(type: DebugMessageType, conversationId: string, ...args: any[]): boolean;
|
|
90
91
|
static getSyncedTime(): number;
|
|
91
92
|
get debugSessionId(): string | null;
|
|
92
|
-
|
|
93
|
+
getCachedParticipantIdByExternalId(externalId: ExternalId): ParticipantId | null;
|
|
94
|
+
private _onNonFatalError;
|
|
95
|
+
private _buildInternalParams;
|
|
93
96
|
onStart({ opponentIds, opponentType, mediaOptions, payload, joiningAllowed, requireAuthToJoin, onlyAdminCanShareMovie, externalIds, onFastStart, conversationId, }: ConversationOnStartParams): Promise<ConversationData>;
|
|
94
97
|
onJoin(joinArgs: ConversationOnJoinParams): Promise<ConversationData>;
|
|
95
98
|
private _onJoinPart2;
|
|
@@ -105,8 +108,8 @@ export default class Conversation extends EventEmitter {
|
|
|
105
108
|
private _getMainRoomParticipants;
|
|
106
109
|
private _decodeExternalConversationParams;
|
|
107
110
|
accept(mediaOptions: MediaOption[]): Promise<ConversationData>;
|
|
108
|
-
decline(
|
|
109
|
-
hangup(
|
|
111
|
+
decline(params?: HangupParams): Promise<void>;
|
|
112
|
+
hangup(params?: HangupParams): Promise<void>;
|
|
110
113
|
addParticipant(participantIds: ExternalId[], params?: AddParticipantParams): Promise<void>;
|
|
111
114
|
addParticipantLegacy(participantIds: CompositeUserId[], params?: AddParticipantParams): Promise<void>;
|
|
112
115
|
removeParticipant(participantId: CompositeUserId, ban?: boolean): Promise<void>;
|
|
@@ -114,10 +117,12 @@ export default class Conversation extends EventEmitter {
|
|
|
114
117
|
updateStatisticsInterval(): void;
|
|
115
118
|
private _openTransport;
|
|
116
119
|
private _allocateParticipantTransport;
|
|
120
|
+
private _closeParticipantTransport;
|
|
117
121
|
private _cleanupRegistry;
|
|
118
122
|
private _emitHangupOnce;
|
|
119
123
|
private _sendHangupApi;
|
|
120
124
|
private _close;
|
|
125
|
+
private _sendHangup;
|
|
121
126
|
destroy(): void;
|
|
122
127
|
private _destroy;
|
|
123
128
|
private _getConversationParams;
|
|
@@ -160,8 +165,9 @@ export default class Conversation extends EventEmitter {
|
|
|
160
165
|
private _registerParticipantInCache;
|
|
161
166
|
private _getExistedParticipantByIdOrCreate;
|
|
162
167
|
private _getExternalIdByParticipantId;
|
|
163
|
-
private
|
|
164
|
-
private
|
|
168
|
+
private _getExternalIdsByParticipantIds;
|
|
169
|
+
private _reportMissingExternalIds;
|
|
170
|
+
private _reportMissingExternalIdsById;
|
|
165
171
|
private _registerParticipantAndSetMarkersIfChunkEnabled;
|
|
166
172
|
private _warnParticipantNotInConversation;
|
|
167
173
|
private _denormalizeMarkers;
|
|
@@ -222,8 +228,6 @@ export default class Conversation extends EventEmitter {
|
|
|
222
228
|
setAnimojiFill(fill: RGBTuple | string): void;
|
|
223
229
|
setVideoStream(stream: MediaStream, isScreen?: boolean): Promise<void>;
|
|
224
230
|
setAudioStream(stream: MediaStream): Promise<void>;
|
|
225
|
-
private readonly _toggleLocalVideo;
|
|
226
|
-
private readonly _toggleLocalAudio;
|
|
227
231
|
toggleLocalVideo(enabled: boolean): Promise<void>;
|
|
228
232
|
toggleLocalAudio(enabled: boolean): Promise<void>;
|
|
229
233
|
/**
|
|
@@ -420,8 +424,6 @@ export default class Conversation extends EventEmitter {
|
|
|
420
424
|
private _toggleJoinAvailability;
|
|
421
425
|
private _updateDisplayLayoutFromCache;
|
|
422
426
|
private _setParticipantsStatus;
|
|
423
|
-
private _setParticipantsStalled;
|
|
424
|
-
private _updateParticipantsStatus;
|
|
425
427
|
private _onJoinLinkChanged;
|
|
426
428
|
private _onRoomsUpdated;
|
|
427
429
|
private _onRoomUpdated;
|
|
@@ -35,6 +35,8 @@ declare function createParams(): {
|
|
|
35
35
|
onChatRoomUpdated: Mock<import("@vitest/spy").Procedure>;
|
|
36
36
|
onRemoteStatus: Mock<import("@vitest/spy").Procedure>;
|
|
37
37
|
onSpeakerChanged: Mock<import("@vitest/spy").Procedure>;
|
|
38
|
+
onAcceptedCall: Mock<import("@vitest/spy").Procedure>;
|
|
39
|
+
onNonFatalError: Mock<import("@vitest/spy").Procedure>;
|
|
38
40
|
};
|
|
39
41
|
export type ConversationTestParams = ReturnType<typeof createParams>;
|
|
40
42
|
export type ConversationTestTools = {
|
|
@@ -8,6 +8,7 @@ type DisplayLayoutRequesterParams = {
|
|
|
8
8
|
getParticipants: () => Record<ParticipantId, Participant>;
|
|
9
9
|
isMe: (participantId: ParticipantId) => boolean;
|
|
10
10
|
updateDisplayLayout: (layouts: ParticipantLayout[]) => Promise<void>;
|
|
11
|
+
onNonFatalError: (message: string) => void;
|
|
11
12
|
};
|
|
12
13
|
export default class DisplayLayoutRequester {
|
|
13
14
|
private readonly _api;
|
|
@@ -15,6 +16,7 @@ export default class DisplayLayoutRequester {
|
|
|
15
16
|
private readonly _getParticipants;
|
|
16
17
|
private readonly _isMe;
|
|
17
18
|
private readonly _updateDisplayLayout;
|
|
19
|
+
private readonly _onNonFatalError;
|
|
18
20
|
private _requestedLayouts;
|
|
19
21
|
private _uncertainLayouts;
|
|
20
22
|
private _pendingRequests;
|
|
@@ -25,7 +27,7 @@ export default class DisplayLayoutRequester {
|
|
|
25
27
|
private _lastFlushAt;
|
|
26
28
|
private _generation;
|
|
27
29
|
private _forceNextFlush;
|
|
28
|
-
constructor({ api, debug, getParticipants, isMe, updateDisplayLayout }: DisplayLayoutRequesterParams);
|
|
30
|
+
constructor({ api, debug, getParticipants, isMe, updateDisplayLayout, onNonFatalError }: DisplayLayoutRequesterParams);
|
|
29
31
|
request(requests: DisplayLayoutRequest[]): Promise<void>;
|
|
30
32
|
resend(): void;
|
|
31
33
|
cleanupParticipant(participantId: ParticipantId): void;
|
|
@@ -42,11 +42,12 @@ export default class ServerTransport extends BaseTransport {
|
|
|
42
42
|
private _rtpReceiversByStreamId;
|
|
43
43
|
private _producerSessionId;
|
|
44
44
|
private _newAudioShareTrack;
|
|
45
|
+
private _simulcastInfo;
|
|
46
|
+
private _isSimulcastNegotiated;
|
|
45
47
|
private readonly _debug;
|
|
46
48
|
private readonly _logger;
|
|
47
49
|
private readonly _statAggregator;
|
|
48
50
|
private readonly _codecStatsAggregator;
|
|
49
|
-
private readonly _simulcast;
|
|
50
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;
|
|
@@ -85,6 +86,8 @@ export default class ServerTransport extends BaseTransport {
|
|
|
85
86
|
private _detectStaleTracks;
|
|
86
87
|
private _allocateConsumer;
|
|
87
88
|
private _processOffer;
|
|
89
|
+
private _findFirstSimTransceiver;
|
|
90
|
+
private _setupSimulcastTransceiver;
|
|
88
91
|
private _acceptProducer;
|
|
89
92
|
private _replaceScreenShareTrack;
|
|
90
93
|
private _handleTracks;
|
|
@@ -99,6 +102,7 @@ export default class ServerTransport extends BaseTransport {
|
|
|
99
102
|
private _onReplacedTrack;
|
|
100
103
|
private _onSourcesChanged;
|
|
101
104
|
getStreamWaitingTimeMs(streamId: string, targetRtpTimestamp: number): number;
|
|
105
|
+
private _changeSimulcastInfo;
|
|
102
106
|
private _monitorRtpShare;
|
|
103
107
|
private _startMonitorRtpShareInterval;
|
|
104
108
|
private _stopMonitorRtpShareInterval;
|
package/default/Api.d.ts
CHANGED
|
@@ -5,14 +5,14 @@ import { IHangupParams } from '../types/Api';
|
|
|
5
5
|
import ConversationParams from '../types/ConversationParams';
|
|
6
6
|
import ConversationResponse from '../types/ConversationResponse';
|
|
7
7
|
import { ExternalId, ExternalParticipantId, ExternalUserId } from '../types/ExternalId';
|
|
8
|
-
import {
|
|
8
|
+
import { OkUserId, ParticipantId } from '../types/Participant';
|
|
9
9
|
import PushData from '../types/PushData';
|
|
10
10
|
export default class Api extends BaseApi {
|
|
11
11
|
private _uuid;
|
|
12
12
|
private _idCache;
|
|
13
13
|
private _callUnsafe;
|
|
14
14
|
protected _call(method: string, data?: any, noSession?: boolean, allowReauthorize?: boolean): Promise<any>;
|
|
15
|
-
userId(participantId: ParticipantId): ExternalParticipantId;
|
|
15
|
+
userId(participantId: ParticipantId): ExternalParticipantId | null;
|
|
16
16
|
authorize(): Promise<void>;
|
|
17
17
|
private _getAnonymLoginCacheKey;
|
|
18
18
|
private _getCachedAnonymLogin;
|
|
@@ -48,13 +48,11 @@ export default class Api extends BaseApi {
|
|
|
48
48
|
getAnonymTokenByLink(joinLink: string, username?: string): Promise<string>;
|
|
49
49
|
joinConversationByLink(joinLink: string, isVideo?: boolean, observedIds?: ExternalUserId[], payload?: string): Promise<ConversationResponse>;
|
|
50
50
|
getCachedOkIdByExternalId(externalId: ExternalId): ParticipantId | null;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
getDecorativeIdByInitialId(initialId: OkUserId | CompositeUserId | ParticipantId): OkUserId | undefined;
|
|
57
|
-
replaceByInitialIdIdIfExists(id: OkUserId | CompositeUserId | ParticipantId): OkUserId;
|
|
51
|
+
getCachedExternalIdByParticipantId(participantId: ParticipantId): ExternalParticipantId | null;
|
|
52
|
+
cacheExternalId(participantId: ParticipantId, externalId: ExternalParticipantId): void;
|
|
53
|
+
mapDecorativeId(decorativeId: ParticipantId, initialId: ParticipantId): void;
|
|
54
|
+
unmapDecorativeId(initialId: ParticipantId): void;
|
|
55
|
+
getDecorativeIdByInitialId(initialId: ParticipantId): ParticipantId | undefined;
|
|
58
56
|
getConversationParams(conversationId?: string): Promise<ConversationParams>;
|
|
59
57
|
getUserId(): OkUserId | null;
|
|
60
58
|
setUserId(userId: OkUserId): void;
|
package/package.json
CHANGED
package/static/External.d.ts
CHANGED
|
@@ -638,5 +638,15 @@ declare namespace External {
|
|
|
638
638
|
* Собеседник подключился к сигналлингу
|
|
639
639
|
*/
|
|
640
640
|
function onPeerRegistered(conversationId?: string, externalIds?: ExternalId[]): void;
|
|
641
|
+
/**
|
|
642
|
+
* SDK обнаружил ошибку, после которой звонок может продолжаться.
|
|
643
|
+
*
|
|
644
|
+
* Callback предназначен для отправки ошибки в клиентский мониторинг.
|
|
645
|
+
* Его вызов не означает завершение звонка.
|
|
646
|
+
*
|
|
647
|
+
* @param error
|
|
648
|
+
* @param conversationId ID звонка
|
|
649
|
+
*/
|
|
650
|
+
function onNonFatalError(error: Error, conversationId: string | null): void;
|
|
641
651
|
}
|
|
642
652
|
export default External;
|
package/static/Params.d.ts
CHANGED
|
@@ -911,6 +911,13 @@ export type ParamsObject = {
|
|
|
911
911
|
* Собеседник подключился к сигналлингу
|
|
912
912
|
*/
|
|
913
913
|
onPeerRegistered?: (conversationId?: string, externalIds?: ExternalId[]) => void;
|
|
914
|
+
/**
|
|
915
|
+
* SDK обнаружил ошибку, после которой звонок может продолжаться.
|
|
916
|
+
*
|
|
917
|
+
* Callback предназначен для отправки ошибки в клиентский мониторинг.
|
|
918
|
+
* Его вызов не означает завершение звонка.
|
|
919
|
+
*/
|
|
920
|
+
onNonFatalError?: (error: Error, conversationId: string | null) => void;
|
|
914
921
|
};
|
|
915
922
|
export default abstract class Params {
|
|
916
923
|
private static _params;
|
|
@@ -11,7 +11,6 @@ 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;
|
|
15
14
|
function setSessionStateApplicable(status: ParticipantConnectionStatus, applicable: boolean): StatusTransition;
|
|
16
15
|
}
|
|
17
16
|
export default ParticipantConnectionStatusUtils;
|
|
@@ -6,10 +6,8 @@ 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>;
|
|
9
10
|
export declare function isEqualSimulcastInfo(si1: ISimulcastInfo | null, si2: ISimulcastInfo | null): boolean;
|
|
10
11
|
export declare function findBitrateAsc(maxDimension: number, bitrates: VideoBitrateSettings[]): number;
|
|
11
|
-
export declare function calculateSimulcastInfo(width?: number, height?: number, bitrates?: VideoBitrateSettings[]
|
|
12
|
-
|
|
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;
|
|
12
|
+
export declare function calculateSimulcastInfo(width?: number, height?: number, bitrates?: VideoBitrateSettings[]): ISimulcastInfo;
|
|
13
|
+
export declare function findScaleResolutionDownBy(rid?: string): number;
|
package/static/Utils.d.ts
CHANGED
|
@@ -77,5 +77,6 @@ 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;
|
|
80
81
|
}
|
|
81
82
|
export default Utils;
|
package/types/Capabilities.d.ts
CHANGED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type ClientHangupReason from '../enums/ClientHangupReason';
|
|
2
|
+
import type HangupType from '../enums/HangupType';
|
|
3
|
+
/**
|
|
4
|
+
* Параметры запроса завершения звонка через внешнего партнёра (fast hangup).
|
|
5
|
+
*
|
|
6
|
+
* SDK генерирует объект и передаёт его в {@link FastHangupHandler}.
|
|
7
|
+
* Хост и backend партнёра пробрасывают `internalParams` как есть, без парсинга.
|
|
8
|
+
*/
|
|
9
|
+
export interface FastHangupParams {
|
|
10
|
+
/**
|
|
11
|
+
* ID звонка
|
|
12
|
+
*/
|
|
13
|
+
conversationId: string;
|
|
14
|
+
/**
|
|
15
|
+
* Причина завершения звонка
|
|
16
|
+
*/
|
|
17
|
+
reason: HangupType;
|
|
18
|
+
/**
|
|
19
|
+
* Внутренние параметры звонка (JSON-строка). Генерируется SDK.
|
|
20
|
+
*/
|
|
21
|
+
internalParams?: string | null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Ответ внешнего партнёра на завершение звонка.
|
|
25
|
+
*/
|
|
26
|
+
export interface FastHangupResponse {
|
|
27
|
+
/**
|
|
28
|
+
* true — участие в звонке завершено
|
|
29
|
+
*/
|
|
30
|
+
success: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Параметры публичных методов {@link hangup} / {@link declineCall}.
|
|
34
|
+
*
|
|
35
|
+
* `reason` и `conversationId` идут в signaling hangup.
|
|
36
|
+
* `onFastHangup` заменяет Calls API `vchat.hangupConversation`, если обработчик передан
|
|
37
|
+
* (явный hangup/decline или delayed hangup во время init).
|
|
38
|
+
* Если обработчик не передан, API hangup не вызывается — кроме закрытия вкладки (`pagehide`),
|
|
39
|
+
* где SDK всегда шлёт beacon, и delayed hangup без handler.
|
|
40
|
+
*/
|
|
41
|
+
export interface HangupParams {
|
|
42
|
+
/**
|
|
43
|
+
* ID звонка. Если опущен — завершается текущий активный звонок.
|
|
44
|
+
*/
|
|
45
|
+
conversationId?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Причина завершения для проброса в сигналинг. См. {@link ClientHangupReason}.
|
|
48
|
+
*/
|
|
49
|
+
reason?: ClientHangupReason;
|
|
50
|
+
/**
|
|
51
|
+
* Обработчик fast hangup — завершение звонка через внешнего партнёра.
|
|
52
|
+
*/
|
|
53
|
+
onFastHangup?: FastHangupHandler;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Функция-обработчик fast hangup.
|
|
57
|
+
*
|
|
58
|
+
* Если передана в {@link HangupParams.onFastHangup} при `hangup` / `declineCall`,
|
|
59
|
+
* SDK вызывает её вместо API `vchat.hangupConversation`.
|
|
60
|
+
*
|
|
61
|
+
* На `pagehide` не используется — SDK всегда отправляет `sendBeacon`.
|
|
62
|
+
*
|
|
63
|
+
* @param params Параметры запроса
|
|
64
|
+
* @param signal AbortSignal текущего звонка, если он ещё жив на момент вызова
|
|
65
|
+
*/
|
|
66
|
+
export type FastHangupHandler = (params: FastHangupParams, signal?: AbortSignal) => Promise<FastHangupResponse>;
|
package/types/Participant.d.ts
CHANGED
|
@@ -49,7 +49,6 @@ export interface ParticipantSessionState {
|
|
|
49
49
|
}
|
|
50
50
|
export interface ParticipantConnectionStatus {
|
|
51
51
|
transport: ParticipantStatus;
|
|
52
|
-
stalled: boolean;
|
|
53
52
|
sessionState?: ParticipantSessionState;
|
|
54
53
|
sessionStateApplicable: boolean;
|
|
55
54
|
sessionStateConnectedBySpeaker: boolean;
|
|
@@ -1,27 +0,0 @@
|
|
|
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
|
-
}
|
package/static/Sdp.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Последовательно выполняет операции, оставляя в очереди только последнее запрошенное значение.
|
|
3
|
-
* Возвращает ошибку, только если не удалось применить итоговое состояние.
|
|
4
|
-
*/
|
|
5
|
-
export declare function serializeLatest<T>(run: (value: T) => Promise<void> | undefined): (value: T) => Promise<void>;
|