@vkontakte/calls-sdk 2.6.2-dev.5b6408b.0 → 2.6.2-dev.5c10106.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.
@@ -15,7 +15,7 @@ import { JSONObject } from '../static/Json';
15
15
  import { ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalUserId } from '../types/ExternalId';
16
16
  import MediaModifiers from '../types/MediaModifiers';
17
17
  import { IVideoDimentions } from '../types/MediaSettings';
18
- import { IAddMovieParams } from '../types/MovieShare';
18
+ import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
19
19
  import MuteStates from '../types/MuteStates';
20
20
  import { CompositeUserId, IGetParticipantsParameters, OkUserId, ParticipantId } from '../types/Participant';
21
21
  import { ParticipantLayout } from '../types/ParticipantLayout';
@@ -77,6 +77,7 @@ export default class Conversation extends EventEmitter {
77
77
  private readonly _signaling;
78
78
  private _mediaSource;
79
79
  private _conversation;
80
+ private _myLastRequestedLayouts;
80
81
  private _state;
81
82
  private _participantState;
82
83
  private _participants;
@@ -152,10 +153,12 @@ export default class Conversation extends EventEmitter {
152
153
  private _processConnection;
153
154
  private _prepareParticipants;
154
155
  private _onConversationParticipantListChunk;
156
+ private _createParticipantListChunk;
155
157
  private _participantListChunkToExternalChunk;
156
158
  private _registerConnectionParticipants;
157
159
  private _registerParticipants;
158
- private _getClientType;
160
+ /** Установим состояние локальных мьютов */
161
+ private _registerParticipantLocalMuteState;
159
162
  private _getStatusByTransportState;
160
163
  private _registerParticipantInCache;
161
164
  private _getExistedParticipantByIdOrCreate;
@@ -204,8 +207,6 @@ export default class Conversation extends EventEmitter {
204
207
  private _stopStreaming;
205
208
  private _sendUpdateDisplayLayout;
206
209
  private _cleanupCooldownQueue;
207
- private static _isStopStreaming;
208
- private static _layoutToString;
209
210
  private _onParticipantSourcesUpdate;
210
211
  private _onParticipantPromoted;
211
212
  private _onChatRoomUpdated;
@@ -235,11 +236,11 @@ export default class Conversation extends EventEmitter {
235
236
  customData(data: JSONObject, participantId?: ParticipantId | null): Promise<void>;
236
237
  createJoinLink(): Promise<string>;
237
238
  removeJoinLink(): Promise<never>;
238
- addMovie({ movieId, gain }: IAddMovieParams): Promise<{
239
+ addMovie({ movieId, gain, metadata }: IAddMovieParams): Promise<{
239
240
  movieId: string;
240
241
  streamType: string;
241
242
  }>;
242
- updateMovie(movieId: string, gain?: number, offset?: number, pause?: boolean): Promise<void>;
243
+ updateMovie(params: IUpdateMovieData): Promise<void>;
243
244
  removeMovie(movieId: string): Promise<void>;
244
245
  startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null): Promise<SignalingMessage>;
245
246
  stopStream(): Promise<SignalingMessage>;
@@ -311,6 +312,7 @@ export default class Conversation extends EventEmitter {
311
312
  private _updateDisplayLayoutFromCache;
312
313
  private _setParticipantsStatus;
313
314
  private _onJoinLinkChanged;
315
+ private _isMe;
314
316
  }
315
317
  export declare class UpdateDisplayLayoutError extends Error {
316
318
  readonly participantErrors: {
@@ -2,7 +2,9 @@ import { ParticipantStreamDescription } from '../types/ParticipantStreamDescript
2
2
  import SignalingMessage from '../types/SignalingMessage';
3
3
  export declare class ParticipantIdRegistry {
4
4
  private streamDescriptionByCompactId;
5
+ private compactIdByStreamDescription;
5
6
  getStreamDescription(compactedId: number): ParticipantStreamDescription | undefined;
7
+ getCompactId(streamDescription: string): number | undefined;
6
8
  handleMessage(data: ArrayBuffer): SignalingMessage | null;
7
9
  private _createParticipantSourcesUpdateNotification;
8
10
  }
@@ -0,0 +1,17 @@
1
+ import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
2
+ import SignalingMessage from '../types/SignalingMessage';
3
+ import { ParticipantIdRegistry } from './ParticipantIdRegistry';
4
+ import { PerfStatReport } from './transport/PerfStatReporter';
5
+ export declare class ProducerCommandSerializationService {
6
+ private participantIdRegistry;
7
+ setParticipantIdRegistry(participantIdRegistry: ParticipantIdRegistry): void;
8
+ serializeUpdateDisplayLayout(sequenceNumber: number, layouts: {
9
+ [key: string]: ParticipantLayout | StopStream | RequestKeyFrame;
10
+ }): ArrayBuffer;
11
+ private writeLayout;
12
+ private writeStreamDesc;
13
+ serializePerfStatReport(sequenceNumber: number, report: PerfStatReport): ArrayBuffer;
14
+ deserializeCommandResponse(data: BufferSource | Blob): Promise<SignalingMessage | undefined>;
15
+ private deserializeUpdateDisplayLayoutResponse;
16
+ private deserializeReportPerfStatResponse;
17
+ }
@@ -3,6 +3,7 @@ export default class ScreenCaptureSender {
3
3
  private readonly _datachannel;
4
4
  private _destroyed;
5
5
  private _needKeyframe;
6
+ private readonly DATA_SIZE;
6
7
  constructor(track: MediaStreamTrack, datachannel: RTCDataChannel);
7
8
  private _requestFrame;
8
9
  private _wrapHeader;
@@ -1,3 +1,4 @@
1
+ export declare const HEADER_SIZE = 11;
1
2
  export interface FrameChunkHeader {
2
3
  timestamp: number;
3
4
  start: boolean;
package/default/Api.d.ts CHANGED
@@ -18,6 +18,7 @@ export default class Api extends BaseApi {
18
18
  joinConversation(conversationId: string, isVideo?: boolean, chatId?: string): Promise<ConversationResponse>;
19
19
  createConversation(conversationId: string, payload?: string, requireAuthToJoin?: boolean): Promise<ConversationResponse>;
20
20
  startConversation(conversationId: string, ids?: OkUserId[], type?: CallType, isVideo?: boolean, payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean): Promise<ConversationResponse>;
21
+ private _preareStartConversationData;
21
22
  private _startConversation;
22
23
  createJoinLink(conversationId: string): Promise<{
23
24
  join_link: string;
@@ -0,0 +1 @@
1
+ export {};
@@ -11,9 +11,10 @@ import UserRole from '../enums/UserRole';
11
11
  import { JSONObject } from '../static/Json';
12
12
  import MediaModifiers from '../types/MediaModifiers';
13
13
  import MediaSettings from '../types/MediaSettings';
14
- import { IAddMovieParams, ISharedMovieState } from '../types/MovieShare';
14
+ import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
15
15
  import MuteStates from '../types/MuteStates';
16
16
  import { CompositeUserId, ParticipantId } from '../types/Participant';
17
+ import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
17
18
  import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
18
19
  import SignalingMessage from '../types/SignalingMessage';
19
20
  import { WaitingParticipantId } from '../types/WaitingHall';
@@ -40,6 +41,8 @@ export default class Signaling extends BaseSignaling {
40
41
  private participantIdRegistry;
41
42
  private producerNotificationDataChannel;
42
43
  private producerCommandDataChannel;
44
+ private producerCommandDataChannelEnabled;
45
+ private producerCommandSerializationService;
43
46
  private static readonly RECONNECT_DELAY;
44
47
  private static readonly RECONNECT_MAX_DELAY;
45
48
  private static readonly RECONNECT_MAX_COUNT;
@@ -53,6 +56,7 @@ export default class Signaling extends BaseSignaling {
53
56
  setParticipantIdRegistry(participantIdRegistry: ParticipantIdRegistry): void;
54
57
  setProducerNotificationDataChannel(dataChannel: RTCDataChannel): void;
55
58
  setProducerCommandDataChannel(dataChannel: RTCDataChannel): void;
59
+ useCommandDataChannel(status: boolean): void;
56
60
  /**
57
61
  * Free used resources
58
62
  */
@@ -90,11 +94,11 @@ export default class Signaling extends BaseSignaling {
90
94
  changePriorities(priorities: {
91
95
  [key: string]: number;
92
96
  }): Promise<SignalingMessage | void>;
93
- updateDisplayLayout(layout: {
94
- [key: string]: string;
97
+ updateDisplayLayout(layouts: {
98
+ [streamDesc: string]: ParticipantLayout | StopStream | RequestKeyFrame;
95
99
  }): Promise<SignalingMessage>;
96
100
  addMovie(data: IAddMovieParams): Promise<SignalingMessage>;
97
- updateMovie(data: ISharedMovieState): Promise<SignalingMessage>;
101
+ updateMovie(data: IUpdateMovieData): Promise<SignalingMessage>;
98
102
  removeMovie(data: any): Promise<SignalingMessage>;
99
103
  startStream(data: any): Promise<SignalingMessage>;
100
104
  stopStream(): Promise<SignalingMessage>;
@@ -141,6 +145,9 @@ export default class Signaling extends BaseSignaling {
141
145
  protected _reconnect(): void;
142
146
  private _handleCommandResponse;
143
147
  private _handleCommandsQueue;
148
+ private _serializeBinary;
149
+ private _serializeJson;
150
+ private _convertDisplayLayout;
144
151
  protected _waitConnectionMessage(): void;
145
152
  protected _stopWaitConnectionMessage(): void;
146
153
  private _startDoctor;
@@ -4,7 +4,8 @@
4
4
  declare enum ConversationOption {
5
5
  REQUIRE_AUTH_TO_JOIN = "REQUIRE_AUTH_TO_JOIN",
6
6
  AUDIENCE_MODE = "AUDIENCE_MODE",
7
- WAITING_HALL = "WAITING_HALL"
7
+ WAITING_HALL = "WAITING_HALL",
8
+ ASR = "ASR"
8
9
  }
9
10
  export default ConversationOption;
10
11
  export declare function compareOptions(oldOptions: ConversationOption[], newOptions: ConversationOption[]): boolean;
@@ -16,6 +16,7 @@ declare enum HangupType {
16
16
  CALLER_IS_BLOCKED = "CALLER_IS_BLOCKED",
17
17
  NOT_FRIENDS = "NOT_FRIENDS",
18
18
  CALLEE_IS_OFFLINE = "CALLEE_IS_OFFLINE",
19
+ CALLER_IS_REJECTED = "CALLER_IS_REJECTED",
19
20
  UNKNOWN_ERROR = "UNKNOWN_ERROR",
20
21
  UNSUPPORTED = "UNSUPPORTED",
21
22
  OLD_VERSION = "OLD_VERSION",
@@ -23,6 +24,7 @@ declare enum HangupType {
23
24
  EXTERNAL_API_ERROR = "EXTERNAL_API_ERROR",
24
25
  SOCKET_CLOSED = "SOCKET_CLOSED",
25
26
  ENDED = "ENDED",
26
- KILLED_WITHOUT_DELETE = "KILLED_WITHOUT_DELETE"
27
+ KILLED_WITHOUT_DELETE = "KILLED_WITHOUT_DELETE",
28
+ ANOTHER_DEVICE = "ANOTHER_DEVICE"
27
29
  }
28
30
  export default HangupType;
@@ -4,6 +4,7 @@
4
4
  declare enum MediaOption {
5
5
  AUDIO = "AUDIO",
6
6
  VIDEO = "VIDEO",
7
- SCREEN_SHARING = "SCREEN_SHARING"
7
+ SCREEN_SHARING = "SCREEN_SHARING",
8
+ MOVIE_SHARING = "MOVIE_SHARING"
8
9
  }
9
10
  export default MediaOption;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.6.2-dev.5b6408b.0",
3
+ "version": "2.6.2-dev.5c10106.0",
4
4
  "author": "vk.com",
5
5
  "description": "Library for video calls based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
@@ -1,7 +1,7 @@
1
1
  export declare function init(): void;
2
2
  export declare function sendBeakon(method: string, params?: {
3
3
  [key: string]: any;
4
- }, noSession?: boolean): void;
4
+ }, noSession?: boolean): Promise<void>;
5
5
  export declare function request(method: string, params?: {
6
6
  [key: string]: any;
7
7
  }, noSession?: boolean): Promise<unknown>;
@@ -10,7 +10,7 @@ import UserRole from '../enums/UserRole';
10
10
  import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalParticipantListMarkers } from '../types/ExternalId';
11
11
  import MediaModifiers from '../types/MediaModifiers';
12
12
  import MediaSettings from '../types/MediaSettings';
13
- import { ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from '../types/MovieShare';
13
+ import { IOnRemoteMovieData, ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from '../types/MovieShare';
14
14
  import MuteStates from '../types/MuteStates';
15
15
  import { ParticipantStateMapped } from '../types/Participant';
16
16
  import { DebugMessageType } from './Debug';
@@ -73,19 +73,17 @@ declare namespace External {
73
73
  * Если сервер закончил стримить собеседника, вместо стрима будет передан null
74
74
  *
75
75
  * @param userId
76
- * @param streamName
77
- * @param stream
76
+ * @param data
78
77
  */
79
- function onRemoteLive(userId: ExternalParticipantId, streamName: string, stream: MediaStream | null): void;
78
+ function onRemoteLive(userId: ExternalParticipantId, data: IOnRemoteMovieData): void;
80
79
  /**
81
80
  * Получен собственный стрим лайв.
82
81
  * Если сервер закончил стримить собеседника, вместо стрима будет передан null
83
82
  *
84
83
  * @param userId
85
- * @param streamName
86
- * @param stream
84
+ * @param data
87
85
  */
88
- function onLocalLive(userId: ExternalParticipantId, streamName: string, stream: MediaStream | null): void;
86
+ function onLocalLive(userId: ExternalParticipantId, data: IOnRemoteMovieData): void;
89
87
  /**
90
88
  * Получено обновление стрима или лайва от собеседника.
91
89
  *
@@ -246,8 +244,10 @@ declare namespace External {
246
244
  * @param unmute Разрешение включить устройство
247
245
  * @param userId Пользователь, для которого изменились разрешения или `null` для текущего пользователя
248
246
  * @param adminId Пользователь, который изменил разрешения
247
+ * @param stateUpdated Если `true`, значит глобальное/персональное состояние изменилось и поля `muteStates`/`unmuteOptions` содержат обновления, если `false`, значит, эти поля не имеют значения
248
+ * @param requestedMedia Какие устройства попросили влючить участника
249
249
  */
250
- function onMuteStates(muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll?: boolean, unmute?: boolean, userId?: ExternalParticipantId | null, adminId?: ExternalParticipantId | null): void;
250
+ function onMuteStates(muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll?: boolean, unmute?: boolean, userId?: ExternalParticipantId | null, adminId?: ExternalParticipantId | null, stateUpdated?: boolean, requestedMedia?: MediaOption[]): void;
251
251
  /**
252
252
  * Изменились роли собеседника в звонке
253
253
  *
@@ -11,7 +11,7 @@ import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalPartici
11
11
  import IceServer from '../types/IceServer';
12
12
  import MediaModifiers from '../types/MediaModifiers';
13
13
  import MediaSettings from '../types/MediaSettings';
14
- import { ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from '../types/MovieShare';
14
+ import { IOnRemoteMovieData, ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from '../types/MovieShare';
15
15
  import MuteStates from '../types/MuteStates';
16
16
  import { ParticipantStateMapped } from '../types/Participant';
17
17
  import AuthData from './AuthData';
@@ -25,6 +25,7 @@ import { FacingMode } from './WebRTCUtils';
25
25
  export declare type ParamsObject = {
26
26
  platform: string;
27
27
  clientType: string;
28
+ externalUserType: string;
28
29
  device: string;
29
30
  /**
30
31
  * API ключ приложения
@@ -44,6 +45,11 @@ export declare type ParamsObject = {
44
45
  * Домен, чтобы попасть в тестовую группу. Для тестирования экспериментальных улучшений существуют отдельные сервера, чтобы собирать фидбек и уже потом раскатывать на всех юзеров. Если передать сюда специальный ключ, то конверсейшн будет обрабатываться на таком сервере.
45
46
  */
46
47
  domain: string;
48
+ /**
49
+ * Домен, куда будет ходить Ok api за данными
50
+ * @hidden
51
+ */
52
+ externalDomain: string;
47
53
  iceServers: IceServer[];
48
54
  wssBase: string;
49
55
  wssToken: string;
@@ -187,6 +193,7 @@ export declare type ParamsObject = {
187
193
  * Работает только при приёме экрана через дата-канал.
188
194
  *
189
195
  * _По умолчанию: `true`_
196
+ * @deprecated
190
197
  */
191
198
  producerScreenTrack: boolean;
192
199
  /**
@@ -194,12 +201,19 @@ export declare type ParamsObject = {
194
201
  * Работает только при отправке экрана через дата-канал.
195
202
  *
196
203
  * _По умолчанию: `true`_
204
+ * @deprecated
197
205
  */
198
206
  consumerScreenTrack: boolean;
199
207
  producerNotificationDataChannel: boolean;
200
208
  producerCommandDataChannel: boolean;
201
209
  consumerScreenDataChannel: boolean;
202
210
  producerScreenDataChannel: boolean;
211
+ /**
212
+ * Размер пакета для отправки трансляции экрана в датаканал в байтах.
213
+ * Максимальный размер пакета 65536 bytes в хроме, но по стандарту лучше максимум 16 Кб.
214
+ * @hidden
215
+ */
216
+ consumerScreenDataChannelPacketSize: number;
203
217
  screenShareWebmBuilder: boolean;
204
218
  noiseSuppression: boolean;
205
219
  /**
@@ -240,6 +254,11 @@ export declare type ParamsObject = {
240
254
  * Включать RED-extension (redundancy) для p2p звонков
241
255
  */
242
256
  p2pAudioRed: boolean;
257
+ /**
258
+ * Добавлять флаг spsPpsIdrInKeyframe для h264 кодека. В результате ключевые фреймы без sps и pps
259
+ * не используются как ключевые. Решает проблему с артефактами на видео в случае потерь пакетов.
260
+ */
261
+ h264spsPpsIdrInKeyframe: boolean;
243
262
  /**
244
263
  * Получать список участников звонка третьим аргументом в `onConversation`
245
264
  * @hidden
@@ -293,12 +312,12 @@ export declare type ParamsObject = {
293
312
  * Получен стрим трансляция или мувик от собеседника.
294
313
  * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
295
314
  */
296
- onRemoteLive?: (userId: ExternalParticipantId, streamId: string, stream: MediaStream | null) => void;
315
+ onRemoteLive?: (userId: ExternalParticipantId, data: IOnRemoteMovieData) => void;
297
316
  /**
298
317
  * Получен собственный стрим трансляция или мувик.
299
318
  * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
300
319
  */
301
- onLocalLive?: (userId: ExternalParticipantId, streamId: string, stream: MediaStream | null) => void;
320
+ onLocalLive?: (userId: ExternalParticipantId, data: IOnRemoteMovieData) => void;
302
321
  /**
303
322
  * Получено обновление стрима или лайва от собеседника.
304
323
  */
@@ -383,7 +402,7 @@ export declare type ParamsObject = {
383
402
  /**
384
403
  * Изменились состояния устройств пользователя или разрешения включать камеру/микрофон
385
404
  */
386
- onMuteStates?: (muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll: boolean, unmute: boolean, userId: ExternalParticipantId | null, adminId: ExternalParticipantId | null) => void;
405
+ onMuteStates?: (muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll: boolean, unmute: boolean, userId: ExternalParticipantId | null, adminId: ExternalParticipantId | null, stateUpdated?: boolean, requestedMedia?: MediaOption[]) => void;
387
406
  /**
388
407
  * Изменились роли собеседника в звонке
389
408
  */
@@ -520,6 +539,8 @@ export default abstract class Params {
520
539
  static set platform(value: string);
521
540
  static get clientType(): string;
522
541
  static set clientType(value: string);
542
+ static get externalUserType(): string;
543
+ static set externalUserType(value: string);
523
544
  static get device(): string;
524
545
  static get apiKey(): string;
525
546
  static get apiEnv(): string;
@@ -529,6 +550,7 @@ export default abstract class Params {
529
550
  static get anonymToken(): string;
530
551
  static set anonymToken(value: string);
531
552
  static get domain(): string;
553
+ static get externalDomain(): string;
532
554
  static get iceServers(): IceServer[];
533
555
  static set iceServers(value: IceServer[]);
534
556
  static get wssBase(): string;
@@ -578,6 +600,7 @@ export default abstract class Params {
578
600
  static get producerCommandDataChannel(): boolean;
579
601
  static get consumerScreenDataChannel(): boolean;
580
602
  static get producerScreenDataChannel(): boolean;
603
+ static get consumerScreenDataChannelPacketSize(): number;
581
604
  static get screenShareWebmBuilder(): boolean;
582
605
  static get noiseSuppression(): boolean;
583
606
  static set noiseSuppression(value: boolean);
@@ -596,6 +619,7 @@ export default abstract class Params {
596
619
  static get participantListChunkInitCount(): number;
597
620
  static get serverAudioRed(): boolean;
598
621
  static get p2pAudioRed(): boolean;
622
+ static get h264spsPpsIdrInKeyframe(): boolean;
599
623
  static get batchParticipantsOnStart(): boolean;
600
624
  static get filterObservers(): boolean;
601
625
  static get muteMode(): boolean;
package/static/Utils.d.ts CHANGED
@@ -6,7 +6,7 @@ import VideoSettings from '../types/VideoSettings';
6
6
  export declare const PARAMETERS_SEPARATOR = ":";
7
7
  export declare const DEVICE_IDX_PARAMETER = "d";
8
8
  declare namespace Utils {
9
- function patchSDP(sdp: string, preferH264: boolean, brokenH264: boolean, preferVP9: boolean, isAudioNack?: boolean, preferRed?: boolean): string;
9
+ function patchSDP(sdp: string, preferH264: boolean, brokenH264: boolean, preferVP9: boolean, h264spsPpsIdrInKeyframe: boolean, isAudioNack?: boolean, preferRed?: boolean): string;
10
10
  function getPeerIdString(peerId: SignalingMessage.PeerId): string;
11
11
  function comparePeerId(peerId1: SignalingMessage.PeerId, peerId2: SignalingMessage.PeerId): boolean;
12
12
  function getPeerConnectionHostInfo(pc: RTCPeerConnection): Promise<any>;
@@ -60,5 +60,9 @@ declare namespace Utils {
60
60
  * https://stash.odkl.ru/projects/ODKL/repos/odnoklassniki-webrtc/browse/src/main/java/one/webrtc/domain/conversation/ParticipantIndex.java#67-78
61
61
  */
62
62
  function participantMarkerCompare(marker1: ExternalParticipantListMarker | undefined, marker2: ExternalParticipantListMarker | undefined): number;
63
+ /** убирает все ключи со значением `V` на 1 уровне */
64
+ function objectFilterOutValues<T extends Record<string, V>, V = unknown>(obj: T, value?: V | V[]): Partial<T>;
65
+ function objectReduce<R, T extends Object>(obj: T, callback: (acc: R, value: T[keyof T], key: keyof T) => R, initialValue: R): R;
66
+ const setImmediate: (fn: VoidFunction) => VoidFunction;
63
67
  }
64
68
  export default Utils;
@@ -0,0 +1,12 @@
1
+ import MediaOption from '../enums/MediaOption';
2
+ import MediaSettings from './MediaSettings';
3
+ import { Participant } from './Participant';
4
+ export interface IProcessMuteStateParams {
5
+ mediaOptions?: MediaOption[];
6
+ muteAll?: boolean;
7
+ unmute?: boolean;
8
+ serverSettings?: MediaSettings | null;
9
+ admin?: Participant | null;
10
+ stateUpdated?: boolean;
11
+ requestedMedia?: MediaOption[];
12
+ }
@@ -10,5 +10,6 @@ declare type ConversationParams = {
10
10
  isp_as_org?: string;
11
11
  loc_cc?: string;
12
12
  loc_reg?: string;
13
+ external_user_type: string;
13
14
  };
14
15
  export default ConversationParams;
@@ -0,0 +1,5 @@
1
+ import { Layout, RequestKeyFrame, StopStream } from './ParticipantLayout';
2
+ export declare const REQUEST_KEY_FRAME_CODE = "kf";
3
+ export declare function isStopStreaming(layout: Layout | StopStream | RequestKeyFrame): layout is StopStream;
4
+ export declare function isRequestKeyFrame(layout: Layout | StopStream | RequestKeyFrame): layout is RequestKeyFrame;
5
+ export declare function layoutToString(layout: Layout | StopStream | RequestKeyFrame): string;
@@ -1,16 +1,38 @@
1
1
  import { OkUserId, CompositeUserId } from './Participant';
2
2
  import { MediaType } from './ParticipantStreamDescription';
3
+ export interface IMoviePreview {
4
+ url: string;
5
+ width: number;
6
+ height: number;
7
+ }
3
8
  export interface IAddMovieParams {
4
9
  movieId: string;
5
10
  gain?: number;
11
+ metadata?: {
12
+ title?: string;
13
+ thumbnails?: IMoviePreview[];
14
+ };
6
15
  }
7
- export declare type ISharedMovieStateResponse = [number, number, boolean, number, number];
16
+ export declare type ISharedMovieStateResponse = [
17
+ number,
18
+ number,
19
+ boolean,
20
+ number,
21
+ boolean
22
+ ];
8
23
  export interface ISharedMovieState {
9
24
  participantId: CompositeUserId;
10
25
  gain?: number;
11
26
  pause?: boolean;
12
27
  offset?: number;
13
- duration?: number;
28
+ mute?: boolean;
29
+ }
30
+ export interface IUpdateMovieData {
31
+ movieId: string;
32
+ gain?: number;
33
+ pause?: boolean;
34
+ offset?: number;
35
+ mute?: boolean;
14
36
  }
15
37
  export interface ISharedMovieInfo {
16
38
  movieId: OkUserId;
@@ -19,14 +41,15 @@ export interface ISharedMovieInfo {
19
41
  source: MediaType;
20
42
  externalMovieId: string;
21
43
  duration: number;
22
- thumbnailNormal: string;
23
- thumbnailMedium: string;
24
- thumbnailBig: string;
25
- thumbnailHigh: string;
26
- thumbnailHd: string;
44
+ thumbnails: IMoviePreview[];
27
45
  }
28
46
  export interface ISharedMovieStoppedInfo {
29
47
  movieId: OkUserId;
30
48
  initiatorId: CompositeUserId;
31
49
  source: MediaType;
32
50
  }
51
+ export interface IOnRemoteMovieData {
52
+ streamName: string;
53
+ stream: MediaStream | null;
54
+ mediaType: MediaType;
55
+ }
@@ -31,10 +31,16 @@ export declare type StopStream = {
31
31
  */
32
32
  stopStream: true;
33
33
  };
34
+ /**
35
+ * Request key frame from source. Should not be called often, negatively impacts video quality.
36
+ */
37
+ export declare type RequestKeyFrame = {
38
+ keyFrameRequested: true;
39
+ };
34
40
  /**
35
41
  * Лейаут собеседника в звонке
36
42
  */
37
- export declare type ParticipantLayout = (Layout | StopStream) & {
43
+ export declare type ParticipantLayout = (Layout | StopStream | RequestKeyFrame) & {
38
44
  /**
39
45
  * Внешний ID пользователя
40
46
  */
@@ -150,6 +150,8 @@ declare namespace SignalingMessage {
150
150
  muteStates: MuteStates;
151
151
  unmuteOptions?: MediaOption[];
152
152
  mediaOptions: MediaOption[];
153
+ requestedMedia?: MediaOption[];
154
+ stateUpdated?: boolean;
153
155
  unmute?: boolean;
154
156
  muteAll?: boolean;
155
157
  }
@@ -0,0 +1,2 @@
1
+ import { MuteState, MediaOption, MuteStates } from '../CallsSDK';
2
+ export declare const getMediaOptionsByMuteState: (muteStates: MuteStates, value: MuteState) => MediaOption[];
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Fork from messagepack internals.
3
+ * Package messagepack doesn't export createWriteBuffer and createReadBuffer methods.
4
+ */
5
+ export declare function createWriteBuffer(): {
6
+ put(v: BufferSource): void;
7
+ putI8(v: number): void;
8
+ putI16(v: number): void;
9
+ putI32(v: number): void;
10
+ putI64(v: number): void;
11
+ putUi8(v: number): void;
12
+ putUi16(v: number): void;
13
+ putUi32(v: number): void;
14
+ putUi64(v: number): void;
15
+ putF(v: number): void;
16
+ ui8array(): Uint8Array;
17
+ };
18
+ export declare function createReadBuffer(buf: BufferSource): {
19
+ peek(): number;
20
+ get(len: number): ArrayBuffer;
21
+ getI8(): number;
22
+ getI16(): number;
23
+ getI32(): number;
24
+ getI64(): number;
25
+ getUi8(): number;
26
+ getUi16(): number;
27
+ getUi32(): number;
28
+ getUi64(): number;
29
+ getF32(): number;
30
+ getF64(): number;
31
+ };