@vkontakte/calls-sdk 2.8.13-dev.63c885d4.0 → 2.8.13-dev.805c82c2.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/calls-sdk.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @vkontakte/calls-sdk v2.8.13-dev.63c885d4.0
3
- * Tue, 15 Sep 2026 18:53:46 GMT
2
+ * @vkontakte/calls-sdk v2.8.13-dev.805c82c2.0
3
+ * Mon, 21 Sep 2026 08:19:28 GMT
4
4
  * https://calls-sdk.cdn-vk.ru/doc/latest/index.html
5
5
  */
6
6
 
@@ -2154,8 +2154,11 @@ var yn = vn.getInstance(), M = class e {
2154
2154
  static get appVersion() {
2155
2155
  return e._params.appVersion;
2156
2156
  }
2157
+ static get apiClientVersion() {
2158
+ return 1.1;
2159
+ }
2157
2160
  static get sdkVersion() {
2158
- return "2.8.13-dev.63c885d4.0";
2161
+ return "2.8.13-dev.805c82c2.0";
2159
2162
  }
2160
2163
  static get debug() {
2161
2164
  return e._params.debug;
@@ -2395,6 +2398,9 @@ var yn = vn.getInstance(), M = class e {
2395
2398
  static get transportConnectionWaitTime() {
2396
2399
  return e._params.transportConnectionWaitTime;
2397
2400
  }
2401
+ static get switchTopologyOnReconnectFromAnySide() {
2402
+ return e._params.switchTopologyOnReconnectFromAnySide;
2403
+ }
2398
2404
  static get statisticsInterval() {
2399
2405
  return e._params.statisticsInterval;
2400
2406
  }
@@ -2640,6 +2646,7 @@ h(M, "_params", {
2640
2646
  vmojiOptions: null,
2641
2647
  iceRestartWaitTime: 2e4,
2642
2648
  transportConnectionWaitTime: 5e3,
2649
+ switchTopologyOnReconnectFromAnySide: !1,
2643
2650
  statisticsInterval: 5e3,
2644
2651
  networkStatisticsInterval: 2e4,
2645
2652
  perfStatReportEnabled: !0,
@@ -4260,8 +4267,8 @@ var Mr = class {
4260
4267
  this._reconnectionTimeout = null, this._neverConnected ? this._requestTopologySwitch() : this._startIceRestart();
4261
4268
  }, M.transportConnectionWaitTime));
4262
4269
  }
4263
- _requestTopologySwitch() {
4264
- this._isMaster && this._signaling.ready && (this._debug.log("Switch topology DIRECT to SERVER", { participantId: this._participantId }), this._signaling.switchTopology(J.SERVER).catch((e) => {
4270
+ _requestTopologySwitch(e = !1) {
4271
+ (this._isMaster || e) && this._signaling.ready && (this._debug.log("Switch topology DIRECT to SERVER", { participantId: this._participantId }), this._signaling.switchTopology(J.SERVER).catch((e) => {
4265
4272
  e instanceof wn || this._debug.warn("Unable to switch topology DIRECT to SERVER", e);
4266
4273
  }));
4267
4274
  }
@@ -4270,7 +4277,7 @@ var Mr = class {
4270
4277
  }
4271
4278
  _startIceRestart() {
4272
4279
  this._isMaster ? (this._logger?.log(C.ICE_RESTART), this._debug.log("Ice restart", { participantId: this._participantId }), this._createOffer(!0).catch(this.close.bind(this))) : this._debug.debug("Waiting for ice restart...", { participantId: this._participantId }), this._iceRestartTimeout = window.setTimeout(() => {
4273
- this._iceRestartTimeout = null, this._debug.error("Ice restart failed", { participantId: this._participantId }), this._logger?.log(C.ERROR, "iceRestart-direct"), this._requestTopologySwitch();
4280
+ this._iceRestartTimeout = null, this._debug.error("Ice restart failed", { participantId: this._participantId }), this._logger?.log(C.ERROR, "iceRestart-direct"), this._requestTopologySwitch(M.switchTopologyOnReconnectFromAnySide);
4274
4281
  }, M.iceRestartWaitTime);
4275
4282
  }
4276
4283
  async _createOffer(t) {
@@ -8490,9 +8497,8 @@ var bo = 90, xo = 3, So = class extends b {
8490
8497
  this._triggerEvent("VOLUMES_DETECTED", e);
8491
8498
  }
8492
8499
  _getAudioTrackLevelByParticipantId(e) {
8493
- if (this._isTransparentAudioMode()) return this._getTransparentAudioLevelByParticipantId(e);
8494
8500
  let t = this._detectors.get(qr.AUDIO_MIX);
8495
- return t ? t.getLevel() : null;
8501
+ return t ? t.getLevel() : this._getTransparentAudioLevelByParticipantId(e);
8496
8502
  }
8497
8503
  _getTransparentAudioLevelByParticipantId(e) {
8498
8504
  if (!this._activeParticipants?.includes(e)) return null;
@@ -8509,9 +8515,6 @@ var bo = 90, xo = 3, So = class extends b {
8509
8515
  _onTopologyChanged(e) {
8510
8516
  this._topology = e, this._destroyDetectors(), e === J.DIRECT && (this._activeParticipants = null, this._removedParticipants = null);
8511
8517
  }
8512
- _isTransparentAudioMode() {
8513
- return this._topology === J.SERVER && M.transparentAudio;
8514
- }
8515
8518
  _destroyDetectors() {
8516
8519
  this._detectors.forEach((e) => {
8517
8520
  e.destroy();
@@ -12467,7 +12470,7 @@ var Ps = class extends Es {
12467
12470
  let t = { session_data: {
12468
12471
  version: 2,
12469
12472
  device_id: this._uuid,
12470
- client_version: M.appVersion,
12473
+ client_version: M.apiClientVersion,
12471
12474
  client_type: "SDK_JS"
12472
12475
  } };
12473
12476
  return M.authToken && (t.session_data.auth_token = M.authToken, t.session_data.version = 3), this._callUnsafe("auth.anonymLogin", t, !0).then((e) => {
@@ -12728,7 +12731,7 @@ var Ls = /* @__PURE__ */ function(e) {
12728
12731
  let e = await bs("auth.anonymLogin", {
12729
12732
  session_data: {
12730
12733
  device_id: this._uuid,
12731
- client_version: M.appVersion,
12734
+ client_version: M.apiClientVersion,
12732
12735
  client_type: "SDK_JS",
12733
12736
  auth_token: this._callToken,
12734
12737
  version: 3
@@ -18,6 +18,5 @@ export declare class VolumesDetector extends EventEmitter {
18
18
  private _getTransparentAudioLevelByParticipantId;
19
19
  private _onSignalledActiveParticipants;
20
20
  private _onTopologyChanged;
21
- private _isTransparentAudioMode;
22
21
  private _destroyDetectors;
23
22
  }
@@ -72,6 +72,10 @@ export default class DirectTransport extends BaseTransport {
72
72
  private _markConnected;
73
73
  private _onConnectionStateChange;
74
74
  private _startReconnection;
75
+ /**
76
+ * Запрашивает у сигналинга переход на серверную топологию.
77
+ * Обычно это делает только мастер, `fromAnySide` снимает это ограничение.
78
+ */
75
79
  private _requestTopologySwitch;
76
80
  private _stopReconnection;
77
81
  private _startIceRestart;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.8.13-dev.63c885d4.0",
3
+ "version": "2.8.13-dev.805c82c2.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",
@@ -235,6 +235,13 @@ export type ParamsObject = {
235
235
  iceRestartWaitTime: number;
236
236
  /** @hidden */
237
237
  transportConnectionWaitTime: number;
238
+ /**
239
+ * Разрешить запрашивать переход на серверную топологию не только звонящему,
240
+ * но и принимающей стороне, если не удалось восстановить оборвавшееся p2p-соединение
241
+ *
242
+ * _По умолчанию: `false`_
243
+ */
244
+ switchTopologyOnReconnectFromAnySide: boolean;
238
245
  /**
239
246
  * Частота получения статистики в миллисекундах
240
247
  *
@@ -933,6 +940,12 @@ export default abstract class Params {
933
940
  static get<N extends keyof ParamsObject>(name: N): ParamsObject[N];
934
941
  static get appName(): string;
935
942
  static get appVersion(): string;
943
+ /**
944
+ * Версия клиента для `client_version` в `auth.anonymLogin`. Бэкенд валидирует формат,
945
+ * поэтому это фиксированное значение, а не версия приложения-хоста (см. {@link Params.appVersion}).
946
+ * @hidden
947
+ */
948
+ static get apiClientVersion(): number;
936
949
  static get sdkVersion(): string;
937
950
  static get debug(): boolean;
938
951
  static get protocolVersion(): 5 | 6;
@@ -1012,6 +1025,7 @@ export default abstract class Params {
1012
1025
  };
1013
1026
  static get iceRestartWaitTime(): number;
1014
1027
  static get transportConnectionWaitTime(): number;
1028
+ static get switchTopologyOnReconnectFromAnySide(): boolean;
1015
1029
  static get statisticsInterval(): number;
1016
1030
  static set statisticsInterval(value: number);
1017
1031
  static get networkStatisticsInterval(): number;