@vkontakte/calls-sdk 2.8.11-dev.69b107ee.0 → 2.8.11-dev.6c644bb1.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 +0 -2
- package/abstract/BaseApi.d.ts +0 -2
- package/calls-sdk.cjs.js +8 -8
- package/calls-sdk.esm.js +5120 -4852
- package/classes/Conversation.d.ts +12 -2
- package/classes/codec/WorkerBase.d.ts +2 -0
- package/default/Api.d.ts +5 -2
- package/enums/SignalingNotification.d.ts +1 -0
- package/package.json +1 -1
- package/static/Capabilities.d.ts +5 -0
- package/static/Params.d.ts +8 -0
- package/static/ParticipantConnectionStatusUtils.d.ts +16 -0
- package/types/Capabilities.d.ts +24 -0
- package/types/Participant.d.ts +11 -1
- package/types/PushData.d.ts +0 -3
- package/types/SignalingMessage.d.ts +9 -1
|
@@ -112,7 +112,7 @@ export default class Conversation extends EventEmitter {
|
|
|
112
112
|
destroy(): Promise<void>;
|
|
113
113
|
private _getConversationParams;
|
|
114
114
|
private _setConversationParams;
|
|
115
|
-
private
|
|
115
|
+
private _buildSignalingEndpoint;
|
|
116
116
|
/**
|
|
117
117
|
* @throws ErrorEvent
|
|
118
118
|
*/
|
|
@@ -139,7 +139,12 @@ export default class Conversation extends EventEmitter {
|
|
|
139
139
|
private _registerParticipants;
|
|
140
140
|
/** Установим состояние локальных мьютов */
|
|
141
141
|
private _registerParticipantLocalMuteState;
|
|
142
|
-
private
|
|
142
|
+
private _remoteParticipantSessionState;
|
|
143
|
+
private _buildConnectionStatus;
|
|
144
|
+
private _isParticipantSessionStateApplicable;
|
|
145
|
+
private _setTransportStatus;
|
|
146
|
+
private _setSessionState;
|
|
147
|
+
private _emitParticipantTransition;
|
|
143
148
|
private _registerParticipantInCache;
|
|
144
149
|
private _getExistedParticipantByIdOrCreate;
|
|
145
150
|
private _getExternalIdByParticipantId;
|
|
@@ -315,6 +320,11 @@ export default class Conversation extends EventEmitter {
|
|
|
315
320
|
private _onSignalingFailed;
|
|
316
321
|
private _onAcceptedCall;
|
|
317
322
|
private _onHungup;
|
|
323
|
+
private _onSessionState;
|
|
324
|
+
private _reconcileParticipantSessionStates;
|
|
325
|
+
private _updateParticipantExternalId;
|
|
326
|
+
private _updateParticipantSessionState;
|
|
327
|
+
private _emitParticipantEffectiveStatusIfSessionOverridesTransport;
|
|
318
328
|
private _onAddedParticipant;
|
|
319
329
|
private _onJoinedParticipant;
|
|
320
330
|
private _onClosedConversation;
|
package/default/Api.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import ConversationParams from '../types/ConversationParams';
|
|
|
5
5
|
import ConversationResponse from '../types/ConversationResponse';
|
|
6
6
|
import { ExternalId, ExternalParticipantId, ExternalUserId } from '../types/ExternalId';
|
|
7
7
|
import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
|
|
8
|
-
import PushData from '../types/PushData';
|
|
9
8
|
export default class Api extends BaseApi {
|
|
10
9
|
private _userId;
|
|
11
10
|
private _uuid;
|
|
@@ -14,6 +13,11 @@ export default class Api extends BaseApi {
|
|
|
14
13
|
protected _call(method: string, data?: any, noSession?: boolean): Promise<any>;
|
|
15
14
|
userId(participantId: ParticipantId): Promise<ExternalParticipantId>;
|
|
16
15
|
authorize(): Promise<void>;
|
|
16
|
+
private _getAnonymLoginCacheKey;
|
|
17
|
+
private _getCachedAnonymLogin;
|
|
18
|
+
private _setCachedAnonymLogin;
|
|
19
|
+
private _removeCachedAnonymLogin;
|
|
20
|
+
private _applyAnonymLogin;
|
|
17
21
|
logClientStats(items: ClientStats[]): void;
|
|
18
22
|
logClientEvents(items: ClientEvent[]): void;
|
|
19
23
|
uploadDebugLogs(conversationId: string, startTime: number, endTime: number, log: string): Promise<void>;
|
|
@@ -61,5 +65,4 @@ export default class Api extends BaseApi {
|
|
|
61
65
|
cleanup(): void;
|
|
62
66
|
private _getExternalIdsByOkIds;
|
|
63
67
|
getServerTime(): Promise<number>;
|
|
64
|
-
getInbounds(): Promise<PushData[]>;
|
|
65
68
|
}
|
|
@@ -24,6 +24,7 @@ declare enum SignalingNotification {
|
|
|
24
24
|
REALLOC_CON = "realloc-con",
|
|
25
25
|
AUDIO_ACTIVITY = "audio-activity",
|
|
26
26
|
SPEAKER_CHANGED = "speaker-changed",
|
|
27
|
+
SESSION_STATE = "session-state",
|
|
27
28
|
STALLED_ACTIVITY = "stalled-activity",
|
|
28
29
|
CHAT_MESSAGE = "chat-message",
|
|
29
30
|
CUSTOM_DATA = "custom-data",
|
package/package.json
CHANGED
package/static/Params.d.ts
CHANGED
|
@@ -493,6 +493,12 @@ export type ParamsObject = {
|
|
|
493
493
|
* _По умолчанию: `false`_
|
|
494
494
|
*/
|
|
495
495
|
transparentAudio: boolean;
|
|
496
|
+
/**
|
|
497
|
+
* Включить получение обновлений состояния медийной сессии участников
|
|
498
|
+
*
|
|
499
|
+
* _По умолчанию: `false`_
|
|
500
|
+
*/
|
|
501
|
+
enableSessionStateUpdates: boolean;
|
|
496
502
|
/**
|
|
497
503
|
* Получен локальный стрим с камеры/микрофона
|
|
498
504
|
*/
|
|
@@ -1007,6 +1013,7 @@ export default abstract class Params {
|
|
|
1007
1013
|
static get webtransport(): boolean;
|
|
1008
1014
|
static get webtransportFF(): boolean;
|
|
1009
1015
|
static get transparentAudio(): boolean;
|
|
1016
|
+
static get enableSessionStateUpdates(): boolean;
|
|
1010
1017
|
static toJSON(): {
|
|
1011
1018
|
apiKey: string;
|
|
1012
1019
|
apiEnv: string;
|
|
@@ -1042,5 +1049,6 @@ export default abstract class Params {
|
|
|
1042
1049
|
webtransport: boolean;
|
|
1043
1050
|
webtransportFF: boolean;
|
|
1044
1051
|
transparentAudio: boolean;
|
|
1052
|
+
enableSessionStateUpdates: boolean;
|
|
1045
1053
|
};
|
|
1046
1054
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ParticipantConnectionStatus, ParticipantSessionState } from '../types/Participant';
|
|
2
|
+
import { ParticipantStatus } from './External';
|
|
3
|
+
import TransportState from '../enums/TransportState';
|
|
4
|
+
type StatusTransition = {
|
|
5
|
+
status: ParticipantStatus;
|
|
6
|
+
shouldNotify: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare namespace ParticipantConnectionStatusUtils {
|
|
9
|
+
function create(status?: Partial<ParticipantConnectionStatus> | null): ParticipantConnectionStatus;
|
|
10
|
+
function fromTransportState(state?: TransportState): ParticipantStatus | null;
|
|
11
|
+
function computeEffective(status: ParticipantConnectionStatus): ParticipantStatus;
|
|
12
|
+
function setSessionState(status: ParticipantConnectionStatus, sessionState?: ParticipantSessionState, sessionStateConnectedBySpeaker?: boolean): StatusTransition;
|
|
13
|
+
function setTransport(status: ParticipantConnectionStatus, transport: ParticipantStatus): StatusTransition;
|
|
14
|
+
function setSessionStateApplicable(status: ParticipantConnectionStatus, applicable: boolean): StatusTransition;
|
|
15
|
+
}
|
|
16
|
+
export default ParticipantConnectionStatusUtils;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type TCapabilities = {
|
|
2
|
+
estimatedPerformanceIndex: number;
|
|
3
|
+
audioMix: boolean;
|
|
4
|
+
consumerUpdate: boolean;
|
|
5
|
+
producerNotificationDataChannelVersion: number;
|
|
6
|
+
producerCommandDataChannelVersion: number;
|
|
7
|
+
consumerScreenDataChannelVersion: number;
|
|
8
|
+
producerScreenDataChannelVersion: number;
|
|
9
|
+
asrDataChannelVersion: number;
|
|
10
|
+
animojiDataChannelVersion: number;
|
|
11
|
+
animojiBackendRender: boolean;
|
|
12
|
+
onDemandTracks: boolean;
|
|
13
|
+
unifiedPlan: boolean;
|
|
14
|
+
singleSession: boolean;
|
|
15
|
+
videoTracksCount: number;
|
|
16
|
+
red: boolean;
|
|
17
|
+
audioShare: boolean;
|
|
18
|
+
fastScreenShare: boolean;
|
|
19
|
+
videoSuspend: boolean;
|
|
20
|
+
simulcast: boolean;
|
|
21
|
+
consumerFastScreenShare: boolean;
|
|
22
|
+
consumerFastScreenShareQualityOnDemand: boolean;
|
|
23
|
+
transparentAudio: boolean;
|
|
24
|
+
};
|
package/types/Participant.d.ts
CHANGED
|
@@ -44,6 +44,16 @@ export interface ParticipantStateMapped {
|
|
|
44
44
|
ts: number;
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
+
export interface ParticipantSessionState {
|
|
48
|
+
connected: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface ParticipantConnectionStatus {
|
|
51
|
+
transport: ParticipantStatus;
|
|
52
|
+
sessionState?: ParticipantSessionState;
|
|
53
|
+
sessionStateApplicable: boolean;
|
|
54
|
+
sessionStateConnectedBySpeaker: boolean;
|
|
55
|
+
lastEffective: ParticipantStatus;
|
|
56
|
+
}
|
|
47
57
|
/**
|
|
48
58
|
* Состояния участников звонка
|
|
49
59
|
*/
|
|
@@ -63,7 +73,6 @@ export interface Participant {
|
|
|
63
73
|
externalId: ExternalParticipantId;
|
|
64
74
|
mediaSettings: MediaSettings;
|
|
65
75
|
state: ParticipantState;
|
|
66
|
-
status: ParticipantStatus;
|
|
67
76
|
remoteStream?: MediaStream | null;
|
|
68
77
|
remoteAudioTrack?: MediaStreamTrack | null;
|
|
69
78
|
secondStream?: MediaStream | null;
|
|
@@ -72,6 +81,7 @@ export interface Participant {
|
|
|
72
81
|
clientType: string;
|
|
73
82
|
roles: UserRole[];
|
|
74
83
|
participantState: ParticipantStateMapped;
|
|
84
|
+
connectionStatus: ParticipantConnectionStatus;
|
|
75
85
|
networkRating: number;
|
|
76
86
|
lastRequestedLayouts: {
|
|
77
87
|
[key: StreamDescriptionString]: ParticipantLayout;
|
package/types/PushData.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import IceServer from './IceServer';
|
|
2
1
|
type PushData = {
|
|
3
2
|
caller_id: string;
|
|
4
3
|
caller_client_type?: string;
|
|
5
4
|
conversation_id: string;
|
|
6
5
|
endpoint: string;
|
|
7
|
-
wt_endpoint?: string;
|
|
8
|
-
turn_server?: IceServer;
|
|
9
6
|
is_video: boolean;
|
|
10
7
|
token: string;
|
|
11
8
|
sdp_offer?: string;
|
|
@@ -19,7 +19,7 @@ import MediaModifiers from './MediaModifiers';
|
|
|
19
19
|
import MediaSettings from './MediaSettings';
|
|
20
20
|
import { ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from './MovieShare';
|
|
21
21
|
import MuteStates from './MuteStates';
|
|
22
|
-
import { CompositeUserId, OkUserId, ParticipantId, ParticipantListMarker as ParticipantParticipantListMarker, ParticipantListMarkers, ParticipantListType as ParticipantParticipantListType } from './Participant';
|
|
22
|
+
import { CompositeUserId, OkUserId, ParticipantId, ParticipantListMarker as ParticipantParticipantListMarker, ParticipantListMarkers, ParticipantListType as ParticipantParticipantListType, ParticipantSessionState } from './Participant';
|
|
23
23
|
import { MediaType, ParticipantStreamDescription } from './ParticipantStreamDescription';
|
|
24
24
|
import { IRoomId } from './Room';
|
|
25
25
|
import VideoSettings from './VideoSettings';
|
|
@@ -89,6 +89,7 @@ declare namespace SignalingMessage {
|
|
|
89
89
|
state: Record<string, string>;
|
|
90
90
|
stateUpdateTs: Record<string, number>;
|
|
91
91
|
};
|
|
92
|
+
sessionState?: ParticipantSessionState;
|
|
92
93
|
roles?: UserRole[];
|
|
93
94
|
peerId?: PeerId;
|
|
94
95
|
restricted?: boolean;
|
|
@@ -323,6 +324,13 @@ declare namespace SignalingMessage {
|
|
|
323
324
|
export interface SpeakerChanged extends Notification {
|
|
324
325
|
speaker: ParticipantId;
|
|
325
326
|
}
|
|
327
|
+
export interface SessionState extends Notification {
|
|
328
|
+
connected: boolean;
|
|
329
|
+
participantId: OkUserId;
|
|
330
|
+
participantType: UserType;
|
|
331
|
+
deviceIdx?: number;
|
|
332
|
+
markers?: ParticipantListMarkers;
|
|
333
|
+
}
|
|
326
334
|
export interface OptionsChanged extends Notification {
|
|
327
335
|
options: ConversationOption[];
|
|
328
336
|
}
|