@vkontakte/calls-sdk 2.8.12-dev.0a19cc2d.0 → 2.8.12-dev.35600965.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.12-dev.0a19cc2d.0
3
- * Thu, 06 Aug 2026 18:49:31 GMT
2
+ * @vkontakte/calls-sdk v2.8.12-dev.35600965.0
3
+ * Thu, 13 Aug 2026 11:58:10 GMT
4
4
  * https://calls-sdk.cdn-vk.ru/doc/latest/index.html
5
5
  */
6
6
 
@@ -1092,8 +1092,8 @@ var w;
1092
1092
  4,
1093
1093
  5,
1094
1094
  6
1095
- ].includes(Number(w.browserSubVersion())), t = w.os() === "Windows" && w.osVersion() === 10;
1096
- return e || t;
1095
+ ].includes(Number(w.browserSubVersion())), t = w.osVersion(), n = w.os() === "Windows" && t != null && t > 0 && t < 13;
1096
+ return e || n;
1097
1097
  }
1098
1098
  e.isBrokenVP9Decoder = fe;
1099
1099
  function pe() {
@@ -1105,7 +1105,8 @@ var w;
1105
1105
  }
1106
1106
  e.canPreferH264 = me;
1107
1107
  function he() {
1108
- return !(w.browserName() === "Firefox" || w.browserName() === "Safari");
1108
+ let e = w.browserName(), t = Number(w.browserVersion());
1109
+ return e === "Safari" ? t >= 18 : e === "Firefox" ? t >= 134 : !0;
1109
1110
  }
1110
1111
  e.isSimulcastSupportedByBrowser = he;
