@vkontakte/calls-sdk 2.8.12-dev.48fc9c32.0 → 2.8.12-dev.49cc00f2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.8.12-dev.48fc9c32.0",
3
+ "version": "2.8.12-dev.49cc00f2.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",
@@ -14,7 +14,7 @@
14
14
  "**/*.d.ts"
15
15
  ],
16
16
  "dependencies": {
17
- "@vkontakte/calls-audio-effects": "1.2.8",
17
+ "@vkontakte/calls-audio-effects": "1.4.1",
18
18
  "@vkontakte/calls-video-effects": "2.2.3-beta.7",
19
19
  "@vkontakte/calls-vmoji": "1.0.10-beta.17",
20
20
  "@vkontakte/libvpx": "2.0.9",
@@ -22,6 +22,6 @@
22
22
  "fflate": "^0.8.2",
23
23
  "messagepack": "1.1.12",
24
24
  "simple-ebml-builder": "0.2.2",
25
- "webrtc-adapter": "7.7.0"
25
+ "webrtc-adapter": "9.0.5"
26
26
  }
27
27
  }
@@ -7,4 +7,7 @@ export declare function sendBeakon(method: string, params?: {
7
7
  export declare function request(method: string, params?: {
8
8
  [key: string]: any;
9
9
  }, noSession?: boolean, customEndpoint?: string): Promise<any>;
10
+ export declare function requestKeepalive(method: string, params?: {
11
+ [key: string]: any;
12
+ }, noSession?: boolean): Promise<any>;
10
13
  export declare function sendFormData(url: string, data: FormData): Promise<void>;
@@ -638,5 +638,15 @@ declare namespace External {
638
638
  * Собеседник подключился к сигналлингу
639
639
  */
640
640
  function onPeerRegistered(conversationId?: string, externalIds?: ExternalId[]): void;
641
+ /**
642
+ * SDK обнаружил ошибку, после которой звонок может продолжаться.
643
+ *
644
+ * Callback предназначен для отправки ошибки в клиентский мониторинг.
645
+ * Его вызов не означает завершение звонка.
646
+ *
647
+ * @param error
648
+ * @param conversationId ID звонка
649
+ */
650
+ function onNonFatalError(error: Error, conversationId: string | null): void;
641
651
  }
642
652
  export default External;
@@ -1,5 +1,5 @@
1
1
  import type { VideoEffects } from '@vkontakte/calls-video-effects';
2
- import type { EffectVoiceChange } from '@vkontakte/calls-audio-effects';
2
+ import type { EffectVoiceChange, VadControllerOptions, VadLib } from '@vkontakte/calls-audio-effects';
3
3
  import type * as Vmoji from '@vkontakte/calls-vmoji';
4
4
  import { IAsrData } from '../types/Asr';
5
5
  import { ConversationData } from '../types/Conversation';
@@ -193,6 +193,14 @@ export type ParamsObject = {
193
193
  * Можно установить позднее методом `setAudioEffects`
194
194
  */
195
195
  audioEffects: EffectVoiceChange | null;
196
+ /**
197
+ * Namespace библиотеки VAD из `@vkontakte/calls-audio-effects`.
198
+ *
199
+ * Можно установить методом `setVad`
200
+ */
201
+ vad: VadLib | null;
202
+ /** Настройки VAD (threshold, hangoverMs, enabled) */
203
+ vadOptions: VadControllerOptions;
196
204
  /**
197
205
  * Максимальная ширина видео в пикселях для видео эффекта
198
206
  *
@@ -505,6 +513,16 @@ export type ParamsObject = {
505
513
  * _По умолчанию: `false`_
506
514
  */
507
515
  enableSessionStateUpdates: boolean;
516
+ /**
517
+ * Использовать `<audio>` вместо `<video>` для воспроизведения звука в desktop Safari
518
+ * @hidden
519
+ */
520
+ safariAudioElement: boolean;
521
+ /**
522
+ * Отправлять пустой ICE candidate (end-of-candidates) удалённому пиру
523
+ * @hidden
524
+ */
525
+ forwardEmptyIceCandidate: boolean;
508
526
  /**
509
527
  * Получен локальный стрим с камеры/микрофона
510
528
  */
@@ -893,6 +911,13 @@ export type ParamsObject = {
893
911
  * Собеседник подключился к сигналлингу
894
912
  */
895
913
  onPeerRegistered?: (conversationId?: string, externalIds?: ExternalId[]) => void;
914
+ /**
915
+ * SDK обнаружил ошибку, после которой звонок может продолжаться.
916
+ *
917
+ * Callback предназначен для отправки ошибки в клиентский мониторинг.
918
+ * Его вызов не означает завершение звонка.
919
+ */
920
+ onNonFatalError?: (error: Error, conversationId: string | null) => void;
896
921
  };
897
922
  export default abstract class Params {
898
923
  private static _params;
@@ -960,6 +985,10 @@ export default abstract class Params {
960
985
  static get displaySurface(): DisplayCaptureSurfaceType;
961
986
  static get audioEffects(): EffectVoiceChange | null;
962
987
  static set audioEffects(value: EffectVoiceChange | null);
988
+ static get vad(): VadLib | null;
989
+ static set vad(value: VadLib | null);
990
+ static get vadOptions(): VadControllerOptions;
991
+ static set vadOptions(value: VadControllerOptions);
963
992
  static get videoEffects(): VideoEffects | null;
964
993
  static set videoEffects(value: VideoEffects | null);
965
994
  static get videoEffectMaxWidth(): number;
@@ -1027,6 +1056,8 @@ export default abstract class Params {
1027
1056
  static get waitForRecordResponse(): boolean;
1028
1057
  static get transparentAudio(): boolean;
1029
1058
  static get enableSessionStateUpdates(): boolean;
1059
+ static get safariAudioElement(): boolean;
1060
+ static get forwardEmptyIceCandidate(): boolean;
1030
1061
  static toJSON(): {
1031
1062
  apiKey: string;
1032
1063
  apiEnv: string;
@@ -1063,5 +1094,7 @@ export default abstract class Params {
1063
1094
  waitForRecordResponse: boolean;
1064
1095
  transparentAudio: boolean;
1065
1096
  enableSessionStateUpdates: boolean;
1097
+ safariAudioElement: boolean;
1098
+ forwardEmptyIceCandidate: boolean;
1066
1099
  };
1067
1100
  }
package/static/Utils.d.ts CHANGED
@@ -9,7 +9,7 @@ export declare const DEVICE_IDX_PARAMETER = "d";
9
9
  /** @hidden */
10
10
  declare namespace Utils {
11
11
  function patchLocalSDP(sdp: string, preferH264: boolean, brokenH264Decoder: boolean, preferVP9: boolean, isAudioNack?: boolean): string;
12
- function patchRemoteSDP(sdp: string, oldDataChannelDescription: boolean, preferH264: boolean, brokenH264: boolean, preferVP9: boolean, brokenVP9Encoder: boolean, brokenVP9Decoder: boolean): string;
12
+ function patchRemoteSDP(sdp: string, preferH264: boolean, brokenH264: boolean, preferVP9: boolean, brokenVP9Encoder: boolean, brokenVP9Decoder: boolean): string;
13
13
  function getPeerIdString(peerId: SignalingMessage.PeerId): string;
14
14
  function comparePeerId(peerId1: SignalingMessage.PeerId, peerId2: SignalingMessage.PeerId): boolean;
15
15
  function getPeerConnectionHostInfo(pc: RTCPeerConnection): Promise<{
@@ -20,7 +20,7 @@ export declare enum FacingMode {
20
20
  /**
21
21
  * Известные браузеры
22
22
  */
23
- export type BrowserName = 'IE' | 'Edge' | 'Chrome' | 'Firefox' | 'Yandex' | 'Opera' | 'Sferum';
23
+ export type BrowserName = 'Edge' | 'Chrome' | 'Firefox' | 'Yandex' | 'Opera' | 'Sferum';
24
24
  declare namespace WebRTCUtils {
25
25
  /**
26
26
  * До вызова этого метода бесполезно опрашивать другие публичные методы.
@@ -143,17 +143,14 @@ declare namespace WebRTCUtils {
143
143
  * В некоторых браузерах VP9 decoder сломан
144
144
  */
145
145
  function isBrokenVP9Decoder(): boolean;
146
- /**
147
- * Изменился формат описания датаканала в SDP
148
- * @link https://blog.mozilla.org/webrtc/how-to-avoid-data-channel-breaking/
149
- */
150
- function isOldDataChannelDescription(): boolean;
151
146
  /**
152
147
  * Может ли браузер делать H264 приоритетным
153
148
  */
154
149
  function canPreferH264(): boolean;
155
150
  /**
156
- * Некоторые браузеры (Firefox, Safari) некорректно поддерживают симулкаст
151
+ * Поддержка simulcast браузером.
152
+ * Safari корректно поддерживает simulcast начиная с версии 18.
153
+ * Firefox поддерживает simulcast с VP8 начиная с версии 134.
157
154
  */
158
155
  function isSimulcastSupportedByBrowser(): boolean;
159
156
  /**
package/types/Api.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import HangupType from '../enums/HangupType';
2
+ export interface IHangupParams {
3
+ conversationId: string;
4
+ reason: HangupType;
5
+ anonymToken?: string;
6
+ peerId?: string;
7
+ application_key?: string;
8
+ session_key?: string;
9
+ }
@@ -188,6 +188,7 @@ declare namespace SignalingMessage {
188
188
  peerId: PeerId;
189
189
  mediaSettings: Partial<MediaSettings>;
190
190
  capabilities?: string;
191
+ externalId?: ExternalId;
191
192
  }
192
193
  export interface Hungup extends Notification {
193
194
  participantId: OkUserId;
@@ -2,8 +2,8 @@ type Device = 'camera' | 'microphone';
2
2
  type PermissionStatusState = typeof PermissionStatus.prototype.state;
3
3
  type EventListener = (name: Device, state: PermissionStatusState) => void;
4
4
  export declare class NavigatorPermissions {
5
- private _cameraPermissionStatus;
6
- private _microphonePermissionStatus;
5
+ private _cameraPermissionStatus?;
6
+ private _microphonePermissionStatus?;
7
7
  private _listener;
8
8
  static isSupported(): boolean;
9
9
  init(listener: EventListener): Promise<void>;