@vkontakte/calls-sdk 2.8.2-dev.e9eec51.0 → 2.8.2-dev.fdec44d.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 +7 -2
- package/abstract/BaseSignaling.d.ts +2 -2
- package/calls-sdk.cjs.js +8 -8
- package/calls-sdk.esm.js +8 -8
- package/classes/Conversation.d.ts +7 -0
- package/classes/ParticipantIdRegistry.d.ts +5 -0
- package/classes/ProducerCommandSerializationService.d.ts +2 -0
- package/default/Signaling.d.ts +4 -5
- package/enums/SignalingCommandType.d.ts +1 -0
- package/enums/SignalingNotification.d.ts +2 -1
- package/package.json +1 -1
- package/static/External.d.ts +14 -0
- package/static/Params.d.ts +15 -8
- package/types/RequestAsr.d.ts +3 -0
- package/types/Streams.d.ts +3 -0
|
@@ -34,6 +34,10 @@ export type ParticipantUpdateInfo = {
|
|
|
34
34
|
sequenceNumber: number;
|
|
35
35
|
fastScreenShare: boolean;
|
|
36
36
|
};
|
|
37
|
+
export type ParticipantSuspendInfo = {
|
|
38
|
+
participantStreamDescription: ParticipantStreamDescription | null;
|
|
39
|
+
suspend: boolean;
|
|
40
|
+
};
|
|
37
41
|
export default class Conversation extends EventEmitter {
|
|
38
42
|
private readonly _api;
|
|
39
43
|
private readonly _signaling;
|
|
@@ -214,6 +218,7 @@ export default class Conversation extends EventEmitter {
|
|
|
214
218
|
private _sendUpdateDisplayLayout;
|
|
215
219
|
private _cleanupCooldownQueue;
|
|
216
220
|
private _onParticipantSourcesUpdate;
|
|
221
|
+
private _onParticipantSourcesSuspend;
|
|
217
222
|
private _onParticipantPromoted;
|
|
218
223
|
private _onChatRoomUpdated;
|
|
219
224
|
private _onSharedMovieUpdate;
|
|
@@ -226,6 +231,7 @@ export default class Conversation extends EventEmitter {
|
|
|
226
231
|
private _onFeaturesPerRoleChanged;
|
|
227
232
|
private _waitForStreamIfNeeded;
|
|
228
233
|
private _matchStreamDescription;
|
|
234
|
+
private _handleParticipantSuspend;
|
|
229
235
|
private _getWaitingTime;
|
|
230
236
|
private _isCallAdmin;
|
|
231
237
|
private _checkAdminRole;
|
|
@@ -267,6 +273,7 @@ export default class Conversation extends EventEmitter {
|
|
|
267
273
|
removeRooms(roomIds: number[]): Promise<void>;
|
|
268
274
|
startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null, roomId?: number | null): Promise<undefined>;
|
|
269
275
|
stopStream(roomId?: number | null): Promise<undefined>;
|
|
276
|
+
publishStream(roomId?: number | null): Promise<undefined>;
|
|
270
277
|
recordSetConf(king?: ParticipantId, pawns?: ParticipantId[], hideParticipantCount?: boolean, roomId?: number | null): Promise<void>;
|
|
271
278
|
getStreamInfo(): Promise<{
|
|
272
279
|
movieId: any;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ParticipantStreamDescription } from '../types/ParticipantStreamDescription';
|
|
2
2
|
import SignalingMessage from '../types/SignalingMessage';
|
|
3
|
+
export type IParticipantSuspendInfoParse = [
|
|
4
|
+
number,
|
|
5
|
+
boolean
|
|
6
|
+
];
|
|
3
7
|
export declare class ParticipantIdRegistry {
|
|
4
8
|
private streamDescriptionByCompactId;
|
|
5
9
|
private compactIdByStreamDescription;
|
|
@@ -7,4 +11,5 @@ export declare class ParticipantIdRegistry {
|
|
|
7
11
|
getCompactId(streamDescription: string): number | undefined;
|
|
8
12
|
handleMessage(data: ArrayBuffer): SignalingMessage | null;
|
|
9
13
|
private _createParticipantSourcesUpdateNotification;
|
|
14
|
+
private _createParticipantSourcesSuspendNotification;
|
|
10
15
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
|
|
2
|
+
import { RequestAsr } from '../types/RequestAsr';
|
|
2
3
|
import SignalingMessage from '../types/SignalingMessage';
|
|
3
4
|
import { PerfStatReport } from '../types/PerfStatReporter';
|
|
4
5
|
import { SharingStatReport } from './screenshare/SharingStatReport';
|
|
@@ -13,6 +14,7 @@ export declare class ProducerCommandSerializationService {
|
|
|
13
14
|
private writeStreamDesc;
|
|
14
15
|
serializePerfStatReport(sequenceNumber: number, report: PerfStatReport): ArrayBuffer;
|
|
15
16
|
serializeSharingStatReport(sequenceNumber: number, report: SharingStatReport): ArrayBuffer;
|
|
17
|
+
serializeRequestAsr(sequenceNumber: number, params: RequestAsr): ArrayBuffer;
|
|
16
18
|
deserializeCommandResponse(data: BufferSource | Blob): Promise<SignalingMessage | undefined>;
|
|
17
19
|
private deserializeUpdateDisplayLayoutResponse;
|
|
18
20
|
private deserializeReportPerfStatResponse;
|
package/default/Signaling.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import BaseSignaling, { AddParticipantParams } from '../abstract/BaseSignaling';
|
|
2
2
|
import { ParticipantIdRegistry } from '../classes/ParticipantIdRegistry';
|
|
3
3
|
import { SharingStatReport } from '../classes/screenshare/SharingStatReport';
|
|
4
|
-
import { StreamDescriptionString } from '../types/ParticipantStreamDescription';
|
|
5
|
-
import { PerfStatReport } from '../types/PerfStatReporter';
|
|
6
4
|
import { TransportTopology } from '../classes/transport/Transport';
|
|
7
5
|
import ConversationFeature from '../enums/ConversationFeature';
|
|
8
6
|
import ConversationOption from '../enums/ConversationOption';
|
|
@@ -19,8 +17,10 @@ import MuteStates from '../types/MuteStates';
|
|
|
19
17
|
import { CompositeUserId, ParticipantId } from '../types/Participant';
|
|
20
18
|
import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
|
|
21
19
|
import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
|
|
20
|
+
import { StreamDescriptionString } from '../types/ParticipantStreamDescription';
|
|
21
|
+
import { PerfStatReport } from '../types/PerfStatReporter';
|
|
22
22
|
import SignalingMessage from '../types/SignalingMessage';
|
|
23
|
-
import { IRecordConfData, IStartStreamData, IStopStreamData } from '../types/Streams';
|
|
23
|
+
import { IRecordConfData, IStartStreamData, IStopStreamData, IPublishStreamData } from '../types/Streams';
|
|
24
24
|
import { WaitingParticipantId } from '../types/WaitingHall';
|
|
25
25
|
export default class Signaling extends BaseSignaling {
|
|
26
26
|
private socket;
|
|
@@ -117,6 +117,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
117
117
|
removeRooms(roomIds: number[]): Promise<SignalingMessage>;
|
|
118
118
|
startStream(data: IStartStreamData): Promise<SignalingMessage>;
|
|
119
119
|
stopStream(data?: IStopStreamData): Promise<SignalingMessage>;
|
|
120
|
+
publishStream(data?: IPublishStreamData): Promise<SignalingMessage>;
|
|
120
121
|
recordSetConf(conf?: IRecordConfData): Promise<SignalingMessage>;
|
|
121
122
|
getRecordStatus(): Promise<SignalingMessage>;
|
|
122
123
|
switchTopology(topology: TransportTopology, force?: boolean): Promise<SignalingMessage>;
|
|
@@ -156,7 +157,6 @@ export default class Signaling extends BaseSignaling {
|
|
|
156
157
|
startAsr(params: IAsrStartParams): Promise<SignalingMessage>;
|
|
157
158
|
stopAsr(params?: IAsrStopParams): Promise<SignalingMessage>;
|
|
158
159
|
requestAsr(request: boolean): Promise<SignalingMessage>;
|
|
159
|
-
setAsrDataChannel(dataChannel: RTCDataChannel): void;
|
|
160
160
|
protected _connect(connectionType: SignalingConnectionType): void;
|
|
161
161
|
protected _disconnect(code?: number): void;
|
|
162
162
|
private _onOpen;
|
|
@@ -170,7 +170,6 @@ export default class Signaling extends BaseSignaling {
|
|
|
170
170
|
protected _closeSocket(error?: Error | null): void;
|
|
171
171
|
protected _reconnect(): void;
|
|
172
172
|
private _handleCommandResponse;
|
|
173
|
-
private _serializeAsrCommand;
|
|
174
173
|
private _handleCommandsQueue;
|
|
175
174
|
private _serializeBinary;
|
|
176
175
|
private _serializeJson;
|
|
@@ -15,6 +15,7 @@ declare enum SignalingCommandType {
|
|
|
15
15
|
REPORT_SHARING_STAT = "report-sharing-stat",
|
|
16
16
|
RECORD_START = "record-start",
|
|
17
17
|
RECORD_STOP = "record-stop",
|
|
18
|
+
RECORD_PUBLISH = "record-publish",
|
|
18
19
|
RECORD_SET_CONF = "record-set-conf",
|
|
19
20
|
RECORD_GET_STATUS = "record-get-status",
|
|
20
21
|
SWITCH_MICRO = "switch-micro",
|
|
@@ -46,6 +46,7 @@ declare enum SignalingNotification {
|
|
|
46
46
|
FEATURES_PER_ROLE_CHANGED = "features-per-role-changed",
|
|
47
47
|
PARTICIPANT_ANIMOJI_CHANGED = "participant-animoji-changed",
|
|
48
48
|
ASR_STARTED = "asr-started",
|
|
49
|
-
ASR_STOPPED = "asr-stopped"
|
|
49
|
+
ASR_STOPPED = "asr-stopped",
|
|
50
|
+
PARTICIPANT_SOURCES_SUSPEND = "participant-sources-suspend"
|
|
50
51
|
}
|
|
51
52
|
export default SignalingNotification;
|
package/package.json
CHANGED
package/static/External.d.ts
CHANGED
|
@@ -126,6 +126,20 @@ declare namespace External {
|
|
|
126
126
|
* @param stream
|
|
127
127
|
*/
|
|
128
128
|
function onRemoteVmojiStream(userId: ExternalParticipantId, stream: MediaStream | null): void;
|
|
129
|
+
/**
|
|
130
|
+
* Cтрим собеседника приостановлен/возобновлен.
|
|
131
|
+
*
|
|
132
|
+
* @param userId
|
|
133
|
+
* @param suspended true - стрим был приостановлен, false - стрим был запущен
|
|
134
|
+
*/
|
|
135
|
+
function onRemoteStreamSuspended(userId: ExternalParticipantId, suspended: boolean): void;
|
|
136
|
+
/**
|
|
137
|
+
* Стрим с экрана собеседника приостановлен/возобновлен.
|
|
138
|
+
*
|
|
139
|
+
* @param userId
|
|
140
|
+
* @param suspended true - стрим был приостановлен, false - стрим был запущен
|
|
141
|
+
*/
|
|
142
|
+
function onRemoteScreenStreamSuspended(userId: ExternalParticipantId, suspended: boolean): void;
|
|
129
143
|
/**
|
|
130
144
|
* Начат звонок
|
|
131
145
|
*
|
package/static/Params.d.ts
CHANGED
|
@@ -373,6 +373,12 @@ export type ParamsObject = {
|
|
|
373
373
|
* Использовать новые правила allMute для админа
|
|
374
374
|
*/
|
|
375
375
|
newMuteRules: boolean;
|
|
376
|
+
/**
|
|
377
|
+
* Включить поддержку приостановки видео в плохой сети.
|
|
378
|
+
*
|
|
379
|
+
* _По умолчанию: `false`_
|
|
380
|
+
*/
|
|
381
|
+
videoSuspend: boolean;
|
|
376
382
|
/**
|
|
377
383
|
* Получен локальный стрим с камеры/микрофона
|
|
378
384
|
*/
|
|
@@ -398,6 +404,14 @@ export type ParamsObject = {
|
|
|
398
404
|
* Если сервер закончил стримить собеседника, вместо стрима будет передан null
|
|
399
405
|
*/
|
|
400
406
|
onRemoteStream?: (userId: ExternalParticipantId, stream: MediaStream | null) => void;
|
|
407
|
+
/**
|
|
408
|
+
* Cтрим собеседника приостановлен/возобновлен.
|
|
409
|
+
*/
|
|
410
|
+
onRemoteStreamSuspended?: (userId: ExternalParticipantId, suspended: boolean) => void;
|
|
411
|
+
/**
|
|
412
|
+
* Стрим с экрана собеседника приостановлен/возобновлен.
|
|
413
|
+
*/
|
|
414
|
+
onRemoteScreenStreamSuspended?: (userId: ExternalParticipantId, suspended: boolean) => void;
|
|
401
415
|
/**
|
|
402
416
|
* Получен стрим с экрана собеседника.
|
|
403
417
|
* Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
|
|
@@ -676,14 +690,6 @@ export type ParamsObject = {
|
|
|
676
690
|
* @param roomId Id комнаты
|
|
677
691
|
*/
|
|
678
692
|
onAsrStopped?: (roomId: number | null) => void;
|
|
679
|
-
/**
|
|
680
|
-
* Получена расшифровка речи
|
|
681
|
-
* @param id Id пользователя, произнесшего реплику
|
|
682
|
-
* @param text Текст расшифровки
|
|
683
|
-
* @param timestamp Время расшифровки
|
|
684
|
-
* @param duration Длительность реплики в расшифровке
|
|
685
|
-
*/
|
|
686
|
-
onAsrTranscription?: (id: ExternalParticipantId, text: string, timestamp: number, duration: number) => void;
|
|
687
693
|
/**
|
|
688
694
|
* Установка начальных параметров текстовой расшифровки звонка. (Используется при входе в звонок/ смене комнаты)
|
|
689
695
|
* @param data Начальная информация по ASR
|
|
@@ -814,5 +820,6 @@ export default abstract class Params {
|
|
|
814
820
|
static get fastScreenShareWidth(): number;
|
|
815
821
|
static get fastScreenShareHeight(): number;
|
|
816
822
|
static get newMuteRules(): boolean;
|
|
823
|
+
static get videoSuspend(): boolean;
|
|
817
824
|
static getScreenFrameRate(fastScreenShare: boolean): number;
|
|
818
825
|
}
|
package/types/Streams.d.ts
CHANGED
|
@@ -10,6 +10,9 @@ export interface IStartStreamData {
|
|
|
10
10
|
export interface IStopStreamData {
|
|
11
11
|
roomId: number | null;
|
|
12
12
|
}
|
|
13
|
+
export interface IPublishStreamData {
|
|
14
|
+
roomId: number | null;
|
|
15
|
+
}
|
|
13
16
|
export interface IRecordConfData {
|
|
14
17
|
king?: ParticipantId;
|
|
15
18
|
pawns?: ParticipantId[];
|