1111
1112
  function ge() {
@@ -2183,7 +2184,7 @@ var hn = mn.getInstance(), M = class e {
2183
2184
  return 1.1;
2184
2185
  }
2185
2186
  static get sdkVersion() {
2186
- return "2.8.12-dev.0a19cc2d.0";
2187
+ return "2.8.12-dev.35600965.0";
2187
2188
  }
2188
2189
  static get debug() {
2189
2190
  return e._params.debug;
@@ -2558,6 +2559,12 @@ var hn = mn.getInstance(), M = class e {
2558
2559
  static get enableSessionStateUpdates() {
2559
2560
  return e._params.enableSessionStateUpdates;
2560
2561
  }
2562
+ static get safariAudioElement() {
2563
+ return e._params.safariAudioElement;
2564
+ }
2565
+ static get forwardEmptyIceCandidate() {
2566
+ return e._params.forwardEmptyIceCandidate;
2567
+ }
2561
2568
  static toJSON() {
2562
2569
  return {
2563
2570
  apiKey: e._params.apiKey,
@@ -2594,7 +2601,9 @@ var hn = mn.getInstance(), M = class e {
2594
2601
  webtransport: e._params.webtransport,
2595
2602
  waitForRecordResponse: e._params.waitForRecordResponse,
2596
2603
  transparentAudio: e._params.transparentAudio,
2597
- enableSessionStateUpdates: e._params.enableSessionStateUpdates
2604
+ enableSessionStateUpdates: e._params.enableSessionStateUpdates,
2605
+ safariAudioElement: e._params.safariAudioElement,
2606
+ forwardEmptyIceCandidate: e._params.forwardEmptyIceCandidate
2598
2607
  };
2599
2608
  }
2600
2609
  };
@@ -2705,7 +2714,9 @@ h(M, "_params", {
2705
2714
  webtransport: !1,
2706
2715
  waitForRecordResponse: !1,
2707
2716
  transparentAudio: !1,
2708
- enableSessionStateUpdates: !1
2717
+ enableSessionStateUpdates: !1,
2718
+ safariAudioElement: !1,
2719
+ forwardEmptyIceCandidate: !1
2709
2720
  });
2710
2721
  //#endregion
2711
2722
  //#region src/static/External.ts
@@ -4197,10 +4208,10 @@ var Er = class {
4197
4208
  }), this._triggerEvent(X.REMOTE_TRACK_ADDED, this._remoteStream, e.track);
4198
4209
  }
4199
4210
  async _handleIceCandidate(e) {
4200
- e.candidate && this._signaling.ready && (this._debug.debug("Local ice candidate", {
4211
+ this._signaling.ready && (e.candidate ? (this._debug.debug("Local ice candidate", {
4201
4212
  participantId: this._participantId,
4202
4213
  candidate: e.candidate
4203
- }), await this._signaling.sendCandidate(this._participantId, e.candidate));
4214
+ }), await this._signaling.sendCandidate(this._participantId, e.candidate)) : M.forwardEmptyIceCandidate && (this._debug.debug("ICE gathering complete, forwarding empty candidate", { participantId: this._participantId }), await this._signaling.sendCandidate(this._participantId, { candidate: "" })));
4204
4215
  }
4205
4216
  _onSignalingStateChange() {
4206
4217
  this._debug.debug(`DirectTransport: Signaling state changed to ${this._pc?.signalingState}`, { participantId: this._participantId });
@@ -6666,7 +6677,12 @@ var fa = da, pa = {
6666
6677
  }
6667
6678
  }, Ca = class {
6668
6679
  static isBrowserSupported() {
6669
- return !(!("WebTransport" in window && typeof WebTransport == "function") || T.browserName() === "Safari");
6680
+ if (!("WebTransport" in window && typeof WebTransport == "function")) return !1;
6681
+ if (T.browserName() === "Safari") {
6682
+ let e = Number(T.browserVersion()), t = Number(T.browserSubVersion());
6683
+ if (e < 26 || e === 26 && t < 4) return !1;
6684
+ }
6685
+ return !0;
6670
6686
  }
6671
6687
  constructor(e, t = {}, n = R) {
6672
6688
  h(this, "onopen", null), h(this, "onmessage", null), h(this, "onerror", null), h(this, "onclose", null), h(this, "readyState", WebSocket.CONNECTING), h(this, "webTransport", null), h(this, "writer", null), h(this, "url", void 0), h(this, "options", void 0), h(this, "compression", void 0), h(this, "encoder", void 0), h(this, "decoder", void 0), h(this, "_debug", void 0), this._debug = n, this.url = e, this.options = t, this.compression = this.getCompressionTypeFromUrl(e), this.encoder = new xa(this.compression), this.decoder = new Sa(this.compression), this.connect();
@@ -7948,7 +7964,7 @@ var io = class {
7948
7964
  if (M.muteMode) return;
7949
7965
  let e = this._getTracks();
7950
7966
  if (!e.length) return;
7951
- let t = T.browserName() !== "Safari" || T.isMobile(), n = document.createElement(t ? "audio" : "video");
7967
+ let t = T.browserName() !== "Safari" || T.isMobile() || M.safariAudioElement, n = document.createElement(t ? "audio" : "video");
7952
7968
  n.muted = !1, n.volume = this._volume, n.preload = "auto";
7953
7969
  let r = () => {
7954
7970
  this._debug.warn("[audio] Error on play audio"), L.onAutoplayError();
@@ -9093,13 +9109,16 @@ var Bo = class {
9093
9109
  }));
9094
9110
  }
9095
9111
  }, Xo = 1e3, Zo = 1e4;
9096
- function Qo(e, t) {
9097
- return new O(e, { callError: {
9098
- scope: "external",
9099
- source: "api",
9100
- code: "invalid-response",
9101
- description: t
9102
- } });
9112
+ function Qo(e, t, n, r) {
9113
+ return new O(e, {
9114
+ callError: {
9115
+ scope: "external",
9116
+ source: "api",
9117
+ code: t,
9118
+ description: n
9119
+ },
9120
+ message: r
9121
+ });
9103
9122
  }
9104
9123
  var $o = 15, $ = class e extends b {
9105
9124
  constructor(e, t) {
@@ -9562,8 +9581,11 @@ var $o = 15, $ = class e extends b {
9562
9581
  isVideo: f,
9563
9582
  joiningAllowed: a,
9564
9583
  requireAuthToJoin: o
9565
- }, this._abortController?.signal), !s) throw Qo(D.FAST_START_ERROR, "fast-start-response-empty");
9566
- if (!s.internalCallerParams) throw Qo(D.FAST_START_ERROR, "fast-start-internal-caller-params-empty");
9584
+ }, this._abortController?.signal), !s) throw Qo(D.FAST_START_ERROR, "invalid-response", "fast-start-response-empty");
9585
+ if (!s.internalCallerParams) {
9586
+ let e = s.rejectedParticipants[0]?.status;
9587
+ throw Qo(D.FAST_START_ERROR, e ? "fast-start" : "invalid-response", e ?? "fast-start-internal-caller-params-empty", JSON.stringify(s));
9588
+ }
9567
9589
  } catch (e) {
9568
9590
  throw this._delayedHangup && this._abortController?.signal.aborted ? new O(D.CANCELED) : e instanceof O ? e : e instanceof Error ? new O(D.FAST_START_ERROR, { message: e.message }) : new O(D.FAST_START_ERROR, { message: String(e) });
9569
9591
  }
