@vkontakte/calls-sdk 2.8.11-dev.5a5b0d53.0 → 2.8.11-dev.6d8b858e.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 +14 -2
- package/calls-sdk.cjs.js +16 -13
- package/calls-sdk.esm.js +11302 -13
- package/classes/Conversation.d.ts +5 -1
- package/classes/DisplayLayoutRequester.d.ts +32 -0
- package/package.json +1 -1
- package/static/Debug.d.ts +4 -4
- package/static/Params.d.ts +8 -0
- package/types/ParticipantLayout.d.ts +33 -0
- package/types/SignalingMessage.d.ts +3 -0
|
@@ -20,7 +20,7 @@ import { IVideoDimentions } from '../types/MediaSettings';
|
|
|
20
20
|
import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
|
|
21
21
|
import MuteStates from '../types/MuteStates';
|
|
22
22
|
import { CompositeUserId, IGetParticipantsParameters, ParticipantId, ParticipantStateData } from '../types/Participant';
|
|
23
|
-
import { ParticipantLayout } from '../types/ParticipantLayout';
|
|
23
|
+
import { DisplayLayoutRequest, ParticipantLayout } from '../types/ParticipantLayout';
|
|
24
24
|
import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
|
|
25
25
|
import ParticipantPriority from '../types/ParticipantPriority';
|
|
26
26
|
import { ParticipantStreamDescription } from '../types/ParticipantStreamDescription';
|
|
@@ -32,6 +32,7 @@ export default class Conversation extends EventEmitter {
|
|
|
32
32
|
private readonly _api;
|
|
33
33
|
private readonly _signaling;
|
|
34
34
|
private readonly _signalingActor;
|
|
35
|
+
private readonly _displayLayoutRequester;
|
|
35
36
|
private _mediaSource;
|
|
36
37
|
private _conversation;
|
|
37
38
|
private _myLastRequestedLayouts;
|
|
@@ -49,6 +50,7 @@ export default class Conversation extends EventEmitter {
|
|
|
49
50
|
private _lastSignalledActiveSpeakerId;
|
|
50
51
|
private _isRealTimeAsrRequested;
|
|
51
52
|
private _serverSettings;
|
|
53
|
+
private _serverTimeOffset;
|
|
52
54
|
private static _current;
|
|
53
55
|
private static _activationMutex;
|
|
54
56
|
private static _delayedHangup;
|
|
@@ -69,6 +71,7 @@ export default class Conversation extends EventEmitter {
|
|
|
69
71
|
static current(): Conversation | null;
|
|
70
72
|
static hangupAfterInit(): void;
|
|
71
73
|
static id(): string | null;
|
|
74
|
+
static getSyncedTime(): number;
|
|
72
75
|
onStart({ opponentIds, opponentType, mediaOptions, payload, joiningAllowed, requireAuthToJoin, onlyAdminCanShareMovie, externalIds, onFastStart, conversationId, }: ConversationOnStartParams): Promise<ConversationData>;
|
|
73
76
|
onJoin(joinArgs: {
|
|
74
77
|
conversationId?: string;
|
|
@@ -204,6 +207,7 @@ export default class Conversation extends EventEmitter {
|
|
|
204
207
|
requestKeyFrame(participantStreamDescription: ParticipantStreamDescription): Promise<void | SignalingMessage>;
|
|
205
208
|
requestTestMode(consumerCommand: string, producerCommand: string): Promise<void>;
|
|
206
209
|
updateDisplayLayout(layouts: ParticipantLayout[]): Promise<void>;
|
|
210
|
+
requestDisplayLayout(requests: DisplayLayoutRequest[]): Promise<void>;
|
|
207
211
|
feedback(key: string): Promise<SignalingMessage>;
|
|
208
212
|
userFeedbackStats(userResponse: number, reason?: string, groupCallUsersCount?: number): void;
|
|
209
213
|
sendClientEvent(eventType: string, eventData?: Record<string, string | number | boolean>, immediately?: boolean): void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import BaseApi from '../abstract/BaseApi';
|
|
2
|
+
import { DisplayLayoutRequest, ParticipantLayout } from '../types/ParticipantLayout';
|
|
3
|
+
import { Participant, ParticipantId } from '../types/Participant';
|
|
4
|
+
type DisplayLayoutRequesterParams = {
|
|
5
|
+
api: BaseApi;
|
|
6
|
+
getParticipants: () => Promise<Record<ParticipantId, Participant>>;
|
|
7
|
+
isMe: (participantId: ParticipantId) => boolean;
|
|
8
|
+
updateDisplayLayout: (layouts: ParticipantLayout[]) => Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
export default class DisplayLayoutRequester {
|
|
11
|
+
private readonly _api;
|
|
12
|
+
private readonly _getParticipants;
|
|
13
|
+
private readonly _isMe;
|
|
14
|
+
private readonly _updateDisplayLayout;
|
|
15
|
+
private _requestedLayouts;
|
|
16
|
+
private _pendingRequests;
|
|
17
|
+
private _pendingPromises;
|
|
18
|
+
private _timer;
|
|
19
|
+
private _inFlight;
|
|
20
|
+
private _lastFlushAt;
|
|
21
|
+
private _generation;
|
|
22
|
+
constructor({ api, getParticipants, isMe, updateDisplayLayout }: DisplayLayoutRequesterParams);
|
|
23
|
+
request(requests: DisplayLayoutRequest[]): Promise<void>;
|
|
24
|
+
cleanupParticipant(participantId: ParticipantId): void;
|
|
25
|
+
clear(): void;
|
|
26
|
+
private _schedule;
|
|
27
|
+
private _flush;
|
|
28
|
+
private _getRequestLayouts;
|
|
29
|
+
private _getDiff;
|
|
30
|
+
private _isChanged;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
package/package.json
CHANGED
package/static/Debug.d.ts
CHANGED
|
@@ -8,10 +8,10 @@ export declare enum DebugMessageType {
|
|
|
8
8
|
ERROR = "ERROR"
|
|
9
9
|
}
|
|
10
10
|
declare namespace Debug {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
function debug(...args: any[]): void;
|
|
12
|
+
function log(...args: any[]): void;
|
|
13
|
+
function warn(...args: any[]): void;
|
|
14
|
+
function error(...args: any[]): void;
|
|
15
15
|
function enabled(): boolean;
|
|
16
16
|
function toggle(enable: boolean): void;
|
|
17
17
|
function send(type: DebugMessageType, ...args: any[]): void;
|
package/static/Params.d.ts
CHANGED
|
@@ -306,6 +306,12 @@ export type ParamsObject = {
|
|
|
306
306
|
* _По умолчанию: `30`_
|
|
307
307
|
*/
|
|
308
308
|
videoTracksCount: number;
|
|
309
|
+
/**
|
|
310
|
+
* Минимальный интервал отправки diff для requestDisplayLayout в миллисекундах.
|
|
311
|
+
*
|
|
312
|
+
* _По умолчанию: `250`_
|
|
313
|
+
*/
|
|
314
|
+
requestDisplayLayoutThrottleMs: number;
|
|
309
315
|
/** @hidden */
|
|
310
316
|
movieShare: boolean;
|
|
311
317
|
/** @hidden */
|
|
@@ -963,6 +969,7 @@ export default abstract class Params {
|
|
|
963
969
|
static get audioNack(): boolean;
|
|
964
970
|
static get movieShare(): boolean;
|
|
965
971
|
static get videoTracksCount(): number;
|
|
972
|
+
static get requestDisplayLayoutThrottleMs(): number;
|
|
966
973
|
static get breakVideoPayloadTypes(): boolean;
|
|
967
974
|
static get useCallsToContacts(): boolean;
|
|
968
975
|
static get useParticipantListChunk(): boolean;
|
|
@@ -1010,6 +1017,7 @@ export default abstract class Params {
|
|
|
1010
1017
|
screenShareCongestionControl: boolean;
|
|
1011
1018
|
screenShareCongestionControlThreshold: number;
|
|
1012
1019
|
videoTracksCount: number;
|
|
1020
|
+
requestDisplayLayoutThrottleMs: number;
|
|
1013
1021
|
asrDataChannel: boolean;
|
|
1014
1022
|
videoMaxHeight: number;
|
|
1015
1023
|
videoMaxWidth: number;
|
|
@@ -54,4 +54,37 @@ export type ParticipantLayout = (Layout | StopStream | RequestKeyFrame) & {
|
|
|
54
54
|
*/
|
|
55
55
|
streamName?: string;
|
|
56
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* Запрос стрима, который клиент хочет получать для отображения.
|
|
59
|
+
*/
|
|
60
|
+
export type DisplayLayoutRequest = {
|
|
61
|
+
/**
|
|
62
|
+
* Внешний ID пользователя
|
|
63
|
+
*/
|
|
64
|
+
uid: ExternalParticipantId | string;
|
|
65
|
+
/**
|
|
66
|
+
* Тип медиа (видео с камеры, картинка с экрана, лайв или мувик)
|
|
67
|
+
*/
|
|
68
|
+
mediaType: MediaType;
|
|
69
|
+
/**
|
|
70
|
+
* Ширина окошка в котором отображается видео, в пикселях
|
|
71
|
+
*/
|
|
72
|
+
width: number;
|
|
73
|
+
/**
|
|
74
|
+
* Высота окошка в котором отображается видео, в пикселях
|
|
75
|
+
*/
|
|
76
|
+
height: number;
|
|
77
|
+
/**
|
|
78
|
+
* Отображать видео как CSS object-fit: cover. По умолчанию используется contain.
|
|
79
|
+
*/
|
|
80
|
+
cover?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Приоритет
|
|
83
|
+
*/
|
|
84
|
+
priority?: number;
|
|
85
|
+
/**
|
|
86
|
+
* ID лайва или мувика. null для камеры или скрин-шары.
|
|
87
|
+
*/
|
|
88
|
+
streamName?: string;
|
|
89
|
+
};
|
|
57
90
|
export default ParticipantLayout;
|
|
@@ -366,6 +366,9 @@ declare namespace SignalingMessage {
|
|
|
366
366
|
export interface Connection extends Notification {
|
|
367
367
|
endpoint: string;
|
|
368
368
|
conversation: Conversation;
|
|
369
|
+
conversationParams: {
|
|
370
|
+
serverTime: number;
|
|
371
|
+
};
|
|
369
372
|
isConcurrent: boolean;
|
|
370
373
|
peerId: PeerId;
|
|
371
374
|
mediaModifiers: MediaModifiers;
|