@vkontakte/calls-sdk 2.8.6-dev.3c52c9a0.0 → 2.8.6-dev.43f40236.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.
@@ -272,7 +272,7 @@ export default class Conversation extends EventEmitter {
272
272
  setLocalResolution({ video, effect }: {
273
273
  video: IVideoDimentions;
274
274
  effect?: IVideoDimentions;
275
- }): Promise<void>;
275
+ }): Promise<void | undefined>;
276
276
  videoEffect(effect: IEffect | null): Promise<void | undefined>;
277
277
  audioEffect(effects: string[] | null, isPreset?: boolean): Promise<void | undefined>;
278
278
  _convertExternalIdsToServerExternalIds(externalIds: ExternalId[]): SignalingMessage.ExternalId[];
@@ -22,13 +22,6 @@ interface AudioEffectParams {
22
22
  effects: string[];
23
23
  isPreset?: boolean;
24
24
  }
25
- /**
26
- * тип источника (для сервера)
27
- */
28
- export declare enum MediaSourceType {
29
- CAMERA = 1,
30
- SCREEN = 2
31
- }
32
25
  export declare class MediaSource extends EventEmitter {
33
26
  /** Стрим с камеры и микрофона пользователя */
34
27
  protected _stream: MediaStream | null;
@@ -97,7 +90,6 @@ export declare class MediaSource extends EventEmitter {
97
90
  video: IVideoDimentions;
98
91
  effect?: IVideoDimentions;
99
92
  }): Promise<void>;
100
- getCameraVideoTrack(): MediaStreamTrack | null;
101
93
  updateNoiseSuppression(): Promise<void>;
102
94
  videoEffect(effect: IEffect | null): Promise<void>;
103
95
  audioEffect(audioEffectParams: AudioEffectParams | null): Promise<void>;
@@ -5,7 +5,6 @@ import { EnableVideoSuspend } from '../types/EnableVideoSuspend';
5
5
  import { EnableVideoSuspendSuggest } from '../types/EnableVideoSuspendSuggest';
6
6
  import SignalingMessage from '../types/SignalingMessage';
7
7
  import { PerfStatReport } from '../types/PerfStatReporter';
8
- import { ChangeSimulcast } from '../types/ChangeSimulcast';
9
8
  import { SharingStatReport } from './screenshare/SharingStatReport';
10
9
  import { ParticipantIdRegistry } from './ParticipantIdRegistry';
