@vkontakte/calls-sdk 2.8.12-beta.8 → 2.8.12-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/calls-sdk.cjs.js +4 -4
- package/calls-sdk.esm.js +87 -82
- package/classes/CallRegistry.d.ts +1 -1
- package/classes/{Conversation.d.ts → conversation/Conversation.d.ts} +29 -30
- package/classes/conversation/Conversation.testUtils.d.ts +148 -0
- package/classes/{ConversationResponseValidator.d.ts → conversation/ConversationResponseValidator.d.ts} +1 -1
- package/classes/{DisplayLayoutRequester.d.ts → conversation/DisplayLayoutRequester.d.ts} +4 -4
- package/classes/conversation/index.d.ts +1 -0
- package/default/Signaling.d.ts +1 -0
- package/default/SignalingTransport.d.ts +1 -1
- package/package.json +1 -1
package/calls-sdk.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @vkontakte/calls-sdk v2.8.12-beta.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/calls-sdk v2.8.12-beta.9
|
|
3
|
+
* Mon, 17 Aug 2026 12:15:07 GMT
|
|
4
4
|
* https://calls-sdk.cdn-vk.ru/doc/latest/index.html
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -2183,7 +2183,7 @@ var mn = pn.getInstance(), N = class e {
|
|
|
2183
2183
|
return 1.1;
|
|
2184
2184
|
}
|
|
2185
2185
|
static get sdkVersion() {
|
|
2186
|
-
return "2.8.12-beta.
|
|
2186
|
+
return "2.8.12-beta.9";
|
|
2187
2187
|
}
|
|
2188
2188
|
static get debug() {
|
|
2189
2189
|
return e._params.debug;
|
|
@@ -6841,8 +6841,8 @@ var pa = fa, ma = {
|
|
|
6841
6841
|
close(e) {
|
|
6842
6842
|
this.manualClose = !0, this._disconnect(e), window.clearTimeout(this.reconnectTimer), this.reconnectTimer = 0, this.lastStamp = 0;
|
|
6843
6843
|
}
|
|
6844
|
-
send(e) {
|
|
6845
|
-
this.socket?.send(e);
|
|
6844
|
+
async send(e) {
|
|
6845
|
+
await this.socket?.send(e);
|
|
6846
6846
|
}
|
|
6847
6847
|
_connect() {
|
|
6848
6848
|
if (this._canUseWebTransport()) {
|
|
@@ -7028,7 +7028,7 @@ var Ma = new Set([
|
|
|
7028
7028
|
return this.sequence;
|
|
7029
7029
|
}
|
|
7030
7030
|
hangup(e) {
|
|
7031
|
-
return this._send(V.HANGUP, { reason: e });
|
|
7031
|
+
return this._send(V.HANGUP, { reason: e }, !1);
|
|
7032
7032
|
}
|
|
7033
7033
|
async sendCandidate(e, t) {
|
|
7034
7034
|
return this._send(V.TRANSMIT_DATA, {
|
|
@@ -7325,7 +7325,7 @@ var Ma = new Set([
|
|
|
7325
7325
|
}
|
|
7326
7326
|
_onMessage(e) {
|
|
7327
7327
|
if (e.data === "ping") {
|
|
7328
|
-
this._statPings?.mark(this._getSocketType()), this._markTransportStat(mr.FAILED_PINGS), R.onSignalingMessage(e.data), this.transport.readyState === WebSocket.OPEN && this.transport.send("pong");
|
|
7328
|
+
this._statPings?.mark(this._getSocketType()), this._markTransportStat(mr.FAILED_PINGS), R.onSignalingMessage(e.data), this.transport.readyState === WebSocket.OPEN && this.transport.send("pong").catch((e) => this._debug.warn("[signaling] unable to send pong", e));
|
|
7329
7329
|
return;
|
|
7330
7330
|
}
|
|
7331
7331
|
try {
|
|
@@ -7501,7 +7501,7 @@ var Ma = new Set([
|
|
|
7501
7501
|
t.reject(/* @__PURE__ */ Error(`Invalid data channel state: ${this.producerCommandDataChannel?.readyState}`));
|
|
7502
7502
|
return;
|
|
7503
7503
|
}
|
|
7504
|
-
this._startResponseTimer(t);
|
|
7504
|
+
t.needResponse ? this._startResponseTimer(t) : this._resolveCommandWithoutResponse(t);
|
|
7505
7505
|
let e = this._serializeBinary(t);
|
|
7506
7506
|
e !== null && this.producerCommandDataChannel.send(e);
|
|
7507
7507
|
} else {
|
|
@@ -7509,25 +7509,28 @@ var Ma = new Set([
|
|
|
7509
7509
|
t.reject(/* @__PURE__ */ Error("Invalid state or socket already closed"));
|
|
7510
7510
|
continue;
|
|
7511
7511
|
}
|
|
7512
|
-
this._startResponseTimer(t), this.transport.send(this._serializeJson(t))
|
|
7512
|
+
t.needResponse && this._startResponseTimer(t), this.transport.send(this._serializeJson(t)).then(() => {
|
|
7513
|
+
t.needResponse || this._resolveCommandWithoutResponse(t);
|
|
7514
|
+
}, (e) => {
|
|
7515
|
+
window.clearTimeout(t.responseTimer), delete this.responseHandlers[t.sequence], t.reject(e, !0);
|
|
7516
|
+
});
|
|
7513
7517
|
}
|
|
7514
7518
|
}
|
|
7515
7519
|
}
|
|
7516
7520
|
_startResponseTimer(t) {
|
|
7517
|
-
if (!t.needResponse) {
|
|
7518
|
-
t.resolve({
|
|
7519
|
-
type: "response",
|
|
7520
|
-
sequence: t.sequence,
|
|
7521
|
-
response: t.name
|
|
7522
|
-
});
|
|
7523
|
-
return;
|
|
7524
|
-
}
|
|
7525
7521
|
t.responseTimer = window.setTimeout(() => this._handleCommandResponse(!1, {
|
|
7526
7522
|
response: t.name,
|
|
7527
7523
|
sequence: t.sequence,
|
|
7528
7524
|
type: "timeout"
|
|
7529
7525
|
}), e.WAIT_RESPONSE_DELAY), this.responseHandlers[t.sequence] = t;
|
|
7530
7526
|
}
|
|
7527
|
+
_resolveCommandWithoutResponse(e) {
|
|
7528
|
+
e.resolve({
|
|
7529
|
+
type: "response",
|
|
7530
|
+
sequence: e.sequence,
|
|
7531
|
+
response: e.name
|
|
7532
|
+
});
|
|
7533
|
+
}
|
|
7531
7534
|
_serializeBinary(e) {
|
|
7532
7535
|
switch (e.name) {
|
|
7533
7536
|
case V.UPDATE_DISPLAY_LAYOUT: return this.producerCommandSerializationService.serializeUpdateDisplayLayout(e.sequence, e.params);
|
|
@@ -8011,7 +8014,7 @@ var ao = class {
|
|
|
8011
8014
|
}
|
|
8012
8015
|
};
|
|
8013
8016
|
//#endregion
|
|
8014
|
-
//#region src/classes/ConversationResponseValidator.ts
|
|
8017
|
+
//#region src/classes/conversation/ConversationResponseValidator.ts
|
|
8015
8018
|
function so(e, t) {
|
|
8016
8019
|
e || lo(t, "response-empty"), e.id || lo(t, "id-empty"), e.endpoint || lo(t, "endpoint-empty"), !co(e.stun_server) && !co(e.turn_server) && lo(t, "ice-servers-empty");
|
|
8017
8020
|
}
|
|
@@ -9133,7 +9136,7 @@ function $o(e, t, n, r) {
|
|
|
9133
9136
|
}
|
|
9134
9137
|
var es = 15, $ = class e extends b {
|
|
9135
9138
|
constructor(e, t) {
|
|
9136
|
-
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", Z.CALLED), h(this, "_participants", {}), h(this, "
|
|
9139
|
+
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", Z.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", Cr()), h(this, "_serverTimeOffset", 0), h(this, "_delayedHangup", !1), 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, "_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, "_changeMediaSettings", M.debounce(async (e) => {
|
|
9137
9140
|
if (this._signaling.ready) try {
|
|
9138
9141
|
await this._signaling.changeMediaSettings(e);
|
|
9139
9142
|
} catch (e) {
|
|
@@ -9146,7 +9149,7 @@ var es = 15, $ = class e extends b {
|
|
|
9146
9149
|
}, 100)), this._stats = new Yo(e, t, () => this._conversation?.id || null, () => this._transport?.getTopology() ?? this._conversation?.topology), this._api = e, this._signaling = new Na(this._debug, this._stats.logger, this._stats.statAggregator, this._stats.pings, this._stats.signalingCommands), this._signalingActor = new vo(this._onSignalingNotification.bind(this), this._debug), this._displayLayoutRequester = new mo({
|
|
9147
9150
|
api: this._api,
|
|
9148
9151
|
debug: this._debug,
|
|
9149
|
-
getParticipants: () => this.
|
|
9152
|
+
getParticipants: () => this._participants,
|
|
9150
9153
|
isMe: (e) => this._isMe(e),
|
|
9151
9154
|
updateDisplayLayout: (e) => this.updateDisplayLayout(e)
|
|
9152
9155
|
}), this._onUnload = () => {
|
|
@@ -9279,7 +9282,7 @@ var es = 15, $ = class e extends b {
|
|
|
9279
9282
|
let e = M.mapParticipantState(i);
|
|
9280
9283
|
Object.keys(e).length > 0 && R.onLocalParticipantState(e, !1, this.id);
|
|
9281
9284
|
}
|
|
9282
|
-
return t && this._openTransport(Object.values(this.
|
|
9285
|
+
return t && this._openTransport(Object.values(this._participants), !1), this._conversation;
|
|
9283
9286
|
} catch (e) {
|
|
9284
9287
|
throw ts = null, this._cleanupRegistry(), this._close(e, { errorText: "Unable to join conversation" }), e;
|
|
9285
9288
|
}
|
|
@@ -9343,13 +9346,13 @@ var es = 15, $ = class e extends b {
|
|
|
9343
9346
|
let e = this._mediaSource.mediaSettings;
|
|
9344
9347
|
this._logWithMediaSettings(C.ACCEPT_CONCURRENT, e), this._debug.debug("Concurrent call", { conversationId: this._conversation.id });
|
|
9345
9348
|
try {
|
|
9346
|
-
this._statFirstMediaReceived.markAcceptCall(this._transport.getTopology()), await this._signaling.acceptCall(this._mediaSource.mediaSettings), this._stats.lifecycle.markIncomingAccepted(!0), R.onCallAccepted(this.id), this._state = "ACTIVE", this._participantState = Z.ACCEPTED, this._changeFeatureSet(), this._openTransport(Object.values(this.
|
|
9349
|
+
this._statFirstMediaReceived.markAcceptCall(this._transport.getTopology()), await this._signaling.acceptCall(this._mediaSource.mediaSettings), this._stats.lifecycle.markIncomingAccepted(!0), R.onCallAccepted(this.id), this._state = "ACTIVE", this._participantState = Z.ACCEPTED, this._changeFeatureSet(), this._openTransport(Object.values(this._participants), !0);
|
|
9347
9350
|
} catch (e) {
|
|
9348
9351
|
this._close(e, { errorText: "Unable to accept concurrent call" });
|
|
9349
9352
|
}
|
|
9350
9353
|
}
|
|
9351
9354
|
_getMainRoomParticipants() {
|
|
9352
|
-
let e = this.
|
|
9355
|
+
let e = this._participants;
|
|
9353
9356
|
return M.mapSharedParticipants(Object.values(e).filter((e) => !e.isInRoom));
|
|
9354
9357
|
}
|
|
9355
9358
|
_decodeExternalConversationParams(e) {
|
|
@@ -9396,7 +9399,7 @@ var es = 15, $ = class e extends b {
|
|
|
9396
9399
|
}), this._registerParticipantLocalMuteState({ muteStates: this._conversation.muteStatesPersonal });
|
|
9397
9400
|
let i = await this._signaling.getRooms(this._isCallAdmin());
|
|
9398
9401
|
if (i.rooms?.rooms) {
|
|
9399
|
-
let e = this.
|
|
9402
|
+
let e = this._participants;
|
|
9400
9403
|
i.rooms.rooms.forEach((t) => {
|
|
9401
9404
|
t.participantIds?.forEach((t) => {
|
|
9402
9405
|
e[t] && (e[t].isInRoom = !0);
|
|
@@ -9406,13 +9409,13 @@ var es = 15, $ = class e extends b {
|
|
|
9406
9409
|
this._conversation.roomId = i.rooms?.roomId || null;
|
|
9407
9410
|
let a = this._extractExternalRoomsData(i.rooms?.rooms, i.rooms?.roomId);
|
|
9408
9411
|
if (R.onCallAccepted(this.id), R.onLocalStream(this._mediaSource.getStream(), t, this.id), R.onConversation(this._conversation.externalId, this._conversation.mediaModifiers, this._getMuteStatesForCurrentRoom(), this._getMainRoomParticipants(), a, this.id), await this._emitHeldParticipantsStatus(), N.useParticipantListChunk) {
|
|
9409
|
-
let e = await this._getInitialParticiapntListChunk(), t = this.
|
|
9412
|
+
let e = await this._getInitialParticiapntListChunk(), t = this._participants;
|
|
9410
9413
|
e?.participants?.forEach((e) => {
|
|
9411
9414
|
let n = t[M.composeId(e)];
|
|
9412
9415
|
n && (n.movieShareInfos = e.movieShareInfos);
|
|
9413
9416
|
}), this._onConversationParticipantListChunk({ participants: e });
|
|
9414
9417
|
}
|
|
9415
|
-
return R.onLocalStatus(P.WAITING, this.id), this._toggleJoinAvailability(), this._changeNeedRate(), this._state = "ACTIVE", this._changeFeatureSet(), this._openTransport(Object.values(this.
|
|
9418
|
+
return R.onLocalStatus(P.WAITING, this.id), this._toggleJoinAvailability(), this._changeNeedRate(), this._state = "ACTIVE", this._changeFeatureSet(), this._openTransport(Object.values(this._participants), !0), this._processConversationUrlSharingInfo(), this._processConnectionAsrInfo(), B.setActive(this.id).catch((e) => {
|
|
9416
9419
|
this._debug.error(e), this._close(e, { errorText: "Unable to activated accepted call" });
|
|
9417
9420
|
}), this._conversation;
|
|
9418
9421
|
} catch (e) {
|
|
@@ -9429,7 +9432,9 @@ var es = 15, $ = class e extends b {
|
|
|
9429
9432
|
if (this._hangupPromise) return this._hangupPromise;
|
|
9430
9433
|
this._clearCalleeUnavailableWatchdog(), this._debug.debug("Hangup");
|
|
9431
9434
|
let e = this._state === "ACTIVE" || this._state === "HELD" ? O.HUNGUP : O.CANCELED, t = new k(e), n = this._conversation?.id ?? null;
|
|
9432
|
-
return this._stats.logger.log(C.HANGUP, e), this._finishLifecycle(t), this._hangupPromise = this._signaling.hangup(e).then(() => void 0).
|
|
9435
|
+
return this._stats.logger.log(C.HANGUP, e), this._finishLifecycle(t), this._hangupPromise = this._signaling.hangup(e).then(() => void 0).catch((e) => {
|
|
9436
|
+
if (!(e instanceof yn)) throw e;
|
|
9437
|
+
}).finally(() => this._close(t)), this._emitHangupOnce(t, n), this._cleanupTransport(), this._cleanupMediaSource(), this._hangupPromise;
|
|
9433
9438
|
}
|
|
9434
9439
|
async addParticipant(e, t) {
|
|
9435
9440
|
if (!this._signaling.ready) {
|
|
@@ -9486,11 +9491,9 @@ var es = 15, $ = class e extends b {
|
|
|
9486
9491
|
}
|
|
9487
9492
|
_close(e, t = {}) {
|
|
9488
9493
|
this._clearCalleeUnavailableWatchdog(), t.errorText && this._debug.error(t.errorText, e), this._debug.debug("Close conversation", e), this._finishLifecycle(e), this._stats.flushCallMetrics();
|
|
9489
|
-
let n = t.signalingReason ?? (e.error ? O.FAILED : void 0);
|
|
9490
|
-
|
|
9491
|
-
|
|
9492
|
-
}), this._signaling.readyToSend(!1), e.error || this._stats.logger.log(C.ERROR, e.hangup);
|
|
9493
|
-
let r = this._conversation && this._conversation.id;
|
|
9494
|
+
let n = t.signalingReason ?? (e.error ? O.FAILED : void 0), r = n && this._signaling.ready ? this._signaling.hangup(n) : void 0;
|
|
9495
|
+
this._signaling.readyToSend(!1), e.error || this._stats.logger.log(C.ERROR, e.hangup);
|
|
9496
|
+
let i = this._conversation && this._conversation.id;
|
|
9494
9497
|
if ([
|
|
9495
9498
|
O.CANCELED,
|
|
9496
9499
|
O.NOT_FRIENDS,
|
|
@@ -9499,32 +9502,35 @@ var es = 15, $ = class e extends b {
|
|
|
9499
9502
|
O.CALLER_IS_BLOCKED,
|
|
9500
9503
|
O.CALLER_IS_REJECTED
|
|
9501
9504
|
].indexOf(e.hangup) !== -1 || e.hangup === O.REJECTED && !e.remote) {
|
|
9502
|
-
this._emitHangupOnce(e,
|
|
9505
|
+
this._emitHangupOnce(e, i), this._destroy(r);
|
|
9503
9506
|
return;
|
|
9504
9507
|
}
|
|
9505
9508
|
if (e.hangup === O.HUNGUP && (!e.remote || this._isCalledState())) {
|
|
9506
|
-
this._emitHangupOnce(e,
|
|
9509
|
+
this._emitHangupOnce(e, i), this._destroy(r);
|
|
9507
9510
|
return;
|
|
9508
9511
|
}
|
|
9509
9512
|
if (e.hangup === O.MISSED && !e.remote) {
|
|
9510
|
-
this._emitHangupOnce(e,
|
|
9513
|
+
this._emitHangupOnce(e, i), this._destroy(r);
|
|
9511
9514
|
return;
|
|
9512
9515
|
}
|
|
9513
9516
|
if (this._cooldownQueueCleanupTimer !== null && (window.clearInterval(this._cooldownQueueCleanupTimer), this._cooldownQueueCleanupTimer = null), (e.hangup === O.SOCKET_CLOSED || e.hangup === O.NOT_FOUND) && B.getActive() && !this._conversation) {
|
|
9514
|
-
this._disposeSignaling(), this._cleanupMediaSource();
|
|
9517
|
+
this._disposeSignaling(r), this._cleanupMediaSource();
|
|
9515
9518
|
return;
|
|
9516
9519
|
}
|
|
9517
9520
|
if (e.hangup === O.BUSY && !e.remote) {
|
|
9518
|
-
this._disposeSignaling(), this._cleanupMediaSource();
|
|
9521
|
+
this._disposeSignaling(r), this._cleanupMediaSource();
|
|
9519
9522
|
return;
|
|
9520
9523
|
}
|
|
9521
|
-
this._state = "CLOSE", this._participantState = Z.HUNGUP, this._changeFeatureSet(), this._cleanupMediaSource(), this._cleanupParticipants(), this._cleanupParticipantAgnosticStreams(), this._cleanupTransport(), this._cleanupSpeakerDetector(), this._cleanupSpecListener(), this._disposeSignaling(), 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),
|
|
9524
|
+
this._state = "CLOSE", this._participantState = Z.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);
|
|
9522
9525
|
}
|
|
9523
9526
|
destroy() {
|
|
9527
|
+
this._destroy();
|
|
9528
|
+
}
|
|
9529
|
+
_destroy(e) {
|
|
9524
9530
|
this._clearCalleeUnavailableWatchdog();
|
|
9525
|
-
let
|
|
9526
|
-
if (this._debug.debug("Destroy conversation", { conversationId:
|
|
9527
|
-
this._api.hangupConversation(
|
|
9531
|
+
let t = this._conversation && this._conversation.id;
|
|
9532
|
+
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 = Z.HUNGUP, this._cleanupMediaSource(), this._cleanupParticipants(), this._cleanupParticipantAgnosticStreams(), this._cleanupTransport(), this._cleanupSpeakerDetector(), this._cleanupSpecListener(), this._disposeSignaling(e), this._api.cleanup(), this._api.setAbortSignal(void 0), this._delayedHangup && t) try {
|
|
9533
|
+
this._api.hangupConversation(t, O.CANCELED);
|
|
9528
9534
|
} catch {}
|
|
9529
9535
|
this._cleanupListeners(), this._stats.destroy(), this._cleanupRegistry(), this._conversation = null, this._myLastRequestedLayouts = {}, this._displayLayoutRequester.clear(), this._delayedHangup = !1, this._abortController = null;
|
|
9530
9536
|
}
|
|
@@ -9879,7 +9885,7 @@ var es = 15, $ = class e extends b {
|
|
|
9879
9885
|
};
|
|
9880
9886
|
}
|
|
9881
9887
|
_participantListChunkToExternalChunk(e) {
|
|
9882
|
-
let t = this.
|
|
9888
|
+
let t = this._participants, n = M.mapSharedParticipants(e.participants.reduce((e, n) => {
|
|
9883
9889
|
let r = M.composeId(n);
|
|
9884
9890
|
return t[r] && e.push(t[r]), e;
|
|
9885
9891
|
}, []));
|
|
@@ -9897,7 +9903,7 @@ var es = 15, $ = class e extends b {
|
|
|
9897
9903
|
if (!this._conversation) return;
|
|
9898
9904
|
let n = e[0]?.externalId?.type;
|
|
9899
9905
|
n && (N.externalUserType = n);
|
|
9900
|
-
let r = this.
|
|
9906
|
+
let r = this._participants;
|
|
9901
9907
|
for (let n of e) {
|
|
9902
9908
|
let e = M.composeId(n);
|
|
9903
9909
|
if (z.test("Conversation:RegisterParticipant", e), this._isMe(e)) {
|
|
@@ -9971,7 +9977,7 @@ var es = 15, $ = class e extends b {
|
|
|
9971
9977
|
return this._participants[e.id] = e, e;
|
|
9972
9978
|
}
|
|
9973
9979
|
_getExistedParticipantByIdOrCreate(e) {
|
|
9974
|
-
let t = this.
|
|
9980
|
+
let t = this._participants[e];
|
|
9975
9981
|
if (t) return t;
|
|
9976
9982
|
let n = this._api.getDecorativeIdByInitialId(M.decomposeId(e).id), r = n ? M.composeUserId(n) : void 0, i = this._getParticipantId(e), { deviceIdx: a } = M.decomposeParticipantId(e);
|
|
9977
9983
|
return this._createParticipant({
|
|
@@ -9985,7 +9991,7 @@ var es = 15, $ = class e extends b {
|
|
|
9985
9991
|
_getExternalIdByParticipantId(e) {
|
|
9986
9992
|
if (this._isMe(e)) return this._conversation?.externalId;
|
|
9987
9993
|
if (N.useParticipantListChunk) return this._getExistedParticipantByIdOrCreate(e).externalId;
|
|
9988
|
-
let t = this.
|
|
9994
|
+
let t = this._participants;
|
|
9989
9995
|
if (t[e]?.externalId) return t[e].externalId;
|
|
9990
9996
|
{
|
|
9991
9997
|
let t = this._getParticipantId(e);
|
|
@@ -10006,7 +10012,7 @@ var es = 15, $ = class e extends b {
|
|
|
10006
10012
|
let n = this._registerParticipantInCache(this._getExistedParticipantByIdOrCreate(e));
|
|
10007
10013
|
return n.markers = this._denormalizeMarkers(n.id, t), n;
|
|
10008
10014
|
}
|
|
10009
|
-
return this.
|
|
10015
|
+
return this._participants[e];
|
|
10010
10016
|
}
|
|
10011
10017
|
_warnParticipantNotInConversation(e) {
|
|
10012
10018
|
this._debug.warn(`Participant [${e}] isn't in conversation`);
|
|
@@ -10050,14 +10056,14 @@ var es = 15, $ = class e extends b {
|
|
|
10050
10056
|
_allocateTransport() {
|
|
10051
10057
|
if (!this._conversation || !this._mediaSource) return;
|
|
10052
10058
|
this._transport = new ra(this._conversation.topology, this._signaling, this._mediaSource, this._serverSettings, this._debug, this._stats.logger, this._stats.statAggregator, this._stats.codecStatsAggregator, this._getFirstMediaSentCallback()), this._debugInfo = new po(this._debug), this.subscribe(this._transport, X.STATE_CHANGED, this._onTransportStateChanged.bind(this)), this.subscribe(this._transport, X.LOCAL_STATE_CHANGED, this._onTransportLocalStateChanged.bind(this)), this.subscribe(this._transport, X.REMOTE_TRACK_ADDED, this._onRemoteTrackAdded.bind(this)), this.subscribe(this._transport, X.REMOTE_TRACK_REMOVED, this._onRemoteTrackRemoved.bind(this)), this.subscribe(this._transport, X.AUDIO_MIX_STALL, this._onAudioMixStall.bind(this)), this.subscribe(this._transport, X.REMOTE_DATA_STATS, this._onRemoteDataStats.bind(this)), this.subscribe(this._transport, X.SIGNALLED_STALLED_PARTICIPANTS, this._onRemoteSignalledStall.bind(this)), this.subscribe(this._transport, X.TOPOLOGY_CHANGED, this._onTopologyChanged.bind(this)), this.subscribe(this._transport, X.NETWORK_STATUS, this._onNetworkStatus.bind(this)), this.subscribe(this._transport, X.REMOTE_STREAM_SECOND, this._onRemoteStreamSecond.bind(this)), this.subscribe(this._transport, X.PEER_CONNECTION_CLOSED, this._onPeerConnectionClosed.bind(this)), this.subscribe(this._transport, X.ASR_TRANSCRIPTION, this._onAsrTranscription.bind(this)), this.subscribe(this._transport, X.ANIMOJI_STREAM, this._onAnimojiStream.bind(this)), this.subscribe(this._transport, X.ANIMOJI_ERROR, this._onAnimojiError.bind(this));
|
|
10053
|
-
let e = this._conversation.direction === Pa.OUTGOING && !this._conversation.concurrent, t = this.
|
|
10059
|
+
let e = this._conversation.direction === Pa.OUTGOING && !this._conversation.concurrent, t = this._participants;
|
|
10054
10060
|
for (let n of Object.values(t)) (n.state === Z.ACCEPTED || n.state === Z.CALLED) && this._allocateParticipantTransport(n.id, e);
|
|
10055
10061
|
}
|
|
10056
10062
|
_createSpeakerDetector() {
|
|
10057
10063
|
this._transport && this._conversation && (this._volumesDetector = new bo(this._transport), this.subscribe(this._volumesDetector, yo.VOLUMES_DETECTED, this._onVolumesDetected.bind(this)), this._speakerDetector = new So(this._volumesDetector, this._transport, this._conversation.topology), this.subscribe(this._speakerDetector, xo.SPEAKER_CHANGED, this._onSpeakerChanged.bind(this)), this._localVolumeDetector = new _o(this._mediaSource));
|
|
10058
10064
|
}
|
|
10059
10065
|
_createSpecListener() {
|
|
10060
|
-
this._transport && this._volumesDetector && (this._specListener = new To(this._transport, this._volumesDetector, this.
|
|
10066
|
+
this._transport && this._volumesDetector && (this._specListener = new To(this._transport, this._volumesDetector, this._participants, this._debug, this._stats.logger));
|
|
10061
10067
|
}
|
|
10062
10068
|
_logDevices() {
|
|
10063
10069
|
let e = E.getCameras().length, t = E.getMicrophones().length;
|
|
@@ -10069,7 +10075,7 @@ var es = 15, $ = class e extends b {
|
|
|
10069
10075
|
async _removeParticipant(e, t) {
|
|
10070
10076
|
if (e.state === Z.CALLED || e.state === Z.ACCEPTED || this._state === "CLOSE") return;
|
|
10071
10077
|
e.id === this._lastSignalledActiveSpeakerId && (this._lastSignalledActiveSpeakerId = null);
|
|
10072
|
-
let n = this.
|
|
10078
|
+
let n = this._participants;
|
|
10073
10079
|
if (n[e.id]) {
|
|
10074
10080
|
t === O.HUNGUP ? this._setParticipantsStatus([e], P.HANGUP) : this._setParticipantsStatus([e], P.ERROR, t), e.mediaSource?.disconnect(), this._displayLayoutRequester.cleanupParticipant(e.id), this._conversation && this._conversation.pinnedParticipantIdByRoom.get(null) === e.id && this._conversation.pinnedParticipantIdByRoom.delete(null), this._conversation && this._conversation.roomId && this._conversation.pinnedParticipantIdByRoom.get(this._conversation.roomId) === e.id && this._conversation.pinnedParticipantIdByRoom.delete(this._conversation.roomId);
|
|
10075
10081
|
for (let [t, n] of Object.entries(e.lastRequestedLayouts)) this._streamIdByStreamDescription.delete(t), this._sequenceNumberByStreamDescription.delete(t), this._cooldownTimestampByStreamDescription.delete(t), this._streamWaitTimerByStreamDescription.has(t) && (window.clearTimeout(this._streamWaitTimerByStreamDescription.get(t)), this._streamWaitTimerByStreamDescription.delete(t)), this._sendUpdateDisplayLayout({ [t]: { stopStream: !0 } }, !1);
|
|
@@ -10083,7 +10089,7 @@ var es = 15, $ = class e extends b {
|
|
|
10083
10089
|
this._mediaSource && (this._mediaSource.destroy(), this._mediaSource = null);
|
|
10084
10090
|
}
|
|
10085
10091
|
_cleanupParticipants() {
|
|
10086
|
-
Object.values(this.
|
|
10092
|
+
Object.values(this._participants).forEach((e) => {
|
|
10087
10093
|
e.remoteStream?.getTracks().forEach((e) => e.stop()), e.remoteAudioTrack?.stop(), e.secondStream?.getTracks().forEach((e) => e.stop()), e.mediaSource?.disconnect();
|
|
10088
10094
|
}), this._participants = {}, this._audioOutput && this._audioOutput.destroy();
|
|
10089
10095
|
}
|
|
@@ -10118,8 +10124,14 @@ var es = 15, $ = class e extends b {
|
|
|
10118
10124
|
_cleanupSpecListener() {
|
|
10119
10125
|
this._specListener && (this._specListener.destroy(), this._specListener = null);
|
|
10120
10126
|
}
|
|
10121
|
-
_disposeSignaling() {
|
|
10122
|
-
|
|
10127
|
+
_disposeSignaling(e) {
|
|
10128
|
+
if (!e) {
|
|
10129
|
+
this._signaling.dispose();
|
|
10130
|
+
return;
|
|
10131
|
+
}
|
|
10132
|
+
e.catch((e) => {
|
|
10133
|
+
e instanceof yn || this._debug.warn("[signaling] unable to send hangup", e);
|
|
10134
|
+
}).finally(() => this._signaling.dispose());
|
|
10123
10135
|
}
|
|
10124
10136
|
async _onAddParticipant(e, t, n) {
|
|
10125
10137
|
this._debug.debug(`Add new participant [${e}]`);
|
|
@@ -10149,7 +10161,7 @@ var es = 15, $ = class e extends b {
|
|
|
10149
10161
|
}
|
|
10150
10162
|
_onRemoveParticipant(e) {
|
|
10151
10163
|
this._debug.debug(`Remove participant [${e}]`);
|
|
10152
|
-
let t = [], n = this.
|
|
10164
|
+
let t = [], n = this._participants;
|
|
10153
10165
|
for (let r = 0; r <= es; r++) {
|
|
10154
10166
|
let i = n[M.compose(e, r)];
|
|
10155
10167
|
i && t.push(i);
|
|
@@ -10215,7 +10227,7 @@ var es = 15, $ = class e extends b {
|
|
|
10215
10227
|
let e = typeof t.uid == "object" ? t.uid : Q.fromId(t.uid), r = Q.toString(e);
|
|
10216
10228
|
n[r] = t.priority;
|
|
10217
10229
|
}
|
|
10218
|
-
let r = this.
|
|
10230
|
+
let r = this._participants;
|
|
10219
10231
|
for (let e of Object.values(r)) {
|
|
10220
10232
|
let r = Q.toString(e.externalId);
|
|
10221
10233
|
Object.hasOwn(n, r) && (t[e.id] = n[r]);
|
|
@@ -10243,9 +10255,9 @@ var es = 15, $ = class e extends b {
|
|
|
10243
10255
|
let n = pa.get();
|
|
10244
10256
|
await this._signaling.hold(!1, n), this._restoreStateAfterHold();
|
|
10245
10257
|
let r = null;
|
|
10246
|
-
if (this._state === "IDLE" && this._participantState === Z.ACCEPTED && (r = Object.values(this.
|
|
10258
|
+
if (this._state === "IDLE" && this._participantState === Z.ACCEPTED && (r = Object.values(this._participants), r.some((e) => e.state === Z.ACCEPTED) && (this._state = "ACTIVE", this._changeFeatureSet())), this._allocateTransport(), this._createSpeakerDetector(), this._createSpecListener(), await this._resumeLocalMedia(t, P.WAITING), this._state === "ACTIVE") {
|
|
10247
10259
|
let e = this._conversation?.direction === Pa.OUTGOING && !this._conversation.concurrent;
|
|
10248
|
-
this._openTransport(r ?? Object.values(this.
|
|
10260
|
+
this._openTransport(r ?? Object.values(this._participants), e);
|
|
10249
10261
|
}
|
|
10250
10262
|
}
|
|
10251
10263
|
async _holdLocally() {
|
|
@@ -10278,7 +10290,7 @@ var es = 15, $ = class e extends b {
|
|
|
10278
10290
|
async updateDisplayLayout(e) {
|
|
10279
10291
|
if (e.length < 1 || !this._signaling.ready) return;
|
|
10280
10292
|
this._debug.log(`Update display layout request [${this._signaling.getNextCommandSequenceNumber()}]`, e);
|
|
10281
|
-
let t = {}, n = [], r = this.
|
|
10293
|
+
let t = {}, n = [], r = this._participants;
|
|
10282
10294
|
for (let i of e) {
|
|
10283
10295
|
let e = typeof i.uid == "object" ? i.uid : Q.fromId(i.uid), a = this._api.getCachedOkIdByExternalId(e);
|
|
10284
10296
|
if (!a) {
|
|
@@ -10322,7 +10334,7 @@ var es = 15, $ = class e extends b {
|
|
|
10322
10334
|
}
|
|
10323
10335
|
_stopStreaming(e) {
|
|
10324
10336
|
if (this._cooldownTimestampByStreamDescription.delete(e), this._sequenceNumberByStreamDescription.set(e, this._signaling.getNextCommandSequenceNumber()), this._streamWaitTimerByStreamDescription.has(e) && (this._debug.log("Client asked to stop streaming before stream became available", e), window.clearTimeout(this._streamWaitTimerByStreamDescription.get(e)), this._streamWaitTimerByStreamDescription.delete(e)), this._streamIdByStreamDescription.get(e)) {
|
|
10325
|
-
let t = this.
|
|
10337
|
+
let t = this._participants, n = Dn(e), r = t[n.participantId], i = this._conversation?.externalId, a = this._isMe(n.participantId);
|
|
10326
10338
|
if (r || a) {
|
|
10327
10339
|
switch (n.mediaType) {
|
|
10328
10340
|
case H.STREAM:
|
|
@@ -10358,7 +10370,7 @@ var es = 15, $ = class e extends b {
|
|
|
10358
10370
|
if (this._debug.warn(`Failed to update display layout ${JSON.stringify(e)}. ${n}`), t) throw n;
|
|
10359
10371
|
return;
|
|
10360
10372
|
}
|
|
10361
|
-
let r = [], i = this.
|
|
10373
|
+
let r = [], i = this._participants;
|
|
10362
10374
|
for (let [e, t] of Object.entries(n.errorCodeByParticipantId || {})) {
|
|
10363
10375
|
let n = Dn(e), a = i[n.participantId];
|
|
10364
10376
|
if (a) {
|
|
@@ -10469,7 +10481,7 @@ var es = 15, $ = class e extends b {
|
|
|
10469
10481
|
else {
|
|
10470
10482
|
let e = this._getExternalIdByParticipantId(n);
|
|
10471
10483
|
if (e) {
|
|
10472
|
-
let t = this.
|
|
10484
|
+
let t = this._participants[n];
|
|
10473
10485
|
t?.movieShareInfos && (t.movieShareInfos = t.movieShareInfos.filter((e) => e && e.movieId !== r)), R.onRemoteSharedMovieStoppedInfo(e, o, a, this.id);
|
|
10474
10486
|
}
|
|
10475
10487
|
}
|
|
@@ -10829,7 +10841,7 @@ var es = 15, $ = class e extends b {
|
|
|
10829
10841
|
this._debug.log("Request participant list chunk", e);
|
|
10830
10842
|
let t = await this._signaling.getParticipantListChunk(e);
|
|
10831
10843
|
if (t.error) throw Error(t.error);
|
|
10832
|
-
let n = this._createParticipantListChunk(t.chunk), r = this.
|
|
10844
|
+
let n = this._createParticipantListChunk(t.chunk), r = this._participants, i = n.participants.filter((e) => !r[M.composeId(e)]);
|
|
10833
10845
|
await this._registerParticipants(i);
|
|
10834
10846
|
let a = this._transport?.getState();
|
|
10835
10847
|
return n.participants.forEach((e) => {
|
|
@@ -10888,7 +10900,7 @@ var es = 15, $ = class e extends b {
|
|
|
10888
10900
|
}
|
|
10889
10901
|
_changeMultipleParticipantState(e, t) {
|
|
10890
10902
|
this._debug.debug("Multiple participants state changed", e);
|
|
10891
|
-
let n = [], r, i = this.
|
|
10903
|
+
let n = [], r, i = this._participants;
|
|
10892
10904
|
e.forEach((e, t) => {
|
|
10893
10905
|
if (this._isMe(t)) r = e;
|
|
10894
10906
|
else {
|
|
@@ -10974,7 +10986,7 @@ var es = 15, $ = class e extends b {
|
|
|
10974
10986
|
e.conversationParams?.serverTime && (this._serverTimeOffset = e.conversationParams.serverTime - Date.now()), e.conversation.acceptTime && (this._conversation.acceptTime = e.conversation.acceptTime), e.conversation.participantsLimit && (this._conversation.participantsLimit = e.conversation.participantsLimit), e.conversation.features && (this._conversation.features = e.conversation.features, this._conversation.featuresPerRole = e.conversation.featuresPerRole, this._changeFeatureSet(), this._changeFeaturesPerRole()), this._processPinnedParticipants(e), e.conversation.state;
|
|
10975
10987
|
let t = null;
|
|
10976
10988
|
if (e.conversation.participants) {
|
|
10977
|
-
let n = Object.keys(this.
|
|
10989
|
+
let n = Object.keys(this._participants), r = [];
|
|
10978
10990
|
for (let n of e.conversation.participants) {
|
|
10979
10991
|
let e = M.composeId(n), i = n.roles || [];
|
|
10980
10992
|
if (this._isMe(e)) {
|
|
@@ -11001,7 +11013,7 @@ var es = 15, $ = class e extends b {
|
|
|
11001
11013
|
M.isEqualParticipantState(r, o) || await this._changeRemoteParticipantState(e, r), Ka(i, a.roles) || this._onRolesChanged(a.id, i), !!n.onHold != !!a.isOnHold && (a.isOnHold = !!n.onHold, this._setParticipantsStatus([a], n.onHold ? P.ONHOLD : P.CONNECTED));
|
|
11002
11014
|
}
|
|
11003
11015
|
}
|
|
11004
|
-
let i = this.
|
|
11016
|
+
let i = this._participants;
|
|
11005
11017
|
for (let e of n) r.indexOf(e) < 0 && i[e] && this._removeParticipant(i[e], O.HUNGUP);
|
|
11006
11018
|
}
|
|
11007
11019
|
let n = [...e.participants?.participants ?? [], ...e.rooms?.rooms.flatMap((e) => e.participants?.participants ?? []) ?? []];
|
|
@@ -11081,7 +11093,7 @@ var es = 15, $ = class e extends b {
|
|
|
11081
11093
|
}
|
|
11082
11094
|
async _reconcileParticipantSessionStates(e) {
|
|
11083
11095
|
if (!N.enableSessionStateUpdates || !e.length) return;
|
|
11084
|
-
let t = this.
|
|
11096
|
+
let t = this._participants;
|
|
11085
11097
|
for (let n of e) {
|
|
11086
11098
|
let e = M.composeId(n), r = t[e];
|
|
11087
11099
|
r && !this._isMe(e) && (this._updateParticipantExternalId(r, n), this._updateParticipantSessionState(r, e, n.sessionState));
|
|
@@ -11440,7 +11452,7 @@ var es = 15, $ = class e extends b {
|
|
|
11440
11452
|
}
|
|
11441
11453
|
async _onNetworkStatus(e) {
|
|
11442
11454
|
if (this._conversation) {
|
|
11443
|
-
let t = [], n = this.
|
|
11455
|
+
let t = [], n = this._participants;
|
|
11444
11456
|
for (let [r, i] of Object.entries(e)) {
|
|
11445
11457
|
let e;
|
|
11446
11458
|
if (this._isMe(r) || r === "") e = this._conversation.networkRating;
|
|
@@ -11460,7 +11472,7 @@ var es = 15, $ = class e extends b {
|
|
|
11460
11472
|
}
|
|
11461
11473
|
}
|
|
11462
11474
|
async _emitHeldParticipantsStatus() {
|
|
11463
|
-
let e = Object.values(this.
|
|
11475
|
+
let e = Object.values(this._participants).filter((e) => e.isOnHold).map((e) => e.externalId);
|
|
11464
11476
|
e.length && R.onRemoteStatus(e, P.ONHOLD, null, this.id);
|
|
11465
11477
|
}
|
|
11466
11478
|
async _onRemoteStreamSecond(e, t) {
|
|
@@ -11537,7 +11549,7 @@ var es = 15, $ = class e extends b {
|
|
|
11537
11549
|
this._debug.debug(`Transport state has changed: ${t}`, e);
|
|
11538
11550
|
let n = Ja.fromTransportState(t);
|
|
11539
11551
|
if (!n) return;
|
|
11540
|
-
let r = this.
|
|
11552
|
+
let r = this._participants, i = [], a = e.reduce((e, n) => {
|
|
11541
11553
|
if (n in r) {
|
|
11542
11554
|
let a = r[n];
|
|
11543
11555
|
e.push(a), t === J.CONNECTED && (a.remoteStream || (a.mediaSettings && this._changeRemoteMediaSettings(n, a.mediaSettings), this._changeRemoteParticipantState(n, a.participantState)), i.push(...Object.values(a.lastRequestedLayouts)));
|
|
@@ -11565,7 +11577,7 @@ var es = 15, $ = class e extends b {
|
|
|
11565
11577
|
if (!N.hold || !this._transport) return !1;
|
|
11566
11578
|
let e = this._transport.opened().length ? this._transport.opened() : this._transport.allocated();
|
|
11567
11579
|
if (!e.length) return !1;
|
|
11568
|
-
let t = this.
|
|
11580
|
+
let t = this._participants;
|
|
11569
11581
|
return e.every((e) => t[e]?.isOnHold);
|
|
11570
11582
|
}
|
|
11571
11583
|
_onRemoteTrackAdded(e, t, n) {
|
|
@@ -11626,7 +11638,7 @@ var es = 15, $ = class e extends b {
|
|
|
11626
11638
|
_onRemoteSignalledStall(e) {
|
|
11627
11639
|
let t = {}, n = [], r = [];
|
|
11628
11640
|
this._debug.debug("Participants stalled:", e);
|
|
11629
|
-
let i = this.
|
|
11641
|
+
let i = this._participants;
|
|
11630
11642
|
for (let r of e) {
|
|
11631
11643
|
if (t[r] = !0, !this._lastStalled[r]) {
|
|
11632
11644
|
let e = i[r];
|
|
@@ -11641,7 +11653,7 @@ var es = 15, $ = class e extends b {
|
|
|
11641
11653
|
n.length && this._setParticipantsStatus(n, P.RECONNECT), r.length && this._setParticipantsStatus(r, P.CONNECTED), this._lastStalled = t;
|
|
11642
11654
|
}
|
|
11643
11655
|
_onRemoteDataStats(e) {
|
|
11644
|
-
this._debugInfo && this._debugInfo.onRemoteDataStats(e, this.
|
|
11656
|
+
this._debugInfo && this._debugInfo.onRemoteDataStats(e, this._participants), this._fixAudioDevice(e.outbound.rtps), this._fixVideoDevice(e.outbound.rtps);
|
|
11645
11657
|
}
|
|
11646
11658
|
_fixAudioDevice(e) {
|
|
11647
11659
|
!E.hasMicrophone() || !this._audioFix || !this.mediaSettings?.isAudioEnabled || this._audioFix.fix(e);
|
|
@@ -11786,7 +11798,7 @@ var es = 15, $ = class e extends b {
|
|
|
11786
11798
|
for (let t of n) {
|
|
11787
11799
|
let n = t.id ?? null;
|
|
11788
11800
|
if (this._setMuteStatesForRoomId(t.muteStates, n), this._conversation?.recordsInfoByRoom.set(n, t.recordInfo ?? null), this._conversation?.pinnedParticipantIdByRoom.set(n, t.pinnedParticipantId ?? null), t.asrInfo && this._conversation?.asrInfoByRoom.set(n, t.asrInfo), t.urlSharingInfo ? this._conversation?.urlSharingInfoByRoom.set(n, t.urlSharingInfo) : this._conversation?.urlSharingInfoByRoom.delete(n), e) {
|
|
11789
|
-
let e = this.
|
|
11801
|
+
let e = this._participants;
|
|
11790
11802
|
await this._registerParticipants(t?.participants?.participants?.filter((t) => !e[M.composeId(t)]) || [], !0);
|
|
11791
11803
|
let n = this._convertRoomToExternal(t);
|
|
11792
11804
|
n && r.push(n);
|
|
@@ -11824,7 +11836,7 @@ var es = 15, $ = class e extends b {
|
|
|
11824
11836
|
let o = Q.fromSignaling(r, a.deviceIdx);
|
|
11825
11837
|
if (R.onParticipantIdChanged(a, o, this.id), this._api.cacheExternalId(n, o), this._api.mapDecorativeId(n, t), i) this._conversation.externalId = o;
|
|
11826
11838
|
else {
|
|
11827
|
-
let e = this.
|
|
11839
|
+
let e = this._participants;
|
|
11828
11840
|
e[t].externalId = o;
|
|
11829
11841
|
}
|
|
11830
11842
|
}
|
|
@@ -11861,17 +11873,10 @@ var es = 15, $ = class e extends b {
|
|
|
11861
11873
|
}
|
|
11862
11874
|
_registerParticipant(e, t) {
|
|
11863
11875
|
let n = this._createParticipant(e, t);
|
|
11864
|
-
this.
|
|
11865
|
-
}
|
|
11866
|
-
_getParticipants() {
|
|
11867
|
-
if (this._pendingParticipants.size) {
|
|
11868
|
-
for (let e of this._pendingParticipants.values()) this._participants[e.id] = e;
|
|
11869
|
-
this._pendingParticipants.clear();
|
|
11870
|
-
}
|
|
11871
|
-
return this._participants;
|
|
11876
|
+
this._registerParticipantInCache(n);
|
|
11872
11877
|
}
|
|
11873
11878
|
_getParticipant(e) {
|
|
11874
|
-
return this.
|
|
11879
|
+
return this._participants[e];
|
|
11875
11880
|
}
|
|
11876
11881
|
}, ts = null, ns = class e extends Error {
|
|
11877
11882
|
constructor(t, n) {
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import type { IEffect } from '@vkontakte/calls-video-effects';
|
|
2
2
|
import type { RGBTuple } from '@vkontakte/calls-vmoji';
|
|
3
|
-
import BaseApi from '
|
|
4
|
-
import BaseLogger from '
|
|
5
|
-
import { AddParticipantParams } from '
|
|
6
|
-
import ConversationFeature from '
|
|
7
|
-
import ConversationOption from '
|
|
8
|
-
import MediaOption from '
|
|
9
|
-
import UpdateDisplayLayoutErrorReason from '
|
|
10
|
-
import UserRole from '
|
|
11
|
-
import UserType from '
|
|
12
|
-
import { DebugMessageType } from '
|
|
13
|
-
import { JSONObject } from '
|
|
14
|
-
import { IAsrStartParams, IAsrStopParams } from '
|
|
15
|
-
import { AudienceModeHandsResponse } from '
|
|
16
|
-
import { ConversationData, ConversationOnJoinParams, ConversationOnStartParams } from '
|
|
17
|
-
import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk } from '
|
|
18
|
-
import MediaModifiers from '
|
|
19
|
-
import MediaSettings, { IVideoDimentions } from '
|
|
20
|
-
import { IAddMovieParams, IUpdateMovieData } from '
|
|
21
|
-
import MuteStates from '
|
|
22
|
-
import { CompositeUserId, IGetParticipantsParameters, OkUserId, ParticipantId, ParticipantStateData } from '
|
|
23
|
-
import { DisplayLayoutRequest, ParticipantLayout } from '
|
|
24
|
-
import { ParticipantListChunkParameters } from '
|
|
25
|
-
import ParticipantPriority from '
|
|
26
|
-
import { ParticipantStreamDescription } from '
|
|
27
|
-
import { ScreenCaptureSettings } from '
|
|
28
|
-
import SignalingMessage from '
|
|
29
|
-
import { WaitingHallResponse } from '
|
|
30
|
-
import EventEmitter from '
|
|
3
|
+
import BaseApi from '../../abstract/BaseApi';
|
|
4
|
+
import BaseLogger from '../../abstract/BaseLogger';
|
|
5
|
+
import { AddParticipantParams } from '../../abstract/BaseSignaling';
|
|
6
|
+
import ConversationFeature from '../../enums/ConversationFeature';
|
|
7
|
+
import ConversationOption from '../../enums/ConversationOption';
|
|
8
|
+
import MediaOption from '../../enums/MediaOption';
|
|
9
|
+
import UpdateDisplayLayoutErrorReason from '../../enums/UpdateDisplayLayoutErrorReason';
|
|
10
|
+
import UserRole from '../../enums/UserRole';
|
|
11
|
+
import UserType from '../../enums/UserType';
|
|
12
|
+
import { DebugMessageType } from '../../static/Debug';
|
|
13
|
+
import { JSONObject } from '../../static/Json';
|
|
14
|
+
import { IAsrStartParams, IAsrStopParams } from '../../types/Asr';
|
|
15
|
+
import { AudienceModeHandsResponse } from '../../types/AudienceMode';
|
|
16
|
+
import { ConversationData, ConversationOnJoinParams, ConversationOnStartParams } from '../../types/Conversation';
|
|
17
|
+
import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk } from '../../types/ExternalId';
|
|
18
|
+
import MediaModifiers from '../../types/MediaModifiers';
|
|
19
|
+
import MediaSettings, { IVideoDimentions } from '../../types/MediaSettings';
|
|
20
|
+
import { IAddMovieParams, IUpdateMovieData } from '../../types/MovieShare';
|
|
21
|
+
import MuteStates from '../../types/MuteStates';
|
|
22
|
+
import { CompositeUserId, IGetParticipantsParameters, OkUserId, ParticipantId, ParticipantStateData } from '../../types/Participant';
|
|
23
|
+
import { DisplayLayoutRequest, ParticipantLayout } from '../../types/ParticipantLayout';
|
|
24
|
+
import { ParticipantListChunkParameters } from '../../types/ParticipantListChunk';
|
|
25
|
+
import ParticipantPriority from '../../types/ParticipantPriority';
|
|
26
|
+
import { ParticipantStreamDescription } from '../../types/ParticipantStreamDescription';
|
|
27
|
+
import { ScreenCaptureSettings } from '../../types/ScreenCaptureSettings';
|
|
28
|
+
import SignalingMessage from '../../types/SignalingMessage';
|
|
29
|
+
import { WaitingHallResponse } from '../../types/WaitingHall';
|
|
30
|
+
import EventEmitter from '../EventEmitter';
|
|
31
31
|
export default class Conversation extends EventEmitter {
|
|
32
32
|
private readonly _api;
|
|
33
33
|
private readonly _signaling;
|
|
@@ -42,7 +42,6 @@ export default class Conversation extends EventEmitter {
|
|
|
42
42
|
private _waitingHallHoldPending;
|
|
43
43
|
private _participantState;
|
|
44
44
|
private _participants;
|
|
45
|
-
private _pendingParticipants;
|
|
46
45
|
private _directTransportIsMaster?;
|
|
47
46
|
private _transport;
|
|
48
47
|
private _debugInfo;
|
|
@@ -118,6 +117,7 @@ export default class Conversation extends EventEmitter {
|
|
|
118
117
|
private _emitHangupOnce;
|
|
119
118
|
private _close;
|
|
120
119
|
destroy(): void;
|
|
120
|
+
private _destroy;
|
|
121
121
|
private _getConversationParams;
|
|
122
122
|
private _setConversationParams;
|
|
123
123
|
private _buildSignalingEndpoint;
|
|
@@ -439,7 +439,6 @@ export default class Conversation extends EventEmitter {
|
|
|
439
439
|
private _setMuteStatesForRoomId;
|
|
440
440
|
private _forceOpenTransportForAloneInCall;
|
|
441
441
|
private _registerParticipant;
|
|
442
|
-
private _getParticipants;
|
|
443
442
|
private _getParticipant;
|
|
444
443
|
}
|
|
445
444
|
declare function _resetPendingInstance(): void;
|