@@ -9584,7 +9606,7 @@ var $o = 15, $ = class e extends b {
9584
9606
  token: new URL(e.endpoint).searchParams.get("token") ?? ""
9585
9607
  }, this._debug.debug("FastStart", p), m = "fastStart";
9586
9608
  } catch {
9587
- throw Qo(D.FAST_START_ERROR, "fast-start-internal-caller-params-invalid");
9609
+ throw Qo(D.FAST_START_ERROR, "invalid-response", "fast-start-internal-caller-params-invalid");
9588
9610
  }
9589
9611
  } else p = await this._api.startConversation(d, e, t, f, i, a, o, { onlyAdminCanShareMovie: s }, c), this._debug.debug("Api.startConversation", p), m = "startConversation";
9590
9612
  oo(p, m), this._setConversationParams(p), this._stats.lifecycle.bindConversationId(p.id), this._stats.lifecycle.markWarmupCompleted();
@@ -9620,9 +9642,9 @@ var $o = 15, $ = class e extends b {
9620
9642
  joinLink: i,
9621
9643
  isVideo: c,
9622
9644
  internalParams: t
9623
- }, this._abortController?.signal), !n) throw Qo(D.FAST_JOIN_ERROR, "fast-join-response-empty");
9624
- if (!n.internalCallerParams) throw Qo(D.FAST_JOIN_ERROR, "fast-join-internal-caller-params-empty");
9625
- if (!n.conversationId) throw Qo(D.FAST_JOIN_ERROR, "fast-join-conversation-id-empty");
9645
+ }, this._abortController?.signal), !n) throw Qo(D.FAST_JOIN_ERROR, "invalid-response", "fast-join-response-empty");
9646
+ if (!n.internalCallerParams) throw Qo(D.FAST_JOIN_ERROR, "invalid-response", "fast-join-internal-caller-params-empty", JSON.stringify(n));
9647
+ if (!n.conversationId) throw Qo(D.FAST_JOIN_ERROR, "invalid-response", "fast-join-conversation-id-empty", JSON.stringify(n));
9626
9648
  } catch (e) {
9627
9649
  throw this._delayedHangup && this._abortController?.signal.aborted ? new O(D.CANCELED) : e instanceof O ? e : e instanceof Error ? new O(D.FAST_JOIN_ERROR, { message: e.message }) : new O(D.FAST_JOIN_ERROR, { message: String(e) });
9628
9650
  }
