@vkontakte/calls-sdk 2.8.11 → 2.8.12-dev.c0dd153e.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/calls-sdk.cjs.js +5 -5
- package/calls-sdk.esm.js +359 -338
- package/classes/Conversation.d.ts +3 -0
- package/default/Signaling.d.ts +2 -2
- package/default/SignalingTransport.d.ts +3 -1
- package/enums/HangupType.d.ts +1 -0
- package/package.json +1 -1
- package/static/Params.d.ts +6 -9
- package/types/WebTransport.d.ts +17 -16
package/calls-sdk.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @vkontakte/calls-sdk v2.8.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/calls-sdk v2.8.12-dev.c0dd153e.0
|
|
3
|
+
* Thu, 23 Jul 2026 11:36:06 GMT
|
|
4
4
|
* https://calls-sdk.cdn-vk.ru/doc/latest/index.html
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -1177,7 +1177,7 @@ function T(e) {
|
|
|
1177
1177
|
//#endregion
|
|
1178
1178
|
//#region src/enums/HangupType.ts
|
|
1179
1179
|
var E = /* @__PURE__ */ function(e) {
|
|
1180
|
-
return e.CANCELED = "CANCELED", e.REJECTED = "REJECTED", e.REMOVED = "REMOVED", e.HUNGUP = "HUNGUP", e.MISSED = "MISSED", e.BUSY = "BUSY", e.FAILED = "FAILED", e.NETWORK_ERROR = "NETWORK_ERROR", e.KILLED = "KILLED", e.BANNED = "BANNED", e.HAS_ACTIVE_CALL = "HAS_ACTIVE_CALL", e.CALLER_IS_BLOCKED = "CALLER_IS_BLOCKED", e.NOT_FRIENDS = "NOT_FRIENDS", e.CALLEE_IS_OFFLINE = "CALLEE_IS_OFFLINE", e.CALLER_IS_REJECTED = "CALLER_IS_REJECTED", e.UNKNOWN_ERROR = "UNKNOWN_ERROR", e.UNSUPPORTED = "UNSUPPORTED", e.OLD_VERSION = "OLD_VERSION", e.SERVICE_DISABLED = "SERVICE_DISABLED", e.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", e.EXTERNAL_API_ERROR = "EXTERNAL_API_ERROR", e.SOCKET_CLOSED = "SOCKET_CLOSED", e.ENDED = "ENDED", e.KILLED_WITHOUT_DELETE = "KILLED_WITHOUT_DELETE", e.ANOTHER_DEVICE = "ANOTHER_DEVICE", e.NOT_FOUND = "NOT_FOUND", e.VCHAT_DETAILED_ERROR = "VCHAT_DETAILED_ERROR", e.TIMEOUT = "TIMEOUT", e.PARTICIPANT_LIMIT_REACHED = "PARTICIPANT_LIMIT_REACHED", e.FAST_START_ERROR = "FAST_START_ERROR", e.FAST_JOIN_ERROR = "FAST_JOIN_ERROR", e.CALL_TIMEOUT = "CALL_TIMEOUT", e.OBSOLETE_CLIENT = "OBSOLETE_CLIENT", e;
|
|
1180
|
+
return e.CANCELED = "CANCELED", e.REJECTED = "REJECTED", e.REMOVED = "REMOVED", e.HUNGUP = "HUNGUP", e.MISSED = "MISSED", e.BUSY = "BUSY", e.FAILED = "FAILED", e.NETWORK_ERROR = "NETWORK_ERROR", e.KILLED = "KILLED", e.BANNED = "BANNED", e.HAS_ACTIVE_CALL = "HAS_ACTIVE_CALL", e.CALLER_IS_BLOCKED = "CALLER_IS_BLOCKED", e.NOT_FRIENDS = "NOT_FRIENDS", e.CALLEE_IS_OFFLINE = "CALLEE_IS_OFFLINE", e.CALLEE_UNAVAILABLE = "CALLEE_UNAVAILABLE", e.CALLER_IS_REJECTED = "CALLER_IS_REJECTED", e.UNKNOWN_ERROR = "UNKNOWN_ERROR", e.UNSUPPORTED = "UNSUPPORTED", e.OLD_VERSION = "OLD_VERSION", e.SERVICE_DISABLED = "SERVICE_DISABLED", e.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", e.EXTERNAL_API_ERROR = "EXTERNAL_API_ERROR", e.SOCKET_CLOSED = "SOCKET_CLOSED", e.ENDED = "ENDED", e.KILLED_WITHOUT_DELETE = "KILLED_WITHOUT_DELETE", e.ANOTHER_DEVICE = "ANOTHER_DEVICE", e.NOT_FOUND = "NOT_FOUND", e.VCHAT_DETAILED_ERROR = "VCHAT_DETAILED_ERROR", e.TIMEOUT = "TIMEOUT", e.PARTICIPANT_LIMIT_REACHED = "PARTICIPANT_LIMIT_REACHED", e.FAST_START_ERROR = "FAST_START_ERROR", e.FAST_JOIN_ERROR = "FAST_JOIN_ERROR", e.CALL_TIMEOUT = "CALL_TIMEOUT", e.OBSOLETE_CLIENT = "OBSOLETE_CLIENT", e;
|
|
1181
1181
|
}(E || {}), D = class e extends Error {
|
|
1182
1182
|
constructor(t, n) {
|
|
1183
1183
|
super(), h(this, "message", void 0), h(this, "hangup", void 0), h(this, "error", void 0), h(this, "code", void 0), h(this, "remote", void 0), h(this, "custom_error", void 0), this.name = "HangupReason", this.code = n && n.code || 0, this.remote = n && n.remote || !1, this.custom_error = n?.custom_error ?? null, Object.values(E).indexOf(t) > -1 ? this.hangup = t : this.error = t;
|
|
@@ -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.
|
|
2162
|
+
return "2.8.12-dev.c0dd153e.0";
|
|
2163
2163
|
}
|
|
2164
2164
|
static get debug() {
|
|
2165
2165
|
return e._params.debug;
|
|
@@ -2291,6 +2291,9 @@ var hn = mn.getInstance(), j = class e {
|
|
|
2291
2291
|
static get waitAnotherTabDelay() {
|
|
2292
2292
|
return e._params.waitAnotherTabDelay;
|
|
2293
2293
|
}
|
|
2294
|
+
static get calleeUnavailableWaitingTime() {
|
|
2295
|
+
return e._params.calleeUnavailableWaitingTime;
|
|
2296
|
+
}
|
|
2294
2297
|
static get debugLog() {
|
|
2295
2298
|
return e._params.debugLog;
|
|
2296
2299
|
}
|
|
@@ -2522,9 +2525,6 @@ var hn = mn.getInstance(), j = class e {
|
|
|
2522
2525
|
static get webtransport() {
|
|
2523
2526
|
return e._params.webtransport;
|
|
2524
2527
|
}
|
|
2525
|
-
static get webtransportFF() {
|
|
2526
|
-
return e._params.webtransportFF;
|
|
2527
|
-
}
|
|
2528
2528
|
static get waitForRecordResponse() {
|
|
2529
2529
|
return e._params.waitForRecordResponse;
|
|
2530
2530
|
}
|
|
@@ -2568,7 +2568,6 @@ var hn = mn.getInstance(), j = class e {
|
|
|
2568
2568
|
switchVideoAtBadNetwork: e._params.switchVideoAtBadNetwork,
|
|
2569
2569
|
simulcast: e._params.simulcast,
|
|
2570
2570
|
webtransport: e._params.webtransport,
|
|
2571
|
-
webtransportFF: e._params.webtransportFF,
|
|
2572
2571
|
waitForRecordResponse: e._params.waitForRecordResponse,
|
|
2573
2572
|
transparentAudio: e._params.transparentAudio,
|
|
2574
2573
|
enableSessionStateUpdates: e._params.enableSessionStateUpdates
|
|
@@ -2680,7 +2679,6 @@ h(j, "_params", {
|
|
|
2680
2679
|
enableVideoEffectsFpsDegradation: !1,
|
|
2681
2680
|
simulcast: !1,
|
|
2682
2681
|
webtransport: !1,
|
|
2683
|
-
webtransportFF: !1,
|
|
2684
2682
|
waitForRecordResponse: !1,
|
|
2685
2683
|
transparentAudio: !1,
|
|
2686
2684
|
enableSessionStateUpdates: !1
|
|
@@ -3715,15 +3713,15 @@ var U = {
|
|
|
3715
3713
|
getMarkNameScreenshareFirstFrame: ur
|
|
3716
3714
|
}, fr = /* @__PURE__ */ function(e) {
|
|
3717
3715
|
return e.START = "start", e.ACCEPT = "accept", e.JOIN = "join", e.RETRY = "retry", e;
|
|
3718
|
-
}(fr || {}),
|
|
3716
|
+
}(fr || {}), W = /* @__PURE__ */ function(e) {
|
|
3719
3717
|
return e.NOTIFICATION = "NOTIFICATION", e.FAILED = "FAILED", e.RECONNECT = "RECONNECT", e;
|
|
3720
|
-
}(
|
|
3718
|
+
}(W || {}), G = /* @__PURE__ */ function(e) {
|
|
3721
3719
|
return e.TRANSMITTED_DATA = "transmitted-data", e.ACCEPTED_CALL = "accepted-call", e.HUNGUP = "hungup", e.PARTICIPANT_ADDED = "participant-added", e.PARTICIPANT_JOINED = "participant-joined", e.CLOSED_CONVERSATION = "closed-conversation", e.MEDIA_SETTINGS_CHANGED = "media-settings-changed", e.PARTICIPANT_STATE_CHANGED = "participant-state-changed", e.PARTICIPANTS_STATE_CHANGED = "participants-state-changed", e.RATE_CALL_DATA = "rate-call-data", e.FEATURE_SET_CHANGED = "feature-set-changed", e.TOPOLOGY_CHANGED = "topology-changed", e.PRODUCER_UPDATED = "producer-updated", e.CONSUMER_ANSWERED = "consumer-answered", e.MULTIPARTY_CHAT_CREATED = "multiparty-chat-created", e.FORCE_MEDIA_SETTINGS_CHANGE = "force-media-settings-change", e.SETTINGS_UPDATE = "settings-update", e.VIDEO_QUALITY_UPDATE = "video-quality-update", e.REGISTERED_PEER = "registered-peer", e.SWITCH_MICRO = "switch-micro", e.RECORD_STARTED = "record-started", e.RECORD_STOPPED = "record-stopped", e.REALLOC_CON = "realloc-con", e.AUDIO_ACTIVITY = "audio-activity", e.SPEAKER_CHANGED = "speaker-changed", e.SESSION_STATE = "session-state", e.STALLED_ACTIVITY = "stalled-activity", e.CHAT_MESSAGE = "chat-message", e.CUSTOM_DATA = "custom-data", e.ROLES_CHANGED = "roles-changed", e.MUTE_PARTICIPANT = "mute-participant", e.PIN_PARTICIPANT = "pin-participant", e.OPTIONS_CHANGED = "options-changed", e.NETWORK_STATUS = "network-status", e.PARTICIPANT_SOURCES_UPDATE = "participant-sources-update", e.PROMOTE_PARTICIPANT = "promote-participant", e.CHAT_ROOM_UPDATED = "chat-room-updated", e.PROMOTION_APPROVED = "promotion-approved", e.JOIN_LINK_CHANGED = "join-link-changed", e.FEEDBACK = "feedback", e.MOVIE_UPDATE_NOTIFICATION = "movie-update-notification", e.MOVIE_SHARE_STARTED = "movie-share-started", e.MOVIE_SHARE_STOPPED = "movie-share-stopped", e.URL_SHARING_INFO_UPDATED = "url-sharing-info-updated", e.ROOM_UPDATED = "room-updated", e.ROOMS_UPDATED = "rooms-updated", e.ROOM_PARTICIPANTS_UPDATED = "room-participants-updated", e.FEATURES_PER_ROLE_CHANGED = "features-per-role-changed", e.PARTICIPANT_ANIMOJI_CHANGED = "participant-animoji-changed", e.ASR_STARTED = "asr-started", e.ASR_STOPPED = "asr-stopped", e.DECORATIVE_PARTICIPANT_ID_CHANGED = "decorative-participant-id-changed", e.VIDEO_SUSPEND_SUGGEST = "video-suspend-suggest", e.HOLD = "hold", e;
|
|
3722
|
-
}(
|
|
3720
|
+
}(G || {}), pr = /* @__PURE__ */ function(e) {
|
|
3723
3721
|
return e.WEBSOCKET = "ws", e.WEBTRANSPORT = "wt", e;
|
|
3724
|
-
}({}),
|
|
3722
|
+
}({}), mr = /* @__PURE__ */ function(e) {
|
|
3725
3723
|
return e.CONNECTED = "connected", e.RECONNECTED = "reconnected", e.FAILED_PINGS = "failed_pings", e.FAILED_EXCEPTIONS = "failed_exception", e.TIMEOUT = "timeout", e.RESTART = "restart", e;
|
|
3726
|
-
}({}),
|
|
3724
|
+
}({}), hr = {
|
|
3727
3725
|
connected: {
|
|
3728
3726
|
wt: V.WEBTRANSPORT_CONNECTED,
|
|
3729
3727
|
ws: V.WEBSOCKET_CONNECTED
|
|
@@ -3748,32 +3746,32 @@ var U = {
|
|
|
3748
3746
|
wt: V.WEBTRANSPORT_RESTART,
|
|
3749
3747
|
ws: V.WEBSOCKET_RESTART
|
|
3750
3748
|
}
|
|
3751
|
-
},
|
|
3749
|
+
}, K = /* @__PURE__ */ function(e) {
|
|
3752
3750
|
return e.IDLE = "IDLE", e.OPENED = "OPENED", e.CONNECTING = "CONNECTING", e.RECONNECTING = "RECONNECTING", e.CONNECTED = "CONNECTED", e.CLOSED = "CLOSED", e.FAILED = "FAILED", e;
|
|
3753
|
-
}(
|
|
3751
|
+
}(K || {}), q = /* @__PURE__ */ function(e) {
|
|
3754
3752
|
return e.DIRECT = "DIRECT", e.SERVER = "SERVER", e;
|
|
3755
|
-
}(
|
|
3753
|
+
}(q || {}), gr = /* @__PURE__ */ function(e) {
|
|
3756
3754
|
return e.producerNotification = "producerNotification", e.producerCommand = "producerCommand", e.consumerScreenShare = "consumerScreenShare", e.producerScreenShare = "producerScreenShare", e.asr = "asr", e.animoji = "animoji", e;
|
|
3757
|
-
}(
|
|
3758
|
-
function
|
|
3759
|
-
return e === null || t === null ? e === null && t === null : e.maxDimension !== t.maxDimension || e.maxBitrateK !== t.maxBitrateK || e.maxFramerate !== t.maxFramerate || e.degradationPreference !== t.degradationPreference || e.scalabilityMode !== t.scalabilityMode ||
|
|
3755
|
+
}(gr || {}), { isObject: _r, isObjectsEquals: vr } = A;
|
|
3756
|
+
function yr(e, t) {
|
|
3757
|
+
return e === null || t === null ? e === null && t === null : e.maxDimension !== t.maxDimension || e.maxBitrateK !== t.maxBitrateK || e.maxFramerate !== t.maxFramerate || e.degradationPreference !== t.degradationPreference || e.scalabilityMode !== t.scalabilityMode || _r(e.bitrates) && _r(t.bitrates) && !vr(e.bitrates, t.bitrates, !0) ? !1 : e.bitrates === t.bitrates;
|
|
3760
3758
|
}
|
|
3761
|
-
var
|
|
3759
|
+
var br = /* @__PURE__ */ function(e) {
|
|
3762
3760
|
return e.L1T1 = "L1T1", e.L1T2 = "L1T2", e.L1T3 = "L1T3", e;
|
|
3763
3761
|
}({});
|
|
3764
3762
|
//#endregion
|
|
3765
3763
|
//#region src/types/ServerSettings.ts
|
|
3766
|
-
function
|
|
3767
|
-
return !(!
|
|
3764
|
+
function xr(e, t) {
|
|
3765
|
+
return !(!yr(e.camera, t.camera) || !yr(e.screenSharing, t.screenSharing) || !yr(e.fastScreenSharing, t.fastScreenSharing));
|
|
3768
3766
|
}
|
|
3769
|
-
function
|
|
3767
|
+
function Sr(e, t) {
|
|
3770
3768
|
return {
|
|
3771
3769
|
camera: Object.assign({}, e.camera, t.camera),
|
|
3772
3770
|
screenSharing: Object.assign({}, e.screenSharing, t.screenSharing),
|
|
3773
3771
|
fastScreenSharing: Object.assign({}, e.fastScreenSharing, t.fastScreenSharing)
|
|
3774
3772
|
};
|
|
3775
3773
|
}
|
|
3776
|
-
function
|
|
3774
|
+
function Cr() {
|
|
3777
3775
|
return {
|
|
3778
3776
|
camera: null,
|
|
3779
3777
|
screenSharing: null,
|
|
@@ -3782,14 +3780,14 @@ function wr() {
|
|
|
3782
3780
|
}
|
|
3783
3781
|
//#endregion
|
|
3784
3782
|
//#region src/classes/transport/BaseTransport.ts
|
|
3785
|
-
var
|
|
3783
|
+
var wr = class extends y {
|
|
3786
3784
|
constructor(e, t) {
|
|
3787
|
-
super(), h(this, "_signaling", void 0), h(this, "_mediaSource", void 0), h(this, "_state",
|
|
3785
|
+
super(), h(this, "_signaling", void 0), h(this, "_mediaSource", void 0), h(this, "_state", K.IDLE), h(this, "_pc", null), this._signaling = e, this._mediaSource = t;
|
|
3788
3786
|
}
|
|
3789
3787
|
getState() {
|
|
3790
|
-
return this._state ||
|
|
3788
|
+
return this._state || K.IDLE;
|
|
3791
3789
|
}
|
|
3792
|
-
},
|
|
3790
|
+
}, Tr = class {
|
|
3793
3791
|
constructor(e, t = null) {
|
|
3794
3792
|
h(this, "weightUp", void 0), h(this, "weightDown", void 0), h(this, "value", NaN), this.weightUp = e, this.weightDown = t ?? e;
|
|
3795
3793
|
}
|
|
@@ -3807,7 +3805,7 @@ var Tr = class extends y {
|
|
|
3807
3805
|
getValue() {
|
|
3808
3806
|
return this.value;
|
|
3809
3807
|
}
|
|
3810
|
-
},
|
|
3808
|
+
}, Er = .25, Dr = .35, Or = 85, kr = .1, Ar = 1.5, jr = .1, Mr = 1, Nr = .6, Pr = .3, Fr = class extends y {
|
|
3811
3809
|
constructor(e, t = L) {
|
|
3812
3810
|
super(), h(this, "_signaling", void 0), h(this, "_localNetworkStat", void 0), h(this, "_remoteNetworkStat", void 0), h(this, "_lastNetworkStat", void 0), h(this, "_networkLimits", {
|
|
3813
3811
|
badNet: {
|
|
@@ -3819,8 +3817,8 @@ var Tr = class extends y {
|
|
|
3819
3817
|
rtt: 600
|
|
3820
3818
|
}
|
|
3821
3819
|
}), h(this, "_lastStatSentTimestamp", 0), h(this, "_currentState", "good"), h(this, "_debug", void 0), this._debug = t, this._signaling = e, this._localNetworkStat = {
|
|
3822
|
-
rtt: new Er
|
|
3823
|
-
loss: new
|
|
3820
|
+
rtt: new Tr(Er, Er),
|
|
3821
|
+
loss: new Tr(Dr, Dr),
|
|
3824
3822
|
bitrate: 0
|
|
3825
3823
|
}, this._remoteNetworkStat = {
|
|
3826
3824
|
rtt: 0,
|
|
@@ -3835,20 +3833,20 @@ var Tr = class extends y {
|
|
|
3835
3833
|
_calcRttRating(e) {
|
|
3836
3834
|
let t = typeof e == "number" ? e : e.getValue(), n = 1;
|
|
3837
3835
|
if (isNaN(t)) return n;
|
|
3838
|
-
let r = Math.round((t - this._networkLimits.goodNet.rtt) /
|
|
3839
|
-
for (let e = 0; e < r; e++) n *= 1 -
|
|
3836
|
+
let r = Math.round((t - this._networkLimits.goodNet.rtt) / Or);
|
|
3837
|
+
for (let e = 0; e < r; e++) n *= 1 - kr;
|
|
3840
3838
|
return n;
|
|
3841
3839
|
}
|
|
3842
3840
|
_calcLossRating(e) {
|
|
3843
3841
|
let t = typeof e == "number" ? e : e.getValue(), n = 1;
|
|
3844
3842
|
if (isNaN(t)) return n;
|
|
3845
|
-
let r = Math.round((t - this._networkLimits.goodNet.loss) /
|
|
3846
|
-
for (let e = 0; e < r; e++) n *= 1 -
|
|
3843
|
+
let r = Math.round((t - this._networkLimits.goodNet.loss) / Ar);
|
|
3844
|
+
for (let e = 0; e < r; e++) n *= 1 - jr;
|
|
3847
3845
|
return n;
|
|
3848
3846
|
}
|
|
3849
3847
|
_calcBitrateRating(e, t) {
|
|
3850
3848
|
if (!e || !t) return 1;
|
|
3851
|
-
let n = 1 - (1 - Math.min(e, t) / Math.max(e, t)) *
|
|
3849
|
+
let n = 1 - (1 - Math.min(e, t) / Math.max(e, t)) * Mr;
|
|
3852
3850
|
return Math.min(n, 1);
|
|
3853
3851
|
}
|
|
3854
3852
|
_calcUDPRating({ rtt: e, loss: t }) {
|
|
@@ -3858,7 +3856,7 @@ var Tr = class extends y {
|
|
|
3858
3856
|
return n ? this._calcBitrateRating(e.bitrate, t.bitrate) : this._calcUDPRating(e) * this._calcUDPRating(t);
|
|
3859
3857
|
}
|
|
3860
3858
|
_getNetworkState(e) {
|
|
3861
|
-
return isNaN(e) || e >=
|
|
3859
|
+
return isNaN(e) || e >= Nr ? "good" : e >= Pr ? "medium" : "bad";
|
|
3862
3860
|
}
|
|
3863
3861
|
updateSettings(e) {
|
|
3864
3862
|
Object.assign(this._networkLimits.badNet, e?.badNet || {}), Object.assign(this._networkLimits.goodNet, e?.goodNet || {});
|
|
@@ -3882,7 +3880,7 @@ var Tr = class extends y {
|
|
|
3882
3880
|
let { rtt: t, loss: n, bitrate: r } = e || {};
|
|
3883
3881
|
this._remoteNetworkStat.rtt = t || 0, this._remoteNetworkStat.loss = n || 0, this._remoteNetworkStat.bitrate = r || 0;
|
|
3884
3882
|
}
|
|
3885
|
-
},
|
|
3883
|
+
}, Ir = 30 * 1e3, Lr = class e extends wr {
|
|
3886
3884
|
constructor(e, t, n, r, i, a = L, o = null, s = null, c = null) {
|
|
3887
3885
|
super(n, r), h(this, "_participantId", void 0), h(this, "_isMaster", void 0), h(this, "_remoteSDP", {}), h(this, "_remoteCandidates", {}), h(this, "_lastRemoteSDP", null), h(this, "_animojiDataChannel", null), h(this, "_animojiReceiver", null), h(this, "_animojiSender", null), h(this, "_remoteAnimojiVersion", 1), h(this, "_isOpen", !1), h(this, "_remotePeerId", null), h(this, "_statInterval", null), h(this, "_settingsInterval", null), h(this, "_failedOnCreate", null), h(this, "_remoteStream", null), h(this, "_iceRestartTimeout", null), h(this, "_reconnectionTimeout", null), h(this, "_reconnectionPrevented", !1), h(this, "_remoteHold", !1), h(this, "_lastStat", null), h(this, "_fingerprint", null), h(this, "_neverConnected", !0), h(this, "_serverSettings", void 0), h(this, "_prevConsumerSettings", {}), h(this, "_networkLimitsForVideo", {
|
|
3888
3886
|
bad: {
|
|
@@ -3897,7 +3895,7 @@ var Tr = class extends y {
|
|
|
3897
3895
|
worst: 320,
|
|
3898
3896
|
bad: 640,
|
|
3899
3897
|
good: 1280
|
|
3900
|
-
}), h(this, "_lastVideoMaxDimension", this._videoMaxDimensionsForNet.good), h(this, "_lastBadConnection", 0), h(this, "_perfStatReporter", void 0), h(this, "_directStatReporter", void 0), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_statAggregator", void 0), h(this, "_codecStatsAggregator", void 0), this._participantId = e, this._isMaster = t, this._serverSettings = i, this._debug = a, this._logger = o, this._statAggregator = s, this._codecStatsAggregator = c, this._perfStatReporter = new ia(this, n, this._statAggregator, !0, this._debug), this._directStatReporter = new
|
|
3898
|
+
}), h(this, "_lastVideoMaxDimension", this._videoMaxDimensionsForNet.good), h(this, "_lastBadConnection", 0), h(this, "_perfStatReporter", void 0), h(this, "_directStatReporter", void 0), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_statAggregator", void 0), h(this, "_codecStatsAggregator", void 0), this._participantId = e, this._isMaster = t, this._serverSettings = i, this._debug = a, this._logger = o, this._statAggregator = s, this._codecStatsAggregator = c, this._perfStatReporter = new ia(this, n, this._statAggregator, !0, this._debug), this._directStatReporter = new Fr(n, this._debug), this.subscribe(this._signaling, W.NOTIFICATION, this._onSignalingNotification.bind(this)), this.subscribe(this._mediaSource, qt.TRACK_REPLACED, this._onReplacedTrack.bind(this)), this.subscribe(this._mediaSource, qt.SOURCE_CHANGED, this._applySettings.bind(this)), this.subscribe(this._directStatReporter, J.NETWORK_STATUS, this._onNetworkStatus.bind(this));
|
|
3901
3899
|
try {
|
|
3902
3900
|
this._pc = this._createPeerConnection();
|
|
3903
3901
|
} catch (e) {
|
|
@@ -3912,7 +3910,7 @@ var Tr = class extends y {
|
|
|
3912
3910
|
return;
|
|
3913
3911
|
}
|
|
3914
3912
|
this._createOffer(!1).catch((e) => {
|
|
3915
|
-
this._state ===
|
|
3913
|
+
this._state === K.IDLE ? this._failedOnCreate = e : this.close(e);
|
|
3916
3914
|
});
|
|
3917
3915
|
}
|
|
3918
3916
|
this._startSettingsInterval();
|
|
@@ -3925,9 +3923,9 @@ var Tr = class extends y {
|
|
|
3925
3923
|
}
|
|
3926
3924
|
_isDeadConnection() {
|
|
3927
3925
|
return !this._pc || [
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3926
|
+
K.IDLE,
|
|
3927
|
+
K.CLOSED,
|
|
3928
|
+
K.FAILED
|
|
3931
3929
|
].includes(this.getState());
|
|
3932
3930
|
}
|
|
3933
3931
|
async open(e = null) {
|
|
@@ -3945,7 +3943,7 @@ var Tr = class extends y {
|
|
|
3945
3943
|
this._logger?.log(S.ERROR, "addTrack-direct"), this._debug.error("DirectTransport: Unable to add media source tracks", e, { participantId: this._participantId }), this.close(e);
|
|
3946
3944
|
return;
|
|
3947
3945
|
}
|
|
3948
|
-
this._setState(
|
|
3946
|
+
this._setState(K.OPENED);
|
|
3949
3947
|
let t = e;
|
|
3950
3948
|
if (!e) {
|
|
3951
3949
|
let e = Object.keys(this._remoteSDP);
|
|
@@ -3960,7 +3958,7 @@ var Tr = class extends y {
|
|
|
3960
3958
|
this._remoteSDP = {}, this._remoteCandidates = {};
|
|
3961
3959
|
}
|
|
3962
3960
|
updateSettings(e) {
|
|
3963
|
-
|
|
3961
|
+
xr(e, this._serverSettings) || (this._serverSettings = e, this._applySettings());
|
|
3964
3962
|
}
|
|
3965
3963
|
preventRestart() {
|
|
3966
3964
|
this._reconnectionPrevented = !0;
|
|
@@ -3994,14 +3992,14 @@ var Tr = class extends y {
|
|
|
3994
3992
|
}
|
|
3995
3993
|
this._startSettingsInterval(), this._isMaster && this._createOffer(!1).catch((e) => {
|
|
3996
3994
|
this._debug.error("Unable to create offer after unhold", e, { participantId: this._participantId });
|
|
3997
|
-
}), this._setState(
|
|
3995
|
+
}), this._setState(K.CONNECTING);
|
|
3998
3996
|
}
|
|
3999
3997
|
_createPeerConnection() {
|
|
4000
3998
|
let e = new RTCPeerConnection({
|
|
4001
3999
|
iceServers: j.iceServers,
|
|
4002
4000
|
iceTransportPolicy: j.forceRelayPolicy ? "relay" : "all"
|
|
4003
4001
|
});
|
|
4004
|
-
return e.onicecandidate = this._handleIceCandidate.bind(this), e.ontrack = this._onAddTrack.bind(this), e.oniceconnectionstatechange = this._onIceConnectionStateChange.bind(this), e.onconnectionstatechange = this._onConnectionStateChange.bind(this), e.onsignalingstatechange = this._onSignalingStateChange.bind(this), this._prevConsumerSettings = {}, j.vmoji && this._createDataChannel(e,
|
|
4002
|
+
return e.onicecandidate = this._handleIceCandidate.bind(this), e.ontrack = this._onAddTrack.bind(this), e.oniceconnectionstatechange = this._onIceConnectionStateChange.bind(this), e.onconnectionstatechange = this._onConnectionStateChange.bind(this), e.onsignalingstatechange = this._onSignalingStateChange.bind(this), this._prevConsumerSettings = {}, j.vmoji && this._createDataChannel(e, gr.animoji, (e) => {
|
|
4005
4003
|
this._animojiDataChannel = e, this._animojiDataChannel.binaryType = "arraybuffer", this._animojiReceiver?.setDataChannel(this._animojiDataChannel), this._animojiSender?.setDataChannel(this._animojiDataChannel);
|
|
4006
4004
|
}), e;
|
|
4007
4005
|
}
|
|
@@ -4021,20 +4019,20 @@ var Tr = class extends y {
|
|
|
4021
4019
|
}
|
|
4022
4020
|
}
|
|
4023
4021
|
close(e) {
|
|
4024
|
-
this._isOpen && (this._isOpen = !1, this._stopReconnection(), this._stopStatInterval(), this._stopSettingsInterval(), this._disposePeerConnection(), this._onNetworkStatus(1), this.unsubscribe(), e ? (this._debug.error("DirectTransport: Closed", e, { participantId: this._participantId }), this._setState(
|
|
4022
|
+
this._isOpen && (this._isOpen = !1, this._stopReconnection(), this._stopStatInterval(), this._stopSettingsInterval(), this._disposePeerConnection(), this._onNetworkStatus(1), this.unsubscribe(), e ? (this._debug.error("DirectTransport: Closed", e, { participantId: this._participantId }), this._setState(K.FAILED)) : (this._debug.debug("DirectTransport: Closed", { participantId: this._participantId }), this._setState(K.CLOSED)), this._triggerEvent(J.PEER_CONNECTION_CLOSED));
|
|
4025
4023
|
}
|
|
4026
4024
|
_setState(e) {
|
|
4027
4025
|
this._state !== e && (this._debug.debug(`DirectTransport: State changed to ${e}`, { participantId: this._participantId }), this._state = e, this._triggerEvent(J.STATE_CHANGED, e));
|
|
4028
4026
|
}
|
|
4029
4027
|
_onSignalingNotification(e) {
|
|
4030
4028
|
switch (e.notification) {
|
|
4031
|
-
case
|
|
4029
|
+
case G.TRANSMITTED_DATA:
|
|
4032
4030
|
this._handleTransmittedData(e);
|
|
4033
4031
|
break;
|
|
4034
|
-
case
|
|
4032
|
+
case G.SETTINGS_UPDATE:
|
|
4035
4033
|
this._directStatReporter.updateSettings(e.settings);
|
|
4036
4034
|
break;
|
|
4037
|
-
case
|
|
4035
|
+
case G.CUSTOM_DATA:
|
|
4038
4036
|
Object.hasOwn(e.data, "sdk") && this._directStatReporter.reportRemote(e.data?.sdk);
|
|
4039
4037
|
break;
|
|
4040
4038
|
}
|
|
@@ -4125,7 +4123,7 @@ var Tr = class extends y {
|
|
|
4125
4123
|
switch (this._debug.debug(`DirectTransport: Ice Connection state changed to ${this._pc?.iceConnectionState}`, { participantId: this._participantId }), this._pc?.iceConnectionState) {
|
|
4126
4124
|
case "checking":
|
|
4127
4125
|
let e = this.getState();
|
|
4128
|
-
e ===
|
|
4126
|
+
e === K.IDLE || e === K.OPENED ? this._setState(K.CONNECTING) : this._setState(K.RECONNECTING);
|
|
4129
4127
|
break;
|
|
4130
4128
|
case "connected":
|
|
4131
4129
|
case "completed":
|
|
@@ -4134,7 +4132,7 @@ var Tr = class extends y {
|
|
|
4134
4132
|
}
|
|
4135
4133
|
}
|
|
4136
4134
|
_markConnected() {
|
|
4137
|
-
this._neverConnected = !1, this._setState(
|
|
4135
|
+
this._neverConnected = !1, this._setState(K.CONNECTED), this._stopReconnection(), this._pc && A.getPeerConnectionHostInfo(this._pc).then((e) => {
|
|
4138
4136
|
e?.local && (this._logger?.log(S.ICE_CONNECTION_TYPE, e.local.type), this._debug.debug("Selected ICE candidates", e));
|
|
4139
4137
|
}), this._startStatInterval();
|
|
4140
4138
|
}
|
|
@@ -4145,7 +4143,7 @@ var Tr = class extends y {
|
|
|
4145
4143
|
break;
|
|
4146
4144
|
case "failed":
|
|
4147
4145
|
case "disconnected":
|
|
4148
|
-
this._remoteHold ? this._debug.log("Remote participant on hold, skipping reconnection", { participantId: this._participantId }) : this._reconnectionPrevented ? this.close(/* @__PURE__ */ Error(`Ice connection ${this._pc.connectionState}`)) : (this._setState(
|
|
4146
|
+
this._remoteHold ? this._debug.log("Remote participant on hold, skipping reconnection", { participantId: this._participantId }) : this._reconnectionPrevented ? this.close(/* @__PURE__ */ Error(`Ice connection ${this._pc.connectionState}`)) : (this._setState(K.RECONNECTING), this._startReconnection());
|
|
4149
4147
|
break;
|
|
4150
4148
|
case "closed":
|
|
4151
4149
|
this._remoteHold || this.close(/* @__PURE__ */ Error("Ice connection closed"));
|
|
@@ -4158,7 +4156,7 @@ var Tr = class extends y {
|
|
|
4158
4156
|
}, j.transportConnectionWaitTime));
|
|
4159
4157
|
}
|
|
4160
4158
|
_requestTopologySwitch() {
|
|
4161
|
-
this._isMaster && this._signaling.ready && (this._debug.log("Switch topology DIRECT to SERVER", { participantId: this._participantId }), this._signaling.switchTopology(
|
|
4159
|
+
this._isMaster && this._signaling.ready && (this._debug.log("Switch topology DIRECT to SERVER", { participantId: this._participantId }), this._signaling.switchTopology(q.SERVER));
|
|
4162
4160
|
}
|
|
4163
4161
|
_stopReconnection() {
|
|
4164
4162
|
this._reconnectionTimeout && (clearTimeout(this._reconnectionTimeout), this._reconnectionTimeout = null), this._iceRestartTimeout && (clearTimeout(this._iceRestartTimeout), this._iceRestartTimeout = null);
|
|
@@ -4241,17 +4239,17 @@ var Tr = class extends y {
|
|
|
4241
4239
|
this._lastStat = t, this._codecStatsAggregator?.reportUsage(t);
|
|
4242
4240
|
let n = {
|
|
4243
4241
|
inbound: {
|
|
4244
|
-
topology:
|
|
4242
|
+
topology: q.DIRECT,
|
|
4245
4243
|
transport: t.transport,
|
|
4246
4244
|
rtps: t.rtps.filter((e) => e.type === "inbound-rtp" ? (e.userId = this._participantId, !0) : !1)
|
|
4247
4245
|
},
|
|
4248
4246
|
outbound: {
|
|
4249
|
-
topology:
|
|
4247
|
+
topology: q.DIRECT,
|
|
4250
4248
|
transport: t.transport,
|
|
4251
4249
|
rtps: t.rtps.filter((e) => e.type === "outbound-rtp")
|
|
4252
4250
|
},
|
|
4253
4251
|
remoteInbound: {
|
|
4254
|
-
topology:
|
|
4252
|
+
topology: q.DIRECT,
|
|
4255
4253
|
transport: t.transport,
|
|
4256
4254
|
rtps: t.remoteRtps ?? []
|
|
4257
4255
|
}
|
|
@@ -4285,8 +4283,8 @@ var Tr = class extends y {
|
|
|
4285
4283
|
}
|
|
4286
4284
|
async _checkPPTNetwork(e) {
|
|
4287
4285
|
if (!j.switchVideoAtBadNetwork || !e.inbound.transport.averageNetStat) return;
|
|
4288
|
-
let { averageNetStat: t } = e.inbound.transport, n = t.currentRoundTripTime <= this._networkLimitsForVideo.good.rtt && t.lostPercent <= this._networkLimitsForVideo.good.loss, r = t.currentRoundTripTime >= this._networkLimitsForVideo.bad.rtt || t.lostPercent >= this._networkLimitsForVideo.bad.loss, i = t.currentRoundTripTime < this._networkLimitsForVideo.bad.rtt, a = this._videoMaxDimensionsForNet.good, o =
|
|
4289
|
-
if (r ? (this._lastBadConnection = Date.now(), i ? (a = this._videoMaxDimensionsForNet.bad, o =
|
|
4286
|
+
let { averageNetStat: t } = e.inbound.transport, n = t.currentRoundTripTime <= this._networkLimitsForVideo.good.rtt && t.lostPercent <= this._networkLimitsForVideo.good.loss, r = t.currentRoundTripTime >= this._networkLimitsForVideo.bad.rtt || t.lostPercent >= this._networkLimitsForVideo.bad.loss, i = t.currentRoundTripTime < this._networkLimitsForVideo.bad.rtt, a = this._videoMaxDimensionsForNet.good, o = br.L1T1;
|
|
4287
|
+
if (r ? (this._lastBadConnection = Date.now(), i ? (a = this._videoMaxDimensionsForNet.bad, o = br.L1T2) : (a = this._videoMaxDimensionsForNet.worst, o = br.L1T3)) : n && (a = this._videoMaxDimensionsForNet.good, o = br.L1T1), !(a < this._lastVideoMaxDimension || Date.now() - this._lastBadConnection > Ir) || this._lastVideoMaxDimension === a) return;
|
|
4290
4288
|
let s = this._serverSettings.camera;
|
|
4291
4289
|
if (!s || !await this._isSVCSupported(e, o)) return;
|
|
4292
4290
|
this._debug.debug("Switch outbound video frame size and scalabilityMode", {
|
|
@@ -4351,9 +4349,9 @@ var Tr = class extends y {
|
|
|
4351
4349
|
}, n(r)) : this._debug.error(`[${t}] data channel open failed, state [${e}]`);
|
|
4352
4350
|
};
|
|
4353
4351
|
}
|
|
4354
|
-
},
|
|
4352
|
+
}, Rr = /* @__PURE__ */ function(e) {
|
|
4355
4353
|
return e.AUDIO_MIX = "audio-mix", e.PARTICIPANT_AGNOSTIC_TRACK_PREFIX = "pat", e.TRANSPARENT_AUDIO_TRACK_PREFIX = "ta", e;
|
|
4356
|
-
}({}),
|
|
4354
|
+
}({}), zr = 16, Br = class e {
|
|
4357
4355
|
constructor(e, t, n, r = L) {
|
|
4358
4356
|
h(this, "_datachannel", void 0), h(this, "_participantIdRegistry", void 0), h(this, "_asrCallback", void 0), h(this, "_textDecoder", void 0), h(this, "_debug", void 0), this._debug = r, this._debug.debug("AsrReceiver started"), this._datachannel = e, this._participantIdRegistry = t, this._asrCallback = n, this._textDecoder = new TextDecoder(), this._datachannel.onmessage = (e) => this._onDataChannelMessage(e.data);
|
|
4359
4357
|
}
|
|
@@ -4367,7 +4365,7 @@ var Tr = class extends y {
|
|
|
4367
4365
|
ssrc: a,
|
|
4368
4366
|
timestamp: o,
|
|
4369
4367
|
duration: s,
|
|
4370
|
-
data: e.slice(
|
|
4368
|
+
data: e.slice(zr)
|
|
4371
4369
|
};
|
|
4372
4370
|
}
|
|
4373
4371
|
_onDataChannelMessage(t) {
|
|
@@ -4387,7 +4385,7 @@ var Tr = class extends y {
|
|
|
4387
4385
|
destroy() {
|
|
4388
4386
|
this._datachannel.onmessage = null;
|
|
4389
4387
|
}
|
|
4390
|
-
},
|
|
4388
|
+
}, Vr, Hr = class {
|
|
4391
4389
|
constructor() {
|
|
4392
4390
|
h(this, "_value", 1);
|
|
4393
4391
|
}
|
|
@@ -4398,10 +4396,10 @@ var Tr = class extends y {
|
|
|
4398
4396
|
this._value = e;
|
|
4399
4397
|
}
|
|
4400
4398
|
};
|
|
4401
|
-
|
|
4399
|
+
Vr = Hr, h(Hr, "_instance", null), h(Hr, "getInstance", () => (Vr._instance || (Vr._instance = new Vr()), Vr._instance));
|
|
4402
4400
|
//#endregion
|
|
4403
4401
|
//#region src/classes/ParticipantIdRegistry.ts
|
|
4404
|
-
var
|
|
4402
|
+
var Ur = class {
|
|
4405
4403
|
constructor(e = L) {
|
|
4406
4404
|
h(this, "streamDescriptionByCompactId", /* @__PURE__ */ new Map()), h(this, "compactIdByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_debug", void 0), this._debug = e;
|
|
4407
4405
|
}
|
|
@@ -4429,25 +4427,25 @@ var Wr = class {
|
|
|
4429
4427
|
}
|
|
4430
4428
|
return n === 2 ? {
|
|
4431
4429
|
type: "notification",
|
|
4432
|
-
notification:
|
|
4430
|
+
notification: G.AUDIO_ACTIVITY,
|
|
4433
4431
|
activeParticipants: i
|
|
4434
4432
|
} : {
|
|
4435
4433
|
type: "notification",
|
|
4436
|
-
notification:
|
|
4434
|
+
notification: G.STALLED_ACTIVITY,
|
|
4437
4435
|
stalledParticipants: i
|
|
4438
4436
|
};
|
|
4439
4437
|
case 3:
|
|
4440
4438
|
let a = s(r);
|
|
4441
4439
|
return {
|
|
4442
4440
|
type: "notification",
|
|
4443
|
-
notification:
|
|
4441
|
+
notification: G.SPEAKER_CHANGED,
|
|
4444
4442
|
speaker: this.getStreamDescription(a)?.participantId
|
|
4445
4443
|
};
|
|
4446
4444
|
case 5:
|
|
4447
4445
|
let o = s(r);
|
|
4448
4446
|
return {
|
|
4449
4447
|
type: "notification",
|
|
4450
|
-
notification:
|
|
4448
|
+
notification: G.VIDEO_QUALITY_UPDATE,
|
|
4451
4449
|
quality: {
|
|
4452
4450
|
maxBitrate: o[0],
|
|
4453
4451
|
maxDimension: o[1]
|
|
@@ -4462,7 +4460,7 @@ var Wr = class {
|
|
|
4462
4460
|
}
|
|
4463
4461
|
return {
|
|
4464
4462
|
type: "notification",
|
|
4465
|
-
notification:
|
|
4463
|
+
notification: G.NETWORK_STATUS,
|
|
4466
4464
|
statuses: l
|
|
4467
4465
|
};
|
|
4468
4466
|
case 7: return this._createParticipantSourcesUpdateNotification(r);
|
|
@@ -4481,7 +4479,7 @@ var Wr = class {
|
|
|
4481
4479
|
});
|
|
4482
4480
|
return {
|
|
4483
4481
|
type: "notification",
|
|
4484
|
-
notification:
|
|
4482
|
+
notification: G.MOVIE_UPDATE_NOTIFICATION,
|
|
4485
4483
|
data: e
|
|
4486
4484
|
};
|
|
4487
4485
|
}
|
|
@@ -4489,7 +4487,7 @@ var Wr = class {
|
|
|
4489
4487
|
let u = s(r);
|
|
4490
4488
|
return {
|
|
4491
4489
|
type: "notification",
|
|
4492
|
-
notification:
|
|
4490
|
+
notification: G.VIDEO_SUSPEND_SUGGEST,
|
|
4493
4491
|
bandwidth: u
|
|
4494
4492
|
};
|
|
4495
4493
|
default: return this._debug.debug("unsupported message type: " + n), null;
|
|
@@ -4517,7 +4515,7 @@ var Wr = class {
|
|
|
4517
4515
|
this._debug.error("unexpected null sequenceNumber", e, r);
|
|
4518
4516
|
continue;
|
|
4519
4517
|
}
|
|
4520
|
-
let l =
|
|
4518
|
+
let l = Rr.PARTICIPANT_AGNOSTIC_TRACK_PREFIX + "-" + e, u = i ? i >>> 0 : null;
|
|
4521
4519
|
n.push({
|
|
4522
4520
|
participantStreamDescription: c,
|
|
4523
4521
|
streamId: l,
|
|
@@ -4529,11 +4527,11 @@ var Wr = class {
|
|
|
4529
4527
|
}
|
|
4530
4528
|
return {
|
|
4531
4529
|
type: "notification",
|
|
4532
|
-
notification:
|
|
4530
|
+
notification: G.PARTICIPANT_SOURCES_UPDATE,
|
|
4533
4531
|
participantUpdateInfos: n
|
|
4534
4532
|
};
|
|
4535
4533
|
}
|
|
4536
|
-
},
|
|
4534
|
+
}, Wr = /* @__PURE__ */ function(e) {
|
|
4537
4535
|
return e.INIT = "init", e.READY = "ready", e.FRAME = "frame", e.SET_BITRATE = "set_bitrate", e.ERROR = "error", e.DEBUG = "debug", e.LOG_ERROR = "log_error", e;
|
|
4538
4536
|
}({}), Gr = class {
|
|
4539
4537
|
constructor(e = L, t = null) {
|
|
@@ -4551,7 +4549,7 @@ var Wr = class {
|
|
|
4551
4549
|
return;
|
|
4552
4550
|
}
|
|
4553
4551
|
t({
|
|
4554
|
-
type:
|
|
4552
|
+
type: Wr.FRAME,
|
|
4555
4553
|
error: e
|
|
4556
4554
|
});
|
|
4557
4555
|
};
|
|
@@ -4561,23 +4559,23 @@ var Wr = class {
|
|
|
4561
4559
|
e.preventDefault?.(), m(this._formatWorkerMessageError(e));
|
|
4562
4560
|
}, f.onmessage = (e) => {
|
|
4563
4561
|
switch (e.data.type) {
|
|
4564
|
-
case
|
|
4562
|
+
case Wr.READY:
|
|
4565
4563
|
s = !0, c || (c = !0, a());
|
|
4566
4564
|
break;
|
|
4567
|
-
case
|
|
4565
|
+
case Wr.ERROR:
|
|
4568
4566
|
s ? m(e.data.error) : p(e.data.error);
|
|
4569
4567
|
break;
|
|
4570
|
-
case
|
|
4568
|
+
case Wr.FRAME:
|
|
4571
4569
|
t(e.data);
|
|
4572
4570
|
break;
|
|
4573
|
-
case
|
|
4571
|
+
case Wr.DEBUG:
|
|
4574
4572
|
this._debug.debug(e.data.message);
|
|
4575
4573
|
break;
|
|
4576
|
-
case
|
|
4574
|
+
case Wr.LOG_ERROR:
|
|
4577
4575
|
this._logger?.log(S.ERROR, e.data.message);
|
|
4578
4576
|
break;
|
|
4579
4577
|
}
|
|
4580
|
-
}, this._sendToWorker(
|
|
4578
|
+
}, this._sendToWorker(Wr.INIT, r, i);
|
|
4581
4579
|
});
|
|
4582
4580
|
}
|
|
4583
4581
|
_removeWorker() {
|
|
@@ -4610,7 +4608,7 @@ var Wr = class {
|
|
|
4610
4608
|
}, [c, c.getUrl]);
|
|
4611
4609
|
}
|
|
4612
4610
|
decodeFrame(e, t, n, r) {
|
|
4613
|
-
this._sendToWorker(
|
|
4611
|
+
this._sendToWorker(Wr.FRAME, {
|
|
4614
4612
|
timestamp: e,
|
|
4615
4613
|
data: t.buffer,
|
|
4616
4614
|
isVP9: n,
|
|
@@ -4634,7 +4632,7 @@ var Wr = class {
|
|
|
4634
4632
|
}, [w.baseChromeVersion() >= 92 || w.browserName() === "Safari"]);
|
|
4635
4633
|
}
|
|
4636
4634
|
decodeFrame(e, t, n, r = !1) {
|
|
4637
|
-
this._sendToWorker(
|
|
4635
|
+
this._sendToWorker(Wr.FRAME, {
|
|
4638
4636
|
timestamp: e,
|
|
4639
4637
|
data: t.buffer,
|
|
4640
4638
|
isVP9: n,
|
|
@@ -5202,7 +5200,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
5202
5200
|
}
|
|
5203
5201
|
_encode(e, t) {
|
|
5204
5202
|
let n = e.data.buffer;
|
|
5205
|
-
this._sendToWorker(
|
|
5203
|
+
this._sendToWorker(Wr.FRAME, {
|
|
5206
5204
|
width: e.width,
|
|
5207
5205
|
height: e.height,
|
|
5208
5206
|
imageData: n,
|
|
@@ -5229,7 +5227,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
5229
5227
|
this._useImageCapture ? this._requestFrameBitmap(e) : this._requestFrameVideo(e);
|
|
5230
5228
|
}
|
|
5231
5229
|
setBitrate(e, t, n) {
|
|
5232
|
-
this._sendToWorker(
|
|
5230
|
+
this._sendToWorker(Wr.SET_BITRATE, {
|
|
5233
5231
|
bitrate: e,
|
|
5234
5232
|
useCbr: t
|
|
5235
5233
|
});
|
|
@@ -5268,10 +5266,10 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
5268
5266
|
}, [n]);
|
|
5269
5267
|
}
|
|
5270
5268
|
requestFrame(e = !1) {
|
|
5271
|
-
this._sendToWorker(
|
|
5269
|
+
this._sendToWorker(Wr.FRAME, { keyFrame: e });
|
|
5272
5270
|
}
|
|
5273
5271
|
setBitrate(e, t, n) {
|
|
5274
|
-
this._sendToWorker(
|
|
5272
|
+
this._sendToWorker(Wr.SET_BITRATE, {
|
|
5275
5273
|
bitrate: e,
|
|
5276
5274
|
useCbr: t,
|
|
5277
5275
|
fps: n
|
|
@@ -5561,14 +5559,14 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
5561
5559
|
t !== null && (this._debug.debug(`cc: send stats: ${JSON.stringify(t)}`), this._signaling.reportSharingStat(t)), this._lastSharingStat = e;
|
|
5562
5560
|
}
|
|
5563
5561
|
}
|
|
5564
|
-
}, Zi = 90, Qi = 4294967295, $i = class e extends
|
|
5562
|
+
}, Zi = 90, Qi = 4294967295, $i = class e extends wr {
|
|
5565
5563
|
constructor(e, t, n, r = L, i = null, a = null, o = null) {
|
|
5566
|
-
super(e, t), h(this, "_producerNotification", null), h(this, "_producerCommand", null), h(this, "_producerScreen", null), h(this, "_consumerScreen", null), h(this, "_asr", null), h(this, "_animojiDataChannel", null), h(this, "_animojiReceiver", null), h(this, "_animojiSender", null), h(this, "_isOpen", !1), h(this, "_observer", !1), h(this, "_reconnectionPrevented", !1), h(this, "_statInterval", null), h(this, "_settingsInterval", null), h(this, "_monitorRtpShareInterval", null), h(this, "_statBytes", {}), h(this, "_ssrcMap", {}), h(this, "_ssrcMapUpdated", !1), h(this, "_perfStatReporter", void 0), h(this, "_producerOfferIsProcessing", !1), h(this, "_producerNextOffer", null), h(this, "_producerNextSessionId", null), h(this, "_lastStat", null), h(this, "_serverSettings", void 0), h(this, "_prevConsumerSettings", {}), h(this, "_prevConsumerFastSharingSettings", {}), h(this, "_asrTrack", null), h(this, "_captureSender", null), h(this, "_captureReceiver", null), h(this, "_participantIdRegistry", null), h(this, "_disabledSenders", /* @__PURE__ */ new Set()), h(this, "_rtpReceiversByStreamId", {}), h(this, "_producerSessionId", ""), h(this, "_newAudioShareTrack", null), h(this, "_simulcastInfo", null), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_statAggregator", void 0), h(this, "_codecStatsAggregator", void 0), this._debug = r, this._logger = i, this._statAggregator = a, this._codecStatsAggregator = o, this.subscribe(this._signaling,
|
|
5564
|
+
super(e, t), h(this, "_producerNotification", null), h(this, "_producerCommand", null), h(this, "_producerScreen", null), h(this, "_consumerScreen", null), h(this, "_asr", null), h(this, "_animojiDataChannel", null), h(this, "_animojiReceiver", null), h(this, "_animojiSender", null), h(this, "_isOpen", !1), h(this, "_observer", !1), h(this, "_reconnectionPrevented", !1), h(this, "_statInterval", null), h(this, "_settingsInterval", null), h(this, "_monitorRtpShareInterval", null), h(this, "_statBytes", {}), h(this, "_ssrcMap", {}), h(this, "_ssrcMapUpdated", !1), h(this, "_perfStatReporter", void 0), h(this, "_producerOfferIsProcessing", !1), h(this, "_producerNextOffer", null), h(this, "_producerNextSessionId", null), h(this, "_lastStat", null), h(this, "_serverSettings", void 0), h(this, "_prevConsumerSettings", {}), h(this, "_prevConsumerFastSharingSettings", {}), h(this, "_asrTrack", null), h(this, "_captureSender", null), h(this, "_captureReceiver", null), h(this, "_participantIdRegistry", null), h(this, "_disabledSenders", /* @__PURE__ */ new Set()), h(this, "_rtpReceiversByStreamId", {}), h(this, "_producerSessionId", ""), h(this, "_newAudioShareTrack", null), h(this, "_simulcastInfo", null), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_statAggregator", void 0), h(this, "_codecStatsAggregator", void 0), this._debug = r, this._logger = i, this._statAggregator = a, this._codecStatsAggregator = o, this.subscribe(this._signaling, W.NOTIFICATION, this._onSignalingNotification.bind(this)), this.subscribe(this._mediaSource, qt.TRACK_REPLACED, this._onReplacedTrack.bind(this)), this.subscribe(this._mediaSource, qt.SOURCE_CHANGED, this._onSourcesChanged.bind(this)), this.subscribe(this._mediaSource, qt.SCREEN_STATUS, this._onScreenSharingStatus.bind(this)), this._createPerfStatsReporter(), this._serverSettings = n, this._debug.debug("ServerTransport: Created");
|
|
5567
5565
|
}
|
|
5568
5566
|
updateStatisticsInterval() {
|
|
5569
5567
|
this._stopStatInterval();
|
|
5570
5568
|
let e = this.getState();
|
|
5571
|
-
e !==
|
|
5569
|
+
e !== K.IDLE && e !== K.CLOSED && e !== K.FAILED && this._startStatInterval();
|
|
5572
5570
|
}
|
|
5573
5571
|
open(e = !1) {
|
|
5574
5572
|
if (this._isOpen) {
|
|
@@ -5578,7 +5576,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
5578
5576
|
this._isOpen = !0, this._observer = e, this._openConnection();
|
|
5579
5577
|
}
|
|
5580
5578
|
close(e) {
|
|
5581
|
-
this._isOpen && (this._isOpen = !1, this._closeConnection(), this.unsubscribe(), e ? (this._debug.error("ServerTransport: Closed", e), this._setState(
|
|
5579
|
+
this._isOpen && (this._isOpen = !1, this._closeConnection(), this.unsubscribe(), e ? (this._debug.error("ServerTransport: Closed", e), this._setState(K.FAILED)) : (this._debug.debug("ServerTransport: Closed"), this._setState(K.CLOSED)));
|
|
5582
5580
|
}
|
|
5583
5581
|
removeParticipant(e) {
|
|
5584
5582
|
this._captureReceiver?.close(e);
|
|
@@ -5590,7 +5588,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
5590
5588
|
this._reconnectionPrevented = !1;
|
|
5591
5589
|
}
|
|
5592
5590
|
updateSettings(e) {
|
|
5593
|
-
|
|
5591
|
+
xr(e, this._serverSettings) || (this._serverSettings = e, this._applyConsumerSettings());
|
|
5594
5592
|
}
|
|
5595
5593
|
setAnimojiTransport(e, t) {
|
|
5596
5594
|
if (j.vmoji && (this._animojiReceiver = e, this._animojiSender = t, this._participantIdRegistry && e.setParticipantIdRegistry(this._participantIdRegistry), this._animojiDataChannel)) {
|
|
@@ -5631,17 +5629,17 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
5631
5629
|
}
|
|
5632
5630
|
this._pc.ontrack = this._onAddTrack.bind(this, this._pc), this._pc.onconnectionstatechange = A.debounce((e) => {
|
|
5633
5631
|
this._pc && this._onConnectionStateChange(this._pc, e);
|
|
5634
|
-
}, 500), this._pc.onsignalingstatechange = this._onSignalingStateChange.bind(this, this._pc), this._participantIdRegistry = new
|
|
5632
|
+
}, 500), this._pc.onsignalingstatechange = this._onSignalingStateChange.bind(this, this._pc), this._participantIdRegistry = new Ur(this._debug), this._signaling.setParticipantIdRegistry(this._participantIdRegistry), this._createDataChannel(this._pc, gr.producerNotification, (e) => {
|
|
5635
5633
|
this._producerNotification = e, this._producerNotification.binaryType = "arraybuffer", this._signaling.setProducerNotificationDataChannel(e);
|
|
5636
|
-
}), this._signaling.useCommandDataChannel(!0), this._createDataChannel(this._pc,
|
|
5634
|
+
}), this._signaling.useCommandDataChannel(!0), this._createDataChannel(this._pc, gr.producerCommand, (e) => {
|
|
5637
5635
|
this._producerCommand = e, this._signaling.setProducerCommandDataChannel(e);
|
|
5638
|
-
}), this._createDataChannel(this._pc,
|
|
5636
|
+
}), this._createDataChannel(this._pc, gr.producerScreenShare, (e) => {
|
|
5639
5637
|
this._producerScreen = e, this._producerScreen.binaryType = "arraybuffer", this._createCaptureReceiver();
|
|
5640
|
-
}), j.asrDataChannel && this._createDataChannel(this._pc,
|
|
5641
|
-
this._asr = e, this._asr.binaryType = "arraybuffer", this._removeAsrTrack(), this._asrTrack = new
|
|
5638
|
+
}), j.asrDataChannel && this._createDataChannel(this._pc, gr.asr, (e) => {
|
|
5639
|
+
this._asr = e, this._asr.binaryType = "arraybuffer", this._removeAsrTrack(), this._asrTrack = new Br(e, this._participantIdRegistry, (e) => {
|
|
5642
5640
|
this._onAsrTranscription(e);
|
|
5643
5641
|
}, this._debug);
|
|
5644
|
-
}), j.vmoji && this._createDataChannel(this._pc,
|
|
5642
|
+
}), j.vmoji && this._createDataChannel(this._pc, gr.animoji, (e) => {
|
|
5645
5643
|
this._animojiDataChannel = e, this._animojiDataChannel.binaryType = "arraybuffer", this._animojiReceiver?.setDataChannel(e), this._animojiReceiver?.setParticipantIdRegistry(this._participantIdRegistry), this._animojiSender?.setDataChannel(e), this._animojiSender?.setProtocolVersion(j.vmojiOptions.protocolVersion || 1);
|
|
5646
5644
|
}), this._newAudioShareTrack = this._mediaSource.getAudioShareTrack();
|
|
5647
5645
|
try {
|
|
@@ -5650,17 +5648,17 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
5650
5648
|
this._debug.error("ServerTransport: Unable to add media source tracks", e), this._logger?.log(S.ERROR, "addTrack-single"), this.close(e);
|
|
5651
5649
|
return;
|
|
5652
5650
|
}
|
|
5653
|
-
this._createDataChannel(this._pc,
|
|
5651
|
+
this._createDataChannel(this._pc, gr.consumerScreenShare, (e) => {
|
|
5654
5652
|
this._consumerScreen = e, this._consumerScreen.binaryType = "arraybuffer";
|
|
5655
5653
|
let t = this._mediaSource.getScreenTrack();
|
|
5656
5654
|
t && (!j.consumerFastScreenShare || !this._mediaSource.mediaSettings.isFastScreenSharingEnabled) && this._createCaptureSender(t);
|
|
5657
|
-
}), e || this._allocateConsumer(), this._setState(
|
|
5655
|
+
}), e || this._allocateConsumer(), this._setState(K.OPENED), this._startStatInterval(), this._startSettingsInterval(), this._startMonitorRtpShareInterval();
|
|
5658
5656
|
}
|
|
5659
5657
|
_removeAsrTrack() {
|
|
5660
5658
|
this._asrTrack?.destroy(), this._asrTrack = null;
|
|
5661
5659
|
}
|
|
5662
5660
|
_reconnect() {
|
|
5663
|
-
this.getState() !==
|
|
5661
|
+
this.getState() !== K.OPENED && (this._setState(K.RECONNECTING), this._closeConnection(), this._openConnection(!0));
|
|
5664
5662
|
}
|
|
5665
5663
|
_signalActiveParticipants(e) {
|
|
5666
5664
|
this._triggerEvent(J.SIGNALLED_ACTIVE_PARTICIPANTS, e);
|
|
@@ -5676,7 +5674,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
5676
5674
|
}
|
|
5677
5675
|
_updateSSRCMap(e) {
|
|
5678
5676
|
e && e.sdp.split("\n").forEach((e) => {
|
|
5679
|
-
let t = `a=ssrc:([0-9]+) label:(audio|video)-((?:[ug]?[\\d]+)|(?:mix)|(?:${
|
|
5677
|
+
let t = `a=ssrc:([0-9]+) label:(audio|video)-((?:[ug]?[\\d]+)|(?:mix)|(?:${Rr.PARTICIPANT_AGNOSTIC_TRACK_PREFIX}-[0-9]+)|(?:${Rr.TRANSPARENT_AUDIO_TRACK_PREFIX}-[0-9]+))`, n = new RegExp(t).exec(e);
|
|
5680
5678
|
n && (this._ssrcMap[n[1]] = n[3], this._ssrcMapUpdated = !0);
|
|
5681
5679
|
});
|
|
5682
5680
|
}
|
|
@@ -5779,17 +5777,17 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
5779
5777
|
_reportStats(e) {
|
|
5780
5778
|
this._triggerEvent(J.REMOTE_DATA_STATS, {
|
|
5781
5779
|
inbound: {
|
|
5782
|
-
topology:
|
|
5780
|
+
topology: q.SERVER,
|
|
5783
5781
|
transport: e.transport,
|
|
5784
5782
|
rtps: e.rtps.filter((e) => e.type === "inbound-rtp")
|
|
5785
5783
|
},
|
|
5786
5784
|
outbound: {
|
|
5787
|
-
topology:
|
|
5785
|
+
topology: q.SERVER,
|
|
5788
5786
|
transport: e.transport,
|
|
5789
5787
|
rtps: e.rtps.filter((e) => e.type === "outbound-rtp")
|
|
5790
5788
|
},
|
|
5791
5789
|
remoteInbound: {
|
|
5792
|
-
topology:
|
|
5790
|
+
topology: q.SERVER,
|
|
5793
5791
|
transport: e.transport,
|
|
5794
5792
|
rtps: e.remoteRtps ?? []
|
|
5795
5793
|
}
|
|
@@ -5798,7 +5796,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
5798
5796
|
_detectStaleTracks(e) {
|
|
5799
5797
|
let t = e.rtps.find((e) => e.type === "inbound-rtp" && e.kind === "audio" && this._ssrcMap[e.ssrc] === "mix");
|
|
5800
5798
|
if (!t) return;
|
|
5801
|
-
let n =
|
|
5799
|
+
let n = Rr.AUDIO_MIX, r = this._statBytes[n], i = !1;
|
|
5802
5800
|
if (r) {
|
|
5803
5801
|
let e = t.bytesReceived - r.bytesReceived;
|
|
5804
5802
|
e >= 0 && e <= 5 && (i = !0), r.stalled !== i && this._triggerEvent(J.AUDIO_MIX_STALL, i);
|
|
@@ -5929,22 +5927,22 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
5929
5927
|
}
|
|
5930
5928
|
async _onSignalingNotification(e) {
|
|
5931
5929
|
if (this._isOpen) switch (e.notification) {
|
|
5932
|
-
case
|
|
5930
|
+
case G.PRODUCER_UPDATED:
|
|
5933
5931
|
await this._onProducerUpdated(e);
|
|
5934
5932
|
break;
|
|
5935
|
-
case
|
|
5933
|
+
case G.REALLOC_CON:
|
|
5936
5934
|
this._reconnect();
|
|
5937
5935
|
break;
|
|
5938
|
-
case
|
|
5936
|
+
case G.AUDIO_ACTIVITY:
|
|
5939
5937
|
this._signalActiveParticipants(e.activeParticipants);
|
|
5940
5938
|
break;
|
|
5941
|
-
case
|
|
5939
|
+
case G.SPEAKER_CHANGED:
|
|
5942
5940
|
this._signalSpeakerChanged(e.speaker);
|
|
5943
5941
|
break;
|
|
5944
|
-
case
|
|
5942
|
+
case G.STALLED_ACTIVITY:
|
|
5945
5943
|
this._signalStalledParticipants(e.stalledParticipants);
|
|
5946
5944
|
break;
|
|
5947
|
-
case
|
|
5945
|
+
case G.NETWORK_STATUS:
|
|
5948
5946
|
this._signalNetworkStatus(e.statuses);
|
|
5949
5947
|
break;
|
|
5950
5948
|
}
|
|
@@ -5972,13 +5970,13 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
5972
5970
|
break;
|
|
5973
5971
|
case "connecting":
|
|
5974
5972
|
let t = this.getState();
|
|
5975
|
-
t ===
|
|
5973
|
+
t === K.IDLE || t === K.OPENED ? this._setState(K.CONNECTING) : e.iceConnectionState === "checking" && this._setState(K.RECONNECTING);
|
|
5976
5974
|
break;
|
|
5977
5975
|
case "disconnected":
|
|
5978
|
-
this._reconnectionPrevented ? this.close(/* @__PURE__ */ Error("Ice connection disconnected")) : this._setState(
|
|
5976
|
+
this._reconnectionPrevented ? this.close(/* @__PURE__ */ Error("Ice connection disconnected")) : this._setState(K.RECONNECTING);
|
|
5979
5977
|
break;
|
|
5980
5978
|
case "connected":
|
|
5981
|
-
this._setState(
|
|
5979
|
+
this._setState(K.CONNECTED), A.getPeerConnectionHostInfo(e).then((e) => {
|
|
5982
5980
|
e?.local && (this._logger?.log(S.ICE_CONNECTION_TYPE, e.local.type), this._debug.debug("Selected ICE candidates", e));
|
|
5983
5981
|
});
|
|
5984
5982
|
break;
|
|
@@ -6043,7 +6041,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
6043
6041
|
}
|
|
6044
6042
|
}
|
|
6045
6043
|
async _monitorRtpShare() {
|
|
6046
|
-
let e =
|
|
6044
|
+
let e = Hr.getInstance().value;
|
|
6047
6045
|
if (!this._mediaSource.mediaSettings.isFastScreenSharingEnabled || !j.consumerFastScreenShare || e < .6) return;
|
|
6048
6046
|
let t = this._pc?.getSenders().find((e) => e.track?.kind === O.video && e.track?.contentHint === "motion");
|
|
6049
6047
|
t && (await t.getStats()).forEach((e) => {
|
|
@@ -6076,7 +6074,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
6076
6074
|
return e.REMOTE_TRACK_ADDED = "REMOTE_TRACK_ADDED", e.REMOTE_TRACK_REMOVED = "REMOTE_TRACK_REMOVED", e.REMOTE_STREAM_SECOND = "REMOTE_STREAM_SECOND", e.AUDIO_MIX_STALL = "AUDIO_MIX_STALL", e.REMOTE_DATA_STATS = "REMOTE_DATA_STATS", e.STATE_CHANGED = "STATE_CHANGED", e.LOCAL_STATE_CHANGED = "LOCAL_STATE_CHANGED", e.SIGNALLED_ACTIVE_PARTICIPANTS = "SIGNALLED_ACTIVE_PARTICIPANTS", e.SIGNALLED_SPEAKER_CHANGED = "SIGNALLED_SPEAKER_CHANGED", e.SIGNALLED_STALLED_PARTICIPANTS = "SIGNALLED_STALLED_PARTICIPANTS", e.TOPOLOGY_CHANGED = "TOPOLOGY_CHANGED", e.NETWORK_STATUS = "NETWORK_STATUS", e.PEER_CONNECTION_CLOSED = "PEER_CONNECTION_CLOSED", e.ASR_TRANSCRIPTION = "ASR_TRANSCRIPTION", e.ANIMOJI_STREAM = "ANIMOJI_STREAM", e.ANIMOJI_ERROR = "ANIMOJI_ERROR", e.SCREEN_SHARING_STAT = "SCREEN_SHARING_STAT", e;
|
|
6077
6075
|
}({}), ea = class extends y {
|
|
6078
6076
|
constructor(e, t, n, r, i = L, a = null, o = null, s = null) {
|
|
6079
|
-
super(), h(this, "_signaling", void 0), h(this, "_mediaSource", void 0), h(this, "_topology", void 0), h(this, "_allocated", []), h(this, "_opened", []), h(this, "_directTransport", null), h(this, "_serverTransport", null), h(this, "_serverSettings", void 0), h(this, "_dtListeners", []), h(this, "_stListeners", []), h(this, "_states", {}), h(this, "_localState",
|
|
6077
|
+
super(), h(this, "_signaling", void 0), h(this, "_mediaSource", void 0), h(this, "_topology", void 0), h(this, "_allocated", []), h(this, "_opened", []), h(this, "_directTransport", null), h(this, "_serverTransport", null), h(this, "_serverSettings", void 0), h(this, "_dtListeners", []), h(this, "_stListeners", []), h(this, "_states", {}), h(this, "_localState", K.IDLE), h(this, "_animojiReceiver", null), h(this, "_animojiSender", null), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_statAggregator", void 0), h(this, "_codecStatsAggregator", void 0), this._signaling = t, this._mediaSource = n, this._topology = e, this._serverSettings = r, this._debug = i, this._logger = a, this._statAggregator = o, this._codecStatsAggregator = s, this.subscribe(this._signaling, W.NOTIFICATION, this._onSignalingNotification.bind(this)), this.subscribe(this._mediaSource, qt.ANIMOJI_STATUS, this._onAnimojiStatus.bind(this)), this.subscribe(this._mediaSource, qt.SOURCE_CHANGED, this._onSourceChanged.bind(this)), this._createAnimojiTransport(), e === q.SERVER && (this._serverTransport = this._createServerTransport());
|
|
6080
6078
|
}
|
|
6081
6079
|
updateSettings(e) {
|
|
6082
6080
|
this._debug.log("Update transport settings", e), this._serverSettings = e, this._directTransport && this._directTransport.updateSettings(e), this._serverTransport && this._serverTransport.updateSettings(e);
|
|
@@ -6089,7 +6087,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
6089
6087
|
this._debug.warn(`The participant [${e}] has already had allocated transport`);
|
|
6090
6088
|
return;
|
|
6091
6089
|
}
|
|
6092
|
-
this._allocated.push(e), this._topology ===
|
|
6090
|
+
this._allocated.push(e), this._topology === q.DIRECT && !this._directTransport && (this._directTransport = this._createDirectTransport(e, t)), this._topology === q.SERVER && !this._serverTransport && (this._serverTransport = this._createServerTransport());
|
|
6093
6091
|
}
|
|
6094
6092
|
open(e, t = null, n = !1, r = !1) {
|
|
6095
6093
|
this._debug.log("Trying open participant", { participantIds: e });
|
|
@@ -6105,11 +6103,11 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
6105
6103
|
}
|
|
6106
6104
|
this._opened.push(t), i = !0;
|
|
6107
6105
|
}
|
|
6108
|
-
i && (this._topology ===
|
|
6106
|
+
i && (this._topology === q.DIRECT && this._directTransport && this._directTransport.open(t), this._topology === q.SERVER && this._serverTransport && (this._serverTransport.open(n), this._setStates(e, this._serverTransport.getState()), this._setLocalState(this._serverTransport.getState())), this._debug.debug("The transport has been opened", e));
|
|
6109
6107
|
}
|
|
6110
6108
|
close(e) {
|
|
6111
6109
|
let t = this._allocated.indexOf(e), n = this._opened.indexOf(e);
|
|
6112
|
-
t < 0 && this._debug.warn(`The participant [${e}] transport has already deallocated`), this._topology ===
|
|
6110
|
+
t < 0 && this._debug.warn(`The participant [${e}] transport has already deallocated`), this._topology === q.DIRECT && this._directTransport && n >= 0 && this._releaseDirectTransport(), this._topology === q.SERVER && (this._serverTransport?.removeParticipant(e), this._setStates([e], K.CLOSED)), n >= 0 && this._opened.splice(n, 1), t >= 0 && this._allocated.splice(t, 1), delete this._states[e];
|
|
6113
6111
|
}
|
|
6114
6112
|
destroy() {
|
|
6115
6113
|
this.unsubscribe();
|
|
@@ -6139,7 +6137,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
6139
6137
|
return this._opened.slice();
|
|
6140
6138
|
}
|
|
6141
6139
|
getState() {
|
|
6142
|
-
return this._topology ===
|
|
6140
|
+
return this._topology === q.SERVER ? this._serverTransport?.getState() : this._directTransport?.getState();
|
|
6143
6141
|
}
|
|
6144
6142
|
getStates() {
|
|
6145
6143
|
return this._states;
|
|
@@ -6151,7 +6149,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
6151
6149
|
this._animojiSender?.setFill(e);
|
|
6152
6150
|
}
|
|
6153
6151
|
async onCameraResolutionChanged() {
|
|
6154
|
-
this._topology ===
|
|
6152
|
+
this._topology === q.SERVER && this._serverTransport && await this._serverTransport.onCameraResolutionChanged();
|
|
6155
6153
|
}
|
|
6156
6154
|
_setStates(e, t) {
|
|
6157
6155
|
let n = e.filter((e) => this._states[e] === t ? !1 : (this._states[e] = t, !0));
|
|
@@ -6161,11 +6159,11 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
6161
6159
|
this._localState !== e && (this._localState = e, this._triggerEvent("LOCAL_STATE_CHANGED", e));
|
|
6162
6160
|
}
|
|
6163
6161
|
_onSignalingNotification(e) {
|
|
6164
|
-
if (e.notification ===
|
|
6162
|
+
if (e.notification === G.TOPOLOGY_CHANGED) return this._onTopologyChanged(e);
|
|
6165
6163
|
}
|
|
6166
6164
|
_onTopologyChanged(e) {
|
|
6167
6165
|
if (e.topology !== this._topology) {
|
|
6168
|
-
if (this._debug.log(`Topology changed ${this._topology} -> ${e.topology}`), this._logger?.log(S.TOPOLOGY_CHANGE_REQUESTED, e.topology), this._topology = e.topology, this._topology ===
|
|
6166
|
+
if (this._debug.log(`Topology changed ${this._topology} -> ${e.topology}`), this._logger?.log(S.TOPOLOGY_CHANGE_REQUESTED, e.topology), this._topology = e.topology, this._topology === q.SERVER && (this._serverTransport ? this._serverTransport.allowRestart() : (this._serverTransport = this._createServerTransport(), this._opened.length > 0 && (this._directTransport?.preventRestart(), this._serverTransport.open()))), this._topology === q.DIRECT) {
|
|
6169
6167
|
let t = e.offerTo || [], n = e.offerToTypes || [], r = e.offerToDeviceIdxs || [], i = t.length && n.length ? A.composeParticipantId(t[0], n[0], r[0]) : null;
|
|
6170
6168
|
if (this._serverTransport && this._serverTransport.preventRestart(), !this._allocated || this._allocated.length === 0) {
|
|
6171
6169
|
this._debug.error("Topology changed to DIRECT, but the list of allocated participants is empty");
|
|
@@ -6184,12 +6182,12 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
6184
6182
|
}
|
|
6185
6183
|
}
|
|
6186
6184
|
_createDirectTransport(e, t = !1) {
|
|
6187
|
-
let n = new
|
|
6188
|
-
return this._dtListeners.length > 0 && this._debug.warn(`The list of direct listeners for the participant [${e}] is not empty`), this._dtListeners = [], this._dtListeners.push(n.addEventListener("REMOTE_TRACK_ADDED", this._onRemoteTrackAdded.bind(this, e)), n.addEventListener("REMOTE_TRACK_REMOVED", this._onRemoteTrackRemoved.bind(this, e)), n.addEventListener("REMOTE_DATA_STATS", this._onRemoteDataStats.bind(this)), n.addEventListener("STATE_CHANGED", this._onDirectTransportChanged.bind(this)), n.addEventListener("NETWORK_STATUS", this._onTransportNetworkStatus.bind(this)), n.addEventListener("PEER_CONNECTION_CLOSED", this._onPeerConnectionClosed.bind(this,
|
|
6185
|
+
let n = new Lr(e, t, this._signaling, this._mediaSource, this._serverSettings, this._debug, this._logger, this._statAggregator, this._codecStatsAggregator);
|
|
6186
|
+
return this._dtListeners.length > 0 && this._debug.warn(`The list of direct listeners for the participant [${e}] is not empty`), this._dtListeners = [], this._dtListeners.push(n.addEventListener("REMOTE_TRACK_ADDED", this._onRemoteTrackAdded.bind(this, e)), n.addEventListener("REMOTE_TRACK_REMOVED", this._onRemoteTrackRemoved.bind(this, e)), n.addEventListener("REMOTE_DATA_STATS", this._onRemoteDataStats.bind(this)), n.addEventListener("STATE_CHANGED", this._onDirectTransportChanged.bind(this)), n.addEventListener("NETWORK_STATUS", this._onTransportNetworkStatus.bind(this)), n.addEventListener("PEER_CONNECTION_CLOSED", this._onPeerConnectionClosed.bind(this, q.DIRECT))), this._animojiReceiver && this._animojiSender && n.setAnimojiTransport(this._animojiReceiver, this._animojiSender), n;
|
|
6189
6187
|
}
|
|
6190
6188
|
_createServerTransport() {
|
|
6191
6189
|
let e = new $i(this._signaling, this._mediaSource, this._serverSettings, this._debug, this._logger, this._statAggregator, this._codecStatsAggregator);
|
|
6192
|
-
return this._stListeners.length > 0 && this._debug.warn("The list of server transport listeners is not empty"), this._stListeners = [], this._stListeners.push(e.addEventListener("REMOTE_TRACK_ADDED", this._onRemoteTrackAdded.bind(this)), e.addEventListener("REMOTE_TRACK_REMOVED", this._onRemoteTrackRemoved.bind(this)), e.addEventListener("AUDIO_MIX_STALL", this._onServerAudioMixStall.bind(this)), e.addEventListener("REMOTE_DATA_STATS", this._onRemoteDataStats.bind(this)), e.addEventListener("STATE_CHANGED", this._onServerTransportChanged.bind(this)), e.addEventListener("SIGNALLED_ACTIVE_PARTICIPANTS", this._onTransportActiveParticipants.bind(this)), e.addEventListener("SIGNALLED_SPEAKER_CHANGED", this._onTransportSpeakerChanged.bind(this)), e.addEventListener("SIGNALLED_STALLED_PARTICIPANTS", this._onTransportStalledParticipants.bind(this)), e.addEventListener("NETWORK_STATUS", this._onTransportNetworkStatus.bind(this)), e.addEventListener("REMOTE_STREAM_SECOND", this._onRemoteStreamSecond.bind(this)), e.addEventListener("PEER_CONNECTION_CLOSED", this._onPeerConnectionClosed.bind(this,
|
|
6190
|
+
return this._stListeners.length > 0 && this._debug.warn("The list of server transport listeners is not empty"), this._stListeners = [], this._stListeners.push(e.addEventListener("REMOTE_TRACK_ADDED", this._onRemoteTrackAdded.bind(this)), e.addEventListener("REMOTE_TRACK_REMOVED", this._onRemoteTrackRemoved.bind(this)), e.addEventListener("AUDIO_MIX_STALL", this._onServerAudioMixStall.bind(this)), e.addEventListener("REMOTE_DATA_STATS", this._onRemoteDataStats.bind(this)), e.addEventListener("STATE_CHANGED", this._onServerTransportChanged.bind(this)), e.addEventListener("SIGNALLED_ACTIVE_PARTICIPANTS", this._onTransportActiveParticipants.bind(this)), e.addEventListener("SIGNALLED_SPEAKER_CHANGED", this._onTransportSpeakerChanged.bind(this)), e.addEventListener("SIGNALLED_STALLED_PARTICIPANTS", this._onTransportStalledParticipants.bind(this)), e.addEventListener("NETWORK_STATUS", this._onTransportNetworkStatus.bind(this)), e.addEventListener("REMOTE_STREAM_SECOND", this._onRemoteStreamSecond.bind(this)), e.addEventListener("PEER_CONNECTION_CLOSED", this._onPeerConnectionClosed.bind(this, q.SERVER)), e.addEventListener("ASR_TRANSCRIPTION", this._onAsrTranscription.bind(this))), this._animojiReceiver && this._animojiSender && e.setAnimojiTransport(this._animojiReceiver, this._animojiSender), e;
|
|
6193
6191
|
}
|
|
6194
6192
|
_releaseDirectTransport() {
|
|
6195
6193
|
this._directTransport?.close(), this._directTransport = null;
|
|
@@ -6203,26 +6201,26 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
6203
6201
|
}
|
|
6204
6202
|
_onDirectTransportChanged(e) {
|
|
6205
6203
|
let t = this._directTransport?.participantId;
|
|
6206
|
-
if (e ===
|
|
6204
|
+
if (e === K.CONNECTED && this._topology === q.DIRECT && this._releaseServerTransport(), (e === K.CLOSED || e === K.FAILED) && (this._releaseDirectTransport(), this._topology === q.DIRECT)) {
|
|
6207
6205
|
let e = this._opened.indexOf(t);
|
|
6208
6206
|
e >= 0 && this._opened.splice(e, 1);
|
|
6209
6207
|
let n = this._allocated.indexOf(t);
|
|
6210
6208
|
n >= 0 && this._allocated.splice(n, 1);
|
|
6211
6209
|
}
|
|
6212
|
-
this._topology ===
|
|
6210
|
+
this._topology === q.DIRECT && t && (this._setStates([t], e), this._setLocalState(e));
|
|
6213
6211
|
}
|
|
6214
6212
|
_onServerTransportChanged(e) {
|
|
6215
6213
|
let t = this._opened.slice();
|
|
6216
|
-
e ===
|
|
6214
|
+
e === K.CONNECTED && this._topology === q.SERVER && this._releaseDirectTransport(), (e === K.CLOSED || e === K.FAILED) && (this._releaseServerTransport(), this._topology === q.SERVER && (this._allocated = [], this._opened = [])), this._topology === q.SERVER && (this._setStates(t, e), this._setLocalState(e));
|
|
6217
6215
|
}
|
|
6218
6216
|
_onTransportActiveParticipants(e) {
|
|
6219
|
-
this._topology ===
|
|
6217
|
+
this._topology === q.SERVER && this._triggerEvent("SIGNALLED_ACTIVE_PARTICIPANTS", e);
|
|
6220
6218
|
}
|
|
6221
6219
|
_onTransportStalledParticipants(e) {
|
|
6222
|
-
this._topology ===
|
|
6220
|
+
this._topology === q.SERVER && this._triggerEvent("SIGNALLED_STALLED_PARTICIPANTS", e);
|
|
6223
6221
|
}
|
|
6224
6222
|
_onTransportSpeakerChanged(e) {
|
|
6225
|
-
this._topology ===
|
|
6223
|
+
this._topology === q.SERVER && this._triggerEvent("SIGNALLED_SPEAKER_CHANGED", e);
|
|
6226
6224
|
}
|
|
6227
6225
|
_onTransportNetworkStatus(e) {
|
|
6228
6226
|
this._triggerEvent("NETWORK_STATUS", e);
|
|
@@ -6234,7 +6232,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
6234
6232
|
this._triggerEvent("PEER_CONNECTION_CLOSED", e);
|
|
6235
6233
|
}
|
|
6236
6234
|
_onServerAudioMixStall(e) {
|
|
6237
|
-
this._topology ===
|
|
6235
|
+
this._topology === q.SERVER && this._triggerEvent("AUDIO_MIX_STALL", e);
|
|
6238
6236
|
}
|
|
6239
6237
|
_onRemoteDataStats(e) {
|
|
6240
6238
|
this._triggerEvent("REMOTE_DATA_STATS", e);
|
|
@@ -6273,14 +6271,14 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
|
|
|
6273
6271
|
this._animojiSender?.destroy(), this._animojiSender = null, this._animojiReceiver?.destroy(), this._animojiReceiver = null;
|
|
6274
6272
|
}
|
|
6275
6273
|
getStreamWaitingTimeMs(e, t) {
|
|
6276
|
-
return this._topology ===
|
|
6274
|
+
return this._topology === q.SERVER ? this._serverTransport ? this._serverTransport.getStreamWaitingTimeMs(e, t) : (this._logger?.log(S.PAT_WAITING_TIME_ERROR, "noTransport"), this._debug.error("Cannot get stream waiting time, server transport is not initialized"), 0) : (this._logger?.log(S.PAT_WAITING_TIME_ERROR, "wrongTopology"), this._debug.error(`Cannot get stream waiting time, incorrect topology: ${this._topology}`), 0);
|
|
6277
6275
|
}
|
|
6278
6276
|
}, ta = "videochat-epi", na = 5e3, ra = 500, ia = class extends y {
|
|
6279
6277
|
constructor(e, t, n = null, r = !1, i = L) {
|
|
6280
6278
|
super(), h(this, "_previousPerfStatReportTimestamp", 0), h(this, "_previousNetworkStatReportTimestamp", Date.now()), h(this, "_previousCallStatReportTimestamp", Date.now()), h(this, "_previousCallStatReport", null), h(this, "_screenShareStats", []), h(this, "_signaling", void 0), h(this, "_directTopology", void 0), h(this, "_debug", void 0), h(this, "_statAggregator", void 0), h(this, "_handleScreenSharingStat", (e) => {
|
|
6281
6279
|
this._screenShareStats.push(e);
|
|
6282
6280
|
}), h(this, "_handleTransportStateChanged", (e) => {
|
|
6283
|
-
(this._directTopology && e ===
|
|
6281
|
+
(this._directTopology && e === K.CONNECTED || !this._directTopology && e === K.OPENED) && (this._previousNetworkStatReportTimestamp = Date.now(), this._previousCallStatReportTimestamp = Date.now());
|
|
6284
6282
|
}), this._signaling = t, this._directTopology = r, this._debug = i, this._statAggregator = n, this.subscribe(e, J.REMOTE_DATA_STATS, this._handleStats.bind(this)), this.subscribe(e, J.SCREEN_SHARING_STAT, this._handleScreenSharingStat.bind(this)), this.subscribe(e, J.STATE_CHANGED, this._handleTransportStateChanged.bind(this));
|
|
6285
6283
|
}
|
|
6286
6284
|
destroy() {
|
|
@@ -6562,8 +6560,32 @@ var ua = la, da = {
|
|
|
6562
6560
|
}
|
|
6563
6561
|
}
|
|
6564
6562
|
}, xa = class {
|
|
6565
|
-
|
|
6566
|
-
|
|
6563
|
+
static isBrowserSupported() {
|
|
6564
|
+
return !(!("WebTransport" in window && typeof WebTransport == "function") || w.browserName() === "Safari");
|
|
6565
|
+
}
|
|
6566
|
+
constructor(e, t = {}, n = L) {
|
|
6567
|
+
h(this, "onopen", null), h(this, "onmessage", null), h(this, "onerror", null), h(this, "onclose", null), h(this, "readyState", WebSocket.CONNECTING), h(this, "webTransport", null), h(this, "writer", null), h(this, "url", void 0), h(this, "options", void 0), h(this, "compression", void 0), h(this, "encoder", void 0), h(this, "decoder", void 0), h(this, "_debug", void 0), this._debug = n, this.url = e, this.options = t, this.compression = this.getCompressionTypeFromUrl(e), this.encoder = new ya(this.compression), this.decoder = new ba(this.compression), this.connect();
|
|
6568
|
+
}
|
|
6569
|
+
async send(e) {
|
|
6570
|
+
if (this.readyState !== WebSocket.OPEN) {
|
|
6571
|
+
this._debug.warn("[WebTransport] Attempt to send data before webtransport is open");
|
|
6572
|
+
return;
|
|
6573
|
+
}
|
|
6574
|
+
let t = this.writer;
|
|
6575
|
+
if (!t) {
|
|
6576
|
+
this._debug.warn("[WebTransport] Attempt to send data before stream is ready");
|
|
6577
|
+
return;
|
|
6578
|
+
}
|
|
6579
|
+
try {
|
|
6580
|
+
await t.ready;
|
|
6581
|
+
let n = this.encoder.encode(e);
|
|
6582
|
+
await t.write(n);
|
|
6583
|
+
} catch (e) {
|
|
6584
|
+
this.handleStreamError("send", e);
|
|
6585
|
+
}
|
|
6586
|
+
}
|
|
6587
|
+
close(e = 1e3, t = "") {
|
|
6588
|
+
this.readyState === WebSocket.CLOSING || this.readyState === WebSocket.CLOSED || (this.readyState = WebSocket.CLOSING, this.requestNativeClose(e, t));
|
|
6567
6589
|
}
|
|
6568
6590
|
getCompressionTypeFromUrl(e) {
|
|
6569
6591
|
try {
|
|
@@ -6575,63 +6597,86 @@ var ua = la, da = {
|
|
|
6575
6597
|
default: return null;
|
|
6576
6598
|
}
|
|
6577
6599
|
} catch (e) {
|
|
6578
|
-
return
|
|
6600
|
+
return this._debug.log("[WebTransport] Exception while parsing compression", e), null;
|
|
6579
6601
|
}
|
|
6580
6602
|
}
|
|
6581
6603
|
async connect() {
|
|
6582
6604
|
try {
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6605
|
+
let e = new WebTransport(this.url, { ...this.options });
|
|
6606
|
+
if (this.webTransport = e, this.observeClosed(e), await e.ready, this.readyState !== WebSocket.CONNECTING) return;
|
|
6607
|
+
this._debug.debug("[WebTransport] WebTransport connected to " + this.url);
|
|
6608
|
+
let t = await e.createBidirectionalStream();
|
|
6609
|
+
if (this.readyState !== WebSocket.CONNECTING) return;
|
|
6610
|
+
this.writer = t.writable.getWriter(), this.readyState = WebSocket.OPEN, this.emitEvent("open", this.onopen, new Event("open")), this.readyState === WebSocket.OPEN && this.readLoop(t.readable);
|
|
6588
6611
|
} catch (e) {
|
|
6589
|
-
if (this.
|
|
6590
|
-
|
|
6612
|
+
if (!this.webTransport) {
|
|
6613
|
+
queueMicrotask(() => this.fail("connect", e));
|
|
6591
6614
|
return;
|
|
6592
6615
|
}
|
|
6593
|
-
|
|
6594
|
-
code: 1006,
|
|
6595
|
-
reason: "Connection Failed"
|
|
6596
|
-
}));
|
|
6616
|
+
this.fail("connect", e);
|
|
6597
6617
|
}
|
|
6598
6618
|
}
|
|
6599
|
-
|
|
6600
|
-
|
|
6619
|
+
observeClosed(e) {
|
|
6620
|
+
e.closed.then(({ closeCode: e, reason: t }) => {
|
|
6621
|
+
this.finishClose(e, t);
|
|
6622
|
+
}, (e) => {
|
|
6623
|
+
let t = this.readyState === WebSocket.CONNECTING ? "connect" : "session";
|
|
6624
|
+
this.fail(t, e), this.finishClose(1006, "");
|
|
6625
|
+
}).catch((e) => {
|
|
6626
|
+
this._debug.error("[WebTransport] Failed to process native close", e);
|
|
6627
|
+
});
|
|
6628
|
+
}
|
|
6629
|
+
async readLoop(e) {
|
|
6630
|
+
let t = e.getReader();
|
|
6631
|
+
try {
|
|
6601
6632
|
for (;;) {
|
|
6602
|
-
let { done: e, value:
|
|
6603
|
-
if (e)
|
|
6604
|
-
|
|
6633
|
+
let { done: e, value: n } = await t.read();
|
|
6634
|
+
if (e) {
|
|
6635
|
+
this.close(1e3, "Stream Closed");
|
|
6636
|
+
return;
|
|
6637
|
+
}
|
|
6638
|
+
if (n) for (let e of this.decoder.decode(n)) this.emitEvent("message", this.onmessage, new MessageEvent("message", { data: e }));
|
|
6605
6639
|
}
|
|
6640
|
+
} catch (e) {
|
|
6641
|
+
this.handleStreamError("read", e);
|
|
6606
6642
|
} finally {
|
|
6607
|
-
|
|
6643
|
+
t.releaseLock();
|
|
6608
6644
|
}
|
|
6609
6645
|
}
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
for await (let e of this.readChunks()) this.decoder.decode(e).forEach((e) => {
|
|
6613
|
-
this.onmessage?.(new MessageEvent("message", { data: e }));
|
|
6614
|
-
});
|
|
6615
|
-
this.close(1e3, "Stream Closed");
|
|
6616
|
-
} catch (e) {
|
|
6617
|
-
L.error("[WebTransport] Stream read failed", e), this.readyState = WebSocket.CLOSED, this.onerror?.(this.createErrorEvent(e, "read"));
|
|
6618
|
-
}
|
|
6646
|
+
fail(e, t) {
|
|
6647
|
+
this.readyState === WebSocket.CLOSING || this.readyState === WebSocket.CLOSED || (this.readyState = WebSocket.CLOSING, this._debug.error(`[WebTransport] ${e} failed`, t), this.emitEvent("error", this.onerror, this.createErrorEvent(t, e)), this.requestNativeClose(1006, `${e} failed`));
|
|
6619
6648
|
}
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6649
|
+
handleStreamError(e, t) {
|
|
6650
|
+
let n = typeof t == "object" && t && "source" in t ? t.source : void 0;
|
|
6651
|
+
if (n === "session") return;
|
|
6652
|
+
let r = n === void 0 && t instanceof Error && t.name === "WebTransportError" && t.message.startsWith("Session closed");
|
|
6653
|
+
this.fail(r ? "session" : e, t);
|
|
6654
|
+
}
|
|
6655
|
+
requestNativeClose(e, t) {
|
|
6656
|
+
if (!this.webTransport) {
|
|
6657
|
+
this.finishClose(1006, "Connection Failed");
|
|
6627
6658
|
return;
|
|
6628
6659
|
}
|
|
6629
6660
|
try {
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6661
|
+
this.webTransport.close({
|
|
6662
|
+
closeCode: e,
|
|
6663
|
+
reason: t
|
|
6664
|
+
});
|
|
6633
6665
|
} catch (e) {
|
|
6634
|
-
|
|
6666
|
+
this._debug.warn("[WebTransport] Native close failed synchronously", e), this.finishClose(1006, "Close Failed");
|
|
6667
|
+
}
|
|
6668
|
+
}
|
|
6669
|
+
finishClose(e, t) {
|
|
6670
|
+
this.readyState !== WebSocket.CLOSED && (this.writer = null, this.readyState = WebSocket.CLOSED, this.emitEvent("close", this.onclose, new CloseEvent("close", {
|
|
6671
|
+
code: e,
|
|
6672
|
+
reason: t
|
|
6673
|
+
})));
|
|
6674
|
+
}
|
|
6675
|
+
emitEvent(e, t, n) {
|
|
6676
|
+
try {
|
|
6677
|
+
t?.call(this, n);
|
|
6678
|
+
} catch (t) {
|
|
6679
|
+
this._debug.error(`[WebTransport] ${e} handler failed`, t);
|
|
6635
6680
|
}
|
|
6636
6681
|
}
|
|
6637
6682
|
createErrorEvent(e, t) {
|
|
@@ -6645,45 +6690,11 @@ var ua = la, da = {
|
|
|
6645
6690
|
compression: this.compression
|
|
6646
6691
|
}, n;
|
|
6647
6692
|
}
|
|
6648
|
-
close(e = 1e3, t) {
|
|
6649
|
-
if (!(this.readyState === WebSocket.CLOSED || this.readyState === WebSocket.CLOSING)) {
|
|
6650
|
-
if (this.closeRequested = {
|
|
6651
|
-
code: e,
|
|
6652
|
-
reason: t
|
|
6653
|
-
}, this.readyState === WebSocket.CONNECTING) {
|
|
6654
|
-
this.readyState = WebSocket.CLOSING;
|
|
6655
|
-
return;
|
|
6656
|
-
}
|
|
6657
|
-
this.closeConnectedTransport(e, t);
|
|
6658
|
-
}
|
|
6659
|
-
}
|
|
6660
|
-
closeConnectedTransport(e = 1e3, t) {
|
|
6661
|
-
if (this.readyState !== WebSocket.CLOSED) {
|
|
6662
|
-
this.readyState = WebSocket.CLOSING, this.reader?.cancel();
|
|
6663
|
-
try {
|
|
6664
|
-
this.webTransport.close();
|
|
6665
|
-
} catch (e) {
|
|
6666
|
-
L.warn("[WebTransport] already closed. Did we get a STOP_SENDING? ignore", e);
|
|
6667
|
-
}
|
|
6668
|
-
this.readyState = WebSocket.CLOSED, this.emitClose(e, t), this.webTransport.closed.then(() => {
|
|
6669
|
-
this.writer = null, this.reader = null, this.stream = null;
|
|
6670
|
-
});
|
|
6671
|
-
}
|
|
6672
|
-
}
|
|
6673
|
-
emitClose(e, t) {
|
|
6674
|
-
this.closeEventEmitted || (this.closeEventEmitted = !0, this.onclose?.(new CloseEvent("close", {
|
|
6675
|
-
code: e,
|
|
6676
|
-
reason: t
|
|
6677
|
-
})));
|
|
6678
|
-
}
|
|
6679
|
-
static isBrowserSupported() {
|
|
6680
|
-
return "WebTransport" in window && typeof WebTransport == "function" ? w.browserName() === "Firefox" ? j.webtransportFF : w.browserName() !== "Safari" : !1;
|
|
6681
|
-
}
|
|
6682
6693
|
}, Sa = /* @__PURE__ */ function(e) {
|
|
6683
6694
|
return e.EMPTY_ENDPOINT = "EMPTY_ENDPOINT", e.NETWORK_ERROR = "NETWORK_ERROR", e.ABORTED = "ABORTED", e;
|
|
6684
6695
|
}({}), Ca = class {
|
|
6685
|
-
constructor(e) {
|
|
6686
|
-
h(this, "handlers", void 0), h(this, "socket", null), h(this, "endpoint", ""), h(this, "wtEndpoint", null), h(this, "peerId", null), h(this, "lastStamp", 0), h(this, "connectionType", void 0), h(this, "reconnectCount", 0), h(this, "reconnectTimer", 0), h(this, "doctorTimer", 0), h(this, "forceWebSocket", !1), h(this, "abortSignal", void 0), h(this, "manualClose", !1), h(this, "currentType",
|
|
6696
|
+
constructor(e = L, t) {
|
|
6697
|
+
h(this, "handlers", void 0), h(this, "socket", null), h(this, "endpoint", ""), h(this, "wtEndpoint", null), h(this, "peerId", null), h(this, "lastStamp", 0), h(this, "connectionType", void 0), h(this, "reconnectCount", 0), h(this, "reconnectTimer", 0), h(this, "doctorTimer", 0), h(this, "forceWebSocket", !1), h(this, "abortSignal", void 0), h(this, "manualClose", !1), h(this, "currentType", pr.WEBSOCKET), h(this, "_debug", void 0), this.handlers = t, this._debug = e;
|
|
6687
6698
|
}
|
|
6688
6699
|
get readyState() {
|
|
6689
6700
|
return this.socket?.readyState ?? null;
|
|
@@ -6731,7 +6742,7 @@ var ua = la, da = {
|
|
|
6731
6742
|
return;
|
|
6732
6743
|
}
|
|
6733
6744
|
let e = this._buildUrl(this.wtEndpoint, !0);
|
|
6734
|
-
this.currentType =
|
|
6745
|
+
this.currentType = pr.WEBTRANSPORT, this.socket = new xa(e, { congestionControl: "low-latency" }, this._debug), this._setSocketHandlers();
|
|
6735
6746
|
}
|
|
6736
6747
|
_connectWebSocket() {
|
|
6737
6748
|
if (!this.endpoint) {
|
|
@@ -6743,7 +6754,7 @@ var ua = la, da = {
|
|
|
6743
6754
|
return;
|
|
6744
6755
|
}
|
|
6745
6756
|
let e = this._buildUrl(this.endpoint, !1);
|
|
6746
|
-
this.currentType =
|
|
6757
|
+
this.currentType = pr.WEBSOCKET, this.socket = new WebSocket(e), this._setSocketHandlers();
|
|
6747
6758
|
}
|
|
6748
6759
|
_setSocketHandlers() {
|
|
6749
6760
|
this.socket && (this.socket.onopen = this._onOpen.bind(this), this.socket.onmessage = this._onMessage.bind(this), this.socket.onerror = this._onError.bind(this), this.socket.onclose = this._onClose.bind(this), this._startDoctor());
|
|
@@ -6773,7 +6784,7 @@ var ua = la, da = {
|
|
|
6773
6784
|
});
|
|
6774
6785
|
return;
|
|
6775
6786
|
}
|
|
6776
|
-
this.forceWebSocket = !0, this._scheduleReconnect();
|
|
6787
|
+
this.forceWebSocket = !0, this._scheduleReconnect(this.currentType === pr.WEBTRANSPORT ? 0 : void 0);
|
|
6777
6788
|
}
|
|
6778
6789
|
}
|
|
6779
6790
|
_disconnect(e) {
|
|
@@ -6820,7 +6831,7 @@ var ua = la, da = {
|
|
|
6820
6831
|
return this.transport.readyState !== null;
|
|
6821
6832
|
}
|
|
6822
6833
|
constructor(e = L, t = null, n = null, r = null, i = null) {
|
|
6823
|
-
super(), h(this, "transport", new Ca({
|
|
6834
|
+
super(), h(this, "transport", void 0), h(this, "sequence", 1), h(this, "lastStamp", 0), h(this, "websocketCommandsQueue", []), h(this, "datachannelCommandsQueue", []), h(this, "incomingCache", []), h(this, "responseHandlers", {}), h(this, "connectionType", void 0), h(this, "conversationResolve", null), h(this, "conversationReject", null), h(this, "connected", !1), h(this, "listenersReady", !1), h(this, "peerId", null), h(this, "conversationId", null), h(this, "connectionMessageWaitTimer", 0), h(this, "participantIdRegistry", null), h(this, "producerNotificationDataChannel", null), h(this, "producerCommandDataChannel", null), h(this, "producerCommandDataChannelEnabled", !1), h(this, "producerCommandSerializationService", void 0), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_statAggregator", void 0), h(this, "_statPings", void 0), h(this, "_statSignalingCommands", void 0), this._debug = e, this._logger = t, this._statAggregator = n, this._statPings = r, this._statSignalingCommands = i, this.producerCommandSerializationService = new qn(e), this.transport = new Ca(e, {
|
|
6824
6835
|
onOpen: this._onOpen.bind(this),
|
|
6825
6836
|
onMessage: this._onMessage.bind(this),
|
|
6826
6837
|
onError: this._onError.bind(this),
|
|
@@ -6828,7 +6839,7 @@ var ua = la, da = {
|
|
|
6828
6839
|
onFailed: this._onTransportFailed.bind(this),
|
|
6829
6840
|
onReconnectScheduled: this._onTransportReconnectScheduled.bind(this),
|
|
6830
6841
|
onConnectionDead: this._onTransportConnectionDead.bind(this)
|
|
6831
|
-
})
|
|
6842
|
+
});
|
|
6832
6843
|
}
|
|
6833
6844
|
setAbortSignal(e) {
|
|
6834
6845
|
super.setAbortSignal(e), this.transport.setAbortSignal(e);
|
|
@@ -7175,11 +7186,11 @@ var ua = la, da = {
|
|
|
7175
7186
|
return this.producerCommandDataChannelEnabled ? e === z.UPDATE_DISPLAY_LAYOUT || e === z.REPORT_PERF_STAT || e === z.REPORT_SHARING_STAT || e === z.REQUEST_ASR || e === z.ENABLE_VIDEO_SUSPEND || e === z.ENABLE_VIDEO_SUSPEND_SUGGEST || e === z.REPORT_NETWORK_STAT || e === z.CHANGE_SIMULCAST : !1;
|
|
7176
7187
|
}
|
|
7177
7188
|
_onOpen() {
|
|
7178
|
-
this._debug.debug("[signaling] socket opened"), this._logger?.log(S.SOCKET_ACTION, "opened"), this._waitConnectionMessage(), this._logTransportStat(this.connectionType === fr.RETRY ?
|
|
7189
|
+
this._debug.debug("[signaling] socket opened"), this._logger?.log(S.SOCKET_ACTION, "opened"), this._waitConnectionMessage(), this._logTransportStat(this.connectionType === fr.RETRY ? mr.RECONNECTED : mr.CONNECTED);
|
|
7179
7190
|
}
|
|
7180
7191
|
_onMessage(e) {
|
|
7181
7192
|
if (e.data === "ping") {
|
|
7182
|
-
this._statPings?.mark(this._getSocketType()), this._markTransportStat(
|
|
7193
|
+
this._statPings?.mark(this._getSocketType()), this._markTransportStat(mr.FAILED_PINGS), I.onSignalingMessage(e.data), this.transport.readyState === WebSocket.OPEN && this.transport.send("pong");
|
|
7183
7194
|
return;
|
|
7184
7195
|
}
|
|
7185
7196
|
try {
|
|
@@ -7192,13 +7203,13 @@ var ua = la, da = {
|
|
|
7192
7203
|
_handleMessage(e) {
|
|
7193
7204
|
switch (e.type) {
|
|
7194
7205
|
case "notification":
|
|
7195
|
-
e.notification === "connection" ? (this._debug.debug("[signaling] signaling connected", e), this.connected = !0, this.transport.resetReconnectCount(), this.transport.setEndpoint(e.endpoint), e.peerId && this.peerId !== e.peerId.id && (this.peerId = e.peerId.id, this.transport.setPeerId(e.peerId.id)), this._stopWaitConnectionMessage(), this.conversationResolve ? this.conversationResolve(e) : (this._logTransportStat(
|
|
7206
|
+
e.notification === "connection" ? (this._debug.debug("[signaling] signaling connected", e), this.connected = !0, this.transport.resetReconnectCount(), this.transport.setEndpoint(e.endpoint), e.peerId && this.peerId !== e.peerId.id && (this.peerId = e.peerId.id, this.transport.setPeerId(e.peerId.id)), this._stopWaitConnectionMessage(), this.conversationResolve ? this.conversationResolve(e) : (this._logTransportStat(mr.RESTART), this._triggerEvent(W.RECONNECT, e), e.conversation.topology && this._triggerEvent(W.NOTIFICATION, {
|
|
7196
7207
|
type: "notification",
|
|
7197
|
-
notification:
|
|
7208
|
+
notification: G.TOPOLOGY_CHANGED,
|
|
7198
7209
|
topology: e.conversation.topology
|
|
7199
7210
|
}), this._resolvePendingRecordCommands(e)), this.lastStamp && this._handleCachedMessages(), e.recoverMessages?.forEach((e) => {
|
|
7200
|
-
e.notification ===
|
|
7201
|
-
}), this._handleCommandsQueue(this.websocketCommandsQueue)) : !this.connected || !this.listenersReady ? this.incomingCache.push(e) : this._triggerEvent(
|
|
7211
|
+
e.notification === G.ACCEPTED_CALL && e.peerId.id === this.peerId && e.peerId.type === "WEB_TRANSPORT" || this._handleMessage(e);
|
|
7212
|
+
}), this._handleCommandsQueue(this.websocketCommandsQueue)) : !this.connected || !this.listenersReady ? this.incomingCache.push(e) : this._triggerEvent(W.NOTIFICATION, e);
|
|
7202
7213
|
break;
|
|
7203
7214
|
case "response":
|
|
7204
7215
|
this._handleCommandResponse(!0, e);
|
|
@@ -7219,8 +7230,8 @@ var ua = la, da = {
|
|
|
7219
7230
|
message: `Conversation ended: ${e.error}`,
|
|
7220
7231
|
remote: !0
|
|
7221
7232
|
});
|
|
7222
|
-
this.conversationReject ? this.conversationReject(n) : this._triggerEvent(
|
|
7223
|
-
notification:
|
|
7233
|
+
this.conversationReject ? this.conversationReject(n) : this._triggerEvent(W.NOTIFICATION, {
|
|
7234
|
+
notification: G.CLOSED_CONVERSATION,
|
|
7224
7235
|
reason: E.SERVICE_UNAVAILABLE
|
|
7225
7236
|
});
|
|
7226
7237
|
break;
|
|
@@ -7228,8 +7239,8 @@ var ua = la, da = {
|
|
|
7228
7239
|
this.conversationReject ? this.conversationReject(new D(e.reason || b.SIGNALING_FAILED, {
|
|
7229
7240
|
message: `Conversation ended: ${e.error}`,
|
|
7230
7241
|
remote: !0
|
|
7231
|
-
})) : this._triggerEvent(
|
|
7232
|
-
notification:
|
|
7242
|
+
})) : this._triggerEvent(W.NOTIFICATION, {
|
|
7243
|
+
notification: G.CLOSED_CONVERSATION,
|
|
7233
7244
|
reason: e.reason
|
|
7234
7245
|
});
|
|
7235
7246
|
break;
|
|
@@ -7243,7 +7254,7 @@ var ua = la, da = {
|
|
|
7243
7254
|
}));
|
|
7244
7255
|
break;
|
|
7245
7256
|
default:
|
|
7246
|
-
if (!t) break;
|
|
7257
|
+
if (!t || t && this._getSocketType() === pr.WEBTRANSPORT) break;
|
|
7247
7258
|
this.connected ? this._throwError(/* @__PURE__ */ Error(`Signaling error: ${e.error}`)) : e.sequence || (this.conversationReject?.(new D(e.reason || b.SIGNALING_FAILED, {
|
|
7248
7259
|
message: `Unable to connect to the signaling: ${e.error}`,
|
|
7249
7260
|
remote: !0
|
|
@@ -7258,10 +7269,10 @@ var ua = la, da = {
|
|
|
7258
7269
|
}
|
|
7259
7270
|
}
|
|
7260
7271
|
_throwError(e) {
|
|
7261
|
-
this._triggerEvent(
|
|
7272
|
+
this._triggerEvent(W.FAILED, e);
|
|
7262
7273
|
}
|
|
7263
7274
|
_onError(e) {
|
|
7264
|
-
this._logger?.log(S.SOCKET_ACTION, "error"), this._debug.error("[signaling] signaling error", e), this._logTransportStat(
|
|
7275
|
+
this._logger?.log(S.SOCKET_ACTION, "error"), this._debug.error("[signaling] signaling error", e), this._logTransportStat(mr.FAILED_EXCEPTIONS, { string_value: this._serializeErrorEvent(e) });
|
|
7265
7276
|
}
|
|
7266
7277
|
_serializeErrorEvent(e) {
|
|
7267
7278
|
let t = e, n = t.error instanceof Error ? t.error : null;
|
|
@@ -7405,17 +7416,17 @@ var ua = la, da = {
|
|
|
7405
7416
|
this.connectionType = fr.RETRY, this._debug.log(`[signaling] reconnect websocket after ${e.delay}ms (${e.count})`), this._logger?.log(S.SOCKET_ACTION, "reconnect");
|
|
7406
7417
|
}
|
|
7407
7418
|
_onTransportConnectionDead() {
|
|
7408
|
-
this._debug.warn("[signaling] socket is dead, trying to reconnect"), this._logTransportStat(
|
|
7419
|
+
this._debug.warn("[signaling] socket is dead, trying to reconnect"), this._logTransportStat(mr.FAILED_PINGS);
|
|
7409
7420
|
}
|
|
7410
7421
|
_getSocketType() {
|
|
7411
7422
|
return this.transport.type;
|
|
7412
7423
|
}
|
|
7413
7424
|
_markTransportStat(e) {
|
|
7414
|
-
let t = this._getSocketType(), n =
|
|
7425
|
+
let t = this._getSocketType(), n = hr[e][t];
|
|
7415
7426
|
U.setMark(n);
|
|
7416
7427
|
}
|
|
7417
7428
|
_logTransportStat(e, t) {
|
|
7418
|
-
let n = this._getSocketType(), r =
|
|
7429
|
+
let n = this._getSocketType(), r = hr[e][n];
|
|
7419
7430
|
this._statAggregator?.logEventualStat({
|
|
7420
7431
|
name: r,
|
|
7421
7432
|
...t
|
|
@@ -7485,7 +7496,7 @@ var Ba;
|
|
|
7485
7496
|
}
|
|
7486
7497
|
e.create = t;
|
|
7487
7498
|
function n(e) {
|
|
7488
|
-
return e ===
|
|
7499
|
+
return e === K.CONNECTED ? M.CONNECTED : e === K.CONNECTING || e === K.OPENED ? M.CONNECTING : e === K.RECONNECTING ? M.RECONNECT : null;
|
|
7489
7500
|
}
|
|
7490
7501
|
e.fromTransportState = n;
|
|
7491
7502
|
function r(e) {
|
|
@@ -8030,7 +8041,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
8030
8041
|
_collectVolumes() {
|
|
8031
8042
|
if (!this._detectors.size) return;
|
|
8032
8043
|
let e = {};
|
|
8033
|
-
if (this._topology ===
|
|
8044
|
+
if (this._topology === q.SERVER) {
|
|
8034
8045
|
if (this._activeParticipants) for (let t of this._activeParticipants) {
|
|
8035
8046
|
let n = this._getAudioTrackLevelByParticipantId(t);
|
|
8036
8047
|
n && (e[t] = n);
|
|
@@ -8047,14 +8058,14 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
8047
8058
|
}
|
|
8048
8059
|
_getAudioTrackLevelByParticipantId(e) {
|
|
8049
8060
|
if (this._isTransparentAudioMode()) return this._getTransparentAudioLevelByParticipantId(e);
|
|
8050
|
-
let t = this._detectors.get(
|
|
8061
|
+
let t = this._detectors.get(Rr.AUDIO_MIX);
|
|
8051
8062
|
return t ? t.getLevel() : null;
|
|
8052
8063
|
}
|
|
8053
8064
|
_getTransparentAudioLevelByParticipantId(e) {
|
|
8054
8065
|
if (!this._activeParticipants?.includes(e)) return null;
|
|
8055
8066
|
let t = null;
|
|
8056
8067
|
return this._detectors.forEach((e, n) => {
|
|
8057
|
-
if (!n.startsWith(`${
|
|
8068
|
+
if (!n.startsWith(`${Rr.TRANSPARENT_AUDIO_TRACK_PREFIX}-`)) return;
|
|
8058
8069
|
let r = e.getLevel();
|
|
8059
8070
|
(!t || r.real > t.real) && (t = r);
|
|
8060
8071
|
}), t;
|
|
@@ -8063,10 +8074,10 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
8063
8074
|
this._removedParticipants = this._activeParticipants?.filter((t) => !e.includes(t)) ?? null, this._activeParticipants = e;
|
|
8064
8075
|
}
|
|
8065
8076
|
_onTopologyChanged(e) {
|
|
8066
|
-
this._topology = e, this._destroyDetectors(), e ===
|
|
8077
|
+
this._topology = e, this._destroyDetectors(), e === q.DIRECT && (this._activeParticipants = null, this._removedParticipants = null);
|
|
8067
8078
|
}
|
|
8068
8079
|
_isTransparentAudioMode() {
|
|
8069
|
-
return this._topology ===
|
|
8080
|
+
return this._topology === q.SERVER && j.transparentAudio;
|
|
8070
8081
|
}
|
|
8071
8082
|
_destroyDetectors() {
|
|
8072
8083
|
this._detectors.forEach((e) => {
|
|
@@ -8077,7 +8088,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
8077
8088
|
return e.SPEAKER_CHANGED = "SPEAKER_CHANGED", e;
|
|
8078
8089
|
}({}), ho = class extends y {
|
|
8079
8090
|
constructor(e, t, n) {
|
|
8080
|
-
super(), h(this, "_speakerId", null), h(this, "_serverSideSpeakerDetection", !1), this._serverSideSpeakerDetection = n ===
|
|
8091
|
+
super(), h(this, "_speakerId", null), h(this, "_serverSideSpeakerDetection", !1), this._serverSideSpeakerDetection = n === q.SERVER, this.subscribe(e, fo.VOLUMES_DETECTED, this._onVolumesDetected.bind(this)), this.subscribe(t, J.SIGNALLED_SPEAKER_CHANGED, this._onServerSpeakerChanged.bind(this)), this.subscribe(t, J.TOPOLOGY_CHANGED, this._onTopologyChanged.bind(this));
|
|
8081
8092
|
}
|
|
8082
8093
|
destroy() {
|
|
8083
8094
|
this.unsubscribe();
|
|
@@ -8097,7 +8108,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
8097
8108
|
this._serverSideSpeakerDetection && this._triggerEvent("SPEAKER_CHANGED", e);
|
|
8098
8109
|
}
|
|
8099
8110
|
_onTopologyChanged(e) {
|
|
8100
|
-
this._serverSideSpeakerDetection = e ===
|
|
8111
|
+
this._serverSideSpeakerDetection = e === q.SERVER;
|
|
8101
8112
|
}
|
|
8102
8113
|
}, go = 15e3, _o = 15e3, vo = class extends y {
|
|
8103
8114
|
constructor(e, t, n, r = L, i = null) {
|
|
@@ -8113,13 +8124,13 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
8113
8124
|
this._connectionTimeout || !this._connectionTimeoutSuppressed || this._reportConnectionTimeout();
|
|
8114
8125
|
}
|
|
8115
8126
|
_getConnectionTimeout() {
|
|
8116
|
-
return this._transport.getTopology() ===
|
|
8127
|
+
return this._transport.getTopology() === q.DIRECT ? go : j.specListenerParams.connectionTimeout;
|
|
8117
8128
|
}
|
|
8118
8129
|
_getVolumeTimeout() {
|
|
8119
|
-
return this._transport.getTopology() ===
|
|
8130
|
+
return this._transport.getTopology() === q.DIRECT ? _o : j.specListenerParams.volumeTimeout;
|
|
8120
8131
|
}
|
|
8121
8132
|
_onTransportStateChanged(e, t) {
|
|
8122
|
-
t ===
|
|
8133
|
+
t === K.OPENED && (this._connectionTimeout || (this._connectionTimeoutSuppressed = !1, this._connectionTimeout = window.setTimeout(this._onConnectionTimeout.bind(this), this._getConnectionTimeout()))), t === K.CONNECTED && (this._volumeTimeout || (this._volumeTimeout = window.setTimeout(this._onVolumeTimeout.bind(this), this._getVolumeTimeout())), this._volumeTimeout && (window.clearTimeout(this._volumeTimeout), this._volumeTimeout = window.setTimeout(this._onVolumeTimeout.bind(this), this._getVolumeTimeout()))), t === K.FAILED && this._connectionTimeout && (this._debug.warn("Transport failed, send callSpecError"), this._logger?.log(S.CALL_SPEC_ERROR, `${this._transport.getTopology()}_CONNECTION_TIMEOUT`));
|
|
8123
8134
|
}
|
|
8124
8135
|
_onVolumesDetected(e) {
|
|
8125
8136
|
Object.keys(e).forEach((t) => {
|
|
@@ -8132,7 +8143,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
8132
8143
|
_reportConnectionTimeout() {
|
|
8133
8144
|
let e = !1, t = !1;
|
|
8134
8145
|
Object.entries(this._transport.getStates()).forEach(([n, r]) => {
|
|
8135
|
-
if (r !==
|
|
8146
|
+
if (r !== K.CONNECTED) {
|
|
8136
8147
|
if (this._participants[n]?.isOnHold) {
|
|
8137
8148
|
e = !0;
|
|
8138
8149
|
return;
|
|
@@ -8252,7 +8263,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
8252
8263
|
name: V.CODEC_USAGE,
|
|
8253
8264
|
codec_implementation: e.codecName,
|
|
8254
8265
|
value: e.totalEncodeTime,
|
|
8255
|
-
call_topology: e.topology ===
|
|
8266
|
+
call_topology: e.topology === q.DIRECT ? "D" : "S"
|
|
8256
8267
|
};
|
|
8257
8268
|
e.audioCodecParams && (t.string_value = e.audioCodecParams), this._logger.logClientStats(t);
|
|
8258
8269
|
}
|
|
@@ -8393,11 +8404,11 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
8393
8404
|
this.lastSeen[e] = t;
|
|
8394
8405
|
}
|
|
8395
8406
|
logMetrics(e) {
|
|
8396
|
-
[
|
|
8407
|
+
[pr.WEBSOCKET, pr.WEBTRANSPORT].forEach((t) => {
|
|
8397
8408
|
if (!this.trackerByTransport[t].hasData) return;
|
|
8398
8409
|
let n = this.trackerByTransport[t].snapshot();
|
|
8399
8410
|
this._logger.logClientStats({
|
|
8400
|
-
call_topology: e ===
|
|
8411
|
+
call_topology: e === q.DIRECT ? "D" : "S",
|
|
8401
8412
|
name: V.SIGNALING_PING_SUMMARY,
|
|
8402
8413
|
min_value: n.min,
|
|
8403
8414
|
max_value: n.max,
|
|
@@ -8428,7 +8439,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
8428
8439
|
if (!n.hasData) continue;
|
|
8429
8440
|
let [r, i] = t.split("|"), a = n.snapshot();
|
|
8430
8441
|
this._logger.logClientStats({
|
|
8431
|
-
call_topology: e ===
|
|
8442
|
+
call_topology: e === q.DIRECT ? "D" : "S",
|
|
8432
8443
|
name: V.SIGNALING_COMMAND_SUMMARY,
|
|
8433
8444
|
api_method: r,
|
|
8434
8445
|
min_value: a.min,
|
|
@@ -8452,6 +8463,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
8452
8463
|
if (![
|
|
8453
8464
|
E.HUNGUP,
|
|
8454
8465
|
E.CANCELED,
|
|
8466
|
+
E.CALLEE_UNAVAILABLE,
|
|
8455
8467
|
E.REJECTED,
|
|
8456
8468
|
E.FAILED,
|
|
8457
8469
|
E.BUSY,
|
|
@@ -8465,7 +8477,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
8465
8477
|
this.logger.logClientStats({
|
|
8466
8478
|
name: V.CALL_FINISH,
|
|
8467
8479
|
reason: e.correctHangupReason(t.hangup),
|
|
8468
|
-
call_topology: n ===
|
|
8480
|
+
call_topology: n === q.DIRECT ? "D" : "S",
|
|
8469
8481
|
...r && { string_value: r }
|
|
8470
8482
|
});
|
|
8471
8483
|
}
|
|
@@ -8478,7 +8490,8 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
8478
8490
|
static correctHangupReason(e) {
|
|
8479
8491
|
switch (e) {
|
|
8480
8492
|
case E.HUNGUP: return "hangup";
|
|
8481
|
-
case E.CANCELED:
|
|
8493
|
+
case E.CANCELED:
|
|
8494
|
+
case E.CALLEE_UNAVAILABLE: return "canceled";
|
|
8482
8495
|
case E.REJECTED: return "rejected";
|
|
8483
8496
|
case E.BUSY: return "busy";
|
|
8484
8497
|
case E.FAILED: return "failed";
|
|
@@ -8495,16 +8508,16 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
8495
8508
|
h(this, "_statAggregator", void 0), h(this, "_isCallMarked", !1), h(this, "_isFinished", !1), h(this, "_callType", null), this._statAggregator = e;
|
|
8496
8509
|
}
|
|
8497
8510
|
markAcceptCall(e) {
|
|
8498
|
-
this.mark(e ===
|
|
8511
|
+
this.mark(e === q.DIRECT ? "direct_incoming" : "server_incoming");
|
|
8499
8512
|
}
|
|
8500
8513
|
markAcceptedCall(e) {
|
|
8501
|
-
e ===
|
|
8514
|
+
e === q.DIRECT && this.mark("direct_outgoing");
|
|
8502
8515
|
}
|
|
8503
8516
|
markOnJoin(e) {
|
|
8504
|
-
this.mark(e ===
|
|
8517
|
+
this.mark(e === q.DIRECT ? "direct_join" : "server_join_server", e === q.DIRECT);
|
|
8505
8518
|
}
|
|
8506
8519
|
markTopologyChanged(e) {
|
|
8507
|
-
this._isFinished || e !==
|
|
8520
|
+
this._isFinished || e !== q.SERVER || (this._callType = "server_change_topology");
|
|
8508
8521
|
}
|
|
8509
8522
|
mark(e, t = !1) {
|
|
8510
8523
|
(!this._isCallMarked || t) && (this._isCallMarked = !0, this._callType = e, U.setMark(V.FIRST_MEDIA_RECEIVED));
|
|
@@ -8517,7 +8530,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
8517
8530
|
}
|
|
8518
8531
|
}, ko = 1e3, Ao = 1e4, jo = 15, Q = class e extends y {
|
|
8519
8532
|
constructor(e, t) {
|
|
8520
|
-
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, "_pendingParticipants", /* @__PURE__ */ new Map()), h(this, "_directTransportIsMaster", void 0), h(this, "_transport", null), h(this, "_debugInfo", null), h(this, "_debug", L.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",
|
|
8533
|
+
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, "_pendingParticipants", /* @__PURE__ */ new Map()), h(this, "_directTransportIsMaster", void 0), h(this, "_transport", null), h(this, "_debugInfo", null), h(this, "_debug", L.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, "_abortController", null), h(this, "_registeredPeerReceived", !1), h(this, "_calleeUnavailableTimer", 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", A.debounce(async (e) => {
|
|
8521
8534
|
if (this._signaling.ready) try {
|
|
8522
8535
|
await this._signaling.changeMediaSettings(e);
|
|
8523
8536
|
} catch (e) {
|
|
@@ -8569,13 +8582,13 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
8569
8582
|
return this._debug.sessionId;
|
|
8570
8583
|
}
|
|
8571
8584
|
async onStart({ opponentIds: e, opponentType: t, mediaOptions: n, payload: r = "", joiningAllowed: i = !1, requireAuthToJoin: a = !1, onlyAdminCanShareMovie: o, externalIds: s, onFastStart: c, conversationId: l }) {
|
|
8572
|
-
let u = Date.now();
|
|
8585
|
+
let u = Date.now(), d = (e?.length ?? 0) + (s?.length ?? 0), f = t === Oa.USER && d === 1 ? j.calleeUnavailableWaitingTime : void 0;
|
|
8573
8586
|
this._debug.setConversationId(l ?? null), Mo = this, this._abortController = new AbortController(), this._api.setAbortSignal(this._abortController?.signal), this._signaling.setAbortSignal(this._abortController?.signal);
|
|
8574
8587
|
try {
|
|
8575
8588
|
this._mediaSource = this._createMediaSource(), await this._mediaSource.request(n);
|
|
8576
8589
|
let d = this._mediaSource.mediaSettings;
|
|
8577
8590
|
t === Oa.CHAT || e && e.length > 1 ? this._logWithMediaSettings(S.OUTGOING_MULTIPARTY_CALL, d) : this._logWithMediaSettings(S.OUTGOING_CALL, d);
|
|
8578
|
-
let
|
|
8591
|
+
let p = await this._startConversation({
|
|
8579
8592
|
opponentIds: e,
|
|
8580
8593
|
opponentType: t,
|
|
8581
8594
|
direction: Y.OUTGOING,
|
|
@@ -8590,12 +8603,14 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
8590
8603
|
conversationId: l
|
|
8591
8604
|
});
|
|
8592
8605
|
if (!this._conversation) throw new D(E.UNKNOWN_ERROR);
|
|
8593
|
-
if (this._participantState = X.ACCEPTED, this._changeMediaSettings(d), await this._processConnection(
|
|
8606
|
+
if (this._participantState = X.ACCEPTED, this._changeMediaSettings(d), await this._processConnection(p), await this._allocateTransport(), this._createSpeakerDetector(), await this._createSpecListener(), this._signaling.readyToSend(), this._delayedHangup) throw new D(E.CANCELED);
|
|
8594
8607
|
return this._debug.debug("Outgoing call", {
|
|
8595
8608
|
opponentIds: e,
|
|
8596
8609
|
opponentType: t,
|
|
8597
8610
|
mediaOptions: n
|
|
8598
|
-
}), await this._processConnectionSharedMovieInfo(
|
|
8611
|
+
}), await this._processConnectionSharedMovieInfo(p), await this._processConversationUrlSharingInfo(p), I.onLocalStream(this._mediaSource.getStream(), this._mediaSource.mediaSettings, this.id), I.onConversation(this._conversation.externalId, this._conversation.mediaModifiers, this._getMuteStatesForCurrentRoom(), await this._getMainRoomParticipants(), void 0, this.id), await this._onConversationParticipantListChunk(p), await this._processPinnedParticipants(p), I.onLocalStatus(M.WAITING, this.id), this._toggleJoinAvailability(), this._changeFeatureSet(), this._changeNeedRate(), R.add(this), await R.setActive(this.id), Mo = null, this._conversation.concurrent && await this._acceptConcurrent(), f && !this._registeredPeerReceived && this._state !== "CLOSE" && (this._calleeUnavailableTimer = window.setTimeout(() => {
|
|
8612
|
+
this._calleeUnavailableTimer = null, this._signaling.ready && this._signaling.hangup(E.CANCELED), this._close(new D(E.CALLEE_UNAVAILABLE));
|
|
8613
|
+
}, f)), this._conversation;
|
|
8599
8614
|
} catch (e) {
|
|
8600
8615
|
throw Mo = null, this._close(e, "Unable to start conversation"), e;
|
|
8601
8616
|
}
|
|
@@ -8769,7 +8784,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
8769
8784
|
this._state = "PROCESSING", this._debug.debug("Decline incoming call"), this._logWithMediaSettings(S.DECLINE_INCOMING, this.mediaSettings), this._participantState = X.HUNGUP, this._signaling.ready && await this._signaling.hangup(E.REJECTED), this._close(new D(E.REJECTED));
|
|
8770
8785
|
}
|
|
8771
8786
|
async hangup() {
|
|
8772
|
-
this._debug.debug("Hangup");
|
|
8787
|
+
this._clearCalleeUnavailableWatchdog(), this._debug.debug("Hangup");
|
|
8773
8788
|
let e = this._state === "ACTIVE" || this._state === "HELD" ? E.HUNGUP : E.CANCELED;
|
|
8774
8789
|
this._stats.logger.log(S.HANGUP, e), this._signaling.ready ? (await this._signaling.hangup(e), this._close(new D(e))) : I.onHangup(new D(E.HUNGUP), this._conversation && this._conversation.id), this._conversation?.id && R.has(this._conversation.id) && R.remove(this._conversation.id);
|
|
8775
8790
|
}
|
|
@@ -8807,18 +8822,19 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
8807
8822
|
if (!this._transport) return;
|
|
8808
8823
|
let n = new Set(this._transport.opened()), r = [];
|
|
8809
8824
|
for (let i of e) (i.state === X.CALLED || i.state === X.ACCEPTED) && (this._transport.isAllocated(i.id) || this._allocateParticipantTransport(i.id, t)), i.state === X.ACCEPTED && !n.has(i.id) && r.push(i.id);
|
|
8810
|
-
r.length ? this._transport.open(r, null, !!this._conversation?.observer) : this._transport.getTopology() ===
|
|
8825
|
+
r.length ? this._transport.open(r, null, !!this._conversation?.observer) : this._transport.getTopology() === q.SERVER && this._forceOpenTransportForAloneInCall();
|
|
8811
8826
|
}
|
|
8812
8827
|
_allocateParticipantTransport(e, t) {
|
|
8813
|
-
this._transport && (this._transport.getTopology() ===
|
|
8828
|
+
this._transport && (this._transport.getTopology() === q.DIRECT && (t = this._directTransportIsMaster ?? (this._directTransportIsMaster = t)), this._transport.allocate(e, t));
|
|
8814
8829
|
}
|
|
8815
8830
|
async _close(e, t) {
|
|
8816
|
-
t && this._debug.error(t, e), this._debug.debug("Close conversation", e), this._stats.logHangup(e, this._transport?.getTopology()), this._stats.flushCallMetrics(this._transport?.getTopology()), this._signaling.readyToSend(!1), e.error ? this._signaling.ready && this._signaling.hangup(E.FAILED) : this._stats.logger.log(S.ERROR, e.hangup);
|
|
8831
|
+
this._clearCalleeUnavailableWatchdog(), t && this._debug.error(t, e), this._debug.debug("Close conversation", e), this._stats.logHangup(e, this._transport?.getTopology()), this._stats.flushCallMetrics(this._transport?.getTopology()), this._signaling.readyToSend(!1), e.error ? this._signaling.ready && this._signaling.hangup(E.FAILED) : this._stats.logger.log(S.ERROR, e.hangup);
|
|
8817
8832
|
let n = this._conversation && this._conversation.id;
|
|
8818
8833
|
if ([
|
|
8819
8834
|
E.CANCELED,
|
|
8820
8835
|
E.NOT_FRIENDS,
|
|
8821
8836
|
E.CALLEE_IS_OFFLINE,
|
|
8837
|
+
E.CALLEE_UNAVAILABLE,
|
|
8822
8838
|
E.CALLER_IS_BLOCKED,
|
|
8823
8839
|
E.CALLER_IS_REJECTED
|
|
8824
8840
|
].indexOf(e.hangup) !== -1 || e.hangup === E.REJECTED && !e.remote) {
|
|
@@ -8844,6 +8860,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
8844
8860
|
this._state = "CLOSE", this._participantState = X.HUNGUP, this._changeFeatureSet(), this._cleanupMediaSource(), await this._cleanupParticipants(), this._cleanupParticipantAgnosticStreams(), this._cleanupTransport(), this._cleanupSpeakerDetector(), this._cleanupSpecListener(), this._cleanupSignaling(), this._api.cleanup(), this._api.setAbortSignal(void 0), this._signaling.setAbortSignal(void 0), this._stats.destroy(), R.remove(this.id), this._conversation = null, this._myLastRequestedLayouts = {}, this._displayLayoutRequester.clear(), this._delayedHangup = !1, this._abortController = null, I.onHangup(e || new D(E.UNKNOWN_ERROR), n);
|
|
8845
8861
|
}
|
|
8846
8862
|
async destroy() {
|
|
8863
|
+
this._clearCalleeUnavailableWatchdog();
|
|
8847
8864
|
let e = this._conversation && this._conversation.id;
|
|
8848
8865
|
if (this._debug.debug("Destroy conversation", { conversationId: e }), this._cooldownQueueCleanupTimer !== null && (window.clearInterval(this._cooldownQueueCleanupTimer), this._cooldownQueueCleanupTimer = null), this._state = "CLOSE", this._participantState = X.HUNGUP, this._cleanupMediaSource(), await this._cleanupParticipants(), this._cleanupParticipantAgnosticStreams(), this._cleanupTransport(), this._cleanupSpeakerDetector(), this._cleanupSpecListener(), this._cleanupSignaling(), this._api.cleanup(), this._api.setAbortSignal(void 0), this._signaling.setAbortSignal(void 0), this._delayedHangup && e) try {
|
|
8849
8866
|
this._api.hangupConversation(e, E.CANCELED);
|
|
@@ -8880,6 +8897,9 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
8880
8897
|
let s = new URL(e), c = s.searchParams;
|
|
8881
8898
|
return c.set("userId", String(t)), c.set("entityType", n), c.set("deviceIdx", String(r)), c.set("conversationId", i), c.set("token", a), o?.isp_as_no && c.set("ispAsNo", String(o.isp_as_no)), o?.isp_as_org && c.set("ispAsOrg", o.isp_as_org), o?.loc_cc && c.set("locCc", o.loc_cc), o?.loc_reg && c.set("locReg", o.loc_reg), s.toString();
|
|
8882
8899
|
}
|
|
8900
|
+
_clearCalleeUnavailableWatchdog() {
|
|
8901
|
+
this._calleeUnavailableTimer !== null && (window.clearTimeout(this._calleeUnavailableTimer), this._calleeUnavailableTimer = null);
|
|
8902
|
+
}
|
|
8883
8903
|
async _startConversation({ opponentIds: e, opponentType: t, direction: n, mediaOptions: r, payload: i = "", joiningAllowed: a = !1, requireAuthToJoin: o = !1, onlyAdminCanShareMovie: s, externalIds: c, startedTime: l, onFastStart: u, conversationId: d }) {
|
|
8884
8904
|
let f = d ?? A.uuid();
|
|
8885
8905
|
if (R.has(f)) throw new D(E.HAS_ACTIVE_CALL);
|
|
@@ -9108,7 +9128,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
9108
9128
|
featuresPerRole: t.conversation.featuresPerRole,
|
|
9109
9129
|
id: t.conversation.id || e.id,
|
|
9110
9130
|
participantsLimit: t.conversation.participantsLimit || 30,
|
|
9111
|
-
topology: t.conversation.topology ||
|
|
9131
|
+
topology: t.conversation.topology || q.DIRECT,
|
|
9112
9132
|
direction: n,
|
|
9113
9133
|
concurrent: t.isConcurrent || e.is_concurrent || !1,
|
|
9114
9134
|
needRate: !1,
|
|
@@ -9135,14 +9155,14 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
9135
9155
|
}
|
|
9136
9156
|
_updateConversation(e) {
|
|
9137
9157
|
if (!this._conversation) throw new D(E.UNKNOWN_ERROR);
|
|
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 ||
|
|
9158
|
+
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 || q.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 ?? []);
|
|
9139
9159
|
}
|
|
9140
9160
|
_createMediaSource() {
|
|
9141
9161
|
let e = new Yt(this._debug, this._stats.logger);
|
|
9142
9162
|
return this.subscribe(e, qt.SOURCE_CHANGED, this._onLocalMediaStreamChanged.bind(this)), this.subscribe(e, qt.SCREEN_STATUS, this._onScreenSharingStatus.bind(this)), this._audioFix = new Qa(e, this._debug, this._stats.logger), e;
|
|
9143
9163
|
}
|
|
9144
9164
|
async _connectSignaling(e, t) {
|
|
9145
|
-
this._signaling.setEndpoint(t.endpoint), this._signaling.setWebTransportEndpoint(t.wt_endpoint ? t.wt_endpoint : null), this.subscribe(this._signaling,
|
|
9165
|
+
this._signaling.setEndpoint(t.endpoint), this._signaling.setWebTransportEndpoint(t.wt_endpoint ? t.wt_endpoint : null), this.subscribe(this._signaling, W.NOTIFICATION, (e) => this._signalingActor.add(e)), this.subscribe(this._signaling, W.FAILED, this._onSignalingFailed.bind(this)), this.subscribe(this._signaling, W.RECONNECT, this._onSignalingReconnect.bind(this));
|
|
9146
9166
|
let n = await this._signaling.connect(e, t);
|
|
9147
9167
|
return this._stats.statAggregator.logEventualStat({ name: V.SIGNALING_CONNECTED }), n;
|
|
9148
9168
|
}
|
|
@@ -9237,7 +9257,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
9237
9257
|
});
|
|
9238
9258
|
}
|
|
9239
9259
|
_isParticipantSessionStateApplicable(e) {
|
|
9240
|
-
return j.enableSessionStateUpdates && !this._isMe(e) && this._conversation?.topology ===
|
|
9260
|
+
return j.enableSessionStateUpdates && !this._isMe(e) && this._conversation?.topology === q.SERVER;
|
|
9241
9261
|
}
|
|
9242
9262
|
_setTransportStatus(e, t) {
|
|
9243
9263
|
return Va.setTransport(e.connectionStatus, t);
|
|
@@ -9576,7 +9596,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
9576
9596
|
}
|
|
9577
9597
|
await this._stopStreaming(e.value), t[e.value] = { stopStream: !0 };
|
|
9578
9598
|
}
|
|
9579
|
-
if (this._transport?.getTopology() !==
|
|
9599
|
+
if (this._transport?.getTopology() !== q.SERVER) {
|
|
9580
9600
|
n.forEach((e) => e());
|
|
9581
9601
|
return;
|
|
9582
9602
|
}
|
|
@@ -9890,10 +9910,10 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
9890
9910
|
this._signaling.ready && this._conversation && (this._conversation.mediaModifiers = e, await this._signaling.updateMediaModifiers(e));
|
|
9891
9911
|
}
|
|
9892
9912
|
async enableVideoSuspend(e) {
|
|
9893
|
-
this._signaling.ready && this._conversation && this._transport?.getTopology() ===
|
|
9913
|
+
this._signaling.ready && this._conversation && this._transport?.getTopology() === q.SERVER && await this._signaling.enableVideoSuspend(e);
|
|
9894
9914
|
}
|
|
9895
9915
|
async enableVideoSuspendSuggest(e) {
|
|
9896
|
-
this._signaling.ready && this._conversation && this._transport?.getTopology() ===
|
|
9916
|
+
this._signaling.ready && this._conversation && this._transport?.getTopology() === q.SERVER && await this._signaling.enableVideoSuspendSuggest(e);
|
|
9897
9917
|
}
|
|
9898
9918
|
async changeOptions(e) {
|
|
9899
9919
|
if (this._signaling.ready && this._conversation) {
|
|
@@ -10198,52 +10218,52 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
10198
10218
|
}
|
|
10199
10219
|
_onSignalingNotification(e) {
|
|
10200
10220
|
switch (e.notification) {
|
|
10201
|
-
case
|
|
10202
|
-
case
|
|
10203
|
-
case
|
|
10204
|
-
case
|
|
10205
|
-
case
|
|
10206
|
-
case
|
|
10207
|
-
case
|
|
10208
|
-
case
|
|
10209
|
-
case
|
|
10210
|
-
case
|
|
10211
|
-
case
|
|
10212
|
-
case
|
|
10213
|
-
case
|
|
10214
|
-
case
|
|
10215
|
-
case
|
|
10216
|
-
case
|
|
10217
|
-
case
|
|
10218
|
-
case
|
|
10219
|
-
case
|
|
10220
|
-
case
|
|
10221
|
-
case
|
|
10222
|
-
case
|
|
10223
|
-
case
|
|
10224
|
-
case
|
|
10225
|
-
case
|
|
10226
|
-
case
|
|
10227
|
-
case
|
|
10228
|
-
case
|
|
10229
|
-
case
|
|
10230
|
-
case
|
|
10231
|
-
case
|
|
10232
|
-
case
|
|
10233
|
-
case
|
|
10234
|
-
case
|
|
10235
|
-
case
|
|
10236
|
-
case
|
|
10237
|
-
case
|
|
10238
|
-
case
|
|
10239
|
-
case
|
|
10240
|
-
case
|
|
10241
|
-
case
|
|
10242
|
-
case
|
|
10243
|
-
case
|
|
10244
|
-
case
|
|
10245
|
-
case
|
|
10246
|
-
case
|
|
10221
|
+
case G.ACCEPTED_CALL: return this._onAcceptedCall(e);
|
|
10222
|
+
case G.HUNGUP: return this._onHungup(e);
|
|
10223
|
+
case G.PARTICIPANT_ADDED: return this._onAddedParticipant(e);
|
|
10224
|
+
case G.PARTICIPANT_JOINED: return this._onJoinedParticipant(e);
|
|
10225
|
+
case G.CLOSED_CONVERSATION: return this._onClosedConversation(e);
|
|
10226
|
+
case G.MEDIA_SETTINGS_CHANGED: return this._onMediaSettingsChanged(e);
|
|
10227
|
+
case G.PARTICIPANT_STATE_CHANGED: return this._onParticipantStateChanged(e);
|
|
10228
|
+
case G.SESSION_STATE: return this._onSessionState(e);
|
|
10229
|
+
case G.PARTICIPANTS_STATE_CHANGED: return this._onParticipantsStateChanged(e);
|
|
10230
|
+
case G.RATE_CALL_DATA: return this._onNeedRate();
|
|
10231
|
+
case G.FEATURE_SET_CHANGED: return this._onFeatureSetChanged(e);
|
|
10232
|
+
case G.MULTIPARTY_CHAT_CREATED: return this._onMultipartyChatCreated(e);
|
|
10233
|
+
case G.FORCE_MEDIA_SETTINGS_CHANGE: return this._onForceMediaSettingsChange(e);
|
|
10234
|
+
case G.SETTINGS_UPDATE: return this._onSettingsUpdate(e);
|
|
10235
|
+
case G.VIDEO_QUALITY_UPDATE: return this._onVideoQualityUpdate(e);
|
|
10236
|
+
case G.REGISTERED_PEER: return this._onPeerRegistered(e);
|
|
10237
|
+
case G.SWITCH_MICRO: return this._onMicSwitched(e);
|
|
10238
|
+
case G.CHAT_MESSAGE: return this._onChatMessage(e);
|
|
10239
|
+
case G.CUSTOM_DATA: return this._onCustomData(e);
|
|
10240
|
+
case G.RECORD_STARTED: return this._onRecordInfo(e.recordInfo, e.roomId);
|
|
10241
|
+
case G.RECORD_STOPPED: return this._onStopRecordInfo(e, e.roomId);
|
|
10242
|
+
case G.ROLES_CHANGED: return this._onRolesChanged(e.participantId, e.roles || []);
|
|
10243
|
+
case G.MUTE_PARTICIPANT: return this._onMuteParticipant(e);
|
|
10244
|
+
case G.PIN_PARTICIPANT: return this._onPinParticipant(e.participantId, e.unpin, e.markers, e.roomId);
|
|
10245
|
+
case G.OPTIONS_CHANGED: return this._onOptionsChanged(e.options || []);
|
|
10246
|
+
case G.PARTICIPANT_SOURCES_UPDATE: return this._onParticipantSourcesUpdate(e);
|
|
10247
|
+
case G.PROMOTE_PARTICIPANT: return this._onParticipantPromoted(e);
|
|
10248
|
+
case G.CHAT_ROOM_UPDATED: return this._onChatRoomUpdated(e.eventType, e.totalCount, e.firstParticipants, e.addedParticipantIds, e.removedParticipantIds);
|
|
10249
|
+
case G.JOIN_LINK_CHANGED: return this._onJoinLinkChanged(e);
|
|
10250
|
+
case G.FEEDBACK: return this._onFeedback(e);
|
|
10251
|
+
case G.MOVIE_UPDATE_NOTIFICATION: return this._onSharedMovieUpdate(e);
|
|
10252
|
+
case G.MOVIE_SHARE_STARTED: return this._onSharedMovieInfoStarted(e);
|
|
10253
|
+
case G.MOVIE_SHARE_STOPPED: return this._onSharedMovieInfoStopped(e);
|
|
10254
|
+
case G.URL_SHARING_INFO_UPDATED: return this._onUrlSharingInfoUpdated(e);
|
|
10255
|
+
case G.ROOMS_UPDATED: return this._onRoomsUpdated(e);
|
|
10256
|
+
case G.ROOM_UPDATED: return this._onRoomUpdated(e);
|
|
10257
|
+
case G.ROOM_PARTICIPANTS_UPDATED: return this._onRoomParticipantsUpdated(e);
|
|
10258
|
+
case G.FEATURES_PER_ROLE_CHANGED: return this._onFeaturesPerRoleChanged(e);
|
|
10259
|
+
case G.PARTICIPANT_ANIMOJI_CHANGED: return this._onParticipantAnimojiChanged(e);
|
|
10260
|
+
case G.ASR_STARTED: return this._onAsrStart(e);
|
|
10261
|
+
case G.ASR_STOPPED: return this._onAsrStop(e);
|
|
10262
|
+
case G.PROMOTION_APPROVED: return this._onPromotionApproved(e);
|
|
10263
|
+
case G.DECORATIVE_PARTICIPANT_ID_CHANGED: return this._onDecorativeParticipantIdChanged(e);
|
|
10264
|
+
case G.VIDEO_SUSPEND_SUGGEST: return this._onVideoSuspendSuggest(e);
|
|
10265
|
+
case G.HOLD: return this._onParticipantHold(e);
|
|
10266
|
+
case G.TOPOLOGY_CHANGED: return this._onSignalingTopologyChanged(e);
|
|
10247
10267
|
}
|
|
10248
10268
|
}
|
|
10249
10269
|
_onSignalingTopologyChanged(e) {
|
|
@@ -10491,7 +10511,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
10491
10511
|
screenSharing: e.screenSharing,
|
|
10492
10512
|
fastScreenSharing: e.fastScreenSharing
|
|
10493
10513
|
};
|
|
10494
|
-
this._serverSettings =
|
|
10514
|
+
this._serverSettings = Sr(this._serverSettings, t), this._transport && this._transport.updateSettings(this._serverSettings);
|
|
10495
10515
|
}
|
|
10496
10516
|
_onVideoQualityUpdate(e) {
|
|
10497
10517
|
this._debug.debug("Got video quality update notification", e);
|
|
@@ -10507,9 +10527,10 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
10507
10527
|
camera: Object.assign({}, this._serverSettings.camera, t),
|
|
10508
10528
|
screenSharing: null,
|
|
10509
10529
|
fastScreenSharing: null
|
|
10510
|
-
}, this._serverSettings =
|
|
10530
|
+
}, this._serverSettings = Sr(this._serverSettings, n), this._transport && this._transport.updateSettings(this._serverSettings);
|
|
10511
10531
|
}
|
|
10512
10532
|
async _onPeerRegistered(e) {
|
|
10533
|
+
this._registeredPeerReceived = !0, this._clearCalleeUnavailableWatchdog();
|
|
10513
10534
|
let t = A.composeMessageId(e), n = await this._getParticipant(t);
|
|
10514
10535
|
n && (n.clientType = e.clientType, n.platform = e.platform), I.onPeerRegistered(this.id);
|
|
10515
10536
|
}
|
|
@@ -10725,7 +10746,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
10725
10746
|
if (this._isMe(r) || r === "") e = this._conversation.networkRating;
|
|
10726
10747
|
else if (n[r]) e = n[r].networkRating;
|
|
10727
10748
|
else continue;
|
|
10728
|
-
if (e !== i) if (this._isMe(r) || r === "") this._conversation.networkRating = i,
|
|
10749
|
+
if (e !== i) if (this._isMe(r) || r === "") this._conversation.networkRating = i, Hr.getInstance().value = i, I.onLocalNetworkStatusChanged(i, this.id);
|
|
10729
10750
|
else {
|
|
10730
10751
|
let e = n[r];
|
|
10731
10752
|
e.networkRating = i, t.push({
|
|
@@ -10766,7 +10787,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
10766
10787
|
}
|
|
10767
10788
|
}
|
|
10768
10789
|
_onPeerConnectionClosed(e) {
|
|
10769
|
-
this._state !== "HELD" && (e ===
|
|
10790
|
+
this._state !== "HELD" && (e === q.SERVER && this._cleanupParticipantAgnosticStreams(), this._audioOutput.destroy());
|
|
10770
10791
|
}
|
|
10771
10792
|
_changeFeatureSet() {
|
|
10772
10793
|
if (this._conversation) {
|
|
@@ -10819,18 +10840,18 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
10819
10840
|
let r = await this._getParticipants(), i = [], a = e.reduce((e, n) => {
|
|
10820
10841
|
if (n in r) {
|
|
10821
10842
|
let a = r[n];
|
|
10822
|
-
e.push(a), t ===
|
|
10843
|
+
e.push(a), t === K.CONNECTED && (a.remoteStream || (a.mediaSettings && this._changeRemoteMediaSettings(n, a.mediaSettings), this._changeRemoteParticipantState(n, a.participantState)), i.push(...Object.values(a.lastRequestedLayouts)));
|
|
10823
10844
|
} else this._warnParticipantNotInConversation(n);
|
|
10824
10845
|
return e;
|
|
10825
10846
|
}, []);
|
|
10826
10847
|
a.length && (this._updateDisplayLayoutFromCache(i), this._setParticipantsStatus(a, n));
|
|
10827
10848
|
}
|
|
10828
10849
|
async _onTransportLocalStateChanged(e) {
|
|
10829
|
-
if (this._debug.debug(`Local transport state has changed: ${e}`), e ===
|
|
10850
|
+
if (this._debug.debug(`Local transport state has changed: ${e}`), e === K.CONNECTED && (w.releaseFirefoxMicrophonePermissionWarmup(), I.onLocalStatus(M.CONNECTED, this.id), this._transport?.getTopology() === q.SERVER)) {
|
|
10830
10851
|
let e = Object.values(this._myLastRequestedLayouts);
|
|
10831
10852
|
await this.updateDisplayLayout(e), this._displayLayoutRequester.resend();
|
|
10832
10853
|
}
|
|
10833
|
-
this._state !== "HELD" && ((e ===
|
|
10854
|
+
this._state !== "HELD" && ((e === K.CONNECTING || e === K.RECONNECTING) && await this._areTransportParticipantsOnHold() || (e === K.CONNECTING && I.onLocalStatus(M.CONNECTING, this.id), e === K.RECONNECTING && I.onLocalStatus(M.RECONNECT, this.id), e === K.FAILED && this._transport && this._transport.allocated().length === 0 && (this._signaling.ready && await this._signaling.hangup(E.FAILED), this._close(new D(E.FAILED), "Transport failed"))));
|
|
10834
10855
|
}
|
|
10835
10856
|
async _areTransportParticipantsOnHold() {
|
|
10836
10857
|
if (!j.hold || !this._transport) return !1;
|
|
@@ -10840,9 +10861,9 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
10840
10861
|
return e.every((e) => t[e]?.isOnHold);
|
|
10841
10862
|
}
|
|
10842
10863
|
async _onRemoteTrackAdded(e, t, n) {
|
|
10843
|
-
if (e.endsWith(
|
|
10844
|
-
else if (e.startsWith(
|
|
10845
|
-
else if (e.startsWith(
|
|
10864
|
+
if (e.endsWith(Rr.AUDIO_MIX)) this._debug.debug("Remote audio mix track added"), this._audioOutput.add(e, n), I.onRemoteMixedAudioStream(t, this.id);
|
|
10865
|
+
else if (e.startsWith(Rr.TRANSPARENT_AUDIO_TRACK_PREFIX)) this._debug.debug(`Remote transparent audio track added: ${e}`), this._audioOutput.add(e, n);
|
|
10866
|
+
else if (e.startsWith(Rr.PARTICIPANT_AGNOSTIC_TRACK_PREFIX)) this._debug.debug(`Participant-agnostic track added: ${e}`), this._streamByStreamId.set(e, t);
|
|
10846
10867
|
else {
|
|
10847
10868
|
this._debug.debug(`Remote track added on the participant [${e}]`, { kind: n.kind });
|
|
10848
10869
|
let r = await this._getParticipant(e);
|
|
@@ -10869,7 +10890,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
10869
10890
|
}
|
|
10870
10891
|
}
|
|
10871
10892
|
async _removeAudioTrack(e, t, n) {
|
|
10872
|
-
if (e !==
|
|
10893
|
+
if (e !== Rr.AUDIO_MIX) {
|
|
10873
10894
|
let n = await this._getParticipant(e);
|
|
10874
10895
|
if (!n || n.remoteStream && n.remoteStream !== t) return;
|
|
10875
10896
|
}
|
|
@@ -10881,7 +10902,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
10881
10902
|
this._conversation && (this._conversation.topology = e);
|
|
10882
10903
|
return;
|
|
10883
10904
|
}
|
|
10884
|
-
if (this._statFirstMediaReceived.markTopologyChanged(e), e ===
|
|
10905
|
+
if (this._statFirstMediaReceived.markTopologyChanged(e), e === q.DIRECT && (this._onRemoteSignalledStall([]), this._onAudioMixStall(!1)), this._conversation) {
|
|
10885
10906
|
this._conversation.topology = e;
|
|
10886
10907
|
for (let e of Object.values(this._participants)) {
|
|
10887
10908
|
let t = Va.setSessionStateApplicable(e.connectionStatus, this._isParticipantSessionStateApplicable(e.id));
|
|
@@ -10928,7 +10949,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
10928
10949
|
}), I.onJoinStatus(t, e, this.id));
|
|
10929
10950
|
}
|
|
10930
10951
|
async _updateDisplayLayoutFromCache(e) {
|
|
10931
|
-
if (this._transport?.getTopology() ===
|
|
10952
|
+
if (this._transport?.getTopology() === q.SERVER && e.length) try {
|
|
10932
10953
|
await this.updateDisplayLayout(e);
|
|
10933
10954
|
} catch (e) {
|
|
10934
10955
|
this._debug.warn(`_updateDisplayLayoutFromCache failed: ${e}`);
|
|
@@ -11011,7 +11032,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
11011
11032
|
}, e.decorativeUserId);
|
|
11012
11033
|
}) || []), s = !1;
|
|
11013
11034
|
for (let e of o) e.id === this._conversation?.compositeUserId && (s = !0), this._registerParticipantInCache(e);
|
|
11014
|
-
this._transport?.getState() ===
|
|
11035
|
+
this._transport?.getState() === K.IDLE && !this._isCalledState() && this._openTransport(o, !0);
|
|
11015
11036
|
let c = [], l = [];
|
|
11016
11037
|
if (e?.removedParticipantMarkers) {
|
|
11017
11038
|
for (let t of e.removedParticipantMarkers) if (t.GRID?.id) {
|
|
@@ -11101,7 +11122,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
11101
11122
|
}
|
|
11102
11123
|
}
|
|
11103
11124
|
_onVideoSuspendSuggest(e) {
|
|
11104
|
-
!this._conversation || this._conversation.topology !==
|
|
11125
|
+
!this._conversation || this._conversation.topology !== q.SERVER || (this._debug.debug("Video suspend suggested", e), I.onVideoSuspendSuggest(e.bandwidth, this.id));
|
|
11105
11126
|
}
|
|
11106
11127
|
async _onParticipantHold(e) {
|
|
11107
11128
|
this._debug.debug("Participant hold suggested", e);
|
|
@@ -11112,7 +11133,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
11112
11133
|
}
|
|
11113
11134
|
if (t.isOnHold = e.hold, this._specListener?.onParticipantHoldChanged(), this._transport?.setRemoteHold(e.hold), e.hold) this._setParticipantsStatus([t], M.ONHOLD);
|
|
11114
11135
|
else {
|
|
11115
|
-
let e = this._transport?.getTopology() ===
|
|
11136
|
+
let e = this._transport?.getTopology() === q.DIRECT ? M.CONNECTING : M.CONNECTED;
|
|
11116
11137
|
this._setParticipantsStatus([t], e);
|
|
11117
11138
|
}
|
|
11118
11139
|
}
|
|
@@ -11129,7 +11150,7 @@ var ro = 90, io = 3, ao = class extends y {
|
|
|
11129
11150
|
this._conversation?.muteStates.set(t, e);
|
|
11130
11151
|
}
|
|
11131
11152
|
_forceOpenTransportForAloneInCall() {
|
|
11132
|
-
this._transport?.getTopology() ===
|
|
11153
|
+
this._transport?.getTopology() === q.SERVER && this._transport?.getState() === K.IDLE && !this._isCalledState() && this._transport.open(this._transport.allocated(), null, !!this._conversation?.observer, !0);
|
|
11133
11154
|
}
|
|
11134
11155
|
_registerParticipant(e, t) {
|
|
11135
11156
|
let n = this._createParticipant(e, t);
|
|
@@ -12221,4 +12242,4 @@ function Yc() {
|
|
|
12221
12242
|
}
|
|
12222
12243
|
typeof window < "u" && (window.__CALLS_SDK = hn);
|
|
12223
12244
|
//#endregion
|
|
12224
|
-
export { Xo as Api, ns as ApiExternal, ts as ArrayDequeue, v as AuthData, f as BaseLogger, Y as CallDirection, Oa as CallType, ka as ChatRoomEventType, Aa as ConversationFeature, ja as ConversationOption, vn as DebugMessageType, Ha as ExternalIdType, jt as FacingMode, b as FatalError, D as HangupReason, E as HangupType, x as MediaOption, O as MediaTrackKind, B as MediaType, Pa as MuteState, X as ParticipantState, es as ParticipantStateDataValue, M as ParticipantStatus, $o as RecordRole, Fa as RoomsEventType, Da as Signaling, z as SignalingCommandType, fr as SignalingConnectionType,
|
|
12245
|
+
export { Xo as Api, ns as ApiExternal, ts as ArrayDequeue, v as AuthData, f as BaseLogger, Y as CallDirection, Oa as CallType, ka as ChatRoomEventType, Aa as ConversationFeature, ja as ConversationOption, vn as DebugMessageType, Ha as ExternalIdType, jt as FacingMode, b as FatalError, D as HangupReason, E as HangupType, x as MediaOption, O as MediaTrackKind, B as MediaType, Pa as MuteState, X as ParticipantState, es as ParticipantStateDataValue, M as ParticipantStatus, $o as RecordRole, Fa as RoomsEventType, Da as Signaling, z as SignalingCommandType, fr as SignalingConnectionType, G as SignalingNotification, q as TransportTopology, Ra as UserRole, k as UserType, co as VolumeDetector, _s as acceptCall, Nc as acceptPromotion, hc as activateRooms, dc as addMovie, Cs as addParticipant, ws as addParticipantInternal, gs as authorize, is as browser, fs as callInternal, ds as callTo, Os as captureScreen, ks as captureVmoji, Tc as changeAudioEffect, Js as changeConversationOptions, Ds as changeDevice, Fs as changeParticipantState, Ps as changePriorities, wc as changeVideoEffect, Zs as chatHistory, Ys as chatMessage, Xs as chatMessageInternal, nc as createJoinLink, Qs as customData, $s as customDataInternal, yc as debug, xc as debugLogs, bc as debugMessage, vs as declineCall, Lc as enableFeatureForRoles, Ks as enableVideoSuspend, qs as enableVideoSuspendSuggest, Ic as feedback, oc as forceRelayPolicy, qc as getActiveCallId, ic as getAnonymTokenByLink, Ac as getAudienceModeHands, hs as getInbounds, Pc as getParticipantListChunk, Fc as getParticipants, uc as getStreamInfo, Jc as getSyncedTime, kc as getWaitingHall, zs as grantRoles, Bs as grantRolesInternal, Ss as hangup, us as init, ys as joinCall, xs as joinCallByLink, bs as joinCallInternal, Vs as muteParticipant, Hs as muteParticipantInternal, Us as pinParticipant, Ws as pinParticipantInternal, ps as processPush, ms as processPushInternal, jc as promoteParticipant, lc as publishStream, Is as putHandsDown, Bc as removeHistoryRecords, rc as removeJoinLink, pc as removeMovie, Ts as removeParticipant, Es as removeParticipantInternal, _c as removeRooms, Uc as requestAsr, Rs as requestDisplayLayout, Mc as requestPromotion, cs as setAudioEffects, Ec as setAudioStream, Ns as setLocalResolution, os as setLogger, Gs as setMediaModifiers, vc as setStatisticsInterval, ss as setVideoEffects, As as setVideoStream, ls as setVmoji, Oc as setVmojiFill, Dc as setVmojiSvg, ac as setVolume, Vc as startAsr, tc as startAudienceConversation, ec as startConversation, sc as startStream, Wc as startUrlSharing, Hc as stopAsr, cc as stopStream, Gc as stopUrlSharing, Kc as switchCall, gc as switchRoom, Ms as toggleLocalAudio, js as toggleLocalVideo, Ls as updateDisplayLayout, fc as updateMovie, mc as updateRooms, Cc as uploadDebugLogs, as as utils, Yc as version };
|