@vkontakte/calls-sdk 2.4.3-beta.4 → 2.4.3-beta.8

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.
Files changed (40) hide show
  1. package/CallsSDK.d.ts +22 -3
  2. package/abstract/BaseApi.d.ts +1 -0
  3. package/abstract/BaseSignaling.d.ts +2 -2
  4. package/calls-sdk.cjs.js +8 -6
  5. package/calls-sdk.esm.js +8 -6
  6. package/classes/Conversation.d.ts +2 -2
  7. package/classes/MediaSource.d.ts +0 -2
  8. package/classes/VolumeDetector.d.ts +0 -2
  9. package/classes/codec/IDecoder.d.ts +0 -2
  10. package/classes/codec/IEncoder.d.ts +1 -3
  11. package/classes/codec/LibVPxDecoder.d.ts +0 -2
  12. package/classes/codec/LibVPxEncoder.d.ts +2 -1
  13. package/classes/codec/Types.d.ts +14 -0
  14. package/classes/codec/WebCodecsDecoder.d.ts +0 -2
  15. package/classes/codec/WebCodecsEncoder.d.ts +2 -1
  16. package/classes/codec/WorkerBase.d.ts +1 -14
  17. package/classes/screenshare/ScreenCaptureReceiver.d.ts +0 -2
  18. package/classes/screenshare/ScreenCaptureSender.d.ts +0 -2
  19. package/classes/screenshare/StreamBuilder.d.ts +0 -2
  20. package/classes/transport/ServerTransport.d.ts +0 -2
  21. package/classes/transport/Statistics.d.ts +0 -2
  22. package/default/Api.d.ts +1 -0
  23. package/default/Signaling.d.ts +2 -2
  24. package/enums/RecordRole.d.ts +10 -0
  25. package/enums/SignalingCommandType.d.ts +1 -0
  26. package/package.json +2 -2
  27. package/static/External.d.ts +0 -2
  28. package/static/Params.d.ts +0 -2
  29. package/static/Utils.d.ts +0 -2
  30. package/static/WebRTCUtils.d.ts +0 -2
  31. package/types/MediaDeviceType.d.ts +0 -1
  32. package/types/Participant.d.ts +0 -2
  33. package/worker/LibVPxDecoderWorker.d.ts +4 -0
  34. package/worker/LibVPxEncoderWorker.d.ts +4 -0
  35. package/worker/WebCodecsDecoderWorker.d.ts +3 -0
  36. package/worker/WebCodecsEncoderWorker.d.ts +3 -0
  37. package/classes/codec/worker/LibVPxDecoderWorker.d.ts +0 -3
  38. package/classes/codec/worker/LibVPxEncoderWorker.d.ts +0 -3
  39. package/classes/codec/worker/WebCodecsDecoderWorker.d.ts +0 -2
  40. package/classes/codec/worker/WebCodecsEncoderWorker.d.ts +0 -2
@@ -1,5 +1,3 @@
1
- /// <reference types="web" />
2
- /// <reference types="webrtc" />
3
1
  import type { IEffect } from '@vkontakte/calls-video-effects';
4
2
  import BaseApi from '../abstract/BaseApi';
5
3
  import BaseLogger from '../abstract/BaseLogger';
@@ -10,6 +8,7 @@ import ConversationFeature from '../enums/ConversationFeature';
10
8
  import ConversationOption from '../enums/ConversationOption';
11
9
  import MediaOption from '../enums/MediaOption';
12
10
  import MuteState from '../enums/MuteState';
11
+ import RecordRole from '../enums/RecordRole';
13
12
  import UpdateDisplayLayoutErrorReason from '../enums/UpdateDisplayLayoutErrorReason';
14
13
  import UserRole from '../enums/UserRole';
15
14
  import UserType from '../enums/UserType';
@@ -220,6 +219,7 @@ export default class Conversation extends EventEmitter {
220
219
  removeMovie(movieId: string): Promise<void>;
221
220
  startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null): Promise<SignalingMessage>;
222
221
  stopStream(): Promise<SignalingMessage>;
