@vkontakte/calls-sdk 2.8.11-beta.8 → 2.8.11-beta.9
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/abstract/BaseApi.d.ts +1 -1
- package/calls-sdk.cjs.js +7 -7
- package/calls-sdk.esm.js +68 -63
- package/classes/Conversation.d.ts +2 -0
- package/default/Api.d.ts +1 -6
- package/default/Signaling.d.ts +2 -0
- package/package.json +1 -1
- package/static/Params.d.ts +10 -0
- package/types/ExternalId.d.ts +1 -1
package/calls-sdk.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @vkontakte/calls-sdk v2.8.11-beta.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/calls-sdk v2.8.11-beta.9
|
|
3
|
+
* Tue, 21 Jul 2026 13:05:53 GMT
|
|
4
4
|
* https://calls-sdk.cdn-vk.ru/doc/latest/index.html
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -2159,7 +2159,7 @@ var hn = mn.getInstance(), j = class e {
|
|
|
2159
2159
|
return 1.1;
|
|
2160
2160
|
}
|
|
2161
2161
|
static get sdkVersion() {
|
|
2162
|
-
return "2.8.11-beta.
|
|
2162
|
+
return "2.8.11-beta.9";
|
|
2163
2163
|
}
|
|
2164
2164
|
static get debug() {
|
|
2165
2165
|
return e._params.debug;
|
|
@@ -2525,6 +2525,9 @@ var hn = mn.getInstance(), j = class e {
|
|
|
2525
2525
|
static get webtransportFF() {
|
|
2526
2526
|
return e._params.webtransportFF;
|
|
2527
2527
|
}
|
|
2528
|
+
static get waitForRecordResponse() {
|
|
2529
|
+
return e._params.waitForRecordResponse;
|
|
2530
|
+
}
|
|
2528
2531
|
static get transparentAudio() {
|
|
2529
2532
|
return e._params.transparentAudio;
|
|
2530
2533
|
}
|
|
@@ -2566,6 +2569,7 @@ var hn = mn.getInstance(), j = class e {
|
|
|
2566
2569
|
simulcast: e._params.simulcast,
|
|
2567
2570
|
webtransport: e._params.webtransport,
|
|
2568
2571
|
webtransportFF: e._params.webtransportFF,
|
|
2572
|
+
waitForRecordResponse: e._params.waitForRecordResponse,
|
|
2569
2573
|
transparentAudio: e._params.transparentAudio,
|
|
2570
2574
|
enableSessionStateUpdates: e._params.enableSessionStateUpdates
|
|
2571
2575
|
};
|
|
@@ -2677,6 +2681,7 @@ h(j, "_params", {
|
|
|
2677
2681
|
simulcast: !1,
|
|
2678
2682
|
webtransport: !1,
|
|
2679
2683
|
webtransportFF: !1,
|
|
2684
|
+
waitForRecordResponse: !1,
|
|
2680
2685
|
transparentAudio: !1,
|
|
2681
2686
|
enableSessionStateUpdates: !1
|
|
2682
2687
|
});
|
|
@@ -7191,7 +7196,7 @@ var ua = la, da = {
|
|
|
7191
7196
|
type: "notification",
|
|
7192
7197
|
notification: W.TOPOLOGY_CHANGED,
|
|
7193
7198
|
topology: e.conversation.topology
|
|
7194
|
-
})), this.lastStamp && this._handleCachedMessages(), e.recoverMessages?.forEach((e) => {
|
|
7199
|
+
}), this._resolvePendingRecordCommands(e)), this.lastStamp && this._handleCachedMessages(), e.recoverMessages?.forEach((e) => {
|
|
7195
7200
|
e.notification === W.ACCEPTED_CALL && e.peerId.id === this.peerId && e.peerId.type === "WEB_TRANSPORT" || this._handleMessage(e);
|
|
7196
7201
|
}), this._handleCommandsQueue(this.websocketCommandsQueue)) : !this.connected || !this.listenersReady ? this.incomingCache.push(e) : this._triggerEvent(pr.NOTIFICATION, e);
|
|
7197
7202
|
break;
|
|
@@ -7278,9 +7283,28 @@ var ua = la, da = {
|
|
|
7278
7283
|
}
|
|
7279
7284
|
_closeSocket(e = null) {
|
|
7280
7285
|
this.transport.readyState !== null && (this.transport.close(), this._stopWaitConnectionMessage(), Object.values(this.responseHandlers).forEach((t) => {
|
|
7281
|
-
window.clearTimeout(t.responseTimer), e
|
|
7286
|
+
window.clearTimeout(t.responseTimer), e ? t.reject(/* @__PURE__ */ Error(`Connection closed. Command ${t.name}`), !0) : j.waitForRecordResponse && this._isRecordCommand(t.name) && t.reject(/* @__PURE__ */ Error("Connection closed"), !0);
|
|
7282
7287
|
}), this.websocketCommandsQueue = [], this.responseHandlers = {}, this.lastStamp = 0, e && this._throwError(e));
|
|
7283
7288
|
}
|
|
7289
|
+
_isRecordCommand(e) {
|
|
7290
|
+
return e === z.RECORD_START || e === z.RECORD_STOP;
|
|
7291
|
+
}
|
|
7292
|
+
_resolvePendingRecordCommands(e) {
|
|
7293
|
+
if (!j.waitForRecordResponse) return;
|
|
7294
|
+
let t = Object.values(this.responseHandlers).filter((e) => this._isRecordCommand(e.name));
|
|
7295
|
+
if (t.length === 0) return;
|
|
7296
|
+
let n = /* @__PURE__ */ new Map();
|
|
7297
|
+
n.set(null, !!e.conversation?.recordInfo);
|
|
7298
|
+
for (let t of e.rooms?.rooms ?? []) t.id !== void 0 && n.set(t.id, !!t.recordInfo);
|
|
7299
|
+
for (let e of t) {
|
|
7300
|
+
let t = e.params.roomId ?? null, r = n.get(t) ?? !1, i = e.name === z.RECORD_START;
|
|
7301
|
+
window.clearTimeout(e.responseTimer), delete this.responseHandlers[e.sequence], this._debug.debug(`[signaling] resolve pending record command [${e.sequence}] via reconnect state`), i === r ? e.resolve({
|
|
7302
|
+
type: "response",
|
|
7303
|
+
sequence: e.sequence,
|
|
7304
|
+
response: e.name
|
|
7305
|
+
}) : e.reject(/* @__PURE__ */ Error("Recording state mismatch"), !0);
|
|
7306
|
+
}
|
|
7307
|
+
}
|
|
7284
7308
|
_handleCommandResponse(t, n) {
|
|
7285
7309
|
if (!Object.hasOwn(this.responseHandlers, n.sequence)) return;
|
|
7286
7310
|
let r = this.responseHandlers[n.sequence];
|
|
@@ -7511,9 +7535,10 @@ var Va = Ba, Ha = /* @__PURE__ */ function(e) {
|
|
|
7511
7535
|
};
|
|
7512
7536
|
}
|
|
7513
7537
|
e.fromId = n;
|
|
7514
|
-
function r(e, t = !0) {
|
|
7515
|
-
let
|
|
7516
|
-
if (
|
|
7538
|
+
function r(e, t = !0, n = !1) {
|
|
7539
|
+
let r = t ? e.decorativeExternalUserId : e.externalId, a = e.deviceIdx ?? 0;
|
|
7540
|
+
if (r) return i(r, a);
|
|
7541
|
+
if (n && t && e.externalId) return i(e.externalId, a);
|
|
7517
7542
|
}
|
|
7518
7543
|
e.fromSignalingParticipant = r;
|
|
7519
7544
|
function i(e, t = 0) {
|
|
@@ -9055,9 +9080,8 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
9055
9080
|
throw this._close(new D(E.NETWORK_ERROR), e), e;
|
|
9056
9081
|
}
|
|
9057
9082
|
}
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
t.conversationParams?.serverTime && (this._serverTimeOffset = t.conversationParams.serverTime - Date.now()), i.forEach((e) => {
|
|
9083
|
+
_cacheParticipantExternalIds(e) {
|
|
9084
|
+
e.forEach((e) => {
|
|
9061
9085
|
let t = A.composeId(e), n = Z.fromSignalingParticipant(e, !1);
|
|
9062
9086
|
if (n) {
|
|
9063
9087
|
this._api.cacheExternalId(t, n);
|
|
@@ -9065,6 +9089,10 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
9065
9089
|
r && i && (this._api.cacheExternalId(r, i), this._api.mapDecorativeId(e.decorativeUserId, e.id));
|
|
9066
9090
|
}
|
|
9067
9091
|
});
|
|
9092
|
+
}
|
|
9093
|
+
async _setConversation(e, t, n, r = k.USER) {
|
|
9094
|
+
let { participants: i } = t.conversation;
|
|
9095
|
+
t.conversationParams?.serverTime && (this._serverTimeOffset = t.conversationParams.serverTime - Date.now()), this._cacheParticipantExternalIds(i);
|
|
9068
9096
|
let a = this._api.getUserId(), o = this._extractLocalParticipantFromConnection(t), s = e.device_idx || 0;
|
|
9069
9097
|
if (!a) {
|
|
9070
9098
|
if (!o) throw new D(E.UNKNOWN_ERROR);
|
|
@@ -9107,7 +9135,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
9107
9135
|
}
|
|
9108
9136
|
_updateConversation(e) {
|
|
9109
9137
|
if (!this._conversation) throw new D(E.UNKNOWN_ERROR);
|
|
9110
|
-
this._conversation.acceptTime = e.conversation.acceptTime, this._conversation.features = e.conversation.features || [], this._conversation.featuresPerRole = e.conversation.featuresPerRole, this._conversation.participantsLimit = e.conversation.participantsLimit || 30, this._conversation.topology = e.conversation.topology || K.DIRECT, this._conversation.concurrent = e.isConcurrent || !1, this._conversation.chatId = e.conversation.multichatId, this._conversation.mediaModifiers = e.mediaModifiers, this._conversation.waitingHall = !1, this._conversation.waitForAdmin = !1, this._conversation.restricted = !1;
|
|
9138
|
+
this._conversation.acceptTime = e.conversation.acceptTime, this._conversation.features = e.conversation.features || [], this._conversation.featuresPerRole = e.conversation.featuresPerRole, this._conversation.participantsLimit = e.conversation.participantsLimit || 30, this._conversation.topology = e.conversation.topology || K.DIRECT, this._conversation.concurrent = e.isConcurrent || !1, this._conversation.chatId = e.conversation.multichatId, this._conversation.mediaModifiers = e.mediaModifiers, this._conversation.waitingHall = !1, this._conversation.waitForAdmin = !1, this._conversation.restricted = !1, this._cacheParticipantExternalIds(e.conversation.participants ?? []);
|
|
9111
9139
|
}
|
|
9112
9140
|
_createMediaSource() {
|
|
9113
9141
|
let e = new Yt(this._debug, this._stats.logger);
|
|
@@ -9167,7 +9195,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
9167
9195
|
let i = A.composeDecorativeId(n);
|
|
9168
9196
|
this._registerParticipant({
|
|
9169
9197
|
id: e,
|
|
9170
|
-
externalId: Z.fromSignalingParticipant(n),
|
|
9198
|
+
externalId: Z.fromSignalingParticipant(n, !0, !0),
|
|
9171
9199
|
mediaSettings: T(n.mediaSettings),
|
|
9172
9200
|
participantState: A.mapParticipantState(n),
|
|
9173
9201
|
state: n.state,
|
|
@@ -9248,6 +9276,9 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
9248
9276
|
return this._api.cacheExternalId(e, t), t;
|
|
9249
9277
|
}
|
|
9250
9278
|
}
|
|
9279
|
+
_getExternalIdsByOkIdsFromCache(e) {
|
|
9280
|
+
return e.map((e) => this._api.getCachedExternalIdByOkId(e) ?? Z.fromId(String(e)));
|
|
9281
|
+
}
|
|
9251
9282
|
async _registerParticipantAndSetMarkersIfChunkEnabled(e, t) {
|
|
9252
9283
|
if (j.useParticipantListChunk) {
|
|
9253
9284
|
let n = this._registerParticipantInCache(await this._getExistedParticipantByIdOrCreate(e));
|
|
@@ -9371,7 +9402,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
9371
9402
|
let n = A.composeDecorativeId(t);
|
|
9372
9403
|
this._registerParticipant({
|
|
9373
9404
|
id: e,
|
|
9374
|
-
externalId: Z.fromSignalingParticipant(t),
|
|
9405
|
+
externalId: Z.fromSignalingParticipant(t, !0, !0),
|
|
9375
9406
|
mediaSettings: T(t.mediaSettings),
|
|
9376
9407
|
state: t.state,
|
|
9377
9408
|
roles: t.roles || [],
|
|
@@ -9651,11 +9682,8 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
9651
9682
|
I.onChatRoomUpdated(e, t, l, [], [], this.id);
|
|
9652
9683
|
return;
|
|
9653
9684
|
}
|
|
9654
|
-
|
|
9655
|
-
|
|
9656
|
-
l.push(...e);
|
|
9657
|
-
}
|
|
9658
|
-
let u = await this._api.getExternalIdsByOkIds(o), d = await this._api.getExternalIdsByOkIds(s);
|
|
9685
|
+
c.length && l.push(...this._getExternalIdsByOkIdsFromCache(c));
|
|
9686
|
+
let u = this._getExternalIdsByOkIdsFromCache(o), d = this._getExternalIdsByOkIdsFromCache(s);
|
|
9659
9687
|
I.onChatRoomUpdated(e, t, l, u, d, this.id);
|
|
9660
9688
|
}
|
|
9661
9689
|
async _onSharedMovieUpdate(e) {
|
|
@@ -9899,7 +9927,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
9899
9927
|
let t = Z.fromSignaling(e.externalId);
|
|
9900
9928
|
n.push(e.id.addedTs), r.push(t), this._api.cacheExternalId(e.id.id, t);
|
|
9901
9929
|
} else i.push(A.decomposeId(e.id.id).id);
|
|
9902
|
-
}), i.length && !r.length && (r =
|
|
9930
|
+
}), i.length && !r.length && (r = this._getExternalIdsByOkIdsFromCache(i), n = r.map((e) => {
|
|
9903
9931
|
let n = this._api.getCachedOkIdByExternalId(e);
|
|
9904
9932
|
return (n ? t.get(n) : void 0) || Date.now();
|
|
9905
9933
|
}));
|
|
@@ -10018,13 +10046,14 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
10018
10046
|
roomId: a,
|
|
10019
10047
|
streamMovie: !e
|
|
10020
10048
|
}, s = await this._signaling.startStream(o);
|
|
10021
|
-
if (s.error) return Promise.reject(s.message);
|
|
10049
|
+
if (s.error) return Promise.reject(Error(s.message));
|
|
10022
10050
|
}
|
|
10023
10051
|
async stopStream(e = null, t) {
|
|
10024
|
-
|
|
10052
|
+
let n = await this._signaling.stopStream({
|
|
10025
10053
|
roomId: e,
|
|
10026
10054
|
...t && { remove: t }
|
|
10027
|
-
})
|
|
10055
|
+
});
|
|
10056
|
+
if (n.error) return Promise.reject(Error(n.message));
|
|
10028
10057
|
}
|
|
10029
10058
|
async publishStream(e = null) {
|
|
10030
10059
|
if ((await this._signaling.publishStream({ roomId: e })).error) return Promise.reject();
|
|
@@ -10070,7 +10099,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
10070
10099
|
let t = A.composeId(e);
|
|
10071
10100
|
return this._createParticipant({
|
|
10072
10101
|
id: t,
|
|
10073
|
-
externalId: Z.fromSignalingParticipant(e),
|
|
10102
|
+
externalId: Z.fromSignalingParticipant(e, !0, !0),
|
|
10074
10103
|
mediaSettings: T(e.mediaSettings),
|
|
10075
10104
|
participantState: A.mapParticipantState(e),
|
|
10076
10105
|
state: e.state,
|
|
@@ -10312,7 +10341,10 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
10312
10341
|
this._warnParticipantNotInConversation(t);
|
|
10313
10342
|
return;
|
|
10314
10343
|
}
|
|
10315
|
-
this._transport && this._transport.close(t), n.state = e.reason === E.REJECTED ? X.REJECTED : X.HUNGUP, this._state !== "CLOSE"
|
|
10344
|
+
if (this._transport && this._transport.close(t), n.state = e.reason === E.REJECTED ? X.REJECTED : X.HUNGUP, this._state !== "CLOSE") {
|
|
10345
|
+
let t = e.reason === E.OBSOLETE_CLIENT ? E.OBSOLETE_CLIENT : E.HUNGUP;
|
|
10346
|
+
this._removeParticipant(n, t);
|
|
10347
|
+
}
|
|
10316
10348
|
}
|
|
10317
10349
|
async _onSessionState(e) {
|
|
10318
10350
|
if (!j.enableSessionStateUpdates) return;
|
|
@@ -10361,7 +10393,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
10361
10393
|
let { participant: r } = e, i = r.decorativeUserId;
|
|
10362
10394
|
this._registerParticipant({
|
|
10363
10395
|
id: t,
|
|
10364
|
-
externalId: Z.fromSignalingParticipant(r),
|
|
10396
|
+
externalId: Z.fromSignalingParticipant(r, !0, !0),
|
|
10365
10397
|
mediaSettings: T(r.mediaSettings),
|
|
10366
10398
|
state: r.state,
|
|
10367
10399
|
participantState: A.mapParticipantState(r),
|
|
@@ -10388,7 +10420,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
10388
10420
|
let { participant: r } = e, i = r.decorativeUserId;
|
|
10389
10421
|
this._registerParticipant({
|
|
10390
10422
|
id: t,
|
|
10391
|
-
externalId: Z.fromSignalingParticipant(r),
|
|
10423
|
+
externalId: Z.fromSignalingParticipant(r, !0, !0),
|
|
10392
10424
|
mediaSettings: T(r.mediaSettings),
|
|
10393
10425
|
state: r.state,
|
|
10394
10426
|
participantState: A.mapParticipantState(r),
|
|
@@ -10955,7 +10987,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
10955
10987
|
};
|
|
10956
10988
|
}
|
|
10957
10989
|
async _onRoomParticipantsUpdated(e) {
|
|
10958
|
-
let t = this._transport?.getState(), n = e.roomId ?? null, r = e.addedParticipantIds?.map((e) => A.decomposeId(e).id) || [], i =
|
|
10990
|
+
let t = this._transport?.getState(), n = e.roomId ?? null, r = e.addedParticipantIds?.map((e) => A.decomposeId(e).id) || [], i = this._getExternalIdsByOkIdsFromCache(r), a = e.addedParticipants;
|
|
10959
10991
|
if (i.length && a?.length !== i.length && !this._isCalledState()) {
|
|
10960
10992
|
let e = this._convertExternalIdsToServerExternalIds(i);
|
|
10961
10993
|
a = (await this._signaling.getParticipants(e)).participants;
|
|
@@ -10964,7 +10996,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
10964
10996
|
let r = A.composeId(e);
|
|
10965
10997
|
return this._createParticipant({
|
|
10966
10998
|
id: r,
|
|
10967
|
-
externalId: Z.fromSignalingParticipant(e),
|
|
10999
|
+
externalId: Z.fromSignalingParticipant(e, !0, !0),
|
|
10968
11000
|
mediaSettings: T(e.mediaSettings),
|
|
10969
11001
|
participantState: A.mapParticipantState(e),
|
|
10970
11002
|
state: e.state,
|
|
@@ -11226,6 +11258,9 @@ var Go = class {
|
|
|
11226
11258
|
getCachedRawOkIdByExternalId(e) {
|
|
11227
11259
|
return null;
|
|
11228
11260
|
}
|
|
11261
|
+
getCachedExternalIdByOkId(e) {
|
|
11262
|
+
return null;
|
|
11263
|
+
}
|
|
11229
11264
|
cacheExternalId(e, t) {}
|
|
11230
11265
|
mapDecorativeId(e, t) {}
|
|
11231
11266
|
unmapDecorativeId(e) {}
|
|
@@ -11357,7 +11392,7 @@ var Go = class {
|
|
|
11357
11392
|
}
|
|
11358
11393
|
async userId(e) {
|
|
11359
11394
|
let t = A.extractOkId(e);
|
|
11360
|
-
return v.isEmpty() ? Z.fromId(String(t)) :
|
|
11395
|
+
return v.isEmpty() ? Z.fromId(String(t)) : this._idCache.getExternalId(t) || Z.fromId(String(t));
|
|
11361
11396
|
}
|
|
11362
11397
|
async authorize() {
|
|
11363
11398
|
if (this._ensureUuid(), !j.apiKey) throw new D(b.API, { message: "Required argument apiAppKey not passed" });
|
|
@@ -11516,22 +11551,15 @@ var Go = class {
|
|
|
11516
11551
|
};
|
|
11517
11552
|
return n?.length && (i.observedIds = n.join(",")), j.anonymToken && (i.anonymToken = j.anonymToken), r && (i.payload = r), this._call("vchat.joinConversationByLink", i);
|
|
11518
11553
|
}
|
|
11519
|
-
async getExternalIdsByOkIds(e) {
|
|
11520
|
-
let t = [], n = [];
|
|
11521
|
-
for (let r of e) {
|
|
11522
|
-
let e = this._idCache.getExternalId(r);
|
|
11523
|
-
e ? t.push(e) : n.push(r);
|
|
11524
|
-
}
|
|
11525
|
-
if (!n.length) return t;
|
|
11526
|
-
let r = await this._getExternalIdsByOkIds(n);
|
|
11527
|
-
return Array.from(r.values());
|
|
11528
|
-
}
|
|
11529
11554
|
getCachedOkIdByExternalId(e) {
|
|
11530
11555
|
return this._idCache.getParticipantIdByExternalId(e);
|
|
11531
11556
|
}
|
|
11532
11557
|
getCachedRawOkIdByExternalId(e) {
|
|
11533
11558
|
return this._idCache.getOkId(e);
|
|
11534
11559
|
}
|
|
11560
|
+
getCachedExternalIdByOkId(e) {
|
|
11561
|
+
return this._idCache.getExternalId(e);
|
|
11562
|
+
}
|
|
11535
11563
|
cacheExternalId(e, t) {
|
|
11536
11564
|
this._idCache.cache(e, t);
|
|
11537
11565
|
}
|
|
@@ -11570,29 +11598,6 @@ var Go = class {
|
|
|
11570
11598
|
cleanup() {
|
|
11571
11599
|
this._idCache.clear();
|
|
11572
11600
|
}
|
|
11573
|
-
async _getExternalIdsByOkIds(e) {
|
|
11574
|
-
let t = /* @__PURE__ */ new Map();
|
|
11575
|
-
e = e.map((e) => this.getDecorativeIdByInitialId(e) ?? e);
|
|
11576
|
-
try {
|
|
11577
|
-
let n = await this._call("vchat.getExternalIdsByOkIds", { uids: e.join(",") }), r = (e, n) => {
|
|
11578
|
-
for (let [r, i] of Object.entries(e)) {
|
|
11579
|
-
let e = Number(r), a = Z.fromId(i, n);
|
|
11580
|
-
t.set(e, a), this.cacheExternalId(e, a);
|
|
11581
|
-
}
|
|
11582
|
-
};
|
|
11583
|
-
n.external_ids && r(n.external_ids, Ha.USER), n.anonym_ids && r(n.anonym_ids, Ha.ANONYM);
|
|
11584
|
-
for (let n of e) {
|
|
11585
|
-
let e = Number(n);
|
|
11586
|
-
if (!t.has(e)) {
|
|
11587
|
-
let n = Z.fromId(String(e));
|
|
11588
|
-
t.set(e, n), this.cacheExternalId(e, n);
|
|
11589
|
-
}
|
|
11590
|
-
}
|
|
11591
|
-
return t;
|
|
11592
|
-
} catch {
|
|
11593
|
-
return t;
|
|
11594
|
-
}
|
|
11595
|
-
}
|
|
11596
11601
|
async getServerTime() {
|
|
11597
11602
|
return (await this._call("system.getInfo")).serverTime;
|
|
11598
11603
|
}
|
|
@@ -134,6 +134,7 @@ export default class Conversation extends EventEmitter {
|
|
|
134
134
|
private _prepareConversation;
|
|
135
135
|
private _createParticipant;
|
|
136
136
|
private _getParticipantId;
|
|
137
|
+
private _cacheParticipantExternalIds;
|
|
137
138
|
private _setConversation;
|
|
138
139
|
private _updateConversation;
|
|
139
140
|
private _createMediaSource;
|
|
@@ -155,6 +156,7 @@ export default class Conversation extends EventEmitter {
|
|
|
155
156
|
private _registerParticipantInCache;
|
|
156
157
|
private _getExistedParticipantByIdOrCreate;
|
|
157
158
|
private _getExternalIdByParticipantId;
|
|
159
|
+
private _getExternalIdsByOkIdsFromCache;
|
|
158
160
|
private _registerParticipantAndSetMarkersIfChunkEnabled;
|
|
159
161
|
private _warnParticipantNotInConversation;
|
|
160
162
|
private _denormalizeMarkers;
|
package/default/Api.d.ts
CHANGED
|
@@ -45,13 +45,9 @@ export default class Api extends BaseApi {
|
|
|
45
45
|
}>;
|
|
46
46
|
getAnonymTokenByLink(joinLink: string, username?: string): Promise<string>;
|
|
47
47
|
joinConversationByLink(joinLink: string, isVideo?: boolean, observedIds?: ExternalUserId[], payload?: string): Promise<ConversationResponse>;
|
|
48
|
-
/**
|
|
49
|
-
* NB: Не сохраняет порядок возвращаемых ID
|
|
50
|
-
* @hidden
|
|
51
|
-
*/
|
|
52
|
-
getExternalIdsByOkIds(uids: OkUserId[]): Promise<ExternalParticipantId[]>;
|
|
53
48
|
getCachedOkIdByExternalId(externalId: ExternalId): ParticipantId | null;
|
|
54
49
|
getCachedRawOkIdByExternalId(externalId: ExternalId): OkUserId | null;
|
|
50
|
+
getCachedExternalIdByOkId(okId: OkUserId): ExternalParticipantId | null;
|
|
55
51
|
cacheExternalId(participantId: OkUserId | CompositeUserId | ParticipantId, externalId: ExternalParticipantId): void;
|
|
56
52
|
mapDecorativeId(decorativeId: OkUserId | CompositeUserId | ParticipantId, initialId: OkUserId | CompositeUserId | ParticipantId): void;
|
|
57
53
|
unmapDecorativeId(initialId: OkUserId | CompositeUserId | ParticipantId): void;
|
|
@@ -63,7 +59,6 @@ export default class Api extends BaseApi {
|
|
|
63
59
|
hangupConversation(conversationId: string, reason?: HangupType): void;
|
|
64
60
|
removeHistoryRecords(recordIds: number[]): Promise<void>;
|
|
65
61
|
cleanup(): void;
|
|
66
|
-
private _getExternalIdsByOkIds;
|
|
67
62
|
getServerTime(): Promise<number>;
|
|
68
63
|
getInbounds(): Promise<PushData[]>;
|
|
69
64
|
}
|
package/default/Signaling.d.ts
CHANGED
|
@@ -174,6 +174,8 @@ export default class Signaling extends BaseSignaling {
|
|
|
174
174
|
private _serializeErrorEvent;
|
|
175
175
|
private _onClose;
|
|
176
176
|
private _closeSocket;
|
|
177
|
+
private _isRecordCommand;
|
|
178
|
+
private _resolvePendingRecordCommands;
|
|
177
179
|
private _handleCommandResponse;
|
|
178
180
|
private _handleCommandsQueue;
|
|
179
181
|
private _startResponseTimer;
|
package/package.json
CHANGED
package/static/Params.d.ts
CHANGED
|
@@ -487,6 +487,14 @@ export type ParamsObject = {
|
|
|
487
487
|
* _По умолчанию: `false`_
|
|
488
488
|
*/
|
|
489
489
|
webtransportFF: boolean;
|
|
490
|
+
/**
|
|
491
|
+
* Ждать подтверждения от бэкенда для команд startStream/stopStream.
|
|
492
|
+
* При включении: reject без соединения, resolve/reject по ответу бэкенда,
|
|
493
|
+
* а при реконнекте — по стейту записи из Connection-сообщения.
|
|
494
|
+
*
|
|
495
|
+
* _По умолчанию: `false`_
|
|
496
|
+
*/
|
|
497
|
+
waitForRecordResponse: boolean;
|
|
490
498
|
/**
|
|
491
499
|
* Включить поддержку прозрачного аудио
|
|
492
500
|
*
|
|
@@ -1018,6 +1026,7 @@ export default abstract class Params {
|
|
|
1018
1026
|
static get simulcast(): boolean;
|
|
1019
1027
|
static get webtransport(): boolean;
|
|
1020
1028
|
static get webtransportFF(): boolean;
|
|
1029
|
+
static get waitForRecordResponse(): boolean;
|
|
1021
1030
|
static get transparentAudio(): boolean;
|
|
1022
1031
|
static get enableSessionStateUpdates(): boolean;
|
|
1023
1032
|
static toJSON(): {
|
|
@@ -1054,6 +1063,7 @@ export default abstract class Params {
|
|
|
1054
1063
|
simulcast: boolean;
|
|
1055
1064
|
webtransport: boolean;
|
|
1056
1065
|
webtransportFF: boolean;
|
|
1066
|
+
waitForRecordResponse: boolean;
|
|
1057
1067
|
transparentAudio: boolean;
|
|
1058
1068
|
enableSessionStateUpdates: boolean;
|
|
1059
1069
|
};
|
package/types/ExternalId.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type ExternalUserId = string;
|
|
|
18
18
|
export declare namespace ExternalIdUtils {
|
|
19
19
|
function fromIds(ids: ExternalUserId[] | ExternalId[]): ExternalId[];
|
|
20
20
|
function fromId(id: ExternalUserId, type?: ExternalIdType, deviceIdx?: number): ExternalParticipantId;
|
|
21
|
-
function fromSignalingParticipant(participant: SignalingMessage.Participant, useDecorative?: boolean): ExternalParticipantId | undefined;
|
|
21
|
+
function fromSignalingParticipant(participant: SignalingMessage.Participant, useDecorative?: boolean, fallbackToNonDecorative?: boolean): ExternalParticipantId | undefined;
|
|
22
22
|
function fromSignaling(signalingId: SignalingMessage.ExternalId, deviceIdx?: number): ExternalParticipantId;
|
|
23
23
|
function toSignaling(externalId: ExternalId): string;
|
|
24
24
|
function toString(externalId: ExternalId): ExternalIdString;
|