@vkontakte/calls-sdk 2.6.2-dev.3549b06.0 → 2.6.2-dev.39ad30b.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.
@@ -151,9 +151,12 @@ export default class Conversation extends EventEmitter {
151
151
  private _processConnection;
152
152
  private _prepareParticipants;
153
153
  private _onConversationParticipantListChunk;
154
+ private _createParticipantListChunk;
154
155
  private _participantListChunkToExternalChunk;
155
156
  private _registerConnectionParticipants;
156
157
  private _registerParticipants;
158
+ /** Установим состояние локальных мьютов */
159
+ private _registerParticipantLocalMuteState;
157
160
  private _getClientType;
158
161
  private _getStatusByTransportState;
159
162
  private _registerParticipantInCache;
@@ -11,7 +11,7 @@ export declare class ProducerCommandSerializationService {
11
11
  private writeLayout;
12
12
  private writeStreamDesc;
13
13
  serializePerfStatReport(sequenceNumber: number, report: PerfStatReport): ArrayBuffer;
14
- deserializeCommandResponse(data: BufferSource): SignalingMessage | undefined;
14
+ deserializeCommandResponse(data: BufferSource | Blob): Promise<SignalingMessage | undefined>;
15
15
  private deserializeUpdateDisplayLayoutResponse;
16
16
  private deserializeReportPerfStatResponse;
17
17
  }
@@ -4,7 +4,6 @@ export default class ScreenCaptureSender {
4
4
  private _destroyed;
5
5
  private _needKeyframe;
6
6
  private readonly DATA_SIZE;
7
- private readonly _timer;
8
7
  constructor(track: MediaStreamTrack, datachannel: RTCDataChannel);
9
8
  private _requestFrame;
10
9
  private _wrapHeader;
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 {};
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.6.2-dev.3549b06.0",
3
+ "version": "2.6.2-dev.39ad30b.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",
@@ -187,8 +187,10 @@ declare namespace External {
187
187
  * @param unmute Разрешение включить устройство
188
188
  * @param userId Пользователь, для которого изменились разрешения или `null` для текущего пользователя
189
189
  * @param adminId Пользователь, который изменил разрешения
190
+ * @param stateUpdated Если `true`, значит глобальное/персональное состояние изменилось и поля `muteStates`/`unmuteOptions` содержат обновления, если `false`, значит, эти поля не имеют значения
191
+ * @param requestedMedia Какие устройства попросили влючить участника
190
192
  */
191
- function onMuteStates(muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll?: boolean, unmute?: boolean, userId?: ExternalParticipantId | null, adminId?: ExternalParticipantId | null): void;
193
+ function onMuteStates(muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll?: boolean, unmute?: boolean, userId?: ExternalParticipantId | null, adminId?: ExternalParticipantId | null, stateUpdated?: boolean, requestedMedia?: MediaOption[]): void;
192
194
  /**
193
195
  * Изменились роли собеседника в звонке
194
196
  *
@@ -43,6 +43,11 @@ export declare type ParamsObject = {
43
43
  * Домен, чтобы попасть в тестовую группу. Для тестирования экспериментальных улучшений существуют отдельные сервера, чтобы собирать фидбек и уже потом раскатывать на всех юзеров. Если передать сюда специальный ключ, то конверсейшн будет обрабатываться на таком сервере.
44
44
  */
45
45
  domain: string;
46
+ /**
47
+ * Домен, куда будет ходить Ok api за данными
48
+ * @hidden
49
+ */
50
+ externalDomain: string;
46
51
  iceServers: IceServer[];
47
52
  wssBase: string;
48
53
  wssToken: string;
@@ -357,7 +362,7 @@ export declare type ParamsObject = {
357
362
  /**
358
363
  * Изменились состояния устройств пользователя или разрешения включать камеру/микрофон
359
364
  */
360
- onMuteStates?: (muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll: boolean, unmute: boolean, userId: ExternalParticipantId | null, adminId: ExternalParticipantId | null) => void;
365
+ onMuteStates?: (muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll: boolean, unmute: boolean, userId: ExternalParticipantId | null, adminId: ExternalParticipantId | null, stateUpdated?: boolean, requestedMedia?: MediaOption[]) => void;
361
366
  /**
362
367
  * Изменились роли собеседника в звонке
363
368
  */
@@ -503,6 +508,7 @@ export default abstract class Params {
503
508
  static get anonymToken(): string;
504
509
  static set anonymToken(value: string);
505
510
  static get domain(): string;
511
+ static get externalDomain(): string;
506
512
  static get iceServers(): IceServer[];
507
513
  static set iceServers(value: IceServer[]);
508
514
  static get wssBase(): string;
package/static/Utils.d.ts CHANGED
@@ -62,6 +62,7 @@ declare namespace Utils {
62
62
  function participantMarkerCompare(marker1: ExternalParticipantListMarker | undefined, marker2: ExternalParticipantListMarker | undefined): number;
63
63
  /** убирает все ключи со значением `V` на 1 уровне */
64
64
  function objectFilterOutValues<T extends Record<string, V>, V = unknown>(obj: T, value?: V | V[]): Partial<T>;
65
- function createBlobWorker(workerFunctionData: string, workerArgs?: unknown[]): string;
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;
66
67
  }
67
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
+ }
@@ -148,6 +148,8 @@ declare namespace SignalingMessage {
148
148
  muteStates: MuteStates;
149
149
  unmuteOptions?: MediaOption[];
150
150
  mediaOptions: MediaOption[];
151
+ requestedMedia?: MediaOption[];
152
+ stateUpdated?: boolean;
151
153
  unmute?: boolean;
152
154
  muteAll?: boolean;
153
155
  }
@@ -0,0 +1,2 @@
1
+ import { MuteState, MediaOption, MuteStates } from '../CallsSDK';
2
+ export declare const getMediaOptionsByMuteState: (muteStates: MuteStates, value: MuteState) => MediaOption[];
package/types/Timer.d.ts DELETED
@@ -1,18 +0,0 @@
1
- export declare type IID = string | number;
2
- export declare type ISetTimeout = ReturnType<typeof setTimeout>;
3
- export interface IMessageTimeout {
4
- type: 'timeout';
5
- id: IID;
6
- ms?: number;
7
- }
8
- export interface IMessageThrottle extends Omit<IMessageTimeout, 'type'> {
9
- type: 'throttle';
10
- }
11
- export interface IMessageReady {
12
- type: 'ready';
13
- }
14
- export interface IMessageError {
15
- type: 'error';
16
- data: unknown;
17
- }
18
- export declare type IEventData = IMessageTimeout | IMessageError | IMessageThrottle | IMessageReady;
package/utils/Timer.d.ts DELETED
@@ -1,26 +0,0 @@
1
- import { IID, IMessageError, IMessageReady, IMessageThrottle, IMessageTimeout } from '../types/Timer';
2
- declare type ICallback = (...args: unknown[]) => void;
3
- interface ITimerWorkerParams {
4
- onError?: (data: IMessageError | ErrorEvent) => void;
5
- onTimeout?: (data: IMessageTimeout) => void;
6
- onThrottle?: (data: IMessageThrottle) => void;
7
- onReady?: (data: IMessageReady) => void;
8
- }
9
- export declare class Timer {
10
- _worker: Worker;
11
- _timeouts: Map<IID, ICallback>;
12
- _throttles: Map<IID, ICallback>;
13
- constructor();
14
- initWorker({ onError, onTimeout, onThrottle, onReady }?: ITimerWorkerParams): Promise<void>;
15
- /** отложить коллбек */
16
- postTimeout(id: IID, callback: ICallback, ms?: number): void;
17
- /** throttle коллбек */
18
- postThrottle(id: IID, callback: ICallback, ms?: number): void;
19
- /** вызывает отложенный коллбек */
20
- private _callTimeout;
21
- /** вызывает отложенный throttle коллбек */
22
- private _callThrottle;
23
- /** удаляет воркер */
24
- destroy(): void;
25
- }
26
- export {};
@@ -1,3 +0,0 @@
1
- /// <reference lib="webworker" />
2
- declare const _default: () => void;
3
- export default _default;