@vkontakte/calls-sdk 2.4.4-dev.1b4f7df.0 → 2.4.4-dev.717e1c2.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 -12
- package/abstract/BaseApi.d.ts +1 -1
- package/abstract/BaseSignaling.d.ts +8 -7
- package/calls-sdk.cjs.js +9 -8
- package/calls-sdk.esm.js +9 -8
- package/classes/Conversation.d.ts +17 -14
- package/classes/DebugInfo.d.ts +2 -2
- package/classes/MediaSource.d.ts +11 -0
- package/classes/SpeakerDetector.d.ts +2 -2
- package/classes/SpecListener.d.ts +3 -3
- package/classes/screenshare/BaseStreamBuilder.d.ts +25 -0
- package/classes/screenshare/ScreenCaptureReceiver.d.ts +2 -2
- package/classes/screenshare/StreamBuilder.d.ts +6 -10
- package/classes/screenshare/WebmBuilder.d.ts +19 -0
- package/classes/transport/DirectTransport.d.ts +2 -2
- package/classes/transport/ServerTransport.d.ts +2 -2
- package/classes/transport/Statistics.d.ts +2 -2
- package/classes/transport/Transport.d.ts +5 -5
- package/default/Api.d.ts +2 -2
- package/default/Signaling.d.ts +8 -7
- package/enums/HangupType.d.ts +1 -0
- package/package.json +4 -2
- package/static/External.d.ts +23 -18
- package/static/Params.d.ts +23 -22
- package/static/Utils.d.ts +13 -4
- package/types/ConversationParams.d.ts +1 -0
- package/types/ConversationResponse.d.ts +4 -0
- package/types/ExternalId.d.ts +30 -3
- package/types/MediaSettings.d.ts +5 -1
- package/types/Participant.d.ts +15 -3
- package/types/ParticipantLayout.d.ts +2 -2
- package/types/ParticipantPriority.d.ts +3 -3
- package/types/ParticipantStreamDescription.d.ts +2 -2
- package/types/SignalingMessage.d.ts +28 -22
- package/utils/Media.d.ts +4 -0
package/static/Params.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import ConversationOption from '../enums/ConversationOption';
|
|
|
7
7
|
import FatalError from '../enums/FatalError';
|
|
8
8
|
import MediaOption from '../enums/MediaOption';
|
|
9
9
|
import UserRole from '../enums/UserRole';
|
|
10
|
-
import { ExternalId, ExternalParticipant } from '../types/ExternalId';
|
|
10
|
+
import { ExternalId, ExternalParticipant, ExternalParticipantId } from '../types/ExternalId';
|
|
11
11
|
import IceServer from '../types/IceServer';
|
|
12
12
|
import MediaModifiers from '../types/MediaModifiers';
|
|
13
13
|
import MediaSettings from '../types/MediaSettings';
|
|
@@ -196,6 +196,7 @@ export declare type ParamsObject = {
|
|
|
196
196
|
producerCommandDataChannel: boolean;
|
|
197
197
|
consumerScreenDataChannel: boolean;
|
|
198
198
|
producerScreenDataChannel: boolean;
|
|
199
|
+
screenShareWebmBuilder: boolean;
|
|
199
200
|
noiseSuppression: boolean;
|
|
200
201
|
/**
|
|
201
202
|
* Количество входящих видео-треков.
|
|
@@ -219,6 +220,7 @@ export declare type ParamsObject = {
|
|
|
219
220
|
*/
|
|
220
221
|
batchParticipantsOnStart: boolean;
|
|
221
222
|
participantStateMapped: boolean;
|
|
223
|
+
joinFromMultipleDevices: boolean;
|
|
222
224
|
/**
|
|
223
225
|
* Получен локальный стрим с камеры/микрофона
|
|
224
226
|
*/
|
|
@@ -239,40 +241,40 @@ export declare type ParamsObject = {
|
|
|
239
241
|
* Получен стрим собеседника.
|
|
240
242
|
* Если сервер закончил стримить собеседника, вместо стрима будет передан null
|
|
241
243
|
*/
|
|
242
|
-
onRemoteStream?: (userId:
|
|
244
|
+
onRemoteStream?: (userId: ExternalParticipantId, stream: MediaStream | null) => void;
|
|
243
245
|
/**
|
|
244
246
|
* Получен стрим с экрана собеседника.
|
|
245
247
|
* Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
|
|
246
248
|
*/
|
|
247
|
-
onRemoteScreenStream?: (userId:
|
|
249
|
+
onRemoteScreenStream?: (userId: ExternalParticipantId, stream: MediaStream | null) => void;
|
|
248
250
|
/**
|
|
249
251
|
* Получен стрим трансляция или мувик от собеседника.
|
|
250
252
|
* Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
|
|
251
253
|
*/
|
|
252
|
-
onRemoteLive?: (userId:
|
|
254
|
+
onRemoteLive?: (userId: ExternalParticipantId, streamId: string, stream: MediaStream | null) => void;
|
|
253
255
|
/**
|
|
254
256
|
* Начат звонок
|
|
255
257
|
*/
|
|
256
|
-
onConversation?: (userId:
|
|
258
|
+
onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants?: ExternalParticipant[]) => void;
|
|
257
259
|
/**
|
|
258
260
|
* Изменились данные стрима собеседника
|
|
259
261
|
*/
|
|
260
|
-
onRemoteMediaSettings?: (userId:
|
|
262
|
+
onRemoteMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings) => void;
|
|
261
263
|
/**
|
|
262
264
|
* Изменились данные состояний собеседника
|
|
263
265
|
*/
|
|
264
|
-
onRemoteParticipantState?: (userId:
|
|
266
|
+
onRemoteParticipantState?: (userId: ExternalParticipantId, participantState: {
|
|
265
267
|
[key: string]: string;
|
|
266
268
|
}) => void;
|
|
267
269
|
/**
|
|
268
270
|
* Изменился статус соединения собеседников
|
|
269
271
|
*/
|
|
270
|
-
onRemoteStatus?: (userIds:
|
|
272
|
+
onRemoteStatus?: (userIds: ExternalParticipantId[], status: ParticipantStatus, data: any) => void;
|
|
271
273
|
/**
|
|
272
274
|
* Изменился статус соединения собеседника
|
|
273
275
|
* @deprecated
|
|
274
276
|
*/
|
|
275
|
-
onParticipantStatus?: (userId:
|
|
277
|
+
onParticipantStatus?: (userId: ExternalParticipantId, status: ParticipantStatus, data: any) => void;
|
|
276
278
|
/**
|
|
277
279
|
* Разрешения на доступы были запрошены в браузере
|
|
278
280
|
*/
|
|
@@ -284,7 +286,7 @@ export declare type ParamsObject = {
|
|
|
284
286
|
/**
|
|
285
287
|
* Пользователь отключился от звонка
|
|
286
288
|
*/
|
|
287
|
-
onRemoteRemoved?: (userId:
|
|
289
|
+
onRemoteRemoved?: (userId: ExternalParticipantId) => void;
|
|
288
290
|
/**
|
|
289
291
|
* Изменилось состояние звонка
|
|
290
292
|
*/
|
|
@@ -296,11 +298,11 @@ export declare type ParamsObject = {
|
|
|
296
298
|
/**
|
|
297
299
|
* Изменились состояния устройств пользователя или разрешения включать камеру/микрофон
|
|
298
300
|
*/
|
|
299
|
-
onMuteStates?: (muteStates: MuteStates, unmuteOptions: MediaOption[], userId:
|
|
301
|
+
onMuteStates?: (muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll: boolean, unmute: boolean, userId: ExternalParticipantId | null, adminId: ExternalParticipantId | null) => void;
|
|
300
302
|
/**
|
|
301
303
|
* Изменились роли собеседника в звонке
|
|
302
304
|
*/
|
|
303
|
-
onRolesChanged?: (userId:
|
|
305
|
+
onRolesChanged?: (userId: ExternalParticipantId, roles: UserRole[]) => void;
|
|
304
306
|
/**
|
|
305
307
|
* Изменились свои роли в звонке
|
|
306
308
|
*/
|
|
@@ -308,7 +310,7 @@ export declare type ParamsObject = {
|
|
|
308
310
|
/**
|
|
309
311
|
* Закрепляет/открепляет собеседника для всех
|
|
310
312
|
*/
|
|
311
|
-
onPinnedParticipant?: (userId:
|
|
313
|
+
onPinnedParticipant?: (userId: ExternalParticipantId, unpin: boolean) => void;
|
|
312
314
|
/**
|
|
313
315
|
* Закрепляет/открепляет текущего пользователя у других собеседников
|
|
314
316
|
*/
|
|
@@ -321,12 +323,12 @@ export declare type ParamsObject = {
|
|
|
321
323
|
/**
|
|
322
324
|
* Изменился говорящий в звонке
|
|
323
325
|
*/
|
|
324
|
-
onSpeakerChanged?: (userId:
|
|
326
|
+
onSpeakerChanged?: (userId: ExternalParticipantId) => void;
|
|
325
327
|
/**
|
|
326
328
|
* Громкость собеседников
|
|
327
329
|
*/
|
|
328
330
|
onVolumesDetected?: (volumes: {
|
|
329
|
-
uid:
|
|
331
|
+
uid: ExternalParticipantId;
|
|
330
332
|
volume: number;
|
|
331
333
|
}[]) => void;
|
|
332
334
|
/**
|
|
@@ -358,15 +360,15 @@ export declare type ParamsObject = {
|
|
|
358
360
|
/**
|
|
359
361
|
* Получено сообщение чата
|
|
360
362
|
*/
|
|
361
|
-
onChatMessage?: (message: string, from:
|
|
363
|
+
onChatMessage?: (message: string, from: ExternalParticipantId, direct: boolean) => void;
|
|
362
364
|
/**
|
|
363
365
|
* Получены данные от собеседника
|
|
364
366
|
*/
|
|
365
|
-
onCustomData?: (data: JSONObject, from:
|
|
367
|
+
onCustomData?: (data: JSONObject, from: ExternalParticipantId, direct: boolean) => void;
|
|
366
368
|
/**
|
|
367
369
|
* Начата трансляция/запись звонка
|
|
368
370
|
*/
|
|
369
|
-
onRecordStarted?: (initiator:
|
|
371
|
+
onRecordStarted?: (initiator: ExternalParticipantId, movieId: number, startTime: number, type: 'STREAM' | 'RECORD', externalMovieId?: string, externalOwnerId?: string) => void;
|
|
370
372
|
/**
|
|
371
373
|
* Закончена трансляция/запись звонка
|
|
372
374
|
*/
|
|
@@ -383,7 +385,7 @@ export declare type ParamsObject = {
|
|
|
383
385
|
* @param status Оценки качества соединения участников от 0 до 1
|
|
384
386
|
*/
|
|
385
387
|
onNetworkStatusChanged?: (status: {
|
|
386
|
-
uid:
|
|
388
|
+
uid: ExternalParticipantId;
|
|
387
389
|
rating: number;
|
|
388
390
|
}[]) => void;
|
|
389
391
|
/**
|
|
@@ -417,7 +419,7 @@ export default abstract class Params {
|
|
|
417
419
|
static get appVersion(): number;
|
|
418
420
|
static get sdkVersion(): string | number | boolean;
|
|
419
421
|
static get debug(): string | number | boolean;
|
|
420
|
-
static get protocolVersion():
|
|
422
|
+
static get protocolVersion(): 5 | 6;
|
|
421
423
|
static get platform(): string;
|
|
422
424
|
static set platform(value: string);
|
|
423
425
|
static get clientType(): string;
|
|
@@ -480,9 +482,8 @@ export default abstract class Params {
|
|
|
480
482
|
static get producerNotificationDataChannel(): boolean;
|
|
481
483
|
static get producerCommandDataChannel(): boolean;
|
|
482
484
|
static get consumerScreenDataChannel(): boolean;
|
|
483
|
-
static set consumerScreenDataChannel(value: boolean);
|
|
484
485
|
static get producerScreenDataChannel(): boolean;
|
|
485
|
-
static
|
|
486
|
+
static get screenShareWebmBuilder(): boolean;
|
|
486
487
|
static get noiseSuppression(): boolean;
|
|
487
488
|
static set noiseSuppression(value: boolean);
|
|
488
489
|
static get preferH264(): boolean;
|
package/static/Utils.d.ts
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
import { BigInteger } from 'big-integer';
|
|
2
2
|
import UserType from '../enums/UserType';
|
|
3
3
|
import { ExternalParticipant } from '../types/ExternalId';
|
|
4
|
-
import { CompositeUserId, OkUserId, Participant, ParticipantStateMapped } from '../types/Participant';
|
|
4
|
+
import { CompositeUserId, OkUserId, Participant, ParticipantId, ParticipantStateMapped } from '../types/Participant';
|
|
5
5
|
import SignalingMessage from '../types/SignalingMessage';
|
|
6
6
|
import VideoSettings from '../types/VideoSettings';
|
|
7
|
+
export declare const PARAMETERS_SEPARATOR = ":";
|
|
8
|
+
export declare const DEVICE_IDX_PARAMETER = "d";
|
|
7
9
|
declare namespace Utils {
|
|
8
10
|
function patchSDP(sdp: string, preferH264: boolean, brokenH264: boolean, preferVP9: boolean, isAudioNack?: boolean): string;
|
|
9
11
|
function getPeerIdString(peerId: SignalingMessage.PeerId): string;
|
|
10
12
|
function comparePeerId(peerId1: SignalingMessage.PeerId, peerId2: SignalingMessage.PeerId): boolean;
|
|
11
13
|
function getPeerConnectionHostInfo(pc: RTCPeerConnection): Promise<any>;
|
|
12
|
-
function
|
|
13
|
-
function composeParticipantId(
|
|
14
|
-
function
|
|
14
|
+
function composeUserId(id: CompositeUserId | OkUserId, type: UserType): CompositeUserId;
|
|
15
|
+
function composeParticipantId(id: CompositeUserId | OkUserId, type: UserType, deviceIdx: number): ParticipantId;
|
|
16
|
+
function compose(compositeId: CompositeUserId, deviceIdx: number): ParticipantId;
|
|
17
|
+
function composeId(participant: SignalingMessage.Participant): ParticipantId;
|
|
18
|
+
function composeMessageId(message: SignalingMessage): ParticipantId;
|
|
15
19
|
function decomposeId(compositeId: CompositeUserId | OkUserId): {
|
|
16
20
|
id: OkUserId;
|
|
17
21
|
type: UserType;
|
|
18
22
|
};
|
|
23
|
+
function decomposeParticipantId(participantId: ParticipantId): {
|
|
24
|
+
compositeUserId: CompositeUserId;
|
|
25
|
+
deviceIdx: number;
|
|
26
|
+
};
|
|
19
27
|
function uuid(): string;
|
|
20
28
|
function throttle(func: Function, ms: number): (this: any) => void;
|
|
21
29
|
function sdpFingerprint(sdp: string): BigInteger;
|
|
@@ -54,5 +62,6 @@ declare namespace Utils {
|
|
|
54
62
|
[key in T]?: K;
|
|
55
63
|
}): boolean;
|
|
56
64
|
function isArraysEquals<T>(arr1: T[], arr2: T[]): boolean;
|
|
65
|
+
function isEmptyObject(obj: object): boolean;
|
|
57
66
|
}
|
|
58
67
|
export default Utils;
|
package/types/ExternalId.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import MediaOption from '../enums/MediaOption';
|
|
1
2
|
import { ParticipantStatus } from '../static/External';
|
|
2
|
-
import
|
|
3
|
+
import MediaSettings from './MediaSettings';
|
|
4
|
+
import MuteStates from './MuteStates';
|
|
5
|
+
import { ParticipantStateMapped } from './Participant';
|
|
3
6
|
import SignalingMessage from './SignalingMessage';
|
|
4
7
|
/**
|
|
5
8
|
* Тип внешнего пользователя
|
|
@@ -19,6 +22,13 @@ export declare namespace ExternalIdUtils {
|
|
|
19
22
|
function compare(id1: ExternalId, id2: ExternalId): boolean;
|
|
20
23
|
}
|
|
21
24
|
export declare type ExternalIdString = string;
|
|
25
|
+
export declare namespace ExternalParticipantIdUtils {
|
|
26
|
+
function fromId(id: string, type?: ExternalIdType, deviceIdx?: number): ExternalParticipantId;
|
|
27
|
+
function toString(externalId: ExternalParticipantId): ExternalParticipantIdString;
|
|
28
|
+
function fromSignaling(signalingId: SignalingMessage.ExternalId, deviceIdx: number): ExternalParticipantId;
|
|
29
|
+
function getDeviceIdx(externalId: string | ExternalParticipantId | null): number;
|
|
30
|
+
}
|
|
31
|
+
export declare type ExternalParticipantIdString = string;
|
|
22
32
|
/**
|
|
23
33
|
* Идентификатор внешнего пользователя
|
|
24
34
|
*/
|
|
@@ -32,6 +42,15 @@ export interface ExternalId {
|
|
|
32
42
|
*/
|
|
33
43
|
type: ExternalIdType;
|
|
34
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Идентификатор участника звонка
|
|
47
|
+
*/
|
|
48
|
+
export interface ExternalParticipantId extends ExternalId {
|
|
49
|
+
/**
|
|
50
|
+
* Индекс устройства (позволяет отличать участников, которые присоединяются к звонку под одной учётной записью с разных устройств)
|
|
51
|
+
*/
|
|
52
|
+
deviceIdx: number;
|
|
53
|
+
}
|
|
35
54
|
/**
|
|
36
55
|
* Участник звонка
|
|
37
56
|
*/
|
|
@@ -39,11 +58,11 @@ export interface ExternalParticipant {
|
|
|
39
58
|
/**
|
|
40
59
|
* Идентификатор пользователя
|
|
41
60
|
*/
|
|
42
|
-
uid:
|
|
61
|
+
uid: ExternalParticipantId;
|
|
43
62
|
/**
|
|
44
63
|
* Данные стрима
|
|
45
64
|
*/
|
|
46
|
-
mediaSettings:
|
|
65
|
+
mediaSettings: MediaSettings;
|
|
47
66
|
/**
|
|
48
67
|
* Статус соединения
|
|
49
68
|
*/
|
|
@@ -52,4 +71,12 @@ export interface ExternalParticipant {
|
|
|
52
71
|
* Клиентское состояние
|
|
53
72
|
*/
|
|
54
73
|
participantState?: ParticipantStateMapped;
|
|
74
|
+
/**
|
|
75
|
+
* Состояние устройств пользователя
|
|
76
|
+
*/
|
|
77
|
+
muteStates: MuteStates;
|
|
78
|
+
/**
|
|
79
|
+
* Разрешения на включение устройств
|
|
80
|
+
*/
|
|
81
|
+
unmuteOptions: MediaOption[];
|
|
55
82
|
}
|
package/types/MediaSettings.d.ts
CHANGED
|
@@ -17,9 +17,13 @@ export declare type MediaSettings = {
|
|
|
17
17
|
videoStreams: VideoStreamInfo[];
|
|
18
18
|
};
|
|
19
19
|
export declare type VideoStreamInfo = {
|
|
20
|
-
|
|
20
|
+
id: string;
|
|
21
21
|
source: string;
|
|
22
22
|
};
|
|
23
23
|
export default MediaSettings;
|
|
24
24
|
export declare function compareMediaSettings(ms1: MediaSettings, ms2: MediaSettings): boolean;
|
|
25
25
|
export declare function createMediaSettingsWithDefaults(ms?: Partial<MediaSettings>): MediaSettings;
|
|
26
|
+
export interface IVideoDimentions {
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
}
|
package/types/Participant.d.ts
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
|
+
import MediaOption from '../enums/MediaOption';
|
|
1
2
|
import ParticipantState from '../enums/ParticipantState';
|
|
2
3
|
import UserRole from '../enums/UserRole';
|
|
3
4
|
import { ParticipantStatus } from '../static/External';
|
|
4
5
|
import MediaSettings from '../types/MediaSettings';
|
|
5
|
-
import {
|
|
6
|
+
import { ExternalParticipantId } from './ExternalId';
|
|
7
|
+
import MuteStates from './MuteStates';
|
|
6
8
|
import ParticipantLayout from './ParticipantLayout';
|
|
9
|
+
/**
|
|
10
|
+
* Уникально идентифицирует пользователя или группу
|
|
11
|
+
*/
|
|
7
12
|
export declare type CompositeUserId = string;
|
|
13
|
+
/**
|
|
14
|
+
* Уникально идентифицирует участника звонка
|
|
15
|
+
* (одному пользователю могут соответствовать несколько участников, в случае если пользователь зашёл в звонок с нескольких устройств)
|
|
16
|
+
*/
|
|
17
|
+
export declare type ParticipantId = string;
|
|
8
18
|
export declare type OkUserId = number;
|
|
9
19
|
/**
|
|
10
20
|
* Стейт участника звонка
|
|
@@ -16,8 +26,8 @@ export interface ParticipantStateMapped {
|
|
|
16
26
|
};
|
|
17
27
|
}
|
|
18
28
|
export interface Participant {
|
|
19
|
-
id:
|
|
20
|
-
externalId:
|
|
29
|
+
id: ParticipantId;
|
|
30
|
+
externalId: ExternalParticipantId;
|
|
21
31
|
mediaSettings: MediaSettings;
|
|
22
32
|
state: ParticipantState;
|
|
23
33
|
status: ParticipantStatus | null;
|
|
@@ -34,4 +44,6 @@ export interface Participant {
|
|
|
34
44
|
lastRequestedLayouts: {
|
|
35
45
|
[key: string]: ParticipantLayout;
|
|
36
46
|
};
|
|
47
|
+
muteStates: MuteStates;
|
|
48
|
+
unmuteOptions: MediaOption[];
|
|
37
49
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExternalParticipantId } from './ExternalId';
|
|
2
2
|
import { MediaType } from './ParticipantStreamDescription';
|
|
3
3
|
/**
|
|
4
4
|
* Лейаут собеседника в звонке
|
|
@@ -42,7 +42,7 @@ export declare type ParticipantLayout = (Layout | StopStream) & {
|
|
|
42
42
|
/**
|
|
43
43
|
* Внешний ID пользователя
|
|
44
44
|
*/
|
|
45
|
-
uid:
|
|
45
|
+
uid: ExternalParticipantId | string;
|
|
46
46
|
/**
|
|
47
47
|
* Тип медиа (видео с камеры, картинка с экрана, лайв или мувик)
|
|
48
48
|
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExternalParticipantId } from './ExternalId';
|
|
2
2
|
/**
|
|
3
3
|
* Приоритет собеседника в звонке
|
|
4
4
|
*/
|
|
5
5
|
declare type ParticipantPriority = {
|
|
6
6
|
/**
|
|
7
|
-
* Внешний ID
|
|
7
|
+
* Внешний ID участника звонка
|
|
8
8
|
*/
|
|
9
|
-
uid:
|
|
9
|
+
uid: ExternalParticipantId | string;
|
|
10
10
|
/**
|
|
11
11
|
* Приоритет [-1..MAX_INT]
|
|
12
12
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ParticipantId } from './Participant';
|
|
2
2
|
/**
|
|
3
3
|
* Тип пользовательского медиа
|
|
4
4
|
*/
|
|
@@ -11,7 +11,7 @@ export declare enum MediaType {
|
|
|
11
11
|
export declare function serializeParticipantStreamDescription(description: ParticipantStreamDescription): string;
|
|
12
12
|
export declare function parseParticipantStreamDescription(descriptionString: string): ParticipantStreamDescription;
|
|
13
13
|
export declare type ParticipantStreamDescription = {
|
|
14
|
-
participantId:
|
|
14
|
+
participantId: ParticipantId;
|
|
15
15
|
mediaType: MediaType | null;
|
|
16
16
|
streamName?: string;
|
|
17
17
|
};
|
|
@@ -4,19 +4,18 @@ import ConversationFeature from '../enums/ConversationFeature';
|
|
|
4
4
|
import ConversationOption from '../enums/ConversationOption';
|
|
5
5
|
import HangupType from '../enums/HangupType';
|
|
6
6
|
import MediaOption from '../enums/MediaOption';
|
|
7
|
-
import MuteState from '../enums/MuteState';
|
|
8
7
|
import ParticipantState from '../enums/ParticipantState';
|
|
9
8
|
import UserRole from '../enums/UserRole';
|
|
10
9
|
import UserType from '../enums/UserType';
|
|
11
10
|
import MediaModifiers from './MediaModifiers';
|
|
12
11
|
import MediaSettings from './MediaSettings';
|
|
13
12
|
import MuteStates from './MuteStates';
|
|
14
|
-
import {
|
|
13
|
+
import { OkUserId, ParticipantId } from './Participant';
|
|
15
14
|
import VideoSettings from './VideoSettings';
|
|
16
15
|
import { WaitingParticipant } from './WaitingHall';
|
|
17
16
|
declare type SignalingMessage = Record<string, any>;
|
|
18
17
|
export declare type RecordInfo = {
|
|
19
|
-
initiator:
|
|
18
|
+
initiator: ParticipantId;
|
|
20
19
|
recordMovieId: number;
|
|
21
20
|
recordStartTime: number;
|
|
22
21
|
recordType: 'STREAM' | 'RECORD';
|
|
@@ -35,6 +34,7 @@ declare namespace SignalingMessage {
|
|
|
35
34
|
export interface Participant {
|
|
36
35
|
id: OkUserId;
|
|
37
36
|
idType?: UserType;
|
|
37
|
+
deviceIdx?: number;
|
|
38
38
|
externalId?: ExternalId;
|
|
39
39
|
state: ParticipantState;
|
|
40
40
|
responders?: OkUserId[];
|
|
@@ -62,8 +62,9 @@ declare namespace SignalingMessage {
|
|
|
62
62
|
multichatId: string | null;
|
|
63
63
|
tamtamMultichatId: string | null;
|
|
64
64
|
recordInfo: RecordInfo | null;
|
|
65
|
-
pinnedParticipantId:
|
|
65
|
+
pinnedParticipantId: ParticipantId | null;
|
|
66
66
|
options: ConversationOption[];
|
|
67
|
+
muteStates?: MuteStates;
|
|
67
68
|
}
|
|
68
69
|
interface Notification extends SignalingMessage {
|
|
69
70
|
type?: string;
|
|
@@ -73,12 +74,14 @@ declare namespace SignalingMessage {
|
|
|
73
74
|
export interface TransmittedData extends Notification {
|
|
74
75
|
participantId: OkUserId;
|
|
75
76
|
participantType: UserType;
|
|
77
|
+
deviceIdx?: number;
|
|
76
78
|
peerId: PeerId;
|
|
77
79
|
data: any;
|
|
78
80
|
}
|
|
79
81
|
export interface RegisteredPeer extends Notification {
|
|
80
82
|
participantId: OkUserId;
|
|
81
83
|
participantType: UserType;
|
|
84
|
+
deviceIdx?: number;
|
|
82
85
|
peerId: PeerId;
|
|
83
86
|
platform: string;
|
|
84
87
|
clientType: string;
|
|
@@ -86,12 +89,14 @@ declare namespace SignalingMessage {
|
|
|
86
89
|
export interface AcceptedCall extends Notification {
|
|
87
90
|
participantId: OkUserId;
|
|
88
91
|
participantType: UserType;
|
|
92
|
+
deviceIdx?: number;
|
|
89
93
|
peerId: PeerId;
|
|
90
94
|
mediaSettings: Partial<MediaSettings>;
|
|
91
95
|
}
|
|
92
96
|
export interface Hungup extends Notification {
|
|
93
97
|
participantId: OkUserId;
|
|
94
98
|
participantType: UserType;
|
|
99
|
+
deviceIdx?: number;
|
|
95
100
|
peerId: PeerId;
|
|
96
101
|
reason: HangupType;
|
|
97
102
|
}
|
|
@@ -101,12 +106,14 @@ declare namespace SignalingMessage {
|
|
|
101
106
|
export interface MediaSettingsChanged extends Notification {
|
|
102
107
|
participantId: OkUserId;
|
|
103
108
|
participantType: UserType;
|
|
109
|
+
deviceIdx?: number;
|
|
104
110
|
peerId: PeerId;
|
|
105
111
|
mediaSettings: Partial<MediaSettings>;
|
|
106
112
|
}
|
|
107
113
|
export interface ParticipantStateChanged extends Notification {
|
|
108
114
|
participantId: OkUserId;
|
|
109
115
|
participantType: UserType;
|
|
116
|
+
deviceIdx?: number;
|
|
110
117
|
peerId: PeerId;
|
|
111
118
|
mediaSettings: Partial<MediaSettings>;
|
|
112
119
|
participantState: {
|
|
@@ -115,18 +122,21 @@ declare namespace SignalingMessage {
|
|
|
115
122
|
};
|
|
116
123
|
}
|
|
117
124
|
export interface RolesChanged extends Notification {
|
|
118
|
-
adminId:
|
|
119
|
-
participantId:
|
|
125
|
+
adminId: ParticipantId;
|
|
126
|
+
participantId: ParticipantId;
|
|
120
127
|
roles?: UserRole[];
|
|
121
128
|
}
|
|
122
129
|
export interface MuteParticipant extends Notification {
|
|
130
|
+
adminId?: ParticipantId;
|
|
131
|
+
participantId?: ParticipantId;
|
|
132
|
+
muteStates: MuteStates;
|
|
133
|
+
unmuteOptions?: MediaOption[];
|
|
123
134
|
mediaOptions: MediaOption[];
|
|
124
135
|
unmute?: boolean;
|
|
125
|
-
mutePermanent?: boolean;
|
|
126
136
|
muteAll?: boolean;
|
|
127
137
|
}
|
|
128
138
|
export interface PinParticipant extends Notification {
|
|
129
|
-
participantId:
|
|
139
|
+
participantId: ParticipantId;
|
|
130
140
|
unpin?: boolean;
|
|
131
141
|
}
|
|
132
142
|
export interface ParticipantAdded extends Notification {
|
|
@@ -150,6 +160,7 @@ declare namespace SignalingMessage {
|
|
|
150
160
|
topology: TransportTopology;
|
|
151
161
|
offerTo: OkUserId[];
|
|
152
162
|
offerToTypes: UserType[];
|
|
163
|
+
offerToDeviceIdxs: number[];
|
|
153
164
|
}
|
|
154
165
|
export interface RateCallData extends Notification {
|
|
155
166
|
maxRateForQuestion: number;
|
|
@@ -166,12 +177,10 @@ declare namespace SignalingMessage {
|
|
|
166
177
|
reason: string;
|
|
167
178
|
}
|
|
168
179
|
export interface RecordStarted extends Notification {
|
|
169
|
-
idType: UserType;
|
|
170
|
-
id: OkUserId;
|
|
171
180
|
recordInfo: RecordInfo;
|
|
172
181
|
}
|
|
173
182
|
export interface RecordStopped extends Notification {
|
|
174
|
-
participant:
|
|
183
|
+
participant: ParticipantId;
|
|
175
184
|
recordMovieId: number;
|
|
176
185
|
}
|
|
177
186
|
export interface ReallocCon extends Notification {
|
|
@@ -181,6 +190,7 @@ declare namespace SignalingMessage {
|
|
|
181
190
|
export interface ChatMessage extends Notification {
|
|
182
191
|
participantId: OkUserId;
|
|
183
192
|
participantType: UserType;
|
|
193
|
+
deviceIdx?: number;
|
|
184
194
|
direct: boolean;
|
|
185
195
|
message: string;
|
|
186
196
|
}
|
|
@@ -193,13 +203,13 @@ declare namespace SignalingMessage {
|
|
|
193
203
|
settings: Record<string, any>;
|
|
194
204
|
}
|
|
195
205
|
export interface StalledActivity extends Notification {
|
|
196
|
-
stalledParticipants:
|
|
206
|
+
stalledParticipants: ParticipantId[];
|
|
197
207
|
}
|
|
198
208
|
export interface AudioActivity extends Notification {
|
|
199
|
-
activeParticipants:
|
|
209
|
+
activeParticipants: ParticipantId[];
|
|
200
210
|
}
|
|
201
211
|
export interface SpeakerChanged extends Notification {
|
|
202
|
-
speaker:
|
|
212
|
+
speaker: ParticipantId;
|
|
203
213
|
}
|
|
204
214
|
export interface OptionsChanged extends Notification {
|
|
205
215
|
options: ConversationOption[];
|
|
@@ -208,22 +218,19 @@ declare namespace SignalingMessage {
|
|
|
208
218
|
statuses: Record<string, number>;
|
|
209
219
|
}
|
|
210
220
|
export interface PromotionApproved extends Notification {
|
|
211
|
-
adminId:
|
|
221
|
+
adminId: ParticipantId;
|
|
212
222
|
}
|
|
213
223
|
export interface PromoteParticipant extends Notification {
|
|
214
224
|
demote: boolean;
|
|
215
225
|
mediaModifiers: MediaModifiers;
|
|
216
|
-
muteState?: MuteState;
|
|
217
|
-
muteOptions?: MediaOption[];
|
|
218
|
-
unmuteOptions?: MediaOption[];
|
|
219
226
|
conversation: Conversation;
|
|
220
227
|
}
|
|
221
228
|
export interface ChatRoomUpdated extends Notification {
|
|
222
229
|
eventType: ChatRoomEventType;
|
|
223
230
|
totalCount: number;
|
|
224
231
|
firstParticipants: WaitingParticipant[];
|
|
225
|
-
addedParticipantIds:
|
|
226
|
-
removedParticipantIds:
|
|
232
|
+
addedParticipantIds: ParticipantId[];
|
|
233
|
+
removedParticipantIds: ParticipantId[];
|
|
227
234
|
feedback: Record<string, any>[];
|
|
228
235
|
}
|
|
229
236
|
export interface VideoQualityUpdate extends Notification {
|
|
@@ -235,6 +242,7 @@ declare namespace SignalingMessage {
|
|
|
235
242
|
export interface CustomData extends Notification {
|
|
236
243
|
participantId: OkUserId;
|
|
237
244
|
participantType: UserType;
|
|
245
|
+
deviceIdx?: number;
|
|
238
246
|
data: Record<string, any>;
|
|
239
247
|
}
|
|
240
248
|
export interface SwitchMicro extends Notification {
|
|
@@ -245,8 +253,6 @@ declare namespace SignalingMessage {
|
|
|
245
253
|
conversation: Conversation;
|
|
246
254
|
isConcurrent: boolean;
|
|
247
255
|
peerId: PeerId;
|
|
248
|
-
muteStates: MuteStates;
|
|
249
|
-
unmuteOptions: MediaOption[];
|
|
250
256
|
mediaModifiers: MediaModifiers;
|
|
251
257
|
}
|
|
252
258
|
export {};
|
package/utils/Media.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const stopMediaStreamTrack: (track: MediaStreamTrack) => void;
|
|
2
|
+
export declare const stopMediaStreamTracks: (stream: MediaStream) => void;
|
|
3
|
+
export declare const stopMediaStreamVideoTracks: (stream: MediaStream) => void;
|
|
4
|
+
export declare const cloneVideoTrack: (stream: MediaStream) => MediaStreamTrack;
|