@vkontakte/calls-sdk 2.8.13-dev.56ef08c8.0 → 2.8.13-dev.5c559492.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/CallsSDK.d.ts +4 -2
- package/calls-sdk.cjs.js +5 -5
- package/calls-sdk.esm.js +123 -74
- package/classes/conversation/Conversation.d.ts +3 -0
- package/enums/Stat.d.ts +4 -1
- package/package.json +1 -1
- package/static/External.d.ts +7 -0
- package/static/Params.d.ts +7 -0
- package/types/ClientStatsEvent.d.ts +11 -0
- package/types/Params.d.ts +1 -1
package/calls-sdk.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @vkontakte/calls-sdk v2.8.13-dev.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/calls-sdk v2.8.13-dev.5c559492.0
|
|
3
|
+
* Fri, 02 Oct 2026 12:29:14 GMT
|
|
4
4
|
* https://calls-sdk.cdn-vk.ru/doc/latest/index.html
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -2182,7 +2182,7 @@ var xn = bn.getInstance(), N = class e {
|
|
|
2182
2182
|
return 1.1;
|
|
2183
2183
|
}
|
|
2184
2184
|
static get sdkVersion() {
|
|
2185
|
-
return "2.8.13-dev.
|
|
2185
|
+
return "2.8.13-dev.5c559492.0";
|
|
2186
2186
|
}
|
|
2187
2187
|
static get debug() {
|
|
2188
2188
|
return e._params.debug;
|
|
@@ -2248,6 +2248,8 @@ var xn = bn.getInstance(), N = class e {
|
|
|
2248
2248
|
case "CALLS_BENDER": return "https://api-bender.calls-test.oneme.ru/api";
|
|
2249
2249
|
case "CALLS_MAMES": return "https://calls-mames.okcdn.ru/api";
|
|
2250
2250
|
case "CALLS_MARS": return "https://api-mars.calls-test.oneme.ru/api";
|
|
2251
|
+
case "CALLS_CHELSEA": return "https://api-chelsea.calls-test.oneme.ru/api";
|
|
2252
|
+
case "CALLS_KERZH": return "https://api-kerzh.calls-test.oneme.ru/api";
|
|
2251
2253
|
default: return e._params.apiEnv;
|
|
2252
2254
|
}
|
|
2253
2255
|
}
|
|
@@ -3020,98 +3022,102 @@ var Cn;
|
|
|
3020
3022
|
F("onStatistics", Object.assign({}, e, { memory: t }));
|
|
3021
3023
|
}
|
|
3022
3024
|
e.onStatistics = Ue;
|
|
3023
|
-
function We() {
|
|
3025
|
+
function We(e) {
|
|
3026
|
+
F("onClientStats", e);
|
|
3027
|
+
}
|
|
3028
|
+
e.onClientStats = We;
|
|
3029
|
+
function Ge() {
|
|
3024
3030
|
F("onAutoplayError");
|
|
3025
3031
|
}
|
|
3026
|
-
e.onAutoplayError =
|
|
3027
|
-
function
|
|
3032
|
+
e.onAutoplayError = Ge;
|
|
3033
|
+
function Ke(e, t, n, r, i, a) {
|
|
3028
3034
|
F("onChatRoomUpdated", e, t, n, r, i, a);
|
|
3029
3035
|
}
|
|
3030
|
-
e.onChatRoomUpdated =
|
|
3031
|
-
function
|
|
3036
|
+
e.onChatRoomUpdated = Ke;
|
|
3037
|
+
function qe(e, t) {
|
|
3032
3038
|
F("onPromoted", e, t);
|
|
3033
3039
|
}
|
|
3034
|
-
e.onPromoted =
|
|
3035
|
-
function
|
|
3040
|
+
e.onPromoted = qe;
|
|
3041
|
+
function y(e, t) {
|
|
3036
3042
|
F("onRemoteMixedAudioStream", e, t);
|
|
3037
3043
|
}
|
|
3038
|
-
e.onRemoteMixedAudioStream =
|
|
3039
|
-
function
|
|
3044
|
+
e.onRemoteMixedAudioStream = y;
|
|
3045
|
+
function b(e, t) {
|
|
3040
3046
|
F("onJoinLinkChanged", e, t);
|
|
3041
3047
|
}
|
|
3042
|
-
e.onJoinLinkChanged =
|
|
3043
|
-
function
|
|
3048
|
+
e.onJoinLinkChanged = b;
|
|
3049
|
+
function x(e, t) {
|
|
3044
3050
|
F("onRoomsUpdated", e, t);
|
|
3045
3051
|
}
|
|
3046
|
-
e.onRoomsUpdated =
|
|
3047
|
-
function
|
|
3052
|
+
e.onRoomsUpdated = x;
|
|
3053
|
+
function S(e, t, n, r, i) {
|
|
3048
3054
|
F("onRoomUpdated", e, t, n, r, i);
|
|
3049
3055
|
}
|
|
3050
|
-
e.onRoomUpdated =
|
|
3051
|
-
function
|
|
3056
|
+
e.onRoomUpdated = S;
|
|
3057
|
+
function C(e, t) {
|
|
3052
3058
|
F("onRoomParticipantsUpdated", e, t);
|
|
3053
3059
|
}
|
|
3054
|
-
e.onRoomParticipantsUpdated =
|
|
3055
|
-
function
|
|
3060
|
+
e.onRoomParticipantsUpdated = C;
|
|
3061
|
+
function Je(e, t) {
|
|
3056
3062
|
F("onRoomSwitched", e, t);
|
|
3057
3063
|
}
|
|
3058
|
-
e.onRoomSwitched =
|
|
3059
|
-
function
|
|
3064
|
+
e.onRoomSwitched = Je;
|
|
3065
|
+
function Ye(e, t) {
|
|
3060
3066
|
F("onRoomStart", e, t);
|
|
3061
3067
|
}
|
|
3062
|
-
e.onRoomStart =
|
|
3063
|
-
function
|
|
3068
|
+
e.onRoomStart = Ye;
|
|
3069
|
+
function Xe(e, t = null, n) {
|
|
3064
3070
|
F("onFeedback", e, t, n);
|
|
3065
3071
|
}
|
|
3066
|
-
e.onFeedback =
|
|
3067
|
-
function
|
|
3072
|
+
e.onFeedback = Xe;
|
|
3073
|
+
function Ze(e, t) {
|
|
3068
3074
|
F("onFeaturesPerRoleChanged", e, t);
|
|
3069
3075
|
}
|
|
3070
|
-
e.onFeaturesPerRoleChanged =
|
|
3071
|
-
function
|
|
3076
|
+
e.onFeaturesPerRoleChanged = Ze;
|
|
3077
|
+
function Qe(e, t) {
|
|
3072
3078
|
F("onParticipantVmojiUpdate", e, t);
|
|
3073
3079
|
}
|
|
3074
|
-
e.onParticipantVmojiUpdate =
|
|
3075
|
-
function
|
|
3080
|
+
e.onParticipantVmojiUpdate = Qe;
|
|
3081
|
+
function $e(e, t, n) {
|
|
3076
3082
|
F("onAsrSet", e, t, n);
|
|
3077
3083
|
}
|
|
3078
|
-
e.onAsrSet =
|
|
3079
|
-
function
|
|
3084
|
+
e.onAsrSet = $e;
|
|
3085
|
+
function et(e, t, n, r) {
|
|
3080
3086
|
F("onAsrStarted", e, t, n, r);
|
|
3081
3087
|
}
|
|
3082
|
-
e.onAsrStarted =
|
|
3083
|
-
function
|
|
3088
|
+
e.onAsrStarted = et;
|
|
3089
|
+
function tt(e, t) {
|
|
3084
3090
|
F("onAsrStopped", e, t);
|
|
3085
3091
|
}
|
|
3086
|
-
e.onAsrStopped =
|
|
3087
|
-
function
|
|
3092
|
+
e.onAsrStopped = tt;
|
|
3093
|
+
function nt(e, t, n, r, i) {
|
|
3088
3094
|
F("onAsrTranscription", e, t, n, r, i);
|
|
3089
3095
|
}
|
|
3090
|
-
e.onAsrTranscription =
|
|
3091
|
-
function
|
|
3096
|
+
e.onAsrTranscription = nt;
|
|
3097
|
+
function rt(e, t, n) {
|
|
3092
3098
|
F("onParticipantIdChanged", e, t, n);
|
|
3093
3099
|
}
|
|
3094
|
-
e.onParticipantIdChanged =
|
|
3095
|
-
function
|
|
3100
|
+
e.onParticipantIdChanged = rt;
|
|
3101
|
+
function it(e, t) {
|
|
3096
3102
|
F("onVideoSuspendSuggest", e, t);
|
|
3097
3103
|
}
|
|
3098
|
-
e.onVideoSuspendSuggest =
|
|
3099
|
-
function
|
|
3104
|
+
e.onVideoSuspendSuggest = it;
|
|
3105
|
+
function w(e) {
|
|
3100
3106
|
F("onSignalingMessage", typeof e == "string" ? e : L(e));
|
|
3101
3107
|
}
|
|
3102
|
-
e.onSignalingMessage =
|
|
3103
|
-
function
|
|
3108
|
+
e.onSignalingMessage = w;
|
|
3109
|
+
function at(e, t) {
|
|
3104
3110
|
F("onPromotionApproved", e, t);
|
|
3105
3111
|
}
|
|
3106
|
-
e.onPromotionApproved =
|
|
3107
|
-
function
|
|
3112
|
+
e.onPromotionApproved = at;
|
|
3113
|
+
function ot(e, t) {
|
|
3108
3114
|
F("onPeerRegistered", e, t);
|
|
3109
3115
|
}
|
|
3110
|
-
e.onPeerRegistered =
|
|
3111
|
-
function
|
|
3116
|
+
e.onPeerRegistered = ot;
|
|
3117
|
+
function st(e, t) {
|
|
3112
3118
|
F("onNonFatalError", e, t);
|
|
3113
3119
|
}
|
|
3114
|
-
e.onNonFatalError =
|
|
3120
|
+
e.onNonFatalError = st;
|
|
3115
3121
|
})(Cn || (Cn = {}));
|
|
3116
3122
|
var R = Cn, wn = /* @__PURE__ */ function(e) {
|
|
3117
3123
|
return e.DEBUG = "DEBUG", e.LOG = "LOG", e.WARN = "WARN", e.ERROR = "ERROR", e;
|
|
@@ -7694,7 +7700,20 @@ var $a = new Set([
|
|
|
7694
7700
|
remote: !0
|
|
7695
7701
|
}));
|
|
7696
7702
|
break;
|
|
7697
|
-
case Xa.INVALID_TOKEN:
|
|
7703
|
+
case Xa.INVALID_TOKEN: {
|
|
7704
|
+
if (e.sequence || t === Sr.WEBTRANSPORT) break;
|
|
7705
|
+
R.onTokenExpired(), this._stopWaitConnectionMessage(), this.transport.close();
|
|
7706
|
+
let i = new k(e.reason || x.SIGNALING_FAILED, {
|
|
7707
|
+
callError: n ?? {
|
|
7708
|
+
scope: "unknown",
|
|
7709
|
+
description: "signaling-unrecognized-error"
|
|
7710
|
+
},
|
|
7711
|
+
message: r,
|
|
7712
|
+
remote: !0
|
|
7713
|
+
});
|
|
7714
|
+
this.connected ? this._throwError(i) : this.conversationReject?.(i);
|
|
7715
|
+
break;
|
|
7716
|
+
}
|
|
7698
7717
|
default:
|
|
7699
7718
|
if (e.sequence || t === Sr.WEBTRANSPORT) break;
|
|
7700
7719
|
if (this.connected) this._throwError(new k(e.reason || x.SIGNALING_FAILED, {
|
|
@@ -7916,7 +7935,7 @@ var $a = new Set([
|
|
|
7916
7935
|
e.callError || !e.reason || e.reason === O.FAILED || e.reason === O.UNKNOWN_ERROR || !$a.has(e.reason) && !e.errorCode || (e.callError = {
|
|
7917
7936
|
scope: "server",
|
|
7918
7937
|
source: this._getSocketType(),
|
|
7919
|
-
code: e.errorCode ||
|
|
7938
|
+
code: e.errorCode || String(e.reason),
|
|
7920
7939
|
description: String(e.reason)
|
|
7921
7940
|
});
|
|
7922
7941
|
}
|
|
@@ -7925,7 +7944,7 @@ var $a = new Set([
|
|
|
7925
7944
|
if (r) return {
|
|
7926
7945
|
scope: "server",
|
|
7927
7946
|
source: n,
|
|
7928
|
-
code: t ??
|
|
7947
|
+
code: t ?? r,
|
|
7929
7948
|
description: r
|
|
7930
7949
|
};
|
|
7931
7950
|
}
|
|
@@ -9497,34 +9516,39 @@ var Is = class extends f {
|
|
|
9497
9516
|
}).catch((e) => z.error("[StatEventCollector] failed to import unload journal", e)));
|
|
9498
9517
|
}
|
|
9499
9518
|
logClientStats(t, n = {}) {
|
|
9500
|
-
|
|
9519
|
+
let r = n.conversationId === void 0 ? this._getConversationId() : n.conversationId, i = n.occurredAt === void 0 ? Date.now() : n.occurredAt;
|
|
9520
|
+
if (R.onClientStats({
|
|
9521
|
+
...t,
|
|
9522
|
+
vcid: r,
|
|
9523
|
+
ts: i
|
|
9524
|
+
}), this._legacy) {
|
|
9501
9525
|
this._legacy.logClientStats(t, n);
|
|
9502
9526
|
return;
|
|
9503
9527
|
}
|
|
9504
|
-
let
|
|
9528
|
+
let a = {
|
|
9505
9529
|
...t,
|
|
9506
9530
|
call_topology: t.call_topology ?? this._getCallTopology()
|
|
9507
9531
|
};
|
|
9508
|
-
Object.keys(
|
|
9509
|
-
|
|
9532
|
+
Object.keys(a).forEach((e) => {
|
|
9533
|
+
a[e] === void 0 && delete a[e];
|
|
9510
9534
|
}), Ts.ensure();
|
|
9511
|
-
let
|
|
9512
|
-
vcid:
|
|
9513
|
-
ts:
|
|
9535
|
+
let o = {
|
|
9536
|
+
vcid: r,
|
|
9537
|
+
ts: i,
|
|
9514
9538
|
delta: Ts.delta(),
|
|
9515
|
-
ev:
|
|
9516
|
-
},
|
|
9517
|
-
if (
|
|
9518
|
-
e._remember(
|
|
9539
|
+
ev: a
|
|
9540
|
+
}, s = y.userId;
|
|
9541
|
+
if (s === null) {
|
|
9542
|
+
e._remember(o);
|
|
9519
9543
|
return;
|
|
9520
9544
|
}
|
|
9521
9545
|
for (let t of e._takePending()) this._store({
|
|
9522
9546
|
...t,
|
|
9523
|
-
uid:
|
|
9547
|
+
uid: s
|
|
9524
9548
|
});
|
|
9525
9549
|
this._store({
|
|
9526
|
-
...
|
|
9527
|
-
uid:
|
|
9550
|
+
...o,
|
|
9551
|
+
uid: s
|
|
9528
9552
|
});
|
|
9529
9553
|
}
|
|
9530
9554
|
destroy() {
|
|
@@ -10254,7 +10278,7 @@ function dc(e, t, n, r) {
|
|
|
10254
10278
|
}
|
|
10255
10279
|
var fc = 15, $ = class e extends b {
|
|
10256
10280
|
constructor(e, t) {
|
|
10257
|
-
super(), h(this, "_api", void 0), h(this, "_signaling", void 0), h(this, "_signalingActor", void 0), h(this, "_displayLayoutRequester", void 0), h(this, "_mediaSource", null), h(this, "_conversation", null), h(this, "_myLastRequestedLayouts", {}), h(this, "_state", "IDLE"), h(this, "_previousState", null), h(this, "_waitingHallHoldPending", !1), h(this, "_participantState", X.CALLED), h(this, "_participants", {}), h(this, "_directTransportIsMaster", void 0), h(this, "_transport", null), h(this, "_debugInfo", null), h(this, "_debug", z.createSessionLogger()), h(this, "_volumesDetector", null), h(this, "_speakerDetector", null), h(this, "_localVolumeDetector", null), h(this, "_specListener", null), h(this, "_activeSpeakerId", null), h(this, "_lastSignalledActiveSpeakerId", null), h(this, "_isRealTimeAsrRequested", !1), h(this, "_serverSettings", Mr()), h(this, "_serverTimeOffset", 0), h(this, "_delayedHangup", !1), h(this, "_onFastHangup", void 0), h(this, "_hangupEmitted", !1), h(this, "_hangupPromise", null), h(this, "_abortController", null), h(this, "_registeredPeerReceived", !1), h(this, "_calleeUnavailableTimer", null), h(this, "_reservedId", null), h(this, "_onUnload", void 0), h(this, "_onRestore", void 0), h(this, "_audioOutput", void 0), h(this, "_stats", void 0), h(this, "_lastStalled", {}), h(this, "_audioMixStalled", !1), h(this, "_audioFix", null), h(this, "_streamByStreamId", /* @__PURE__ */ new Map()), h(this, "_streamIdByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_streamWaitTimerByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_sequenceNumberByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_cooldownTimestampByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_cooldownQueueCleanupTimer", null), h(this, "_statFirstMediaReceived", void 0), h(this, "_toggleLocalVideo", ko((e) => {
|
|
10281
|
+
super(), h(this, "_api", void 0), h(this, "_signaling", void 0), h(this, "_signalingActor", void 0), h(this, "_displayLayoutRequester", void 0), h(this, "_mediaSource", null), h(this, "_conversation", null), h(this, "_myLastRequestedLayouts", {}), h(this, "_state", "IDLE"), h(this, "_previousState", null), h(this, "_waitingHallHoldPending", !1), h(this, "_participantState", X.CALLED), h(this, "_participants", {}), h(this, "_directTransportIsMaster", void 0), h(this, "_transport", null), h(this, "_debugInfo", null), h(this, "_debug", z.createSessionLogger()), h(this, "_volumesDetector", null), h(this, "_speakerDetector", null), h(this, "_localVolumeDetector", null), h(this, "_specListener", null), h(this, "_activeSpeakerId", null), h(this, "_lastSignalledActiveSpeakerId", null), h(this, "_isRealTimeAsrRequested", !1), h(this, "_serverSettings", Mr()), h(this, "_serverTimeOffset", 0), h(this, "_delayedHangup", !1), h(this, "_onFastHangup", void 0), h(this, "_hangupEmitted", !1), h(this, "_hangupPromise", null), h(this, "_abortController", null), h(this, "_registeredPeerReceived", !1), h(this, "_calleeUnavailableTimer", null), h(this, "_reservedId", null), h(this, "_onUnload", void 0), h(this, "_onRestore", void 0), h(this, "_audioOutput", void 0), h(this, "_stats", void 0), h(this, "_lastStalled", {}), h(this, "_audioMixStalled", !1), h(this, "_audioFix", null), h(this, "_streamByStreamId", /* @__PURE__ */ new Map()), h(this, "_streamIdByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_streamWaitTimerByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_sequenceNumberByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_cooldownTimestampByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_cooldownQueueCleanupTimer", null), h(this, "_invalidTokenRetried", !1), h(this, "_statFirstMediaReceived", void 0), h(this, "_toggleLocalVideo", ko((e) => {
|
|
10258
10282
|
if (this._mediaSource) return this._stats.logger.log(C.MEDIA_STATUS, e ? "video_1" : "video_0"), this._mediaSource.toggleVideo(e);
|
|
10259
10283
|
})), h(this, "_toggleLocalAudio", ko((e) => {
|
|
10260
10284
|
if (this._mediaSource) return this._stats.logger.log(C.MEDIA_STATUS, e ? "audio_1" : "audio_0"), this._mediaSource.toggleAudio(e);
|
|
@@ -10698,7 +10722,7 @@ var fc = 15, $ = class e extends b {
|
|
|
10698
10722
|
this._disposeSignaling(r), this._cleanupMediaSource();
|
|
10699
10723
|
return;
|
|
10700
10724
|
}
|
|
10701
|
-
this._state = "CLOSE", this._participantState = X.HUNGUP, this._changeFeatureSet(), this._cleanupMediaSource(), this._cleanupParticipants(), this._cleanupParticipantAgnosticStreams(), this._cleanupTransport(), this._cleanupSpeakerDetector(), this._cleanupSpecListener(), this._disposeSignaling(r), this._api.cleanup(), this._api.setAbortSignal(void 0), this._stats.destroy(), this._cleanupRegistry(), this._conversation = null, this._myLastRequestedLayouts = {}, this._displayLayoutRequester.clear(), this._delayedHangup = !1, this._abortController = null, this._emitHangupOnce(e || new k(O.UNKNOWN_ERROR), i);
|
|
10725
|
+
this._state = "CLOSE", this._participantState = X.HUNGUP, this._changeFeatureSet(), this._cleanupMediaSource(), this._cleanupParticipants(), this._cleanupParticipantAgnosticStreams(), this._cleanupTransport(), this._cleanupSpeakerDetector(), this._cleanupSpecListener(), this._disposeSignaling(r), this._api.cleanup(), this._api.setAbortSignal(void 0), this._stats.destroy(), this._cleanupRegistry(), this._conversation = null, this._myLastRequestedLayouts = {}, this._displayLayoutRequester.clear(), this._delayedHangup = !1, this._abortController = null, this._invalidTokenRetried = !1, this._emitHangupOnce(e || new k(O.UNKNOWN_ERROR), i);
|
|
10702
10726
|
}
|
|
10703
10727
|
_sendHangup(e, t, n) {
|
|
10704
10728
|
typeof n == "function" ? n({
|
|
@@ -10720,7 +10744,7 @@ var fc = 15, $ = class e extends b {
|
|
|
10720
10744
|
if (this._debug.debug("Destroy conversation", { conversationId: t }), this._stopFirstMediaSentProbe(), this._cooldownQueueCleanupTimer !== null && (window.clearInterval(this._cooldownQueueCleanupTimer), this._cooldownQueueCleanupTimer = null), this._state = "CLOSE", this._participantState = X.HUNGUP, this._cleanupMediaSource(), this._cleanupParticipants(), this._cleanupParticipantAgnosticStreams(), this._cleanupTransport(), this._cleanupSpeakerDetector(), this._cleanupSpecListener(), this._disposeSignaling(e), this._delayedHangup && t) try {
|
|
10721
10745
|
this._sendHangup(t, O.CANCELED, this._onFastHangup);
|
|
10722
10746
|
} catch {}
|
|
10723
|
-
this._api.cleanup(), this._api.setAbortSignal(void 0), this._cleanupListeners(), this._stats.destroy(), this._cleanupRegistry(), this._conversation = null, this._myLastRequestedLayouts = {}, this._displayLayoutRequester.clear(), this._delayedHangup = !1, this._abortController = null;
|
|
10747
|
+
this._api.cleanup(), this._api.setAbortSignal(void 0), this._cleanupListeners(), this._stats.destroy(), this._cleanupRegistry(), this._conversation = null, this._myLastRequestedLayouts = {}, this._displayLayoutRequester.clear(), this._delayedHangup = !1, this._abortController = null, this._invalidTokenRetried = !1;
|
|
10724
10748
|
}
|
|
10725
10749
|
async _getConversationParams(e) {
|
|
10726
10750
|
let t = await this._api.getConversationParams(e);
|
|
@@ -11021,8 +11045,33 @@ var fc = 15, $ = class e extends b {
|
|
|
11021
11045
|
}
|
|
11022
11046
|
async _connectSignaling(e, t) {
|
|
11023
11047
|
this._signaling.setEndpoint(t.endpoint), this._signaling.setWebTransportEndpoint(t.wt_endpoint ? t.wt_endpoint : null), this.subscribe(this._signaling, xr.NOTIFICATION, (e) => this._signalingActor.add(e)), this.subscribe(this._signaling, xr.FAILED, this._onSignalingFailed.bind(this)), this.subscribe(this._signaling, xr.RECONNECT, this._onSignalingReconnect.bind(this));
|
|
11024
|
-
|
|
11025
|
-
|
|
11048
|
+
try {
|
|
11049
|
+
let n = await this._signaling.connect(e, t);
|
|
11050
|
+
return this._stats.statAggregator.logEventualStatSinceMark({ name: U.SIGNALING_CONNECTED }), n;
|
|
11051
|
+
} catch (n) {
|
|
11052
|
+
if (this._isInvalidTokenError(n) && !this._invalidTokenRetried && t.id && (this._invalidTokenRetried = !0, this._debug.debug("[conversation] invalid-token error, refreshing token and retrying"), await this._refreshSignalingEndpoint(t))) {
|
|
11053
|
+
this._signaling.setEndpoint(t.endpoint), this._signaling.setWebTransportEndpoint(t.wt_endpoint ? t.wt_endpoint : null);
|
|
11054
|
+
let n = await this._signaling.connect(e, t);
|
|
11055
|
+
return this._stats.statAggregator.logEventualStatSinceMark({ name: U.SIGNALING_CONNECTED }), n;
|
|
11056
|
+
}
|
|
11057
|
+
throw n;
|
|
11058
|
+
}
|
|
11059
|
+
}
|
|
11060
|
+
_isInvalidTokenError(e) {
|
|
11061
|
+
return e instanceof k && e.callError?.scope === "server" && e.callError?.description === "invalid-token";
|
|
11062
|
+
}
|
|
11063
|
+
async _refreshSignalingEndpoint(e) {
|
|
11064
|
+
try {
|
|
11065
|
+
await this._getConversationParams(e.id);
|
|
11066
|
+
let t = new URL(e.endpoint);
|
|
11067
|
+
if (t.searchParams.set("token", N.wssToken), e.endpoint = t.toString(), e.wt_endpoint) {
|
|
11068
|
+
let t = new URL(e.wt_endpoint);
|
|
11069
|
+
t.searchParams.set("token", N.wssToken), e.wt_endpoint = t.toString();
|
|
11070
|
+
}
|
|
11071
|
+
return !0;
|
|
11072
|
+
} catch (e) {
|
|
11073
|
+
return this._debug.warn("[conversation] failed to refresh signaling endpoint", e), !1;
|
|
11074
|
+
}
|
|
11026
11075
|
}
|
|
11027
11076
|
async _processConnection(e) {
|
|
11028
11077
|
await this._registerConnectionParticipants(e), this._processRooms(e), this._processMuteStates(e), this._processRecordInfos(e), this._onOptionsChanged(e.conversation.options), e.chatRoom && e.chatRoom.totalCount && this._onChatRoomUpdated(ro.ATTENDEE, e.chatRoom.totalCount, e.chatRoom.firstParticipants, null, null);
|
|
@@ -12207,7 +12256,7 @@ var fc = 15, $ = class e extends b {
|
|
|
12207
12256
|
let t = M.composeMessageId(e), n = M.getPeerIdString(e.peerId);
|
|
12208
12257
|
if (this._debug.debug(`Participant accepted call [${t}]`), this._statFirstMediaReceived.markAcceptedCall(this._transport?.getTopology()), this._conversation && this._isMe(t)) {
|
|
12209
12258
|
if (this._conversation.concurrent) return;
|
|
12210
|
-
this._close(new k(O.
|
|
12259
|
+
this._close(new k(O.ANOTHER_DEVICE), { errorText: "Call accepted on other device" });
|
|
12211
12260
|
return;
|
|
12212
12261
|
}
|
|
12213
12262
|
this._conversation?.direction === to.OUTGOING && !this._conversation.concurrent && this._stats.lifecycle.markOutgoingAccepted();
|
|
@@ -13060,7 +13109,7 @@ var fc = 15, $ = class e extends b {
|
|
|
13060
13109
|
this._warnParticipantNotInConversation(e.participantId);
|
|
13061
13110
|
return;
|
|
13062
13111
|
}
|
|
13063
|
-
if (t.isOnHold = e.hold, this._specListener?.onParticipantHoldChanged(), this._transport?.setRemoteHold(e.hold), e.hold) this._setParticipantsStatus([t], P.ONHOLD), this._audioOutput.destroy();
|
|
13112
|
+
if (t.isOnHold = e.hold, this._specListener?.onParticipantHoldChanged(), this._transport?.setRemoteHold(e.hold), e.hold) this._setParticipantsStatus([t], P.ONHOLD), this._transport?.getTopology() === J.DIRECT && this._audioOutput.destroy();
|
|
13064
13113
|
else {
|
|
13065
13114
|
let e = this._transport?.getTopology() === J.DIRECT ? P.CONNECTING : P.CONNECTED;
|
|
13066
13115
|
this._setParticipantsStatus([t], e);
|
|
@@ -14182,4 +14231,4 @@ function Mu() {
|
|
|
14182
14231
|
}
|
|
14183
14232
|
typeof window < "u" && (window.__CALLS_SDK = xn);
|
|
14184
14233
|
//#endregion
|
|
14185
|
-
export { wc as Api, Ac as ApiExternal, kc as ArrayDequeue, y as AuthData, f as BaseLogger, to as CallDirection, no as CallType, ro as ChatRoomEventType, io as ConversationFeature, ao as ConversationOption, wn as DebugMessageType, _o as ExternalIdType, jt as FacingMode, x as FatalError, k as HangupReason, O as HangupType, S as MediaOption, A as MediaTrackKind, H as MediaType, co as MuteState, X as ParticipantState, Oc as ParticipantStateDataValue, P as ParticipantStatus, Dc as RecordRole, lo as RoomsEventType, eo as Signaling, V as SignalingCommandType, br as SignalingConnectionType, K as SignalingNotification, J as TransportTopology, po as UserRole, j as UserType, Bo as VolumeDetector, Xc as acceptCall, pu as acceptPromotion, Jl as activateRooms, Wl as addMovie, nl as addParticipant, rl as addParticipantInternal, Yc as authorize, Pc as browser, Wc as callInternal, Hc as callTo, sl as captureScreen, cl as captureVmoji, au as changeAudioEffect, Dl as changeConversationOptions, ol as changeDevice, ml as changeParticipantState, pl as changePriorities, iu as changeVideoEffect, Al as chatHistory, Ol as chatMessage, kl as chatMessageInternal, Fl as createJoinLink, jl as customData, Ml as customDataInternal, Ql as debug, tu as debugLogs, $l as debugMessage, eu as debugMessageWithContext, Zc as declineCall, _u as enableFeatureForRoles, Tl as enableVideoSuspend, El as enableVideoSuspendSuggest, gu as feedback, zl as forceRelayPolicy, Au as getActiveCallId, Ll as getAnonymTokenByLink, uu as getAudienceModeHands, qc as getInbounds, mu as getParticipantListChunk, hu as getParticipants, Ul as getStreamInfo, ju as getSyncedTime, lu as getWaitingHall, vl as grantRoles, yl as grantRolesInternal, tl as hangup, Vc as init, Qc as joinCall, el as joinCallByLink, $c as joinCallInternal, bl as muteParticipant, xl as muteParticipantInternal, Sl as pinParticipant, Cl as pinParticipantInternal, Gc as processPush, Kc as processPushInternal, du as promoteParticipant, Hl as publishStream, hl as putHandsDown, Cu as removeHistoryRecords, Il as removeJoinLink, Kl as removeMovie, il as removeParticipant, al as removeParticipantInternal, Xl as removeRooms, Eu as requestAsr, _l as requestDisplayLayout, fu as requestPromotion, Rc as setAudioEffects, ou as setAudioStream, fl as setLocalResolution, Ic as setLogger, wl as setMediaModifiers, Zl as setStatisticsInterval, zc as setVad, Lc as setVideoEffects, ll as setVideoStream, Bc as setVmoji, cu as setVmojiFill, su as setVmojiSvg, Rl as setVolume, wu as startAsr, Pl as startAudienceConversation, Nl as startConversation, Jc as startStats, Bl as startStream, Du as startUrlSharing, Tu as stopAsr, Vl as stopStream, Ou as stopUrlSharing, ku as switchCall, Yl as switchRoom, dl as toggleLocalAudio, ul as toggleLocalVideo, gl as updateDisplayLayout, Gl as updateMovie, ql as updateRooms, ru as uploadDebugLogs, Fc as utils, Mu as version };
|
|
14234
|
+
export { wc as Api, Ac as ApiExternal, kc as ArrayDequeue, y as AuthData, f as BaseLogger, to as CallDirection, no as CallType, ro as ChatRoomEventType, io as ConversationFeature, ao as ConversationOption, wn as DebugMessageType, _o as ExternalIdType, jt as FacingMode, x as FatalError, k as HangupReason, O as HangupType, S as MediaOption, A as MediaTrackKind, H as MediaType, co as MuteState, X as ParticipantState, Oc as ParticipantStateDataValue, P as ParticipantStatus, Dc as RecordRole, lo as RoomsEventType, eo as Signaling, V as SignalingCommandType, br as SignalingConnectionType, K as SignalingNotification, U as Stat, J as TransportTopology, po as UserRole, j as UserType, Bo as VolumeDetector, Xc as acceptCall, pu as acceptPromotion, Jl as activateRooms, Wl as addMovie, nl as addParticipant, rl as addParticipantInternal, Yc as authorize, Pc as browser, Wc as callInternal, Hc as callTo, sl as captureScreen, cl as captureVmoji, au as changeAudioEffect, Dl as changeConversationOptions, ol as changeDevice, ml as changeParticipantState, pl as changePriorities, iu as changeVideoEffect, Al as chatHistory, Ol as chatMessage, kl as chatMessageInternal, Fl as createJoinLink, jl as customData, Ml as customDataInternal, Ql as debug, tu as debugLogs, $l as debugMessage, eu as debugMessageWithContext, Zc as declineCall, _u as enableFeatureForRoles, Tl as enableVideoSuspend, El as enableVideoSuspendSuggest, gu as feedback, zl as forceRelayPolicy, Au as getActiveCallId, Ll as getAnonymTokenByLink, uu as getAudienceModeHands, qc as getInbounds, mu as getParticipantListChunk, hu as getParticipants, Ul as getStreamInfo, ju as getSyncedTime, lu as getWaitingHall, vl as grantRoles, yl as grantRolesInternal, tl as hangup, Vc as init, Qc as joinCall, el as joinCallByLink, $c as joinCallInternal, bl as muteParticipant, xl as muteParticipantInternal, Sl as pinParticipant, Cl as pinParticipantInternal, Gc as processPush, Kc as processPushInternal, du as promoteParticipant, Hl as publishStream, hl as putHandsDown, Cu as removeHistoryRecords, Il as removeJoinLink, Kl as removeMovie, il as removeParticipant, al as removeParticipantInternal, Xl as removeRooms, Eu as requestAsr, _l as requestDisplayLayout, fu as requestPromotion, Rc as setAudioEffects, ou as setAudioStream, fl as setLocalResolution, Ic as setLogger, wl as setMediaModifiers, Zl as setStatisticsInterval, zc as setVad, Lc as setVideoEffects, ll as setVideoStream, Bc as setVmoji, cu as setVmojiFill, su as setVmojiSvg, Rl as setVolume, wu as startAsr, Pl as startAudienceConversation, Nl as startConversation, Jc as startStats, Bl as startStream, Du as startUrlSharing, Tu as stopAsr, Vl as stopStream, Ou as stopUrlSharing, ku as switchCall, Yl as switchRoom, dl as toggleLocalAudio, ul as toggleLocalVideo, gl as updateDisplayLayout, Gl as updateMovie, ql as updateRooms, ru as uploadDebugLogs, Fc as utils, Mu as version };
|
|
@@ -77,6 +77,7 @@ export default class Conversation extends EventEmitter {
|
|
|
77
77
|
private _sequenceNumberByStreamDescription;
|
|
78
78
|
private _cooldownTimestampByStreamDescription;
|
|
79
79
|
private _cooldownQueueCleanupTimer;
|
|
80
|
+
private _invalidTokenRetried;
|
|
80
81
|
private readonly _statFirstMediaReceived;
|
|
81
82
|
constructor(api: BaseApi, externalLogger: BaseLogger | null);
|
|
82
83
|
static current(): Conversation | null;
|
|
@@ -154,6 +155,8 @@ export default class Conversation extends EventEmitter {
|
|
|
154
155
|
private _updateConversation;
|
|
155
156
|
private _createMediaSource;
|
|
156
157
|
private _connectSignaling;
|
|
158
|
+
private _isInvalidTokenError;
|
|
159
|
+
private _refreshSignalingEndpoint;
|
|
157
160
|
private _processConnection;
|
|
158
161
|
private _onConversationParticipantListChunk;
|
|
159
162
|
private _createParticipantListChunk;
|
package/enums/Stat.d.ts
CHANGED
package/package.json
CHANGED
package/static/External.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IAsrData } from '../types/Asr';
|
|
2
|
+
import { ClientStatsEvent } from '../types/ClientStatsEvent';
|
|
2
3
|
import { ConversationData } from '../types/Conversation';
|
|
3
4
|
import HangupReason from '../classes/HangupReason';
|
|
4
5
|
import { MediaTrackKind } from '../classes/MediaSource';
|
|
@@ -513,6 +514,12 @@ declare namespace External {
|
|
|
513
514
|
* @param memory Статистика памяти
|
|
514
515
|
*/
|
|
515
516
|
function onStatistics(connection: StatResult, memory: Record<string, number>): void;
|
|
517
|
+
/**
|
|
518
|
+
* Событие статистики SDK
|
|
519
|
+
*
|
|
520
|
+
* @param data Данные события с `vcid` и `ts`
|
|
521
|
+
*/
|
|
522
|
+
function onClientStats(data: ClientStatsEvent): void;
|
|
516
523
|
/**
|
|
517
524
|
* Ошибка воспроизведения звука
|
|
518
525
|
*/
|
package/static/Params.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { VideoEffects } from '@vkontakte/calls-video-effects';
|
|
|
2
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
|
+
import { ClientStatsEvent } from '../types/ClientStatsEvent';
|
|
5
6
|
import { ConversationData } from '../types/Conversation';
|
|
6
7
|
import HangupReason from '../classes/HangupReason';
|
|
7
8
|
import { MediaTrackKind } from '../classes/MediaSource';
|
|
@@ -804,6 +805,12 @@ export type ParamsObject = {
|
|
|
804
805
|
* Статистика звонка
|
|
805
806
|
*/
|
|
806
807
|
onStatistics?: (stats: {}) => void;
|
|
808
|
+
/**
|
|
809
|
+
* Событие статистики SDK: те же данные, что уходят в статистику звонков, плюс `vcid` и `ts`
|
|
810
|
+
*
|
|
811
|
+
* @param data Данные события
|
|
812
|
+
*/
|
|
813
|
+
onClientStats?: (data: ClientStatsEvent) => void;
|
|
807
814
|
/**
|
|
808
815
|
* Ошибка воспроизведения звука
|
|
809
816
|
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Событие статистики SDK, которое получает `onClientStats`
|
|
3
|
+
*/
|
|
4
|
+
export type ClientStatsEvent = Record<string, string | number | boolean | null> & {
|
|
5
|
+
/** Имя события из `Stat`. У периодической статистики звонка его нет */
|
|
6
|
+
name?: string;
|
|
7
|
+
/** ID звонка, `null` — пока он неизвестен */
|
|
8
|
+
vcid: string | null;
|
|
9
|
+
/** Время события, мс */
|
|
10
|
+
ts: number;
|
|
11
|
+
};
|
package/types/Params.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type IApiEnv = 'AUTO' | 'PROD' | 'CALLS' | 'PROD_OK' | 'TEST' | 'VIDEOTEST' | 'CALLSTEST' | 'CALLS_BETA' | 'CALLS_BENDER' | 'CALLS_MAMES' | 'CALLS_MARS' | string;
|
|
1
|
+
export type IApiEnv = 'AUTO' | 'PROD' | 'CALLS' | 'PROD_OK' | 'TEST' | 'VIDEOTEST' | 'CALLSTEST' | 'CALLS_BETA' | 'CALLS_BENDER' | 'CALLS_MAMES' | 'CALLS_MARS' | 'CALLS_CHELSEA' | 'CALLS_KERZH' | string;
|
|
2
2
|
export type IAPIBaseUrl = string | null;
|