@@ -9640,7 +9662,7 @@ var $o = 15, $ = class e extends b {
9640
9662
  token: new URL(e.endpoint).searchParams.get("token") ?? ""
9641
9663
  }, this._debug.debug("FastJoin", l), u = "fastJoin";
9642
9664
  } catch (e) {
9643
- throw e instanceof O ? e : Qo(D.FAST_JOIN_ERROR, "fast-join-internal-caller-params-invalid");
9665
+ throw e instanceof O ? e : Qo(D.FAST_JOIN_ERROR, "invalid-response", "fast-join-internal-caller-params-invalid");
9644
9666
  }
9645
9667
  } else if (t) l = await this._api.joinConversation(t, c, r), u = "joinConversation";
9646
9668
  else if (i) l = await this._api.joinConversationByLink(i, c, a, o), u = "joinConversationByLink";
@@ -75,7 +75,7 @@ export default class Signaling extends BaseSignaling {
75
75
  connect(connectionType: SignalingConnectionType): Promise<SignalingMessage.Connection>;
76
76
  getNextCommandSequenceNumber(): number;
77
77
  hangup(reason: string): Promise<SignalingMessage | void>;
78
- sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidate): Promise<SignalingMessage>;
78
+ sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidateInit): Promise<SignalingMessage>;
79
79
  requestTestMode(consumerCommand: string, producerCommand: string | null): Promise<SignalingMessage>;
80
80
  sendSdp(participantId: ParticipantId, sdp: RTCSessionDescriptionInit, extraPayload?: Record<string, any>): Promise<SignalingMessage>;
81
81
  acceptCall(mediaSettings: MediaSettings): Promise<SignalingMessage>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.8.12-dev.0a19cc2d.0",
3
+ "version": "2.8.12-dev.35600965.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",
@@ -505,6 +505,16 @@ export type ParamsObject = {
505
505
  * _По умолчанию: `false`_
506
506
  */
507
507
  enableSessionStateUpdates: boolean;
508
+ /**
509
+ * Использовать `<audio>` вместо `<video>` для воспроизведения звука в desktop Safari
510
+ * @hidden
511
+ */
512
+ safariAudioElement: boolean;
513
+ /**
514
+ * Отправлять пустой ICE candidate (end-of-candidates) удалённому пиру
515
+ * @hidden
516
+ */
517
+ forwardEmptyIceCandidate: boolean;
508
518
  /**
509
519
  * Получен локальный стрим с камеры/микрофона
510
520
  */
@@ -1027,6 +1037,8 @@ export default abstract class Params {
1027
1037
  static get waitForRecordResponse(): boolean;
1028
1038
  static get transparentAudio(): boolean;
1029
1039
  static get enableSessionStateUpdates(): boolean;
1040
+ static get safariAudioElement(): boolean;
1041
+ static get forwardEmptyIceCandidate(): boolean;
1030
1042
  static toJSON(): {
1031
1043
  apiKey: string;
1032
1044
  apiEnv: string;
@@ -1063,5 +1075,7 @@ export default abstract class Params {
1063
1075
  waitForRecordResponse: boolean;
1064
1076
  transparentAudio: boolean;
1065
1077
  enableSessionStateUpdates: boolean;
1078
+ safariAudioElement: boolean;
1079
+ forwardEmptyIceCandidate: boolean;
1066
1080
  };
1067
1081
  }
@@ -153,7 +153,9 @@ declare namespace WebRTCUtils {
153
153
  */
154
154
  function canPreferH264(): boolean;
155
155
  /**
156
- * Некоторые браузеры (Firefox, Safari) некорректно поддерживают симулкаст
156
+ * Поддержка simulcast браузером.
157
+ * Safari корректно поддерживает simulcast начиная с версии 18.
158
+ * Firefox поддерживает simulcast с VP8 начиная с версии 134.
157
159
  */
158
160
  function isSimulcastSupportedByBrowser(): boolean;
159
161
  /**