222
+ recordSetRole(participantId: CompositeUserId, role: RecordRole | null): Promise<void>;
223
223
  getStreamInfo(): Promise<{
224
224
  movieId: any;
225
225
  preview: any;
@@ -1,5 +1,3 @@
1
- /// <reference types="web" />
2
- /// <reference types="webrtc" />
3
1
  import type { IEffect } from '@vkontakte/calls-video-effects';
4
2
  import EventEmitter from '../classes/EventEmitter';
5
3
  import MediaOption from '../enums/MediaOption';
@@ -1,5 +1,3 @@
1
- /// <reference types="web" />
2
- /// <reference types="webrtc" />
3
1
  export declare type VolumeLevel = {
4
2
  real: number;
5
3
  smoothed: number;
@@ -1,5 +1,3 @@
1
- /// <reference types="web" />
2
- /// <reference types="webgl2" />
3
1
  export default interface IDecoder {
4
2
  init(onFrameImage: (image: ImageBitmap | ImageData) => void): Promise<void>;
5
3
  decodeFrame(timestamp: number, data: Uint8Array, isVP9: boolean, keyFrame?: boolean): void;
@@ -1,6 +1,4 @@
1
- import { MessageType } from './WorkerBase';
2
- export declare type EncodedVideoFrame = Pick<EncodedVideoChunk, 'type' | 'timestamp' | 'duration' | 'byteLength' | 'data'>;
3
- export declare type OnFrameCallback = (chunk: EncodedVideoFrame | null, error?: string) => void;
1
+ import type { MessageType } from './Types';
4
2
  export default interface IEncoder {
5
3
  init(): Promise<void>;
6
4
  requestFrame(keyFrame: boolean): void;
@@ -1,5 +1,3 @@
1
- /// <reference types="web" />
2
- /// <reference types="webgl2" />
3
1
  import IDecoder from './IDecoder';
4
2
  import WorkerBase from './WorkerBase';
5
3
  export default class LibVPxDecoder extends WorkerBase implements IDecoder {
@@ -1,4 +1,5 @@
1
- import IEncoder, { OnFrameCallback } from './IEncoder';
1
+ import IEncoder from './IEncoder';
2
+ import { OnFrameCallback } from './Types';
2
3
  import WorkerBase from './WorkerBase';
3
4
  export default class LibVPxEncoder extends WorkerBase implements IEncoder {
4
5
  private readonly _sourceTrack;
@@ -0,0 +1,14 @@
1
+ export declare const enum WebCodec {
2
+ VP9 = "vp09.00.50.08",
3
+ VP8 = "vp8"
4
+ }
5
+ export declare const enum MessageType {
6
+ INIT = "init",
7
+ READY = "ready",
8
+ FRAME = "frame",
9
+ ERROR = "error",
10
+ DEBUG = "debug",
11
+ LOG_ERROR = "log_error"
12
+ }
13
+ export declare type EncodedVideoFrame = Pick<EncodedVideoChunk, 'type' | 'timestamp' | 'duration' | 'byteLength' | 'data'>;
14
+ export declare type OnFrameCallback = (chunk: EncodedVideoFrame | null, error?: string) => void;
@@ -1,5 +1,3 @@
1
- /// <reference types="web" />
2
- /// <reference types="webgl2" />
3
1
  import IDecoder from './IDecoder';
4
2
  import WorkerBase from './WorkerBase';
5
3
  export default class WebCodecsDecoder extends WorkerBase implements IDecoder {
@@ -1,4 +1,5 @@
1
- import IEncoder, { OnFrameCallback } from './IEncoder';
1
+ import IEncoder from './IEncoder';
2
+ import { OnFrameCallback } from './Types';
2
3
  import WorkerBase from './WorkerBase';
3
4
  export default class WebCodecsEncoder extends WorkerBase implements IEncoder {
4
5
  private readonly _sourceTrack;
@@ -1,19 +1,6 @@
1
- /// <reference types="web" />
2
- export declare enum WebCodec {
3
- VP9 = "vp09.00.50.08",
4
- VP8 = "vp8"
5
- }
6
- export declare enum MessageType {
7
- INIT = "init",
8
- READY = "ready",
9
- FRAME = "frame",
10
- ERROR = "error",
11
- DEBUG = "debug",
12
- LOG_ERROR = "log_error"
13
- }
14
1
  export default abstract class WorkerBase {
15
2
  protected _worker: Worker | null;
16
- protected _createWorker(workerFunction: Function, onFrame: (data: any) => void, workerArgs?: any[], initArgs?: {
3
+ protected _createWorker(workerFunctionData: string, onFrame: (data: any) => void, workerArgs?: any[], initArgs?: {
17
4
  [key: string]: any;
18
5
  }, transfer?: any[]): Promise<void>;
19
6
  protected _removeWorker(): void;
@@ -1,5 +1,3 @@
1
- /// <reference types="web" />
2
- /// <reference types="webrtc" />
3
1
  import { CompositeUserId } from '../../types/Participant';
4
2
  import { ParticipantIdRegistry } from '../ParticipantIdRegistry';
5
3
  export default class ScreenCaptureReceiver {
@@ -1,5 +1,3 @@
1
- /// <reference types="web" />
2
- /// <reference types="webrtc" />
3
1
  export default class ScreenCaptureSender {
4
2
  private readonly _encoder;
5
3
  private readonly _datachannel;
@@ -1,5 +1,3 @@
1
- /// <reference types="web" />
2
- /// <reference types="webrtc" />
3
1
  import { CompositeUserId } from '../../types/Participant';
4
2
  import { FrameChunk } from './Utils';
5
3
  export default class StreamBuilder {
@@ -1,5 +1,3 @@
1
- /// <reference types="web" />
2
- /// <reference types="webrtc" />
3
1
  import BaseSignaling from '../../abstract/BaseSignaling';
4
2
  import { CompositeUserId } from '../../types/Participant';
5
3
  import ServerSettings from '../../types/ServerSettings';
@@ -1,5 +1,3 @@
1
- /// <reference types="web" />
2
- /// <reference types="webrtc" />
3
1
  import { ExternalId } from '../../types/ExternalId';
4
2
  import { TransportTopology } from './Transport';
5
3
  export declare type StatTransport = {
package/default/Api.d.ts CHANGED
@@ -43,6 +43,7 @@ export default class Api extends BaseApi {
43
43
  getUserId(): OkUserId | null;
44
44
  setUserId(userId: OkUserId): void;
45
45
  hangupConversation(conversationId: string): void;
46
+ removeHistoryRecords(recordIds: number[]): Promise<void>;
46
47
  cleanup(): void;
47
48
  private _getExternalIdsByOkIds;
48
49
  getTokenForAnonym(userId: string, appKey?: string): Promise<string>;
@@ -1,11 +1,10 @@
1
- /// <reference types="web" />
2
- /// <reference types="webrtc" />
3
1
  import BaseSignaling, { AddParticipantParams } from '../abstract/BaseSignaling';
4
2
  import { ParticipantIdRegistry } from '../classes/ParticipantIdRegistry';
5
3
  import { PerfStatReport } from '../classes/transport/PerfStatReporter';
6
4
  import { TransportTopology } from '../classes/transport/Transport';
7
5
  import ConversationOption from '../enums/ConversationOption';
8
6
  import MediaOption from '../enums/MediaOption';
7
+ import RecordRole from '../enums/RecordRole';
9
8
  import SignalingCommandType from '../enums/SignalingCommandType';
10
9
  import SignalingConnectionType from '../enums/SignalingConnectionType';
11
10
  import UserRole from '../enums/UserRole';
@@ -96,6 +95,7 @@ export default class Signaling extends BaseSignaling {
96
95
  removeMovie(data: any): Promise<SignalingMessage>;
97
96
  startStream(data: any): Promise<SignalingMessage>;
98
97
  stopStream(): Promise<SignalingMessage>;
98
+ recordSetRole(participantId: CompositeUserId, role: RecordRole | null): Promise<SignalingMessage>;
99
99
  getRecordStatus(): Promise<SignalingMessage>;
100
100
  switchTopology(topology: TransportTopology, force?: boolean): Promise<SignalingMessage>;
101
101
  requestRealloc(): Promise<SignalingMessage>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Роль участника в записи звонке.
3
+ * Если выставлена хотя бы на одном участнике, то в записи звонка видны только те участники звонка,
4
+ * у которых есть роль.
5
+ */
6
+ declare enum RecordRole {
7
+ KING = "KING",
8
+ PAWN = "PAWN"
9
+ }
10
+ export default RecordRole;
@@ -14,6 +14,7 @@ declare enum SignalingCommandType {
14
14
  REPORT_PERF_STAT = "report-perf-stat",
15
15
  RECORD_START = "record-start",
16
16
  RECORD_STOP = "record-stop",
17
+ RECORD_SET_ROLE = "record-set-role",
17
18
  RECORD_GET_STATUS = "record-get-status",
18
19
  SWITCH_MICRO = "switch-micro",
19
20
  SWITCH_TOPOLOGY = "switch-topology",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.4.3-beta.4",
3
+ "version": "2.4.3-beta.8",
4
4
  "author": "vk.com",
5
5
  "description": "Library for video calls based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
@@ -14,7 +14,7 @@
14
14
  "**/*.d.ts"
15
15
  ],
16
16
  "dependencies": {
17
- "@vkontakte/calls-video-effects": "1.0.5",
17
+ "@vkontakte/calls-video-effects": "1.0.6-beta.0",
18
18
  "@vkontakte/libvpx": "2.0.9",
19
19
  "big-integer": "1.6.48",
20
20
  "messagepack": "1.1.12",
@@ -1,5 +1,3 @@
1
- /// <reference types="web" />
2
- /// <reference types="webrtc" />
3
1
  import { ConversationData } from '../classes/Conversation';
4
2
  import HangupReason from '../classes/HangupReason';
5
3
  import { MediaTrackKind } from '../classes/MediaSource';
@@ -1,5 +1,3 @@
1
- /// <reference types="web" />
2
- /// <reference types="webrtc" />
3
1
  import type { VideoEffects } from '@vkontakte/calls-video-effects';
4
2
  import { ConversationData } from '../classes/Conversation';
5
3
  import HangupReason from '../classes/HangupReason';
package/static/Utils.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- /// <reference types="web" />
2
- /// <reference types="webrtc" />
3
1
  import { BigInteger } from 'big-integer';
4
2
  import UserType from '../enums/UserType';
5
3
  import { ExternalParticipant } from '../types/ExternalId';
@@ -1,8 +1,6 @@
1
1
  /**
2
2
  * Вспомогательный плагин для работы с WebRTC
3
3
  */
4
- /// <reference types="web" />
5
- /// <reference types="webrtc" />
6
4
  /**
7
5
  * Тип камеры мобильного устройства
8
6
  */
@@ -1,4 +1,3 @@
1
- /// <reference types="web" />
2
1
  /**
3
2
  * @hidden
4
3
  */
@@ -1,5 +1,3 @@
1
- /// <reference types="web" />
2
- /// <reference types="webrtc" />
3
1
  import ParticipantState from '../enums/ParticipantState';
4
2
  import UserRole from '../enums/UserRole';
5
3
  import { ParticipantStatus } from '../static/External';
@@ -0,0 +1,4 @@
1
+ /// <reference lib="webworker" />
2
+ import type libvpx from '@vkontakte/libvpx';
3
+ declare const _default: (vpx: typeof libvpx, urlResolver: (url: string) => string) => void;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference lib="webworker" />
2
+ import type libvpx from '@vkontakte/libvpx';
3
+ declare const _default: (vpx: typeof libvpx, urlResolver: (url: string) => string) => void;
4
+ export default _default;
@@ -0,0 +1,3 @@
1
+ /// <reference lib="webworker" />
2
+ declare const _default: () => void;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ /// <reference lib="webworker" />
2
+ declare const _default: () => void;
3
+ export default _default;
@@ -1,3 +0,0 @@
1
- import type libvpx from '@vkontakte/libvpx';
2
- import type { MessageType as MT } from '../WorkerBase';
3
- export default function libVPxDecoderWorker(MessageType: typeof MT, vpx: typeof libvpx, urlResolver: (url: string) => string): void;
@@ -1,3 +0,0 @@
1
- import type libvpx from '@vkontakte/libvpx';
2
- import type { MessageType as MT } from '../WorkerBase';
3
- export default function libVPxEncoderWorker(MessageType: typeof MT, vpx: typeof libvpx, urlResolver: (url: string) => string): void;
@@ -1,2 +0,0 @@
1
- import type { MessageType as MT, WebCodec as WC } from '../WorkerBase';
2
- export default function webCodecsDecoderWorker(MessageType: typeof MT, WebCodec: typeof WC): void;
@@ -1,2 +0,0 @@
1
- import type { MessageType as MT, WebCodec as WC } from '../WorkerBase';
2
- export default function webCodecsEncoderWorker(MessageType: typeof MT, WebCodec: typeof WC): void;