11
10
  export declare class ProducerCommandSerializationService {
@@ -22,7 +21,6 @@ export declare class ProducerCommandSerializationService {
22
21
  serializeNetworkStatReport(sequenceNumber: number, report: NetworkStatReport): ArrayBuffer;
23
22
  serializeEnableVideoSuspend(sequenceNumber: number, params: EnableVideoSuspend): ArrayBuffer;
24
23
  serializeEnableVideoSuspendSuggest(sequenceNumber: number, params: EnableVideoSuspendSuggest): ArrayBuffer;
25
- serializeChangeSimulcast(sequenceNumber: number, params: ChangeSimulcast): ArrayBuffer;
26
24
  deserializeCommandResponse(data: BufferSource | Blob): Promise<SignalingMessage | undefined>;
27
25
  private deserializeUpdateDisplayLayoutResponse;
28
26
  private deserializeReportPerfStatResponse;
@@ -35,7 +35,6 @@ export default class ServerTransport extends BaseTransport {
35
35
  private _rtpReceiversByStreamId;
36
36
  private _producerSessionId;
37
37
  private _newAudioShareTrack;
38
- private _simulcastInfo;
39
38
  constructor(signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings);
40
39
  updateStatisticsInterval(): void;
41
40
  open(observer?: boolean): void;
@@ -45,7 +44,6 @@ export default class ServerTransport extends BaseTransport {
45
44
  allowRestart(): void;
46
45
  updateSettings(settings: ServerSettings): void;
47
46
  setAnimojiTransport(receiver: AnimojiReceiver, sender: AnimojiSender): void;
48
- onCameraResolutionChanged(): Promise<void>;
49
47
  private _createPerfStatsReporter;
50
48
  private _closeConnection;
51
49
  private static _closeDataChannel;
@@ -74,8 +72,6 @@ export default class ServerTransport extends BaseTransport {
74
72
  private _detectStaleTracks;
75
73
  private _allocateConsumer;
76
74
  private _processOffer;
77
- private _findFirstSimTransceiver;
78
- private _setupSimulcastTransceiver;
79
75
  private _acceptProducer;
80
76
  private _handleTracks;
81
77
  private _onSignalingNotification;
@@ -86,5 +82,4 @@ export default class ServerTransport extends BaseTransport {
86
82
  private _onConnectionStateChange;
87
83
  private _onReplacedTrack;
88
84
  getStreamWaitingTimeMs(streamId: string, targetRtpTimestamp: number): number;
89
- private _changeSimulcastInfo;
90
85
  }
@@ -66,7 +66,6 @@ export declare class Transport extends EventEmitter {
66
66
  getStates(): Record<string, TransportState>;
67
67
  setAnimojiSvg(participantId: ParticipantId, svgData: AnimojiSvgData): void;
68
68
  setAnimojiFill(fill: RGBTuple | string): void;
69
- onCameraResolutionChanged(): Promise<void>;
70
69
  private _setStates;
71
70
  private _setLocalState;
72
71
  private _onSignalingNotification;
@@ -1,11 +1,12 @@
1
- import { IApiEnv } from '../types/Params';
1
+ import { IAPIBaseUrl, IApiEnv } from '../types/Params';
2
2
  export declare class ApiExternal {
3
3
  private readonly _uuid;
4
4
  private readonly _apiKey;
5
5
  private readonly _callToken;
6
6
  private readonly _apiEnv;
7
+ private readonly _baseApiUrl;
7
8
  private _sessionKey;
8
- constructor(apiEvn: IApiEnv, apiKey: string, callToken: string);
9
+ constructor(apiEvn: IApiEnv, apiKey: string, callToken: string, baseApiUrl?: IAPIBaseUrl);
9
10
  authorize(): Promise<boolean>;
10
11
  hangupConversation(conversationId: string): Promise<void>;
11
12
  }
@@ -20,7 +20,6 @@ import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/Partici
20
20
  import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
21
21
  import { StreamDescriptionString } from '../types/ParticipantStreamDescription';
22
22
  import { PerfStatReport } from '../types/PerfStatReporter';
23
- import { ChangeSimulcast } from '../types/ChangeSimulcast';
24
23
  import SignalingMessage, { GetParticipantsSignalingResponse, GetRoomsSignalingResponse, SignalingSuccessResponse } from '../types/SignalingMessage';
25
24
  import { IPublishStreamData, IRecordConfData, IStartStreamData, IStopStreamData } from '../types/Streams';
26
25
  export default class Signaling extends BaseSignaling {
@@ -133,7 +132,6 @@ export default class Signaling extends BaseSignaling {
133
132
  updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<SignalingMessage>;
134
133
  enableVideoSuspend(enabled: boolean): Promise<SignalingMessage>;
135
134
  enableVideoSuspendSuggest(enabled: boolean): Promise<SignalingMessage>;
136
- changeSimulcast(changeSimulcast: ChangeSimulcast): Promise<SignalingMessage>;
137
135
  changeOptions(changes: {
138
136
  [key in ConversationOption]?: boolean;
139
137
  }): Promise<SignalingMessage>;
@@ -55,7 +55,6 @@ declare enum SignalingCommandType {
55
55
  GET_HAND_QUEUE = "get-hand-queue",
56
56
  ENABLE_VIDEO_SUSPEND = "enable-video-suspend",
57
57
  ENABLE_VIDEO_SUSPEND_SUGGEST = "enable-video-suspend-suggest",
58
- PUT_HANDS_DOWN = "put-hands-down",
59
- CHANGE_SIMULCAST = "change-simulcast"
58
+ PUT_HANDS_DOWN = "put-hands-down"
60
59
  }
61
60
  export default SignalingCommandType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.8.6-dev.3c52c9a0.0",
3
+ "version": "2.8.6-dev.43f40236.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,5 +1,6 @@
1
- import { IApiEnv } from '../types/Params';
2
- export declare function _resolveApiEndpoint(apiEnv?: IApiEnv): Promise<string>;
1
+ import { IAPIBaseUrl, IApiEnv } from '../types/Params';
2
+ export declare function _resetEndpoint(): void;
3
+ export declare function _resolveApiEndpoint(apiBaseUrl?: IAPIBaseUrl, apiEnv?: IApiEnv): Promise<string>;
3
4
  export declare function sendBeakon(method: string, params?: {
4
5
  [key: string]: any;
5
6
  }, noSession?: boolean): Promise<void>;
@@ -22,7 +22,7 @@ import MuteStates from '../types/MuteStates';
22
22
  import { ParticipantsStateList, ParticipantStateMapped } from '../types/Participant';
23
23
  import { MediaType } from '../types/ParticipantStreamDescription';
24
24
  import { IRoomId, Room, RoomParticipantUpdate, Rooms, RoomsUpdate } from '../types/Room';
25
- import { IApiEnv } from '../types/Params';
25
+ import { IAPIBaseUrl, IApiEnv } from '../types/Params';
26
26
  import { VmojiError } from '../types/Vmoji';
27
27
  import { DebugMessageType } from './Debug';
28
28
  import { ParticipantStatus } from './External';
@@ -48,6 +48,12 @@ export type ParamsObject = {
48
48
  apiKey: string;
49
49
  /** @hidden */
50
50
  apiEnv: IApiEnv;
51
+ /**
52
+ * Базовый урл для запросов к API одноклассников
53
+ * Позволяет задать значение независимо от apiEnv
54
+ * @hidden
55
+ */
56
+ apiBaseUrl: IAPIBaseUrl;
51
57
  /** @hidden */
52
58
  apiAuth?: {
53
59
  sessionKey?: string;
@@ -837,12 +843,6 @@ export type ParamsObject = {
837
843
  switchVideoAtBadNetwork: boolean;
838
844
  /** включает деградацию фпс для видео с камеры при низком фпс с включенными вирт фонами */
839
845
  enableVideoEffectsFpsDegradation: boolean;
840
- /**
841
- * Включить поддержку simulcast на отправке
842
- *
843
- * _По умолчанию: `false`_
844
- */
845
- simulcast: boolean;
846
846
  };
847
847
  export default abstract class Params {
848
848
  private static _params;
@@ -866,6 +866,8 @@ export default abstract class Params {
866
866
  static get device(): string;
867
867
  static get apiKey(): string;
868
868
  static get apiEnv(): IApiEnv;
869
+ static get apiBaseUrl(): IAPIBaseUrl;
870
+ static set apiBaseUrl(apiBaseUrl: IAPIBaseUrl);
869
871
  static apiEndpoint(apiEnv?: IApiEnv): string;
870
872
  static get authToken(): string;
871
873
  static set authToken(value: string);
@@ -968,8 +970,6 @@ export default abstract class Params {
968
970
  static getScreenFrameRate(fastScreenShare: boolean): number;
969
971
  static get switchVideoAtBadNetwork(): boolean;
970
972
  static get enableVideoEffectsFpsDegradation(): boolean;
971
- static get simulcast(): boolean;
972
- static set simulcast(value: boolean);
973
973
  static toJSON(): {
974
974
  apiKey: string;
975
975
  apiEnv: string;
package/static/Utils.d.ts CHANGED
@@ -61,7 +61,7 @@ declare namespace Utils {
61
61
  [key in T]?: K;
62
62
  }, obj2: {
63
63
  [key in T]?: K;
64
- }, deep?: boolean): boolean;
64
+ }): boolean;
65
65
  function isArraysEquals<T>(arr1: T[], arr2: T[]): boolean;
66
66
  function isEmptyObject(obj: object): boolean;
67
67
  /**
@@ -74,6 +74,5 @@ declare namespace Utils {
74
74
  function objectReduce<R, T extends Object>(obj: T, callback: (acc: R, value: T[keyof T], key: keyof T) => R, initialValue: R): R;
75
75
  const setImmediate: (fn: VoidFunction) => VoidFunction;
76
76
  function isObject(obj: unknown): obj is object;
77
- function patchSimulcastAnswerSdp(sdp: string, trans: RTCRtpTransceiver, width: number, height: number): string;
78
77
  }
79
78
  export default Utils;
@@ -127,7 +127,6 @@ declare namespace WebRTCUtils {
127
127
  function isBrokenH264Decoder(): boolean;
128
128
  /**
129
129
  * В некоторых браузерах VP9 encoder сломан
130
- * В симулкасте вп9 енкодер ведет себя некорректно
131
130
  */
132
131
  function isBrokenVP9Encoder(): boolean;
133
132
  /**
package/types/Params.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export type IApiEnv = 'AUTO' | 'PROD' | 'CALLS' | 'PROD_OK' | 'TEST' | 'VIDEOTEST' | 'CALLSTEST' | string;
2
+ export type IAPIBaseUrl = string | null;
@@ -24,15 +24,7 @@ export interface ILocalIceCandidateStat extends IRemoteIceCandidateStat {
24
24
  relayProtocol: string;
25
25
  networkType: RTCNetworkType;
26
26
  }
27
- interface StatRtpOutboundVideo {
28
- frameHeight?: number;
29
- frameWidth?: number;
30
- rid?: string;
31
- framesSent?: number;
32
- framesPerSecond?: number;
33
- targetBitrate?: number;
34
- }
35
- export interface StatRtp extends StatRtpOutboundVideo {
27
+ export type StatRtp = {
36
28
  ssrc: number;
37
29
  type: string;
38
30
  kind: string;
@@ -53,6 +45,8 @@ export interface StatRtp extends StatRtpOutboundVideo {
53
45
  packetLoss?: number;
54
46
  clockRate?: number;
55
47
  mimeType?: string;
48
+ frameHeight?: number;
49
+ frameWidth?: number;
56
50
  framesDecoded?: number;
57
51
  framesReceived?: number;
58
52
  framesDropped?: number;
@@ -69,7 +63,7 @@ export interface StatRtp extends StatRtpOutboundVideo {
69
63
  totalFreezesDurationDelta?: number;
70
64
  freezeCount: number;
71
65
  freezeCountDelta?: number;
72
- }
66
+ };
73
67
  export type StatItem = {
74
68
  timestamp: number;
75
69
  transport: StatTransport;
@@ -93,4 +87,3 @@ export type StatResult = {
93
87
  rtps: StatRtp[];
94
88
  };
95
89
  };
96
- export {};
@@ -25,10 +25,6 @@ export type VideoSettings = {
25
25
  * https://www.w3.org/TR/webrtc-svc/
26
26
  */
27
27
  scalabilityMode: string;
28
- /**
29
- * Таблица с битрейтами в зависимости от разрешения
30
- */
31
- bitrates?: Record<'generic' | string, VideoBitrateSettings[]>;
32
28
  };
33
29
  export default VideoSettings;
34
30
  export declare function compareVideoSettings(vs1: VideoSettings | null, vs2: VideoSettings | null): boolean;
@@ -42,11 +38,3 @@ export declare enum VideoScalability {
42
38
  L1T2 = "L1T2",
43
39
  L1T3 = "L1T3"
44
40
  }
45
- /**
46
- * Настройка битрейта под конкретное разрешение
47
- * @hidden
48
- */
49
- export type VideoBitrateSettings = {
50
- dimension: number;
51
- bitrate: number;
52
- };
@@ -1,13 +0,0 @@
1
- import { type SimulcastInfo as ISimulcastInfo } from '../types/SimulcastInfo';
2
- import type { VideoBitrateSettings } from '../types/VideoSettings';
3
- export declare const SIMULCAST_DEFAULT: {
4
- HEIGHT: number;
5
- WIDTH: number;
6
- BITRATE: number;
7
- };
8
- export declare const MAP_RID_TO_SCALE_RESOLUTION_DOWN_BY: Record<string, number>;
9
- export declare function getSimulcastInfo(stats?: RTCOutboundRtpStreamStats[], bitrates?: VideoBitrateSettings[]): ISimulcastInfo;
10
- export declare function isEqualSimulcastInfo(si1: ISimulcastInfo | null, si2: ISimulcastInfo | null): boolean;
11
- export declare function findBitrateAsc(maxDimension: number, bitrates: VideoBitrateSettings[]): number;
12
- export declare function calculateSimulcastInfo(width?: number, height?: number, bitrates?: VideoBitrateSettings[]): ISimulcastInfo;
13
- export declare function findScaleResolutionDownBy(rid: string): number;
@@ -1,6 +0,0 @@
1
- import { MediaSourceType } from '../classes/MediaSource';
2
- import { SimulcastInfo } from './SimulcastInfo';
3
- export type ChangeSimulcast = {
4
- mediaSource: MediaSourceType;
5
- simulcastInfo: SimulcastInfo;
6
- };
@@ -1,10 +0,0 @@
1
- export type SimulcastStreamInfo = {
2
- rid: string;
3
- width: number;
4
- height: number;
5
- fps: number;
6
- bitrate: number;
7
- };
8
- export type SimulcastInfo = {
9
- streams: SimulcastStreamInfo[];
10
- };