@cloudflare/realtimekit 1.2.2 → 1.2.3-staging.2
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/dist/EncryptionManager.d.ts +1 -0
- package/dist/browser.js +10 -10
- package/dist/dependencies.txt +1 -1
- package/dist/index.cjs.js +10 -10
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +201 -200
- package/dist/index.es5.js +134 -137
- package/dist/index.rn.js +10 -10
- package/dist/ts3.4/dist/EncryptionManager.d.ts +1 -0
- package/dist/ts3.4/dist/index.d.ts +1 -0
- package/package.json +2 -3
package/dist/index.es5.js
CHANGED
|
@@ -3,7 +3,7 @@ import _v from "bowser";
|
|
|
3
3
|
import { MessageType as M, PbLong as Ko, typeofJsonValue as mm } from "@protobuf-ts/runtime";
|
|
4
4
|
import * as Ml from "worker-timers";
|
|
5
5
|
import * as Dn from "sdp-transform";
|
|
6
|
-
var Zg = ["id"], xg = ["chat", "connectedMeetings", "plugins", "polls", "media"], em = ["id"], rm = ["meetingId"], cn, Za, z, Jn, $e, Kn, oa, Fl, so, dn, Hl, pl, xa, ei, Eo, pn, ri, zn, wi, oo, Yn, uo, lo, hn, ti, Or, Qe, Dr, ni, ai, It, ii, vn, si,
|
|
6
|
+
var Zg = ["id"], xg = ["chat", "connectedMeetings", "plugins", "polls", "media"], em = ["id"], rm = ["meetingId"], cn, Za, z, Jn, $e, Kn, oa, Fl, so, dn, Hl, pl, xa, ei, Eo, pn, ri, zn, wi, oo, Yn, uo, lo, hn, ti, Or, Qe, Dr, ni, ai, It, ii, vn, si, qr, oi, et, Pi, ui, li, ci, Gr, Ae, di, pi, Nr, Qn, bn, Xn, hl, Mt, co, mn, Zn, _t, vl, po, fl, gl, ye, ho, xn, hi, ea, wr, Wr, rt, vi, fi, ur, gi, Ne, Ot, Ve, mi, Ie, Si, Ei, vo, kp, Uc, Co, Ro, Xe, W, Ci, lr, ua, la, ra, fo, Kr, Dt, js, ta, na, hr, Pr, fn, ml, Bl, ql, Ao, Gl, Wl, Jl, Kl, We, aa, yl, kl, bl, ia, tt, Z, cr, gn, be, Te, Jr, Je, go, mo, he, Ue, sa;
|
|
7
7
|
function cc(o, t) {
|
|
8
8
|
if (o == null)
|
|
9
9
|
return {};
|
|
@@ -5830,12 +5830,12 @@ function DP(o) {
|
|
|
5830
5830
|
var Hh = 1080, Bh = 1920, LP = function(t, e, r, n, a, i) {
|
|
5831
5831
|
var s = 0.5, u = 0.5, c = a, d = i, p = Math.min(r / c, n / d), v = c * p, f = d * p, g, k, y, b, E = 1;
|
|
5832
5832
|
return v < r && (E = r / v), Math.abs(E - 1) < 1e-14 && f < n && (E = n / f), v *= E, f *= E, y = c / (v / r), b = d / (f / n), g = (c - y) * s, k = (d - b) * u, g < 0 && (g = 0), k < 0 && (k = 0), y > c && (y = c), b > d && (b = d), [g, k, y, b, t, e, r, n];
|
|
5833
|
-
},
|
|
5833
|
+
}, zr = /* @__PURE__ */ C("canvas"), ha = /* @__PURE__ */ C("context"), tr = /* @__PURE__ */ C("videoContainer"), Yr = /* @__PURE__ */ C("video"), Se = /* @__PURE__ */ C("dimensions"), st = /* @__PURE__ */ C("colors"), qt = /* @__PURE__ */ C("rafRequest"), fr = /* @__PURE__ */ C("sources"), Oe = /* @__PURE__ */ C("self"), ss = /* @__PURE__ */ C("pinIcon"), os = /* @__PURE__ */ C("handRaiseIcon"), Gt = /* @__PURE__ */ C("state"), us = /* @__PURE__ */ C("initComplete"), $P = /* @__PURE__ */ function(o) {
|
|
5834
5834
|
function t(e, r, n, a) {
|
|
5835
5835
|
var i;
|
|
5836
5836
|
w(this, t);
|
|
5837
5837
|
var s = e.getValue("logger");
|
|
5838
|
-
return i = R(this, t, [s]), Object.defineProperty(i,
|
|
5838
|
+
return i = R(this, t, [s]), Object.defineProperty(i, zr, { writable: !0, value: void 0 }), Object.defineProperty(i, ha, { writable: !0, value: void 0 }), Object.defineProperty(i, tr, { writable: !0, value: void 0 }), Object.defineProperty(i, Yr, { writable: !0, value: void 0 }), Object.defineProperty(i, Se, { writable: !0, value: { height: Hh, width: Bh } }), Object.defineProperty(i, st, { writable: !0, value: { brand: "#2160FD", background: "#141414", text: "#000000", videoBackground: "#191919", textOnBrand: "#EEEEEE" } }), Object.defineProperty(i, qt, { writable: !0, value: void 0 }), Object.defineProperty(i, fr, { writable: !0, value: {} }), Object.defineProperty(i, Oe, { writable: !0, value: void 0 }), Object.defineProperty(i, ss, { writable: !0, value: void 0 }), Object.defineProperty(i, os, { writable: !0, value: void 0 }), Object.defineProperty(i, Gt, { writable: !0, value: void 0 }), Object.defineProperty(i, us, { writable: !0, value: !1 }), i.cleanupEventListeners = function() {
|
|
5839
5839
|
l(i, ha)[ha].unsubscribe("stageStatus", i.handlePipMediaControls), l(i, Oe)[Oe].removeListener("videoUpdate", i.onSelfVideoUpdateListener), l(i, Oe)[Oe].removeListener("audioUpdate", i.onSelfAudioUpdateListener), l(i, Oe)[Oe].removeListener("roomLeft", function() {
|
|
5840
5840
|
return i.disable();
|
|
5841
5841
|
});
|
|
@@ -5922,7 +5922,7 @@ var Hh = 1080, Bh = 1920, LP = function(t, e, r, n, a, i) {
|
|
|
5922
5922
|
}, n.src = i;
|
|
5923
5923
|
});
|
|
5924
5924
|
} }, { key: "createVideoContainer", value: function() {
|
|
5925
|
-
l(this, tr)[tr] = document.createElement("div"), l(this, tr)[tr].style.width = "0.1px", l(this, tr)[tr].style.height = "0.1px", l(this, tr)[tr].style.overflow = "hidden", l(this, tr)[tr].style.position = "absolute", l(this, tr)[tr].style.bottom = "0", l(this, tr)[tr].style.right = "0", l(this, tr)[tr].style.opacity = "0", l(this, tr)[tr].appendChild(l(this,
|
|
5925
|
+
l(this, tr)[tr] = document.createElement("div"), l(this, tr)[tr].style.width = "0.1px", l(this, tr)[tr].style.height = "0.1px", l(this, tr)[tr].style.overflow = "hidden", l(this, tr)[tr].style.position = "absolute", l(this, tr)[tr].style.bottom = "0", l(this, tr)[tr].style.right = "0", l(this, tr)[tr].style.opacity = "0", l(this, tr)[tr].appendChild(l(this, Yr)[Yr]);
|
|
5926
5926
|
} }, { key: "setupEventListeners", value: function() {
|
|
5927
5927
|
var r = this;
|
|
5928
5928
|
l(this, ha)[ha].subscribe("stageStatus", this.handlePipMediaControls), l(this, Oe)[Oe].addListener("videoUpdate", this.onSelfVideoUpdateListener), l(this, Oe)[Oe].addListener("audioUpdate", this.onSelfAudioUpdateListener), l(this, Oe)[Oe].addListener("roomLeft", function() {
|
|
@@ -5930,7 +5930,7 @@ var Hh = 1080, Bh = 1920, LP = function(t, e, r, n, a, i) {
|
|
|
5930
5930
|
});
|
|
5931
5931
|
} }, { key: "createCanvas", value: function() {
|
|
5932
5932
|
var r = document.createElement("canvas");
|
|
5933
|
-
r.height = l(this, Se)[Se].height, r.width = l(this, Se)[Se].width, l(this,
|
|
5933
|
+
r.height = l(this, Se)[Se].height, r.width = l(this, Se)[Se].width, l(this, zr)[zr] = r;
|
|
5934
5934
|
} }, { key: "setupMediaSessionEvents", value: function() {
|
|
5935
5935
|
var r = this;
|
|
5936
5936
|
navigator.mediaSession === void 0 || navigator.mediaSession.setCameraActive === void 0 || (navigator.mediaSession.setActionHandler("hangup", function() {
|
|
@@ -5952,21 +5952,21 @@ var Hh = 1080, Bh = 1920, LP = function(t, e, r, n, a, i) {
|
|
|
5952
5952
|
}, { pinned: [], regular: [] });
|
|
5953
5953
|
return [].concat(Pe(n.pinned), Pe(n.regular));
|
|
5954
5954
|
} }, { key: "drawEmptyTile", value: function(r, n, a, i) {
|
|
5955
|
-
if (l(this,
|
|
5956
|
-
var s = l(this,
|
|
5955
|
+
if (l(this, zr)[zr] !== void 0) {
|
|
5956
|
+
var s = l(this, zr)[zr].getContext("2d"), u = l(this, zr)[zr].width, c = 0, d = 0, p = n - c * 2, v = a - c * 2, f = Math.floor(u / p), g = Math.floor(r / f), k = r % f, y = k * (p + c) + c, b = g * (v + c) + c, E = i != null ? i : {}, T = E.displayText, S = E.image;
|
|
5957
5957
|
s.fillStyle = T || S ? l(this, st)[st].videoBackground : l(this, st)[st].background, s.strokeStyle = l(this, st)[st].brand, s.beginPath(), s.moveTo(y + d, b), s.arcTo(y + p, b, y + p, b + d, d), s.arcTo(y + p, b + v, y + p - d, b + v, d), s.arcTo(y, b + v, y, b + v - d, d), s.arcTo(y, b, y + d, b, d), s.closePath(), s.fill(), s.stroke();
|
|
5958
5958
|
var D = p / 6, I = p / 2 + y, _ = v / 2 + b;
|
|
5959
5959
|
s.save(), (T || S) && (s.beginPath(), s.arc(I, _, D, 0, Math.PI * 2), s.fillStyle = l(this, st)[st].brand, s.fill(), S ? (s.clip(), s.drawImage(S, I - D, _ - D, D * 2, D * 2), s.restore()) : T && (s.fillStyle = l(this, st)[st].textOnBrand, s.font = "".concat(D / 2, "px sans-serif"), s.textAlign = "center", s.textBaseline = "middle", s.fillText(T, I, _)), this.drawIcons(i, y, b, Math.max(p, v)));
|
|
5960
5960
|
}
|
|
5961
5961
|
} }, { key: "drawIcons", value: function(r, n, a, i) {
|
|
5962
5962
|
var s = this, u = Math.min(Math.max(i * 0.15, 100), 200), c = u * 0.2, d = u * 0.2, p = n + c, v = a + c, f = function(k) {
|
|
5963
|
-
var y = l(s,
|
|
5963
|
+
var y = l(s, zr)[zr].getContext("2d");
|
|
5964
5964
|
y.save(), y.fillStyle = l(s, st)[st].background, y.beginPath(), y.moveTo(p + d, v), y.arcTo(p + u, v, p + u, v + d, d), y.arcTo(p + u, v + u, p + u - d, v + u, d), y.arcTo(p, v + u, p, v + u - d, d), y.arcTo(p, v, p + d, v, d), y.closePath(), y.fill(), typeof k == "string" ? (y.font = "".concat(u / 1.5, "px sans-serif"), y.fillStyle = l(s, st)[st].text, y.textAlign = "center", y.textBaseline = "top", y.fillText(k, u / 2 + p, v + c)) : y.drawImage(k, p + c, v + c, u - c * 2, u - c * 2), p += u + c, y.restore();
|
|
5965
5965
|
};
|
|
5966
5966
|
r.pinned && f(l(this, ss)[ss]), r.handRaised && f(l(this, os)[os]), r.reaction && f(r.reaction);
|
|
5967
5967
|
} }, { key: "drawTile", value: function(r, n, a) {
|
|
5968
|
-
if (l(this,
|
|
5969
|
-
for (var i = l(this,
|
|
5968
|
+
if (l(this, zr)[zr] !== void 0)
|
|
5969
|
+
for (var i = l(this, zr)[zr].getContext("2d"), s = this.getSources(), u = 0, c = 0; u < l(this, Se)[Se].height - 5; ) {
|
|
5970
5970
|
for (var d = 0; d < l(this, Se)[Se].width - 5 && c < a; ) {
|
|
5971
5971
|
var p;
|
|
5972
5972
|
if ((p = s[c]) !== null && p !== void 0 && p.enabled) {
|
|
@@ -6016,7 +6016,7 @@ var Hh = 1080, Bh = 1920, LP = function(t, e, r, n, a, i) {
|
|
|
6016
6016
|
document.body.removeChild(l(this, tr)[tr]);
|
|
6017
6017
|
} catch (r) {
|
|
6018
6018
|
}
|
|
6019
|
-
this.removeAllSources(), l(this,
|
|
6019
|
+
this.removeAllSources(), l(this, zr)[zr] = void 0, l(this, Yr)[Yr] = void 0, l(this, qt)[qt] = void 0;
|
|
6020
6020
|
}
|
|
6021
6021
|
/**
|
|
6022
6022
|
* Initialize PiP and prepare sources
|
|
@@ -6028,9 +6028,9 @@ var Hh = 1080, Bh = 1920, LP = function(t, e, r, n, a, i) {
|
|
|
6028
6028
|
if (!l(this, us)[us]) {
|
|
6029
6029
|
l(this, us)[us] = !0, this.createCanvas(), this.setupMediaSessionEvents();
|
|
6030
6030
|
var s = document.createElement("video");
|
|
6031
|
-
l(this, Se)[Se] = { height: a != null ? a : Hh, width: i != null ? i : Bh }, s.height = l(this, Se)[Se].height, s.width = l(this, Se)[Se].width, s.autoplay = !0, s.muted = !0, s.srcObject = l(this,
|
|
6031
|
+
l(this, Se)[Se] = { height: a != null ? a : Hh, width: i != null ? i : Bh }, s.height = l(this, Se)[Se].height, s.width = l(this, Se)[Se].width, s.autoplay = !0, s.muted = !0, s.srcObject = l(this, zr)[zr].captureStream(24), l(this, Yr)[Yr] = s, l(this, Yr)[Yr].onloadedmetadata = function() {
|
|
6032
6032
|
try {
|
|
6033
|
-
r.emit("pipStarted"), l(r,
|
|
6033
|
+
r.emit("pipStarted"), l(r, Yr)[Yr].onleavepictureinpicture = function() {
|
|
6034
6034
|
r.emit("pipEnded");
|
|
6035
6035
|
};
|
|
6036
6036
|
} catch (u) {
|
|
@@ -6137,11 +6137,11 @@ var Hh = 1080, Bh = 1920, LP = function(t, e, r, n, a, i) {
|
|
|
6137
6137
|
var r = this;
|
|
6138
6138
|
l(this, Gt)[Gt] = "activating", this.setupEventListeners(), this.updateMediaSession("CAMERA", l(this, Oe)[Oe].videoEnabled), this.updateMediaSession("MIC", l(this, Oe)[Oe].audioEnabled), document.body.appendChild(l(this, tr)[tr]), l(this, qt)[qt] = requestAnimationFrame(function() {
|
|
6139
6139
|
return r.animate();
|
|
6140
|
-
}), l(this,
|
|
6141
|
-
l(r,
|
|
6140
|
+
}), l(this, Yr)[Yr].onloadedmetadata = function() {
|
|
6141
|
+
l(r, Yr)[Yr].requestPictureInPicture().then(function() {
|
|
6142
6142
|
l(r, Gt)[Gt] = "active";
|
|
6143
6143
|
});
|
|
6144
|
-
}, l(this,
|
|
6144
|
+
}, l(this, Yr)[Yr].readyState === 4 && l(this, Yr)[Yr].requestPictureInPicture().then(function() {
|
|
6145
6145
|
l(r, Gt)[Gt] = "active";
|
|
6146
6146
|
});
|
|
6147
6147
|
} }], [{ key: "_init", value: function() {
|
|
@@ -13333,12 +13333,12 @@ var Zo = {}, za = {
|
|
|
13333
13333
|
for (var a = n > 1 ? void 0 : n ? jI(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
|
13334
13334
|
(s = t[i]) && (a = (n ? s(e, r, a) : s(a)) || a);
|
|
13335
13335
|
return n && a && UI(e, r, a), a;
|
|
13336
|
-
},
|
|
13336
|
+
}, Qr = /* @__PURE__ */ C("stageSocketHandler"), Qc = /* @__PURE__ */ C("roomSocketHandler"), oe = /* @__PURE__ */ C("self"), xo = /* @__PURE__ */ C("participants"), yt = /* @__PURE__ */ C("stageRequests"), Ge = /* @__PURE__ */ C("context"), eu = /* @__PURE__ */ C("roomNodeClient"), cs = /* @__PURE__ */ C("setStatus"), Di = /* @__PURE__ */ function(o) {
|
|
13337
13337
|
function t(e, r, n, a, i) {
|
|
13338
13338
|
var s;
|
|
13339
13339
|
w(this, t);
|
|
13340
13340
|
var u = e.getValue("logger");
|
|
13341
|
-
return s = R(this, t, [u]), Object.defineProperty(s, cs, { value: HI }), Object.defineProperty(s, eu, { get: FI, set: void 0 }), Object.defineProperty(s,
|
|
13341
|
+
return s = R(this, t, [u]), Object.defineProperty(s, cs, { value: HI }), Object.defineProperty(s, eu, { get: FI, set: void 0 }), Object.defineProperty(s, Qr, { writable: !0, value: void 0 }), Object.defineProperty(s, Qc, { writable: !0, value: void 0 }), Object.defineProperty(s, oe, { writable: !0, value: void 0 }), Object.defineProperty(s, xo, { writable: !0, value: void 0 }), Object.defineProperty(s, yt, { writable: !0, value: void 0 }), Object.defineProperty(s, Ge, { writable: !0, value: void 0 }), l(s, Ge)[Ge] = e, l(s, Qr)[Qr] = a, l(s, Qc)[Qc] = i, l(s, oe)[oe] = r, l(s, xo)[xo] = n, l(s, yt)[yt] = [], s.setupEvents(), s;
|
|
13342
13342
|
}
|
|
13343
13343
|
return A(t, o), P(t, [{ key: "telemetry", get: (
|
|
13344
13344
|
/**
|
|
@@ -13407,7 +13407,7 @@ var Zo = {}, za = {
|
|
|
13407
13407
|
};
|
|
13408
13408
|
l(this, oe)[oe].permissions.on("permissionsUpdate", function(s) {
|
|
13409
13409
|
var u = s.canAcceptProductionRequests;
|
|
13410
|
-
u !== void 0 && (l(r, oe)[oe].permissions.acceptStageRequests ? (a(), l(r,
|
|
13410
|
+
u !== void 0 && (l(r, oe)[oe].permissions.acceptStageRequests ? (a(), l(r, Qr)[Qr].getStageRequests()) : (i(), l(r, yt)[yt] = [], r.emit("stageAccessRequestUpdate", l(r, yt)[yt])));
|
|
13411
13411
|
}), l(this, oe)[oe].permissions.acceptStageRequests && a();
|
|
13412
13412
|
} }, { key: "getAccessRequests", value: function() {
|
|
13413
13413
|
if (!l(this, oe)[oe].permissions.stageEnabled)
|
|
@@ -13444,7 +13444,7 @@ var Zo = {}, za = {
|
|
|
13444
13444
|
}
|
|
13445
13445
|
return l(this, cs)[cs]("ACCEPTED_TO_JOIN_STAGE"), i.abrupt("return");
|
|
13446
13446
|
case 8:
|
|
13447
|
-
l(this,
|
|
13447
|
+
l(this, Qr)[Qr].requestAccess(), l(this, cs)[cs]("REQUESTED_TO_JOIN_STAGE");
|
|
13448
13448
|
case 10:
|
|
13449
13449
|
case "end":
|
|
13450
13450
|
return i.stop();
|
|
@@ -13467,7 +13467,7 @@ var Zo = {}, za = {
|
|
|
13467
13467
|
}
|
|
13468
13468
|
throw this.logger.error("Stage::stage_disabled"), new j("Stage is disabled", "2003");
|
|
13469
13469
|
case 3:
|
|
13470
|
-
l(this,
|
|
13470
|
+
l(this, Qr)[Qr].cancelRequestAccess(), l(this, cs)[cs]("OFF_STAGE");
|
|
13471
13471
|
case 5:
|
|
13472
13472
|
case "end":
|
|
13473
13473
|
return i.stop();
|
|
@@ -13485,7 +13485,7 @@ var Zo = {}, za = {
|
|
|
13485
13485
|
throw this.logger.error("Stage::stage_disabled"), new j("Stage is disabled", "2003");
|
|
13486
13486
|
if (!l(this, oe)[oe].permissions.acceptStageRequests)
|
|
13487
13487
|
throw this.logger.error("Stage::grant_access::permission_denied"), new j("You do not have permission to perform this action", "2001");
|
|
13488
|
-
return l(this,
|
|
13488
|
+
return l(this, Qr)[Qr].grantAccess(r);
|
|
13489
13489
|
} }, {
|
|
13490
13490
|
key: "denyAccess",
|
|
13491
13491
|
value: function(r) {
|
|
@@ -13495,7 +13495,7 @@ var Zo = {}, za = {
|
|
|
13495
13495
|
throw this.logger.error("Stage::stage_disabled"), new j("Stage is disabled", "2003");
|
|
13496
13496
|
if (!l(this, oe)[oe].permissions.acceptStageRequests)
|
|
13497
13497
|
throw this.logger.error("Stage::deny_access::permission_denied"), new j("You do not have permission to perform this action", "2001");
|
|
13498
|
-
return l(this,
|
|
13498
|
+
return l(this, Qr)[Qr].denyAccess(r);
|
|
13499
13499
|
}
|
|
13500
13500
|
/**
|
|
13501
13501
|
* Returns the peerId of the current user
|
|
@@ -13521,7 +13521,7 @@ var Zo = {}, za = {
|
|
|
13521
13521
|
}
|
|
13522
13522
|
throw new j("Unable to join stage you are currently ".concat(this.status), "2006");
|
|
13523
13523
|
case 5:
|
|
13524
|
-
return l(this, Ge)[Ge].setValue("stageStatus", "ON_STAGE", !1), s.next = 8, l(this,
|
|
13524
|
+
return l(this, Ge)[Ge].setValue("stageStatus", "ON_STAGE", !1), s.next = 8, l(this, Qr)[Qr].joinStage();
|
|
13525
13525
|
case 8:
|
|
13526
13526
|
if (a !== Lt.Livestream) {
|
|
13527
13527
|
s.next = 12;
|
|
@@ -13562,7 +13562,7 @@ var Zo = {}, za = {
|
|
|
13562
13562
|
}
|
|
13563
13563
|
throw new j("Unable to leave stage you are currently ".concat(this.status), "2006");
|
|
13564
13564
|
case 5:
|
|
13565
|
-
return l(this, oe)[oe].setIsPinned(!1), l(this, Ge)[Ge].setValue("stageStatus", "OFF_STAGE", !1), i.next = 9, l(this,
|
|
13565
|
+
return l(this, oe)[oe].setIsPinned(!1), l(this, Ge)[Ge].setValue("stageStatus", "OFF_STAGE", !1), i.next = 9, l(this, Qr)[Qr].leaveStage(l(this, oe)[oe].userId);
|
|
13566
13566
|
case 9:
|
|
13567
13567
|
return i.prev = 9, i.next = 12, l(this, Ge)[Ge].getValue("peerSessionStore").emitAsync(F.LEAVE_MEDIA_ROOM, "stageLeft");
|
|
13568
13568
|
case 12:
|
|
@@ -13612,7 +13612,7 @@ var Zo = {}, za = {
|
|
|
13612
13612
|
}
|
|
13613
13613
|
throw this.logger.error("Stage::kick::permission_denied"), new j("You do not have permissions for kick", "2001");
|
|
13614
13614
|
case 8:
|
|
13615
|
-
return s.abrupt("return", l(this,
|
|
13615
|
+
return s.abrupt("return", l(this, Qr)[Qr].kick(a));
|
|
13616
13616
|
case 9:
|
|
13617
13617
|
case "end":
|
|
13618
13618
|
return s.stop();
|
|
@@ -14221,9 +14221,9 @@ var XI = Object.defineProperty, ZI = Object.getOwnPropertyDescriptor, Ec = funct
|
|
|
14221
14221
|
for (var a = n > 1 ? void 0 : n ? ZI(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
|
14222
14222
|
(s = t[i]) && (a = (n ? s(e, r, a) : s(a)) || a);
|
|
14223
14223
|
return n && a && XI(e, r, a), a;
|
|
14224
|
-
}, kg = (
|
|
14224
|
+
}, kg = (qr = /* @__PURE__ */ C("pluginSocketHandler"), oi = /* @__PURE__ */ C("chatSocketHandler"), et = /* @__PURE__ */ C("context"), /* @__PURE__ */ function() {
|
|
14225
14225
|
function o(t, e, r, n) {
|
|
14226
|
-
w(this, o), this.plugins = void 0, Object.defineProperty(this,
|
|
14226
|
+
w(this, o), this.plugins = void 0, Object.defineProperty(this, qr, { writable: !0, value: void 0 }), Object.defineProperty(this, oi, { writable: !0, value: void 0 }), Object.defineProperty(this, et, { writable: !0, value: void 0 }), l(this, qr)[qr] = e, l(this, oi)[oi] = r, l(this, et)[et] = t, this.plugins = n, this.setupEvents();
|
|
14227
14227
|
}
|
|
14228
14228
|
return P(o, [{
|
|
14229
14229
|
key: "telemetry",
|
|
@@ -14249,7 +14249,7 @@ var XI = Object.defineProperty, ZI = Object.getOwnPropertyDescriptor, Ec = funct
|
|
|
14249
14249
|
for (; ; )
|
|
14250
14250
|
switch (c.prev = c.next) {
|
|
14251
14251
|
case 0:
|
|
14252
|
-
return c.next = 2, l(this,
|
|
14252
|
+
return c.next = 2, l(this, qr)[qr].getActivePlugins();
|
|
14253
14253
|
case 2:
|
|
14254
14254
|
return i = c.sent, s = i.plugins, (n = this.plugins.active) === null || n === void 0 || n.toArray().forEach(function(d) {
|
|
14255
14255
|
a.disablePlugin({ id: d.id });
|
|
@@ -14346,7 +14346,7 @@ var XI = Object.defineProperty, ZI = Object.getOwnPropertyDescriptor, Ec = funct
|
|
|
14346
14346
|
return a.stop();
|
|
14347
14347
|
}
|
|
14348
14348
|
}, r);
|
|
14349
|
-
}))), l(this,
|
|
14349
|
+
}))), l(this, qr)[qr].on(se.addPlugin, /* @__PURE__ */ function() {
|
|
14350
14350
|
var r = m(/* @__PURE__ */ h().mark(function n(a) {
|
|
14351
14351
|
var i, s;
|
|
14352
14352
|
return h().wrap(function(c) {
|
|
@@ -14369,7 +14369,7 @@ var XI = Object.defineProperty, ZI = Object.getOwnPropertyDescriptor, Ec = funct
|
|
|
14369
14369
|
return function(n) {
|
|
14370
14370
|
return r.apply(this, arguments);
|
|
14371
14371
|
};
|
|
14372
|
-
}()), l(this,
|
|
14372
|
+
}()), l(this, qr)[qr].on(se.removePlugin, /* @__PURE__ */ function() {
|
|
14373
14373
|
var r = m(/* @__PURE__ */ h().mark(function n(a) {
|
|
14374
14374
|
var i, s;
|
|
14375
14375
|
return h().wrap(function(c) {
|
|
@@ -14393,7 +14393,7 @@ var XI = Object.defineProperty, ZI = Object.getOwnPropertyDescriptor, Ec = funct
|
|
|
14393
14393
|
return r.apply(this, arguments);
|
|
14394
14394
|
};
|
|
14395
14395
|
}()), [se.enablePluginForPeers, se.enablePluginForRoom].forEach(function(r) {
|
|
14396
|
-
l(e,
|
|
14396
|
+
l(e, qr)[qr].on(r, /* @__PURE__ */ function() {
|
|
14397
14397
|
var n = m(/* @__PURE__ */ h().mark(function a(i, s) {
|
|
14398
14398
|
return h().wrap(function(c) {
|
|
14399
14399
|
for (; ; )
|
|
@@ -14411,7 +14411,7 @@ var XI = Object.defineProperty, ZI = Object.getOwnPropertyDescriptor, Ec = funct
|
|
|
14411
14411
|
};
|
|
14412
14412
|
}());
|
|
14413
14413
|
}), [se.disablePluginForPeers, se.disablePluginForRoom].forEach(function(r) {
|
|
14414
|
-
l(e,
|
|
14414
|
+
l(e, qr)[qr].on(r, /* @__PURE__ */ function() {
|
|
14415
14415
|
var n = m(/* @__PURE__ */ h().mark(function a(i, s) {
|
|
14416
14416
|
return h().wrap(function(c) {
|
|
14417
14417
|
for (; ; )
|
|
@@ -14429,7 +14429,7 @@ var XI = Object.defineProperty, ZI = Object.getOwnPropertyDescriptor, Ec = funct
|
|
|
14429
14429
|
};
|
|
14430
14430
|
}());
|
|
14431
14431
|
}), [se.customPluginEventToPeers, se.customPluginEventToRoom].forEach(function(r) {
|
|
14432
|
-
l(e,
|
|
14432
|
+
l(e, qr)[qr].on(r, /* @__PURE__ */ function() {
|
|
14433
14433
|
var n = m(/* @__PURE__ */ h().mark(function a(i, s) {
|
|
14434
14434
|
return h().wrap(function(c) {
|
|
14435
14435
|
for (; ; )
|
|
@@ -14447,7 +14447,7 @@ var XI = Object.defineProperty, ZI = Object.getOwnPropertyDescriptor, Ec = funct
|
|
|
14447
14447
|
};
|
|
14448
14448
|
}());
|
|
14449
14449
|
}), [se.storeInsertKeys, se.storeGetKeys, se.storeDeleteKeys].forEach(function(r) {
|
|
14450
|
-
l(e,
|
|
14450
|
+
l(e, qr)[qr].on(r, /* @__PURE__ */ function() {
|
|
14451
14451
|
var n = m(/* @__PURE__ */ h().mark(function a(i, s) {
|
|
14452
14452
|
var u, c;
|
|
14453
14453
|
return h().wrap(function(p) {
|
|
@@ -14468,7 +14468,7 @@ var XI = Object.defineProperty, ZI = Object.getOwnPropertyDescriptor, Ec = funct
|
|
|
14468
14468
|
return n.apply(this, arguments);
|
|
14469
14469
|
};
|
|
14470
14470
|
}());
|
|
14471
|
-
}), l(this,
|
|
14471
|
+
}), l(this, qr)[qr].on(se.storeDelete, /* @__PURE__ */ function() {
|
|
14472
14472
|
var r = m(/* @__PURE__ */ h().mark(function n(a, i) {
|
|
14473
14473
|
return h().wrap(function(u) {
|
|
14474
14474
|
for (; ; )
|
|
@@ -14865,12 +14865,12 @@ var ga = /* @__PURE__ */ C("context"), sM = /* @__PURE__ */ function() {
|
|
|
14865
14865
|
for (var a = n > 1 ? void 0 : n ? cM(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
|
14866
14866
|
(s = t[i]) && (a = (n ? s(e, r, a) : s(a)) || a);
|
|
14867
14867
|
return n && a && lM(e, r, a), a;
|
|
14868
|
-
}, je = /* @__PURE__ */ C("mediaInterface"), me = /* @__PURE__ */ C("audioMediaHandler"), fe = /* @__PURE__ */ C("videoMediaHandler"), Wt = /* @__PURE__ */ C("audioOutputMediaHandler"),
|
|
14868
|
+
}, je = /* @__PURE__ */ C("mediaInterface"), me = /* @__PURE__ */ C("audioMediaHandler"), fe = /* @__PURE__ */ C("videoMediaHandler"), Wt = /* @__PURE__ */ C("audioOutputMediaHandler"), Xr = /* @__PURE__ */ C("screenShareMediaHandler"), nu = /* @__PURE__ */ C("autoSwitchDevice"), Ee = /* @__PURE__ */ C("context"), Nt = /* @__PURE__ */ function(o) {
|
|
14869
14869
|
function t(e, r) {
|
|
14870
14870
|
var n, a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : tc, i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !0;
|
|
14871
14871
|
w(this, t);
|
|
14872
14872
|
var s = e.getValue("logger");
|
|
14873
|
-
return n = R(this, t, [s]), Object.defineProperty(n, je, { writable: !0, value: void 0 }), Object.defineProperty(n, me, { writable: !0, value: void 0 }), Object.defineProperty(n, fe, { writable: !0, value: void 0 }), Object.defineProperty(n, Wt, { writable: !0, value: void 0 }), Object.defineProperty(n,
|
|
14873
|
+
return n = R(this, t, [s]), Object.defineProperty(n, je, { writable: !0, value: void 0 }), Object.defineProperty(n, me, { writable: !0, value: void 0 }), Object.defineProperty(n, fe, { writable: !0, value: void 0 }), Object.defineProperty(n, Wt, { writable: !0, value: void 0 }), Object.defineProperty(n, Xr, { writable: !0, value: void 0 }), Object.defineProperty(n, nu, { writable: !0, value: void 0 }), Object.defineProperty(n, Ee, { writable: !0, value: void 0 }), n.audioUpdateInProgress = void 0, n.videoUpdateInProgress = void 0, l(n, Ee)[Ee] = e, n.audioUpdateInProgress = !1, n.videoUpdateInProgress = !1, l(n, je)[je] = new Tg(e, r), l(n, me)[me] = new DM(e, l(n, je)[je], void 0, a), l(n, fe)[fe] = new FM(e, l(n, je)[je], void 0, a), l(n, Xr)[Xr] = new VM(l(n, Ee)[Ee], l(n, je)[je]), l(n, Wt)[Wt] = new $M(e, l(n, je)[je]), l(n, nu)[nu] = i, l(n, me)[me].on("trackMuted", n.onAudioTrackMuted.bind(n)), l(n, me)[me].on("trackChanged", n.onAudioTrackChanged.bind(n)), l(n, fe)[fe].on("trackChanged", n.onVideoTrackChanged.bind(n)), l(n, fe)[fe].on("trackEnded", n.onVideoTrackEnded.bind(n)), l(n, Xr)[Xr].on("trackEnded", n.onScreenShareEnded.bind(n)), n.onVisibilityChange = n.onVisibilityChange.bind(n), document.addEventListener("visibilitychange", n.onVisibilityChange), n;
|
|
14874
14874
|
}
|
|
14875
14875
|
return A(t, o), P(t, [{ key: "telemetry", get: (
|
|
14876
14876
|
/**
|
|
@@ -15255,16 +15255,16 @@ var ga = /* @__PURE__ */ C("context"), sM = /* @__PURE__ */ function() {
|
|
|
15255
15255
|
}, { key: "onScreenShareEnded", value: function() {
|
|
15256
15256
|
this.emit("SCREENSHARE_ENDED");
|
|
15257
15257
|
} }, { key: "screenShareTracks", get: function() {
|
|
15258
|
-
return { audio: l(this,
|
|
15258
|
+
return { audio: l(this, Xr)[Xr].audioMediaTrack, video: l(this, Xr)[Xr].videoMediaTrack };
|
|
15259
15259
|
} }, { key: "screenShareEnabled", get: function() {
|
|
15260
|
-
return l(this,
|
|
15260
|
+
return l(this, Xr)[Xr].trackEnabled;
|
|
15261
15261
|
} }, { key: "enableScreenShare", value: function() {
|
|
15262
15262
|
var e = m(/* @__PURE__ */ h().mark(function n() {
|
|
15263
15263
|
return h().wrap(function(i) {
|
|
15264
15264
|
for (; ; )
|
|
15265
15265
|
switch (i.prev = i.next) {
|
|
15266
15266
|
case 0:
|
|
15267
|
-
return i.next = 2, l(this,
|
|
15267
|
+
return i.next = 2, l(this, Xr)[Xr].enableScreenShare();
|
|
15268
15268
|
case 2:
|
|
15269
15269
|
case "end":
|
|
15270
15270
|
return i.stop();
|
|
@@ -15281,7 +15281,7 @@ var ga = /* @__PURE__ */ C("context"), sM = /* @__PURE__ */ function() {
|
|
|
15281
15281
|
for (; ; )
|
|
15282
15282
|
switch (i.prev = i.next) {
|
|
15283
15283
|
case 0:
|
|
15284
|
-
l(this,
|
|
15284
|
+
l(this, Xr)[Xr].disableScreenShare();
|
|
15285
15285
|
case 1:
|
|
15286
15286
|
case "end":
|
|
15287
15287
|
return i.stop();
|
|
@@ -15298,7 +15298,7 @@ var ga = /* @__PURE__ */ C("context"), sM = /* @__PURE__ */ function() {
|
|
|
15298
15298
|
for (; ; )
|
|
15299
15299
|
switch (s.prev = s.next) {
|
|
15300
15300
|
case 0:
|
|
15301
|
-
return s.next = 2, l(this,
|
|
15301
|
+
return s.next = 2, l(this, Xr)[Xr].updateConstraints(a);
|
|
15302
15302
|
case 2:
|
|
15303
15303
|
case "end":
|
|
15304
15304
|
return s.stop();
|
|
@@ -15332,7 +15332,7 @@ var ga = /* @__PURE__ */ C("context"), sM = /* @__PURE__ */ function() {
|
|
|
15332
15332
|
} }, { key: "setVideoMiddlewareGlobalConfig", value: function(r) {
|
|
15333
15333
|
return l(this, fe)[fe].setVideoMiddlewareGlobalConfig(r);
|
|
15334
15334
|
} }, { key: "destruct", value: function() {
|
|
15335
|
-
l(this, me)[me].disableTrack(), l(this, fe)[fe].disableTrack(), l(this, fe)[fe].terminateMiddlewareWebWorker(), l(this,
|
|
15335
|
+
l(this, me)[me].disableTrack(), l(this, fe)[fe].disableTrack(), l(this, fe)[fe].terminateMiddlewareWebWorker(), l(this, Xr)[Xr].disableScreenShare(), l(this, je)[je].destruct();
|
|
15336
15336
|
} }, {
|
|
15337
15337
|
key: "onDeviceChange",
|
|
15338
15338
|
value: function() {
|
|
@@ -15846,10 +15846,10 @@ var ya = /* @__PURE__ */ C("mediaConstraints"), kt = /* @__PURE__ */ C("context"
|
|
|
15846
15846
|
for (var a = n > 1 ? void 0 : n ? TM(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
|
15847
15847
|
(s = t[i]) && (a = (n ? s(e, r, a) : s(a)) || a);
|
|
15848
15848
|
return n && a && bM(e, r, a), a;
|
|
15849
|
-
}, an = (ci = /* @__PURE__ */ C("deviceChangeAbortController"),
|
|
15849
|
+
}, an = (ci = /* @__PURE__ */ C("deviceChangeAbortController"), Gr = /* @__PURE__ */ C("constraintsBuilder"), Ae = /* @__PURE__ */ C("context"), /* @__PURE__ */ function(o) {
|
|
15850
15850
|
function t(e, r) {
|
|
15851
15851
|
var n;
|
|
15852
|
-
return w(this, t), n = R(this, t), Object.defineProperty(n, ci, { writable: !0, value: void 0 }), Object.defineProperty(n,
|
|
15852
|
+
return w(this, t), n = R(this, t), Object.defineProperty(n, ci, { writable: !0, value: void 0 }), Object.defineProperty(n, Gr, { writable: !0, value: void 0 }), Object.defineProperty(n, Ae, { writable: !0, value: void 0 }), l(n, Ae)[Ae] = e, l(n, Gr)[Gr] = new yM(e, r), l(n, ci)[ci] = new AbortController(), n;
|
|
15853
15853
|
}
|
|
15854
15854
|
return A(t, o), P(t, [{
|
|
15855
15855
|
key: "telemetry",
|
|
@@ -15869,7 +15869,7 @@ var ya = /* @__PURE__ */ C("mediaConstraints"), kt = /* @__PURE__ */ C("context"
|
|
|
15869
15869
|
}, { key: "logger", get: function() {
|
|
15870
15870
|
return l(this, Ae)[Ae].getValue("logger");
|
|
15871
15871
|
} }, { key: "constraintsBuilder", get: function() {
|
|
15872
|
-
return l(this,
|
|
15872
|
+
return l(this, Gr)[Gr];
|
|
15873
15873
|
} }, { key: "destruct", value: function() {
|
|
15874
15874
|
var e = m(/* @__PURE__ */ h().mark(function n() {
|
|
15875
15875
|
var a;
|
|
@@ -15906,7 +15906,7 @@ var ya = /* @__PURE__ */ C("mediaConstraints"), kt = /* @__PURE__ */ C("context"
|
|
|
15906
15906
|
return $.deviceId === a;
|
|
15907
15907
|
})), a && p ? v = a : c && (s = c[0]) !== null && s !== void 0 && s.deviceId && (v = (f = c[0]) === null || f === void 0 ? void 0 : f.deviceId), g = !!(d != null && d.find(function($) {
|
|
15908
15908
|
return $.deviceId === i;
|
|
15909
|
-
})), i && g ? k = i : d && (u = d[0]) !== null && u !== void 0 && u.deviceId && (k = (y = d[0]) === null || y === void 0 ? void 0 : y.deviceId), b = { audio: l(this,
|
|
15909
|
+
})), i && g ? k = i : d && (u = d[0]) !== null && u !== void 0 && u.deviceId && (k = (y = d[0]) === null || y === void 0 ? void 0 : y.deviceId), b = { audio: l(this, Gr)[Gr].getAudioConstraints(v).audio, video: l(this, Gr)[Gr].getVideoConstraints(k).video }, this.logger.info("getUserMediaWithoutTimeout::requesting_user_media", { constraints: JSON.stringify(b) }), U.next = 15, navigator.mediaDevices.getUserMedia(b);
|
|
15910
15910
|
case 15:
|
|
15911
15911
|
if (E = U.sent, this.logger.info("getUserMediaWithoutTimeout::received_user_media", { constraints: JSON.stringify(b) }), T = E.getAudioTracks()[0], S = E.getVideoTracks()[0], this.permissions.audio = "ACCEPTED", this.permissions.video = "ACCEPTED", D = l(this, Ae)[Ae].getValue("flagsmith").hasFeature(ge.OBS_QUALITY), !(D && S.label.includes("OBS Virtual"))) {
|
|
15912
15912
|
U.next = 30;
|
|
@@ -15959,7 +15959,7 @@ var ya = /* @__PURE__ */ C("mediaConstraints"), kt = /* @__PURE__ */ C("context"
|
|
|
15959
15959
|
case 0:
|
|
15960
15960
|
return B.prev = 0, p = p.filter(function(x) {
|
|
15961
15961
|
return x.deviceId !== D;
|
|
15962
|
-
}), I = l(d,
|
|
15962
|
+
}), I = l(d, Gr)[Gr].getAudioConstraints(D), d.logger.info("getUserMediaWithoutTimeout::requesting_user_media", { constraints: JSON.stringify(I) }), B.next = 6, navigator.mediaDevices.getUserMedia(I);
|
|
15963
15963
|
case 6:
|
|
15964
15964
|
return _ = B.sent.getAudioTracks(), V = He(_, 1), U = V[0], d.logger.info("getUserMediaWithoutTimeout::received_user_media", { constraints: JSON.stringify(I) }), B.abrupt("return", U);
|
|
15965
15965
|
case 13:
|
|
@@ -15973,7 +15973,7 @@ var ya = /* @__PURE__ */ C("mediaConstraints"), kt = /* @__PURE__ */ C("context"
|
|
|
15973
15973
|
}
|
|
15974
15974
|
throw L;
|
|
15975
15975
|
case 21:
|
|
15976
|
-
return d.logger.info("getAudioTrack::gum_failed", { constraints: JSON.stringify(I), error: B.t0 }), Y = l(d,
|
|
15976
|
+
return d.logger.info("getAudioTrack::gum_failed", { constraints: JSON.stringify(I), error: B.t0 }), Y = l(d, Gr)[Gr].getAudioConstraints(H.deviceId), d.logger.info("getAudioTrack::retrying_gum_for_next_device", { constraints: JSON.stringify(Y) }), B.abrupt("return", k(H.deviceId));
|
|
15977
15977
|
case 25:
|
|
15978
15978
|
throw L;
|
|
15979
15979
|
case 26:
|
|
@@ -16055,7 +16055,7 @@ var ya = /* @__PURE__ */ C("mediaConstraints"), kt = /* @__PURE__ */ C("context"
|
|
|
16055
16055
|
}
|
|
16056
16056
|
throw Le;
|
|
16057
16057
|
case 23:
|
|
16058
|
-
return u.logger.info("getVideoTrack::gum_failed", { constraints: JSON.stringify(_), error: Be.t0 }), X = l(u,
|
|
16058
|
+
return u.logger.info("getVideoTrack::gum_failed", { constraints: JSON.stringify(_), error: Be.t0 }), X = l(u, Gr)[Gr].getVideoConstraints(Tr.deviceId), u.logger.info("getVideoTrack::retrying_gum_for_next_device", { constraints: JSON.stringify(X) }), Be.abrupt("return", y({ video: X.video }));
|
|
16059
16059
|
case 27:
|
|
16060
16060
|
throw Le;
|
|
16061
16061
|
case 28:
|
|
@@ -16067,7 +16067,7 @@ var ya = /* @__PURE__ */ C("mediaConstraints"), kt = /* @__PURE__ */ C("context"
|
|
|
16067
16067
|
return function(_) {
|
|
16068
16068
|
return D.apply(this, arguments);
|
|
16069
16069
|
};
|
|
16070
|
-
}(), S.prev = 24, b = l(this,
|
|
16070
|
+
}(), S.prev = 24, b = l(this, Gr)[Gr].getVideoConstraints(g), S.next = 28, y(b);
|
|
16071
16071
|
case 28:
|
|
16072
16072
|
return E = S.sent, this.permissions.video !== "ACCEPTED" && (this.permissions.video = "ACCEPTED", l(this, Ae)[Ae].getValue("peerSessionStore").emit(F.MEDIA_PERMISSION_UPDATE, { message: this.permissions.video, kind: "video" })), S.abrupt("return", E);
|
|
16073
16073
|
case 33:
|
|
@@ -16122,7 +16122,7 @@ var ya = /* @__PURE__ */ C("mediaConstraints"), kt = /* @__PURE__ */ C("context"
|
|
|
16122
16122
|
return function(f) {
|
|
16123
16123
|
return p.apply(this, arguments);
|
|
16124
16124
|
};
|
|
16125
|
-
}(), d.prev = 1, s = l(this,
|
|
16125
|
+
}(), d.prev = 1, s = l(this, Gr)[Gr].getScreenShareConstraints(), d.next = 5, i(s);
|
|
16126
16126
|
case 5:
|
|
16127
16127
|
return u = d.sent, this.permissions.screenshare !== "ACCEPTED" && (this.permissions.screenshare = "ACCEPTED", l(this, Ae)[Ae].getValue("peerSessionStore").emit(F.MEDIA_PERMISSION_UPDATE, { message: this.permissions.screenshare, kind: "screenshare" })), d.abrupt("return", { audioTrack: u.getAudioTracks()[0], videoTrack: u.getVideoTracks()[0] });
|
|
16128
16128
|
case 10:
|
|
@@ -19118,10 +19118,10 @@ var b_ = Object.defineProperty, T_ = Object.getOwnPropertyDescriptor, no = funct
|
|
|
19118
19118
|
for (var a = n > 1 ? void 0 : n ? T_(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
|
19119
19119
|
(s = t[i]) && (a = (n ? s(e, r, a) : s(a)) || a);
|
|
19120
19120
|
return n && a && b_(e, r, a), a;
|
|
19121
|
-
}, Rg = (
|
|
19121
|
+
}, Rg = (Wr = /* @__PURE__ */ C("currentView"), rt = /* @__PURE__ */ C("consumersSyncing"), vi = /* @__PURE__ */ C("resyncRequired"), /* @__PURE__ */ function() {
|
|
19122
19122
|
function o(t, e, r) {
|
|
19123
19123
|
var n = this;
|
|
19124
|
-
w(this, o), this.participants = void 0, this.self = void 0, this.selectedPeers = Cg, this.maxSpatialLayerUpdates = /* @__PURE__ */ new Map(), this.consumerPeerMap = void 0, this.events = void 0, this.roomSocketHandler = void 0, this.context = void 0, this.videoPeerConsumerMap = /* @__PURE__ */ new Map(), Object.defineProperty(this,
|
|
19124
|
+
w(this, o), this.participants = void 0, this.self = void 0, this.selectedPeers = Cg, this.maxSpatialLayerUpdates = /* @__PURE__ */ new Map(), this.consumerPeerMap = void 0, this.events = void 0, this.roomSocketHandler = void 0, this.context = void 0, this.videoPeerConsumerMap = /* @__PURE__ */ new Map(), Object.defineProperty(this, Wr, { writable: !0, value: { mode: "ACTIVE_GRID", page: 0 } }), Object.defineProperty(this, rt, { writable: !0, value: !1 }), Object.defineProperty(this, vi, { writable: !0, value: !1 }), this.updateConsumerSpatialLayers = jp(function() {
|
|
19125
19125
|
var a = {}, i = new Map(n.maxSpatialLayerUpdates);
|
|
19126
19126
|
n.maxSpatialLayerUpdates.clear(), Array.from(i.entries()).forEach(function(s) {
|
|
19127
19127
|
var u = He(s, 2), c = u[0], d = u[1];
|
|
@@ -19360,8 +19360,8 @@ var b_ = Object.defineProperty, T_ = Object.getOwnPropertyDescriptor, no = funct
|
|
|
19360
19360
|
* */
|
|
19361
19361
|
}, { key: "updateMediaSubscribedMaps", value: function(e, r) {
|
|
19362
19362
|
var n = r != null ? r : {}, a = n.page;
|
|
19363
|
-
e && l(this,
|
|
19364
|
-
var i = l(this,
|
|
19363
|
+
e && l(this, Wr)[Wr].mode !== e && (l(this, Wr)[Wr].mode = e), a && l(this, Wr)[Wr].page !== a && (l(this, Wr)[Wr].page = a);
|
|
19364
|
+
var i = l(this, Wr)[Wr], s = i.mode, u = i.page;
|
|
19365
19365
|
switch (s) {
|
|
19366
19366
|
case "PAGINATED": {
|
|
19367
19367
|
if (!u)
|
|
@@ -19389,7 +19389,7 @@ var b_ = Object.defineProperty, T_ = Object.getOwnPropertyDescriptor, no = funct
|
|
|
19389
19389
|
for (; ; )
|
|
19390
19390
|
switch (v.prev = v.next) {
|
|
19391
19391
|
case 0:
|
|
19392
|
-
c = n.source, d = ((a = l(this,
|
|
19392
|
+
c = n.source, d = ((a = l(this, Wr)[Wr]) === null || a === void 0 ? void 0 : a.mode) === "PAGINATED" && !l(this, rt)[rt] ? 200 : 0, this.logger.info("scheduleSyncConsumers():: Source: ".concat(c, ", ViewMode: ").concat((i = l(this, Wr)[Wr]) === null || i === void 0 ? void 0 : i.mode, ", ConsumersSyncing: ").concat(l(this, rt)[rt], ", Delay: ").concat(d, ", Page: ").concat((s = l(this, Wr)[Wr]) === null || s === void 0 ? void 0 : s.page)), setTimeout(function() {
|
|
19393
19393
|
return u.syncConsumers();
|
|
19394
19394
|
}, d);
|
|
19395
19395
|
case 4:
|
|
@@ -19693,7 +19693,7 @@ var b_ = Object.defineProperty, T_ = Object.getOwnPropertyDescriptor, no = funct
|
|
|
19693
19693
|
for (; ; )
|
|
19694
19694
|
switch (d.prev = d.next) {
|
|
19695
19695
|
case 0:
|
|
19696
|
-
n = u.length > 0 && u[0] !== void 0 ? u[0] : { viewMode: "ACTIVE_GRID", page: 0, createAllConsumers: !1 }, a = n.viewMode, i = n.page, s = n.createAllConsumers, e.logger.info("UPDATE_ACTIVE event received - viewMode: ".concat(l(e,
|
|
19696
|
+
n = u.length > 0 && u[0] !== void 0 ? u[0] : { viewMode: "ACTIVE_GRID", page: 0, createAllConsumers: !1 }, a = n.viewMode, i = n.page, s = n.createAllConsumers, e.logger.info("UPDATE_ACTIVE event received - viewMode: ".concat(l(e, Wr)[Wr].mode, ", page: ").concat(i, ", CreateAllConsumers: ").concat(s)), s && (e.logger.info("UPDATE_ACTIVE viewMode: ".concat(a, ", Page: ").concat(i, ", Removing existing subscriptions.")), e.participants.videoSubscribed.clear(), e.participants.audioSubscribed.clear()), e.updateMediaSubscribedMaps(a, { page: i }), e.scheduleSyncConsumers({ source: "UPDATE_ACTIVE" });
|
|
19697
19697
|
case 5:
|
|
19698
19698
|
case "end":
|
|
19699
19699
|
return d.stop();
|
|
@@ -20344,13 +20344,10 @@ var ar = jn(Np().permissions), G = /* @__PURE__ */ C("permissions"), gs = /* @__
|
|
|
20344
20344
|
function P_() {
|
|
20345
20345
|
return l(this, Ms)[Ms].getValue("stageStatus");
|
|
20346
20346
|
}
|
|
20347
|
-
var
|
|
20348
|
-
function t() {
|
|
20349
|
-
var
|
|
20350
|
-
w(this, t);
|
|
20351
|
-
for (var r = arguments.length, n = new Array(r), a = 0; a < r; a++)
|
|
20352
|
-
n[a] = arguments[a];
|
|
20353
|
-
return e = R(this, t, [].concat(n)), e.localMediaHandler = void 0, Object.defineProperty(e, Xr, { writable: !0, value: void 0 }), e;
|
|
20347
|
+
var jr = /* @__PURE__ */ C("context"), Ag = /* @__PURE__ */ function(o) {
|
|
20348
|
+
function t(e, r) {
|
|
20349
|
+
var n;
|
|
20350
|
+
return w(this, t), n = R(this, t, [r]), n.localMediaHandler = void 0, Object.defineProperty(n, jr, { writable: !0, value: void 0 }), l(n, jr)[jr] = e, n;
|
|
20354
20351
|
}
|
|
20355
20352
|
return A(t, o), P(t, [{
|
|
20356
20353
|
key: "updatePermission",
|
|
@@ -20364,7 +20361,7 @@ var Xr = /* @__PURE__ */ C("context"), Ag = /* @__PURE__ */ function(o) {
|
|
|
20364
20361
|
if (u = function(b, E) {
|
|
20365
20362
|
a.mediaPermissions[b] = E;
|
|
20366
20363
|
var T = { message: a.mediaPermissions[b], kind: b };
|
|
20367
|
-
E === "DENIED" ? l(a,
|
|
20364
|
+
E === "DENIED" ? l(a, jr)[jr].getValue("peerSessionStore").emit(F.MEDIA_PERMISSION_ERROR, T) : l(a, jr)[jr].getValue("peerSessionStore").emit(F.MEDIA_PERMISSION_UPDATE, T);
|
|
20368
20365
|
}, br.getName() !== "firefox") {
|
|
20369
20366
|
k.next = 3;
|
|
20370
20367
|
break;
|
|
@@ -20415,11 +20412,11 @@ var Xr = /* @__PURE__ */ C("context"), Ag = /* @__PURE__ */ function(o) {
|
|
|
20415
20412
|
i = a.message, s = a.kind, f.t0 = s, f.next = f.t0 === "audio" ? 4 : f.t0 === "video" ? 7 : f.t0 === "screenshare" ? 9 : 11;
|
|
20416
20413
|
break;
|
|
20417
20414
|
case 4:
|
|
20418
|
-
return (u = l(this,
|
|
20415
|
+
return (u = l(this, jr)[jr]) === null || u === void 0 || u.getValue("callstats").mediaPermission("AUDIO", i), (c = l(this, jr)[jr]) === null || c === void 0 || c.getValue("callstats").mediaPermission("SPEAKER", i), f.abrupt("break", 11);
|
|
20419
20416
|
case 7:
|
|
20420
|
-
return (d = l(this,
|
|
20417
|
+
return (d = l(this, jr)[jr]) === null || d === void 0 || d.getValue("callstats").mediaPermission("VIDEO", i), f.abrupt("break", 11);
|
|
20421
20418
|
case 9:
|
|
20422
|
-
return (p = l(this,
|
|
20419
|
+
return (p = l(this, jr)[jr]) === null || p === void 0 || p.getValue("callstats").mediaPermission("SCREENSHARE", i), f.abrupt("break", 11);
|
|
20423
20420
|
case 11:
|
|
20424
20421
|
case "end":
|
|
20425
20422
|
return f.stop();
|
|
@@ -20432,7 +20429,7 @@ var Xr = /* @__PURE__ */ C("context"), Ag = /* @__PURE__ */ function(o) {
|
|
|
20432
20429
|
return r;
|
|
20433
20430
|
}() }, { key: "peerId", get: function() {
|
|
20434
20431
|
var r;
|
|
20435
|
-
return (r = l(this,
|
|
20432
|
+
return (r = l(this, jr)[jr]) === null || r === void 0 ? void 0 : r.getValue("peerId");
|
|
20436
20433
|
} }, { key: "init", value: function() {
|
|
20437
20434
|
var e = m(/* @__PURE__ */ h().mark(function n() {
|
|
20438
20435
|
var a = this, i, s, u, c, d, p, v, f, g, k, y, b, E, T, S = arguments;
|
|
@@ -20440,7 +20437,7 @@ var Xr = /* @__PURE__ */ C("context"), Ag = /* @__PURE__ */ function(o) {
|
|
|
20440
20437
|
for (; ; )
|
|
20441
20438
|
switch (I.prev = I.next) {
|
|
20442
20439
|
case 0:
|
|
20443
|
-
if (i = S.length > 0 && S[0] !== void 0 ? S[0] : {}, s = S.length > 1 && S[1] !== void 0 ? S[1] : !1, u = S.length > 2 && S[2] !== void 0 ? S[2] : null, br.init(), u && (l(this,
|
|
20440
|
+
if (i = S.length > 0 && S[0] !== void 0 ? S[0] : {}, s = S.length > 1 && S[1] !== void 0 ? S[1] : !1, u = S.length > 2 && S[2] !== void 0 ? S[2] : null, br.init(), u && (l(this, jr)[jr] = u), !this.localMediaHandler) {
|
|
20444
20441
|
I.next = 7;
|
|
20445
20442
|
break;
|
|
20446
20443
|
}
|
|
@@ -20537,7 +20534,7 @@ var Xr = /* @__PURE__ */ C("context"), Ag = /* @__PURE__ */ function(o) {
|
|
|
20537
20534
|
}() }, {
|
|
20538
20535
|
key: "context",
|
|
20539
20536
|
set: function(r) {
|
|
20540
|
-
l(this,
|
|
20537
|
+
l(this, jr)[jr] = r, this.localMediaHandler.context = r;
|
|
20541
20538
|
}
|
|
20542
20539
|
/**
|
|
20543
20540
|
* Returns the `audioTrack`.
|
|
@@ -20992,7 +20989,7 @@ var Xr = /* @__PURE__ */ C("context"), Ag = /* @__PURE__ */ function(o) {
|
|
|
20992
20989
|
var s, u;
|
|
20993
20990
|
w(this, t);
|
|
20994
20991
|
var c = e.getValue("logger");
|
|
20995
|
-
return u = R(this, t, [c]), Object.defineProperty(u, vo, { value: M_ }), Object.defineProperty(u, Ie, { get: I_, set: void 0 }), Object.defineProperty(u, mi, { get: A_, set: void 0 }), Object.defineProperty(u, Ve, { get: R_, set: void 0 }), Object.defineProperty(u, Ot, { get: C_, set: void 0 }), u.name = void 0, u.picture = void 0, u.customParticipantId = void 0, u.waitlistStatus = void 0, Object.defineProperty(u, fi, { writable: !0, value: void 0 }), Object.defineProperty(u, ur, { writable: !0, value: void 0 }), Object.defineProperty(u, gi, { writable: !0, value: void 0 }), u.role = void 0, u.userId = void 0, u.organizationId = void 0, u.supportsRemoteControl = !1, u.device = void 0, Object.defineProperty(u, Ne, { writable: !0, value: void 0 }), u.hidden = !1, u.presetName = void 0, u.roomState = "init", Object.defineProperty(u, Si, { writable: !0, value: /* @__PURE__ */ new Set() }), Object.defineProperty(u, Ei, { writable: !0, value: /* @__PURE__ */ new Set() }), l(u, Ne)[Ne] = e, u.userId = r.id, u.name = r.name, u.picture = r.picture, u.customParticipantId = (s = r.customParticipantId) !== null && s !== void 0 ? s : r.clientSpecificId, u.waitlistStatus = "none", l(u, ur)[ur] = n, l(u, fi)[fi] = a, u.hidden = !1, l(u, gi)[gi] = !1, u.organizationId = r.organizationId, u.supportsRemoteControl = br.isElectron(), u.device = br.getDeviceInfo(), u.presetName = i, a.viewType !== Lt.Chat && u.updatePermission(), u.updateVideo = u.updateVideo.bind(u), l(u, vo)[vo](), u;
|
|
20992
|
+
return u = R(this, t, [e, c]), Object.defineProperty(u, vo, { value: M_ }), Object.defineProperty(u, Ie, { get: I_, set: void 0 }), Object.defineProperty(u, mi, { get: A_, set: void 0 }), Object.defineProperty(u, Ve, { get: R_, set: void 0 }), Object.defineProperty(u, Ot, { get: C_, set: void 0 }), u.name = void 0, u.picture = void 0, u.customParticipantId = void 0, u.waitlistStatus = void 0, Object.defineProperty(u, fi, { writable: !0, value: void 0 }), Object.defineProperty(u, ur, { writable: !0, value: void 0 }), Object.defineProperty(u, gi, { writable: !0, value: void 0 }), u.role = void 0, u.userId = void 0, u.organizationId = void 0, u.supportsRemoteControl = !1, u.device = void 0, Object.defineProperty(u, Ne, { writable: !0, value: void 0 }), u.hidden = !1, u.presetName = void 0, u.roomState = "init", Object.defineProperty(u, Si, { writable: !0, value: /* @__PURE__ */ new Set() }), Object.defineProperty(u, Ei, { writable: !0, value: /* @__PURE__ */ new Set() }), l(u, Ne)[Ne] = e, u.userId = r.id, u.name = r.name, u.picture = r.picture, u.customParticipantId = (s = r.customParticipantId) !== null && s !== void 0 ? s : r.clientSpecificId, u.waitlistStatus = "none", l(u, ur)[ur] = n, l(u, fi)[fi] = a, u.hidden = !1, l(u, gi)[gi] = !1, u.organizationId = r.organizationId, u.supportsRemoteControl = br.isElectron(), u.device = br.getDeviceInfo(), u.presetName = i, a.viewType !== Lt.Chat && u.updatePermission(), u.updateVideo = u.updateVideo.bind(u), l(u, vo)[vo](), u;
|
|
20996
20993
|
}
|
|
20997
20994
|
return A(t, o), P(t, [{ key: "telemetry", get: (
|
|
20998
20995
|
/**
|
|
@@ -22563,10 +22560,10 @@ var qe = /* @__PURE__ */ C("socket"), V_ = /* @__PURE__ */ function() {
|
|
|
22563
22560
|
for (; ; )
|
|
22564
22561
|
switch (c.prev = c.next) {
|
|
22565
22562
|
case 0:
|
|
22566
|
-
return this.pc.addTransceiver("video", { direction: "sendonly" }), c.next =
|
|
22567
|
-
case
|
|
22568
|
-
return i = c.sent, c.next =
|
|
22569
|
-
case
|
|
22563
|
+
return this.pc.addTransceiver("audio", { direction: "sendonly" }), this.pc.addTransceiver("video", { direction: "sendonly" }), c.next = 4, this.pc.createOffer();
|
|
22564
|
+
case 4:
|
|
22565
|
+
return i = c.sent, c.next = 7, this.pc.setLocalDescription(i);
|
|
22566
|
+
case 7:
|
|
22570
22567
|
return this.logger.info("connect offer: ".concat(JSON.stringify(i))), s = /* @__PURE__ */ function() {
|
|
22571
22568
|
var d = m(/* @__PURE__ */ h().mark(function p(v) {
|
|
22572
22569
|
return h().wrap(function(g) {
|
|
@@ -22584,7 +22581,7 @@ var qe = /* @__PURE__ */ C("socket"), V_ = /* @__PURE__ */ function() {
|
|
|
22584
22581
|
return d.apply(this, arguments);
|
|
22585
22582
|
};
|
|
22586
22583
|
}(), c.abrupt("return", { offerSdp: i, callback: s });
|
|
22587
|
-
case
|
|
22584
|
+
case 10:
|
|
22588
22585
|
case "end":
|
|
22589
22586
|
return c.stop();
|
|
22590
22587
|
}
|
|
@@ -23245,10 +23242,10 @@ function W_() {
|
|
|
23245
23242
|
this.logger.error("Consumer::destroyTrack()", N(N({}, l(this, Pt)[Pt]), {}, { error: o }));
|
|
23246
23243
|
}
|
|
23247
23244
|
}
|
|
23248
|
-
var ut = /* @__PURE__ */ C("handler"), ms = /* @__PURE__ */ C("stopTracks"), ys = /* @__PURE__ */ C("disableTrackOnPause"), wa = /* @__PURE__ */ C("zeroRtpOnPause"), Zr = /* @__PURE__ */ C("closed"), Ke = /* @__PURE__ */ C("track"), In = /* @__PURE__ */ C("paused"), ks = /* @__PURE__ */ C("maxSpatialLayer"), id = /* @__PURE__ */ C("context"),
|
|
23245
|
+
var ut = /* @__PURE__ */ C("handler"), ms = /* @__PURE__ */ C("stopTracks"), ys = /* @__PURE__ */ C("disableTrackOnPause"), wa = /* @__PURE__ */ C("zeroRtpOnPause"), Zr = /* @__PURE__ */ C("closed"), Ke = /* @__PURE__ */ C("track"), In = /* @__PURE__ */ C("paused"), ks = /* @__PURE__ */ C("maxSpatialLayer"), id = /* @__PURE__ */ C("context"), Fr = /* @__PURE__ */ C("metadata"), J_ = /* @__PURE__ */ function(o) {
|
|
23249
23246
|
function t(e, r) {
|
|
23250
23247
|
var n, a, i;
|
|
23251
|
-
return w(this, t), i = R(this, t, [e]), Object.defineProperty(i,
|
|
23248
|
+
return w(this, t), i = R(this, t, [e]), Object.defineProperty(i, Fr, { get: K_, set: void 0 }), i.id = void 0, i.localId = void 0, Object.defineProperty(i, ut, { writable: !0, value: void 0 }), i.kind = void 0, i.appData = void 0, i.rtpSender = void 0, Object.defineProperty(i, ms, { writable: !0, value: void 0 }), Object.defineProperty(i, ys, { writable: !0, value: void 0 }), Object.defineProperty(i, wa, { writable: !0, value: void 0 }), Object.defineProperty(i, Zr, { writable: !0, value: !1 }), Object.defineProperty(i, Ke, { writable: !0, value: void 0 }), Object.defineProperty(i, In, { writable: !0, value: void 0 }), Object.defineProperty(i, ks, { writable: !0, value: void 0 }), Object.defineProperty(i, id, { writable: !0, value: void 0 }), i.id = r.id, i.localId = r.localId, l(i, Ke)[Ke] = r.track, i.kind = (n = r.track) === null || n === void 0 ? void 0 : n.kind, l(i, In)[In] = r.disableTrackOnPause ? !((a = r.track) !== null && a !== void 0 && a.enabled) : !1, l(i, ks)[ks] = void 0, l(i, ms)[ms] = r.stopTracks, l(i, ys)[ys] = r.disableTrackOnPause, l(i, wa)[wa] = r.zeroRtpOnPause, i.appData = r.appData || {}, i._onTrackEnded = i._onTrackEnded.bind(i), l(i, ut)[ut] = r.handler, i.rtpSender = r.rtpSender, i._handleTrack(), l(i, id)[id] = e, i;
|
|
23252
23249
|
}
|
|
23253
23250
|
return A(t, o), P(t, [{
|
|
23254
23251
|
key: "closed",
|
|
@@ -23295,7 +23292,7 @@ var ut = /* @__PURE__ */ C("handler"), ms = /* @__PURE__ */ C("stopTracks"), ys
|
|
|
23295
23292
|
}
|
|
23296
23293
|
return v.abrupt("return");
|
|
23297
23294
|
case 2:
|
|
23298
|
-
if (this.logger.debug("Producer::close() ".concat(a ? "with reason ".concat(a) : ""), l(this,
|
|
23295
|
+
if (this.logger.debug("Producer::close() ".concat(a ? "with reason ".concat(a) : ""), l(this, Fr)[Fr]), l(this, Zr)[Zr] = !0, this._destroyTrack(), a !== ac) {
|
|
23299
23296
|
v.next = 8;
|
|
23300
23297
|
break;
|
|
23301
23298
|
}
|
|
@@ -23343,7 +23340,7 @@ var ut = /* @__PURE__ */ C("handler"), ms = /* @__PURE__ */ C("stopTracks"), ys
|
|
|
23343
23340
|
}() }, {
|
|
23344
23341
|
key: "pause",
|
|
23345
23342
|
value: function() {
|
|
23346
|
-
this.logger.debug("Producer::pause()", l(this,
|
|
23343
|
+
this.logger.debug("Producer::pause()", l(this, Fr)[Fr]), l(this, Zr)[Zr] && this.logger.error("Producer::pause() | Producer closed", l(this, Fr)[Fr]), l(this, In)[In] = !0, l(this, Ke)[Ke] && l(this, ys)[ys] && (l(this, Ke)[Ke].enabled = !1), l(this, wa)[wa] && l(this, ut)[ut].replaceTrack(this.localId, null), this.emit("pause");
|
|
23347
23344
|
}
|
|
23348
23345
|
/**
|
|
23349
23346
|
* Resumes sending media.
|
|
@@ -23351,8 +23348,8 @@ var ut = /* @__PURE__ */ C("handler"), ms = /* @__PURE__ */ C("stopTracks"), ys
|
|
|
23351
23348
|
}, {
|
|
23352
23349
|
key: "resume",
|
|
23353
23350
|
value: function() {
|
|
23354
|
-
if (this.logger.debug("Producer::resume()", l(this,
|
|
23355
|
-
this.logger.error("Producer::resume() | Producer closed", l(this,
|
|
23351
|
+
if (this.logger.debug("Producer::resume()", l(this, Fr)[Fr]), l(this, Zr)[Zr]) {
|
|
23352
|
+
this.logger.error("Producer::resume() | Producer closed", l(this, Fr)[Fr]);
|
|
23356
23353
|
return;
|
|
23357
23354
|
}
|
|
23358
23355
|
l(this, In)[In] = !1, l(this, Ke)[Ke] && l(this, ys)[ys] && (l(this, Ke)[Ke].enabled = !0), l(this, wa)[wa] && l(this, ut)[ut].replaceTrack(this.localId, l(this, Ke)[Ke]), this.emit("resume");
|
|
@@ -23367,7 +23364,7 @@ var ut = /* @__PURE__ */ C("handler"), ms = /* @__PURE__ */ C("stopTracks"), ys
|
|
|
23367
23364
|
for (; ; )
|
|
23368
23365
|
switch (u.prev = u.next) {
|
|
23369
23366
|
case 0:
|
|
23370
|
-
if (i = a.track, this.logger.debug("Producer::replaceTrack() trackId: ".concat(i == null ? void 0 : i.id), l(this,
|
|
23367
|
+
if (i = a.track, this.logger.debug("Producer::replaceTrack() trackId: ".concat(i == null ? void 0 : i.id), l(this, Fr)[Fr]), !l(this, Zr)[Zr]) {
|
|
23371
23368
|
u.next = 7;
|
|
23372
23369
|
break;
|
|
23373
23370
|
}
|
|
@@ -23375,7 +23372,7 @@ var ut = /* @__PURE__ */ C("handler"), ms = /* @__PURE__ */ C("stopTracks"), ys
|
|
|
23375
23372
|
try {
|
|
23376
23373
|
i.stop();
|
|
23377
23374
|
} catch (c) {
|
|
23378
|
-
this.logger.error("Producer::replaceTrack", N(N({}, l(this,
|
|
23375
|
+
this.logger.error("Producer::replaceTrack", N(N({}, l(this, Fr)[Fr]), {}, { error: c }));
|
|
23379
23376
|
}
|
|
23380
23377
|
throw new kn("closed");
|
|
23381
23378
|
case 7:
|
|
@@ -23389,7 +23386,7 @@ var ut = /* @__PURE__ */ C("handler"), ms = /* @__PURE__ */ C("stopTracks"), ys
|
|
|
23389
23386
|
u.next = 12;
|
|
23390
23387
|
break;
|
|
23391
23388
|
}
|
|
23392
|
-
return this.logger.debug("replaceTrack() | same track, ignored trackId: ".concat(i.id), l(this,
|
|
23389
|
+
return this.logger.debug("replaceTrack() | same track, ignored trackId: ".concat(i.id), l(this, Fr)[Fr]), u.abrupt("return");
|
|
23393
23390
|
case 12:
|
|
23394
23391
|
if (!(!l(this, wa)[wa] || !l(this, In)[In])) {
|
|
23395
23392
|
u.next = 15;
|
|
@@ -23475,7 +23472,7 @@ var ut = /* @__PURE__ */ C("handler"), ms = /* @__PURE__ */ C("stopTracks"), ys
|
|
|
23475
23472
|
}
|
|
23476
23473
|
return r;
|
|
23477
23474
|
}() }, { key: "_onTrackEnded", value: function() {
|
|
23478
|
-
this.logger.debug('Producer::track "ended" event trackId: '.concat(this.track.id), l(this,
|
|
23475
|
+
this.logger.debug('Producer::track "ended" event trackId: '.concat(this.track.id), l(this, Fr)[Fr]), this.safeEmit("trackended", this.track.id);
|
|
23479
23476
|
} }, { key: "_handleTrack", value: function() {
|
|
23480
23477
|
l(this, Ke)[Ke] && l(this, Ke)[Ke].addEventListener("ended", this._onTrackEnded);
|
|
23481
23478
|
} }, { key: "_destroyTrack", value: function() {
|
|
@@ -23484,7 +23481,7 @@ var ut = /* @__PURE__ */ C("handler"), ms = /* @__PURE__ */ C("stopTracks"), ys
|
|
|
23484
23481
|
l(this, Ke)[Ke].removeEventListener("ended", this._onTrackEnded), l(this, ms)[ms] && l(this, Ke)[Ke].stop();
|
|
23485
23482
|
} catch (n) {
|
|
23486
23483
|
var r;
|
|
23487
|
-
this.logger.error("Producer::_destroyTrack trackId: ".concat((r = this.track) === null || r === void 0 ? void 0 : r.id), N(N({}, l(this,
|
|
23484
|
+
this.logger.error("Producer::_destroyTrack trackId: ".concat((r = this.track) === null || r === void 0 ? void 0 : r.id), N(N({}, l(this, Fr)[Fr]), {}, { error: n }));
|
|
23488
23485
|
}
|
|
23489
23486
|
} }]);
|
|
23490
23487
|
}(Ac);
|
|
@@ -25486,10 +25483,10 @@ var _O = function() {
|
|
|
25486
25483
|
for (var a = n > 1 ? void 0 : n ? LO(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
|
25487
25484
|
(s = t[i]) && (a = (n ? s(e, r, a) : s(a)) || a);
|
|
25488
25485
|
return n && a && DO(e, r, a), a;
|
|
25489
|
-
}, Qt = ["video/VP9", "video/VP8"], _g = (Co = /* @__PURE__ */ C("roomUUID"), Ro = /* @__PURE__ */ C("peerDisplayName"), Xe = /* @__PURE__ */ C("socketClient"), W = /* @__PURE__ */ C("sfuHandler"), Ci = /* @__PURE__ */ C("rtpCapabilities"), lr = /* @__PURE__ */ C("events"), ua = /* @__PURE__ */ C("roomJoiningInProgress"), la = /* @__PURE__ */ C("onceJoined"), ra = /* @__PURE__ */ C("transportQueue"), fo = /* @__PURE__ */ C("rejoinRoomFn"),
|
|
25486
|
+
}, Qt = ["video/VP9", "video/VP8"], _g = (Co = /* @__PURE__ */ C("roomUUID"), Ro = /* @__PURE__ */ C("peerDisplayName"), Xe = /* @__PURE__ */ C("socketClient"), W = /* @__PURE__ */ C("sfuHandler"), Ci = /* @__PURE__ */ C("rtpCapabilities"), lr = /* @__PURE__ */ C("events"), ua = /* @__PURE__ */ C("roomJoiningInProgress"), la = /* @__PURE__ */ C("onceJoined"), ra = /* @__PURE__ */ C("transportQueue"), fo = /* @__PURE__ */ C("rejoinRoomFn"), Kr = /* @__PURE__ */ C("connectionPromise"), Dt = /* @__PURE__ */ C("screenshareConsumerProducer"), js = /* @__PURE__ */ C("location"), ta = /* @__PURE__ */ C("senderVideoCodecMap"), na = /* @__PURE__ */ C("receiverVideoCodecMap"), hr = /* @__PURE__ */ C("producerTypes"), Pr = /* @__PURE__ */ C("audioActivityReporter"), fn = /* @__PURE__ */ C("connectionHandler"), ml = /* @__PURE__ */ C("joinRoom"), Bl = /* @__PURE__ */ C("completeJoinRoom"), ql = /* @__PURE__ */ C("reportRoomJoinedAnalytics"), Ao = /* @__PURE__ */ C("initializeConnection"), Gl = /* @__PURE__ */ C("getLocation"), Wl = /* @__PURE__ */ C("getRtpCapabilities"), Jl = /* @__PURE__ */ C("sendJoinRoomMessage"), Kl = /* @__PURE__ */ C("setupInitialMediaProducers"), We = /* @__PURE__ */ C("getProducer"), aa = /* @__PURE__ */ C("setProducer"), yl = /* @__PURE__ */ C("deleteProducer"), kl = /* @__PURE__ */ C("getMicProducerDefaults"), bl = /* @__PURE__ */ C("getWebcamProducerDefaults"), Uc = /* @__PURE__ */ function() {
|
|
25490
25487
|
function o(t, e) {
|
|
25491
25488
|
var r, n, a = this;
|
|
25492
|
-
w(this, o), Object.defineProperty(this, bl, { value: zO }), Object.defineProperty(this, kl, { value: KO }), Object.defineProperty(this, yl, { value: JO }), Object.defineProperty(this, aa, { value: WO }), Object.defineProperty(this, We, { value: GO }), Object.defineProperty(this, Kl, { value: qO }), Object.defineProperty(this, Jl, { value: BO }), Object.defineProperty(this, Wl, { value: HO }), Object.defineProperty(this, Ao, { value: jO }), Object.defineProperty(this, ql, { value: UO }), Object.defineProperty(this, Bl, { value: VO }), Object.defineProperty(this, ml, { value: NO }), Object.defineProperty(this, fn, { get: $O, set: void 0 }), this.context = void 0, this.authToken = void 0, this.e2ee = void 0, Object.defineProperty(this, Co, { writable: !0, value: void 0 }), Object.defineProperty(this, Ro, { writable: !0, value: void 0 }), Object.defineProperty(this, Xe, { writable: !0, value: void 0 }), Object.defineProperty(this, W, { writable: !0, value: void 0 }), Object.defineProperty(this, Ci, { writable: !0, value: void 0 }), Object.defineProperty(this, lr, { writable: !0, value: void 0 }), Object.defineProperty(this, ua, { writable: !0, value: void 0 }), Object.defineProperty(this, la, { writable: !0, value: void 0 }), Object.defineProperty(this, ra, { writable: !0, value: void 0 }), Object.defineProperty(this, fo, { writable: !0, value: void 0 }), Object.defineProperty(this,
|
|
25489
|
+
w(this, o), Object.defineProperty(this, bl, { value: zO }), Object.defineProperty(this, kl, { value: KO }), Object.defineProperty(this, yl, { value: JO }), Object.defineProperty(this, aa, { value: WO }), Object.defineProperty(this, We, { value: GO }), Object.defineProperty(this, Kl, { value: qO }), Object.defineProperty(this, Jl, { value: BO }), Object.defineProperty(this, Wl, { value: HO }), Object.defineProperty(this, Ao, { value: jO }), Object.defineProperty(this, ql, { value: UO }), Object.defineProperty(this, Bl, { value: VO }), Object.defineProperty(this, ml, { value: NO }), Object.defineProperty(this, fn, { get: $O, set: void 0 }), this.context = void 0, this.authToken = void 0, this.e2ee = void 0, Object.defineProperty(this, Co, { writable: !0, value: void 0 }), Object.defineProperty(this, Ro, { writable: !0, value: void 0 }), Object.defineProperty(this, Xe, { writable: !0, value: void 0 }), Object.defineProperty(this, W, { writable: !0, value: void 0 }), Object.defineProperty(this, Ci, { writable: !0, value: void 0 }), Object.defineProperty(this, lr, { writable: !0, value: void 0 }), Object.defineProperty(this, ua, { writable: !0, value: void 0 }), Object.defineProperty(this, la, { writable: !0, value: void 0 }), Object.defineProperty(this, ra, { writable: !0, value: void 0 }), Object.defineProperty(this, fo, { writable: !0, value: void 0 }), Object.defineProperty(this, Kr, { writable: !0, value: null }), Object.defineProperty(this, Dt, { writable: !0, value: void 0 }), Object.defineProperty(this, js, { writable: !0, value: void 0 }), Object.defineProperty(this, ta, { writable: !0, value: void 0 }), Object.defineProperty(this, na, { writable: !0, value: void 0 }), Object.defineProperty(this, hr, { writable: !0, value: void 0 }), Object.defineProperty(this, Pr, { writable: !0, value: void 0 }), this.context = t;
|
|
25493
25490
|
var i = e.socket;
|
|
25494
25491
|
this.mediaJoined = !1, l(this, ta)[ta] = /* @__PURE__ */ new Map([["video/VP9", /* @__PURE__ */ new Set()], ["video/VP8", /* @__PURE__ */ new Set()]]), l(this, na)[na] = /* @__PURE__ */ new Map([["video/VP9", /* @__PURE__ */ new Set()], ["video/VP8", /* @__PURE__ */ new Set()]]), l(this, Xe)[Xe] = i, l(this, ua)[ua] = !1, l(this, W)[W] = new vO(t, i), l(this, lr)[lr] = l(this, W)[W].events, l(this, Dt)[Dt] = /* @__PURE__ */ new Set(), l(this, hr)[hr] = /* @__PURE__ */ new Map(), l(this, la)[la] = !1, l(this, ra)[ra] = new Bd(t.getValue("logger")), l(this, Pr)[Pr] = new Mc(this.context, l(this, W)[W].socketHandler.audioActivity.bind(l(this, W)[W].socketHandler)), this.e2ee = (r = (n = t.getValue("modules").e2ee) === null || n === void 0 ? void 0 : n.enabled) !== null && r !== void 0 ? r : !1, this.handleSocketEvents(), this.handleCallstatsEvents(), l(this, fo)[fo] = jp(/* @__PURE__ */ m(/* @__PURE__ */ h().mark(function s() {
|
|
25495
25492
|
var u, c;
|
|
@@ -25538,7 +25535,7 @@ var _O = function() {
|
|
|
25538
25535
|
}, set: function(e) {
|
|
25539
25536
|
l(this, fn)[fn].mediaJoined = e;
|
|
25540
25537
|
} }, { key: "reset", value: function() {
|
|
25541
|
-
l(this, W)[W].closeAllProducers(), l(this, W)[W].closeAllConsumers(), l(this, hr)[hr].clear(), l(this, Dt)[Dt].clear(), l(this,
|
|
25538
|
+
l(this, W)[W].closeAllProducers(), l(this, W)[W].closeAllConsumers(), l(this, hr)[hr].clear(), l(this, Dt)[Dt].clear(), l(this, Kr)[Kr] = null, l(this, ra)[ra].stop(), l(this, W)[W].stopAllTransports(), l(this, W)[W].reset(), l(this, ra)[ra] = new Bd();
|
|
25542
25539
|
} }, { key: "joinRoom", value: function() {
|
|
25543
25540
|
var t = m(/* @__PURE__ */ h().mark(function r(n, a) {
|
|
25544
25541
|
var i = this, s, u, c, d, p = arguments;
|
|
@@ -25576,13 +25573,13 @@ var _O = function() {
|
|
|
25576
25573
|
for (; ; )
|
|
25577
25574
|
switch (p.prev = p.next) {
|
|
25578
25575
|
case 0:
|
|
25579
|
-
if (s = c.length > 2 && c[2] !== void 0 ? c[2] : !1, u = c.length > 3 && c[3] !== void 0 ? c[3] : {}, !l(this,
|
|
25576
|
+
if (s = c.length > 2 && c[2] !== void 0 ? c[2] : !1, u = c.length > 3 && c[3] !== void 0 ? c[3] : {}, !l(this, Kr)[Kr]) {
|
|
25580
25577
|
p.next = 4;
|
|
25581
25578
|
break;
|
|
25582
25579
|
}
|
|
25583
|
-
return p.abrupt("return", l(this,
|
|
25580
|
+
return p.abrupt("return", l(this, Kr)[Kr]);
|
|
25584
25581
|
case 4:
|
|
25585
|
-
return l(this,
|
|
25582
|
+
return l(this, Kr)[Kr] = m(/* @__PURE__ */ h().mark(function v() {
|
|
25586
25583
|
return h().wrap(function(g) {
|
|
25587
25584
|
for (; ; )
|
|
25588
25585
|
switch (g.prev = g.next) {
|
|
@@ -25592,13 +25589,13 @@ var _O = function() {
|
|
|
25592
25589
|
g.next = 9;
|
|
25593
25590
|
break;
|
|
25594
25591
|
case 5:
|
|
25595
|
-
throw g.prev = 5, g.t0 = g.catch(0), l(i,
|
|
25592
|
+
throw g.prev = 5, g.t0 = g.catch(0), l(i, Kr)[Kr] = null, g.t0;
|
|
25596
25593
|
case 9:
|
|
25597
25594
|
case "end":
|
|
25598
25595
|
return g.stop();
|
|
25599
25596
|
}
|
|
25600
25597
|
}, v, null, [[0, 5]]);
|
|
25601
|
-
}))(), p.abrupt("return", l(this,
|
|
25598
|
+
}))(), p.abrupt("return", l(this, Kr)[Kr]);
|
|
25602
25599
|
case 6:
|
|
25603
25600
|
case "end":
|
|
25604
25601
|
return p.stop();
|
|
@@ -26489,11 +26486,11 @@ function up() {
|
|
|
26489
26486
|
for (; ; )
|
|
26490
26487
|
switch (s.prev = s.next) {
|
|
26491
26488
|
case 0:
|
|
26492
|
-
if (l(this, Ro)[Ro] = t, s.prev = 1, !l(this,
|
|
26489
|
+
if (l(this, Ro)[Ro] = t, s.prev = 1, !l(this, Kr)[Kr]) {
|
|
26493
26490
|
s.next = 7;
|
|
26494
26491
|
break;
|
|
26495
26492
|
}
|
|
26496
|
-
return s.next = 5, l(this,
|
|
26493
|
+
return s.next = 5, l(this, Kr)[Kr];
|
|
26497
26494
|
case 5:
|
|
26498
26495
|
s.next = 9;
|
|
26499
26496
|
break;
|
|
@@ -26506,7 +26503,7 @@ function up() {
|
|
|
26506
26503
|
case 16:
|
|
26507
26504
|
return s.prev = 16, s.t0 = s.catch(1), this.logger.error("Failed to complete room join", { error: s.t0 }), s.abrupt("return", { roomJoined: !1 });
|
|
26508
26505
|
case 20:
|
|
26509
|
-
return s.prev = 20, l(this,
|
|
26506
|
+
return s.prev = 20, l(this, Kr)[Kr] = null, s.finish(20);
|
|
26510
26507
|
case 23:
|
|
26511
26508
|
case "end":
|
|
26512
26509
|
return s.stop();
|
|
@@ -27330,9 +27327,9 @@ var tD = Object.defineProperty, nD = Object.getOwnPropertyDescriptor, aD = funct
|
|
|
27330
27327
|
for (var a = n > 1 ? void 0 : n ? nD(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
|
27331
27328
|
(s = t[i]) && (a = (n ? s(e, r, a) : s(a)) || a);
|
|
27332
27329
|
return n && a && tD(e, r, a), a;
|
|
27333
|
-
},
|
|
27330
|
+
}, Hr = /* @__PURE__ */ C("context"), $g = /* @__PURE__ */ function() {
|
|
27334
27331
|
function o(t, e) {
|
|
27335
|
-
w(this, o), this.socket = void 0, Object.defineProperty(this,
|
|
27332
|
+
w(this, o), this.socket = void 0, Object.defineProperty(this, Hr, { writable: !0, value: void 0 }), l(this, Hr)[Hr] = t, this.socket = e, this.handleSocketEvents(), l(this, Hr)[Hr].setValue("roomSocketHandler", this);
|
|
27336
27333
|
}
|
|
27337
27334
|
return P(o, [{
|
|
27338
27335
|
key: "telemetry",
|
|
@@ -27342,7 +27339,7 @@ var tD = Object.defineProperty, nD = Object.getOwnPropertyDescriptor, aD = funct
|
|
|
27342
27339
|
* Not for external use
|
|
27343
27340
|
*/
|
|
27344
27341
|
function() {
|
|
27345
|
-
return l(this,
|
|
27342
|
+
return l(this, Hr)[Hr].getValue("telemetry");
|
|
27346
27343
|
}
|
|
27347
27344
|
)
|
|
27348
27345
|
/**
|
|
@@ -27350,7 +27347,7 @@ var tD = Object.defineProperty, nD = Object.getOwnPropertyDescriptor, aD = funct
|
|
|
27350
27347
|
* Not for external use
|
|
27351
27348
|
*/
|
|
27352
27349
|
}, { key: "logger", get: function() {
|
|
27353
|
-
return l(this,
|
|
27350
|
+
return l(this, Hr)[Hr].getValue("logger");
|
|
27354
27351
|
} }, { key: "cleanup", value: function() {
|
|
27355
27352
|
try {
|
|
27356
27353
|
var e;
|
|
@@ -27367,9 +27364,9 @@ var tD = Object.defineProperty, nD = Object.getOwnPropertyDescriptor, aD = funct
|
|
|
27367
27364
|
case 0:
|
|
27368
27365
|
return this.socket.joinAttempted = !0, i = { capabilities: [], peer: { displayName: (a = n.name) !== null && a !== void 0 ? a : "Participant", customParticipantId: n.customParticipantId, peerId: n.id, userId: n.userId, displayPictureUrl: n.picture, waitlisted: !1 }, roomUuid: "" }, s = this.socket.sendMessagePromise(Q.joinRoom, gC.toBinary(i)), b.prev = 3, b.t0 = bo, b.next = 7, s;
|
|
27369
27366
|
case 7:
|
|
27370
|
-
return b.t1 = b.sent.payload, u = b.t0.fromBinary.call(b.t0, b.t1), c = u.peer, l(this,
|
|
27367
|
+
return b.t1 = b.sent.payload, u = b.t0.fromBinary.call(b.t0, b.t1), c = u.peer, l(this, Hr)[Hr].getValue("connectionHandler").socketJoined = !0, l(this, Hr)[Hr].getValue("peerSessionStore").emit(F.SOCKET_SERVICE_ROOM_JOINED, { peer: c }), d = this.getRoomState(), p = this.getRoomPeersNonPaginated(), b.next = 16, Promise.all([d, p]);
|
|
27371
27368
|
case 16:
|
|
27372
|
-
return v = b.sent, f = He(v, 2), g = f[0].room, k = f[1].peers, l(this,
|
|
27369
|
+
return v = b.sent, f = He(v, 2), g = f[0].room, k = f[1].peers, l(this, Hr)[Hr].getValue("peerSessionStore").emit(F.ROOM_STATE, g), l(this, Hr)[Hr].getValue("peerSessionStore").emit(F.SOCKET_PEERS, k), b.abrupt("return", { peer: c });
|
|
27373
27370
|
case 25:
|
|
27374
27371
|
throw b.prev = 25, b.t2 = b.catch(3), this.logger.error("RoomSocketHandler.joinRoom.failed", { error: b.t2 }), new j("Error: RoomSocketHandler.joinRoom failed.", "0002", this.logger, b.t2);
|
|
27375
27372
|
case 29:
|
|
@@ -27732,7 +27729,7 @@ var tD = Object.defineProperty, nD = Object.getOwnPropertyDescriptor, aD = funct
|
|
|
27732
27729
|
var n = r.payload;
|
|
27733
27730
|
try {
|
|
27734
27731
|
var a = Xo.fromBinary(n);
|
|
27735
|
-
l(e,
|
|
27732
|
+
l(e, Hr)[Hr].getValue("peerSessionStore").emit(F.ROOM_MESSAGE, { payload: JSON.parse(new TextDecoder().decode(a.payload)), type: a.type, timestamp: a.timestamp });
|
|
27736
27733
|
} catch (i) {
|
|
27737
27734
|
e.logger.error("failed to decode broadcast message:", i);
|
|
27738
27735
|
}
|
|
@@ -27740,7 +27737,7 @@ var tD = Object.defineProperty, nD = Object.getOwnPropertyDescriptor, aD = funct
|
|
|
27740
27737
|
var n = r.payload;
|
|
27741
27738
|
try {
|
|
27742
27739
|
var a = Xo.fromBinary(n);
|
|
27743
|
-
l(e,
|
|
27740
|
+
l(e, Hr)[Hr].getValue("peerSessionStore").emit(F.MESSAGE, { payload: JSON.parse(new TextDecoder().decode(a.payload)), type: a.type, timestamp: a.timestamp });
|
|
27744
27741
|
} catch (i) {
|
|
27745
27742
|
e.logger.error("failed to decode peer broadcast message:", i);
|
|
27746
27743
|
}
|
|
@@ -28412,12 +28409,12 @@ var yi = { debug: 0, info: 1, warn: 2, error: 3 }, Cs, Rs, bD = /* @__PURE__ */
|
|
|
28412
28409
|
Cs = /* @__PURE__ */ new WeakMap(), Rs = /* @__PURE__ */ new WeakMap();
|
|
28413
28410
|
var Wg = /* @__PURE__ */ function(o) {
|
|
28414
28411
|
return o[o.CONNECTING = 0] = "CONNECTING", o[o.OPEN = 1] = "OPEN", o[o.CLOSING = 2] = "CLOSING", o[o.CLOSED = 3] = "CLOSED", o;
|
|
28415
|
-
}(Wg || {}), TD = "2", wD = "3", $r, wo, Sr,
|
|
28412
|
+
}(Wg || {}), TD = "2", wD = "3", $r, wo, Sr, Br, Ti, nt, Ha, Ii, Nn, Po, $a, hp, Jg, _u, Ul, vp, Kg, fp, Cv, sc, gp, mp, zg, Fu, jl, Hu, oc, uc, yp, Oo, Bu, qu, lc, PD = /* @__PURE__ */ function() {
|
|
28416
28413
|
function o(t, e) {
|
|
28417
28414
|
var r, n, a, i, s, u, c, d, p, v;
|
|
28418
|
-
w(this, o), yr(this, hp), yr(this, _u), yr(this, vp), yr(this, fp), yr(this, sc), yr(this, mp), yr(this, Fu), yr(this, Hu), yr(this, uc), yr(this, Oo), yr(this, qu), yr(this, $r, void 0), yr(this, wo, void 0), yr(this, Sr, void 0), yr(this,
|
|
28415
|
+
w(this, o), yr(this, hp), yr(this, _u), yr(this, vp), yr(this, fp), yr(this, sc), yr(this, mp), yr(this, Fu), yr(this, Hu), yr(this, uc), yr(this, Oo), yr(this, qu), yr(this, $r, void 0), yr(this, wo, void 0), yr(this, Sr, void 0), yr(this, Br, void 0), yr(this, Ti, void 0), yr(this, nt, void 0), yr(this, Ha, void 0), yr(this, Ii, void 0), yr(this, Nn, void 0), yr(this, Po, void 0), yr(this, $a, void 0);
|
|
28419
28416
|
var f, g, k, y, b, E, T, S, D;
|
|
28420
|
-
ze(this, wo, t), ze(this, Ti, []), ze(this, nt, new ic()), ze(this, Ha, !0), ze(this, Nn, !1), ze(this, Sr, e != null ? e : {}), (r = (f = J(this, Sr)).autoReconnect) !== null && r !== void 0 || (f.autoReconnect = !0), (n = (g = J(this, Sr)).retryConnectionInterval) !== null && n !== void 0 || (g.retryConnectionInterval = 1e3), (a = (k = J(this, Sr)).pingTimeout) !== null && a !== void 0 || (k.pingTimeout = 3e4), (i = (y = J(this, Sr)).connectionTimeout) !== null && i !== void 0 || (y.connectionTimeout = 5e3), (s = (b = J(this, Sr)).debug) !== null && s !== void 0 || (b.debug = !0), (u = (E = J(this, Sr)).maxReconnectionAttempts) !== null && u !== void 0 || (E.maxReconnectionAttempts = 10), (c = (T = J(this, Sr)).disconnectOnPingTimeout) !== null && c !== void 0 || (T.disconnectOnPingTimeout = !0), (d = (S = J(this, Sr)).queueOnDisconnect) !== null && d !== void 0 || (S.queueOnDisconnect = !1), (p = (D = J(this, Sr)).flushOnReconnect) !== null && p !== void 0 || (D.flushOnReconnect = !1), ze(this, Ii, { code: void 0, reason: void 0 }), ze(this,
|
|
28417
|
+
ze(this, wo, t), ze(this, Ti, []), ze(this, nt, new ic()), ze(this, Ha, !0), ze(this, Nn, !1), ze(this, Sr, e != null ? e : {}), (r = (f = J(this, Sr)).autoReconnect) !== null && r !== void 0 || (f.autoReconnect = !0), (n = (g = J(this, Sr)).retryConnectionInterval) !== null && n !== void 0 || (g.retryConnectionInterval = 1e3), (a = (k = J(this, Sr)).pingTimeout) !== null && a !== void 0 || (k.pingTimeout = 3e4), (i = (y = J(this, Sr)).connectionTimeout) !== null && i !== void 0 || (y.connectionTimeout = 5e3), (s = (b = J(this, Sr)).debug) !== null && s !== void 0 || (b.debug = !0), (u = (E = J(this, Sr)).maxReconnectionAttempts) !== null && u !== void 0 || (E.maxReconnectionAttempts = 10), (c = (T = J(this, Sr)).disconnectOnPingTimeout) !== null && c !== void 0 || (T.disconnectOnPingTimeout = !0), (d = (S = J(this, Sr)).queueOnDisconnect) !== null && d !== void 0 || (S.queueOnDisconnect = !1), (p = (D = J(this, Sr)).flushOnReconnect) !== null && p !== void 0 || (D.flushOnReconnect = !1), ze(this, Ii, { code: void 0, reason: void 0 }), ze(this, Br, (v = J(this, Sr).logger) !== null && v !== void 0 ? v : new bD(J(this, Sr).debug ? "debug" : "info")), ze(this, $a, new kD());
|
|
28421
28418
|
}
|
|
28422
28419
|
return P(o, [{
|
|
28423
28420
|
key: "readyState",
|
|
@@ -28487,7 +28484,7 @@ var Wg = /* @__PURE__ */ function(o) {
|
|
|
28487
28484
|
u.next = 4;
|
|
28488
28485
|
break;
|
|
28489
28486
|
}
|
|
28490
|
-
return J(this,
|
|
28487
|
+
return J(this, Br).debug("Websocket was already connecting or connected."), u.abrupt("return");
|
|
28491
28488
|
case 4:
|
|
28492
28489
|
if (J(this, Ha) === !1) {
|
|
28493
28490
|
u.next = 6;
|
|
@@ -28496,15 +28493,15 @@ var Wg = /* @__PURE__ */ function(o) {
|
|
|
28496
28493
|
return u.abrupt("return", new Promise(function(c, d) {
|
|
28497
28494
|
Er(n, Oo, Bu).call(n), Er(n, qu, lc).call(n);
|
|
28498
28495
|
try {
|
|
28499
|
-
ze(n, $r, new WebSocket(Er(n, hp, Jg).call(n, J(n, wo)))), J(n, $r).binaryType = "arraybuffer", J(n,
|
|
28496
|
+
ze(n, $r, new WebSocket(Er(n, hp, Jg).call(n, J(n, wo)))), J(n, $r).binaryType = "arraybuffer", J(n, Br).debug("Connecting");
|
|
28500
28497
|
var p = setTimeout(function() {
|
|
28501
|
-
J(n,
|
|
28498
|
+
J(n, Br).debug("Connection timeout. Closing socket"), ze(n, Ha, !0), Er(n, qu, lc).call(n), J(n, $r).close(3001, "Connection Timeout"), J(n, Sr).autoReconnect && !J(n, Nn) && (J(n, nt).emit(
|
|
28502
28499
|
"reconnecting"
|
|
28503
28500
|
/* reconnecting */
|
|
28504
28501
|
), Er(n, Fu, jl).call(n)), d(new Error("Connection timed out!"));
|
|
28505
28502
|
}, J(n, Sr).connectionTimeout);
|
|
28506
28503
|
J(n, $r).onopen = function() {
|
|
28507
|
-
J(n,
|
|
28504
|
+
J(n, Br).debug("Ready State: ".concat(Wg[J(n, $r).readyState])), p && clearTimeout(p), Er(n, uc, yp).call(n), ze(n, Ii, { code: void 0, reason: void 0 }), J(n, nt).emit(
|
|
28508
28505
|
"connected"
|
|
28509
28506
|
/* connected */
|
|
28510
28507
|
), J(n, Sr).flushOnReconnect && n.flush(), c();
|
|
@@ -28512,7 +28509,7 @@ var Wg = /* @__PURE__ */ function(o) {
|
|
|
28512
28509
|
try {
|
|
28513
28510
|
p && clearTimeout(p);
|
|
28514
28511
|
var f = v.code, g = v.reason;
|
|
28515
|
-
d(g), J(n,
|
|
28512
|
+
d(g), J(n, Br).debug("Socket closed. Close event:", { event: v }), J(n, Br).debug("Connection closed code: ".concat(f)), J(n, Br).debug("Connection closed reason: ".concat(g)), J(n, Nn) || Er(n, sc, gp).call(n, f, g);
|
|
28516
28513
|
} catch (k) {
|
|
28517
28514
|
Er(n, _u, Ul).call(n, k);
|
|
28518
28515
|
}
|
|
@@ -28545,7 +28542,7 @@ var Wg = /* @__PURE__ */ function(o) {
|
|
|
28545
28542
|
value: function(e, r, n, a) {
|
|
28546
28543
|
var i = { event: e, id: r, payload: n, metadata: a };
|
|
28547
28544
|
if (J(this, Sr).queueOnDisconnect && (!J(this, $r) || J(this, $r).readyState !== 1))
|
|
28548
|
-
return J(this,
|
|
28545
|
+
return J(this, Br).debug("Queuing message since socket is not connected!", i), J(this, Ti).push(i), !1;
|
|
28549
28546
|
var s = Gg.encode(i);
|
|
28550
28547
|
return Er(this, Hu, oc).call(this, s);
|
|
28551
28548
|
}
|
|
@@ -28635,7 +28632,7 @@ var Wg = /* @__PURE__ */ function(o) {
|
|
|
28635
28632
|
ze(this, Ha, !1), Er(this, Oo, Bu).call(this), this.removeAllListeners(), ze(this, Ii, { code: 1e3, reason: "Sockrates disconnect method called" }), J(this, $r).close(1e3, "Sockrates disconnect method called.");
|
|
28636
28633
|
} }]);
|
|
28637
28634
|
}();
|
|
28638
|
-
$r = /* @__PURE__ */ new WeakMap(), wo = /* @__PURE__ */ new WeakMap(), Sr = /* @__PURE__ */ new WeakMap(),
|
|
28635
|
+
$r = /* @__PURE__ */ new WeakMap(), wo = /* @__PURE__ */ new WeakMap(), Sr = /* @__PURE__ */ new WeakMap(), Br = /* @__PURE__ */ new WeakMap(), Ti = /* @__PURE__ */ new WeakMap(), nt = /* @__PURE__ */ new WeakMap(), Ha = /* @__PURE__ */ new WeakMap(), Ii = /* @__PURE__ */ new WeakMap(), Nn = /* @__PURE__ */ new WeakMap(), Po = /* @__PURE__ */ new WeakMap(), $a = /* @__PURE__ */ new WeakMap(), hp = /* @__PURE__ */ new WeakSet(), Jg = function(t) {
|
|
28639
28636
|
if (t.startsWith("ws://") || t.startsWith("wss://"))
|
|
28640
28637
|
return t;
|
|
28641
28638
|
if (t.startsWith("https://"))
|
|
@@ -28644,21 +28641,21 @@ $r = /* @__PURE__ */ new WeakMap(), wo = /* @__PURE__ */ new WeakMap(), Sr = /*
|
|
|
28644
28641
|
return "ws://".concat(t.substring(7));
|
|
28645
28642
|
throw new Error("Invalid URL. URL must start with http(s):// or ws(s)://.");
|
|
28646
28643
|
}, _u = /* @__PURE__ */ new WeakSet(), Ul = function(t, e) {
|
|
28647
|
-
J(this,
|
|
28644
|
+
J(this, Br).error("Error:", { error: t }), J(this, nt).emit("errored", { error: t }), e == null || e(t);
|
|
28648
28645
|
}, vp = /* @__PURE__ */ new WeakSet(), Kg = function(t) {
|
|
28649
28646
|
if (Er(this, uc, yp).call(this), t.data === TD) {
|
|
28650
|
-
J(this,
|
|
28647
|
+
J(this, Br).debug("Received ping from server"), Er(this, Hu, oc).call(this, wD);
|
|
28651
28648
|
return;
|
|
28652
28649
|
}
|
|
28653
28650
|
var e = Gg.decode(t.data), r = e.id, n = e.payload;
|
|
28654
|
-
J(this,
|
|
28651
|
+
J(this, Br).debug("Received message", { event: e.event, messageID: r }), J(this, nt).emit(e.event.toString(), { id: r, payload: n });
|
|
28655
28652
|
}, fp = /* @__PURE__ */ new WeakSet(), Cv = function() {
|
|
28656
28653
|
return J(this, $r).readyState === 1;
|
|
28657
28654
|
}, sc = /* @__PURE__ */ new WeakSet(), gp = function(t, e) {
|
|
28658
28655
|
ze(this, Ii, { reason: e, code: t }), J(this, nt).emit("disconnected", { code: t, reason: e });
|
|
28659
28656
|
}, mp = /* @__PURE__ */ new WeakSet(), zg = function() {
|
|
28660
28657
|
var t = J(this, Ii), e = t.reason, r = t.code;
|
|
28661
|
-
r && r !== 1e3 && J(this, Ha) && J(this, Sr).autoReconnect && !J(this, Nn) && (J(this,
|
|
28658
|
+
r && r !== 1e3 && J(this, Ha) && J(this, Sr).autoReconnect && !J(this, Nn) && (J(this, Br).debug("Triggering reconnection due to ".concat(e, ".")), J(this, nt).emit(
|
|
28662
28659
|
"reconnecting"
|
|
28663
28660
|
/* reconnecting */
|
|
28664
28661
|
), Er(this, Fu, jl).call(this));
|
|
@@ -28673,7 +28670,7 @@ $r = /* @__PURE__ */ new WeakMap(), wo = /* @__PURE__ */ new WeakMap(), Sr = /*
|
|
|
28673
28670
|
a.next = 4;
|
|
28674
28671
|
break;
|
|
28675
28672
|
}
|
|
28676
|
-
return J(this,
|
|
28673
|
+
return J(this, Br).debug("Reconnect called when already in a reconnect loop. Ignoring."), a.abrupt("return");
|
|
28677
28674
|
case 4:
|
|
28678
28675
|
if (J(this, Nn) || J(this, $a).reset(), !(J(this, Sr).maxReconnectionAttempts !== null && J(this, $a).getAttempts() >= J(this, Sr).maxReconnectionAttempts)) {
|
|
28679
28676
|
a.next = 7;
|
|
@@ -28692,7 +28689,7 @@ $r = /* @__PURE__ */ new WeakMap(), wo = /* @__PURE__ */ new WeakMap(), Sr = /*
|
|
|
28692
28689
|
}
|
|
28693
28690
|
return a.abrupt("return");
|
|
28694
28691
|
case 13:
|
|
28695
|
-
return J(this,
|
|
28692
|
+
return J(this, Br).debug("Reconnection attempt ".concat(J(this, $a).getAttempts())), J(this, nt).emit("reconnectAttempt", { attempt: J(this, $a).getAttempts() }), a.next = 17, this.connect();
|
|
28696
28693
|
case 17:
|
|
28697
28694
|
if (Er(this, fp, Cv).call(this)) {
|
|
28698
28695
|
a.next = 19;
|
|
@@ -28706,7 +28703,7 @@ $r = /* @__PURE__ */ new WeakMap(), wo = /* @__PURE__ */ new WeakMap(), Sr = /*
|
|
|
28706
28703
|
), a.next = 25;
|
|
28707
28704
|
break;
|
|
28708
28705
|
case 22:
|
|
28709
|
-
a.prev = 22, a.t0 = a.catch(8), J(this,
|
|
28706
|
+
a.prev = 22, a.t0 = a.catch(8), J(this, Br).debug("Failed to reconnect."), J(this, nt).emit("reconnectFailure", { attempt: J(this, $a).getAttempts() }), Er(this, Fu, jl).call(this, !1);
|
|
28710
28707
|
case 25:
|
|
28711
28708
|
case "end":
|
|
28712
28709
|
return a.stop();
|
|
@@ -28720,13 +28717,13 @@ $r = /* @__PURE__ */ new WeakMap(), wo = /* @__PURE__ */ new WeakMap(), Sr = /*
|
|
|
28720
28717
|
try {
|
|
28721
28718
|
return J(this, $r).send(t), !0;
|
|
28722
28719
|
} catch (e) {
|
|
28723
|
-
return J(this,
|
|
28720
|
+
return J(this, Br).error(e.message), !1;
|
|
28724
28721
|
}
|
|
28725
28722
|
}, uc = /* @__PURE__ */ new WeakSet(), yp = function() {
|
|
28726
28723
|
var t = this;
|
|
28727
|
-
this.config.disconnectOnPingTimeout && (J(this,
|
|
28724
|
+
this.config.disconnectOnPingTimeout && (J(this, Br).debug("Resetting ping timeout"), Er(this, Oo, Bu).call(this), ze(this, Po, setTimeout(function() {
|
|
28728
28725
|
var e;
|
|
28729
|
-
J(t,
|
|
28726
|
+
J(t, Br).debug("Disconnecting the socket due to ping timeout"), ze(t, Ha, !0);
|
|
28730
28727
|
var r = 3002, n = "Ping timeout";
|
|
28731
28728
|
(e = J(t, $r)) == null || e.close(r, n), Er(t, sc, gp).call(t, r, n);
|
|
28732
28729
|
}, J(this, Sr).pingTimeout)));
|
|
@@ -28739,12 +28736,12 @@ var SD = Object.defineProperty, ED = Object.getOwnPropertyDescriptor, Dc = funct
|
|
|
28739
28736
|
for (var a = n > 1 ? void 0 : n ? ED(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
|
28740
28737
|
(s = t[i]) && (a = (n ? s(e, r, a) : s(a)) || a);
|
|
28741
28738
|
return n && a && SD(e, r, a), a;
|
|
28742
|
-
}, Rv = 65535, CD = 3e3, Yg = (gn = /* @__PURE__ */ C("url"), be = /* @__PURE__ */ C("sockrates"), Te = /* @__PURE__ */ C("connectionHandler"),
|
|
28739
|
+
}, Rv = 65535, CD = 3e3, Yg = (gn = /* @__PURE__ */ C("url"), be = /* @__PURE__ */ C("sockrates"), Te = /* @__PURE__ */ C("connectionHandler"), Jr = /* @__PURE__ */ C("socketDisconnectionTimeout"), Je = /* @__PURE__ */ C("context"), go = /* @__PURE__ */ C("getSocketURL"), mo = /* @__PURE__ */ C("generateId"), /* @__PURE__ */ function() {
|
|
28743
28740
|
function o(t, e) {
|
|
28744
28741
|
var r, n = e.peerId, a = e.meetingId, i = e.authToken, s = e.capabilities;
|
|
28745
|
-
if (w(this, o), Object.defineProperty(this, mo, { value: ID }), Object.defineProperty(this, go, { value: AD }), Object.defineProperty(this, Te, { get: RD, set: void 0 }), Object.defineProperty(this, gn, { writable: !0, value: void 0 }), Object.defineProperty(this, be, { writable: !0, value: void 0 }), this.roomName = void 0, this.authToken = void 0, this.capabilities = void 0, Object.defineProperty(this,
|
|
28742
|
+
if (w(this, o), Object.defineProperty(this, mo, { value: ID }), Object.defineProperty(this, go, { value: AD }), Object.defineProperty(this, Te, { get: RD, set: void 0 }), Object.defineProperty(this, gn, { writable: !0, value: void 0 }), Object.defineProperty(this, be, { writable: !0, value: void 0 }), this.roomName = void 0, this.authToken = void 0, this.capabilities = void 0, Object.defineProperty(this, Jr, { writable: !0, value: void 0 }), Object.defineProperty(this, Je, { writable: !0, value: void 0 }), !n || !a || !i)
|
|
28746
28743
|
throw new j("peerId, meetingId, or authToken can not be empty", "0404");
|
|
28747
|
-
l(this,
|
|
28744
|
+
l(this, Jr)[Jr] = void 0, l(this, Je)[Je] = t, this.capabilities = s, this.roomName = a, this.authToken = i, l(this, gn)[gn] = l(this, go)[go](n), l(this, be)[be] = new PD(l(this, gn)[gn], { autoReconnect: !0, disconnectOnPingTimeout: (r = s.includes("PING")) !== null && r !== void 0 ? r : !1, queueOnDisconnect: !0, flushOnReconnect: !1, logger: this.logger }), this.handleSocketConnectionEvents();
|
|
28748
28745
|
}
|
|
28749
28746
|
return P(o, [{ key: "joinAttempted", get: function() {
|
|
28750
28747
|
return l(this, Te)[Te].socketJoinAttempted;
|
|
@@ -28856,7 +28853,7 @@ var SD = Object.defineProperty, ED = Object.getOwnPropertyDescriptor, Dc = funct
|
|
|
28856
28853
|
for (; ; )
|
|
28857
28854
|
switch (a.prev = a.next) {
|
|
28858
28855
|
case 0:
|
|
28859
|
-
e.logger.info("SocketService::Connected to socket-edge"), l(e,
|
|
28856
|
+
e.logger.info("SocketService::Connected to socket-edge"), l(e, Jr)[Jr] && (clearTimeout(l(e, Jr)[Jr]), l(e, Jr)[Jr] = void 0), l(e, Te)[Te].updateSocketConnectionState("connected");
|
|
28860
28857
|
case 3:
|
|
28861
28858
|
case "end":
|
|
28862
28859
|
return a.stop();
|
|
@@ -28866,8 +28863,8 @@ var SD = Object.defineProperty, ED = Object.getOwnPropertyDescriptor, Dc = funct
|
|
|
28866
28863
|
var n, a = r.code, i = r.reason;
|
|
28867
28864
|
e.logger.info("SocketService::Disconnected from socket-edge", { error: { code: a, reason: i }, country: O.location.country });
|
|
28868
28865
|
var s = (n = l(e, Te)[Te].mediaState) !== null && n !== void 0 ? n : {}, u = s.recv, c = s.send;
|
|
28869
|
-
u != null && u.state && (u == null ? void 0 : u.state) !== Uo.CONNECTED || c != null && c.state && (c == null ? void 0 : c.state) !== Uo.CONNECTED ? l(e, Je)[Je].getValue("peerSessionStore").emit(F.SOCKET_SERVICE_DISCONNECTED, { joinAttempted: l(e, Te)[Te].joinAttempted }) : l(e,
|
|
28870
|
-
l(e, Je)[Je].getValue("peerSessionStore").emit(F.SOCKET_SERVICE_DISCONNECTED, { joinAttempted: l(e, Te)[Te].joinAttempted }), l(e,
|
|
28866
|
+
u != null && u.state && (u == null ? void 0 : u.state) !== Uo.CONNECTED || c != null && c.state && (c == null ? void 0 : c.state) !== Uo.CONNECTED ? l(e, Je)[Je].getValue("peerSessionStore").emit(F.SOCKET_SERVICE_DISCONNECTED, { joinAttempted: l(e, Te)[Te].joinAttempted }) : l(e, Jr)[Jr] = setTimeout(function() {
|
|
28867
|
+
l(e, Je)[Je].getValue("peerSessionStore").emit(F.SOCKET_SERVICE_DISCONNECTED, { joinAttempted: l(e, Te)[Te].joinAttempted }), l(e, Jr)[Jr] = void 0;
|
|
28871
28868
|
}, CD), l(e, Te)[Te].updateSocketConnectionState("disconnected");
|
|
28872
28869
|
}), this.onStateEvent("reconnecting", /* @__PURE__ */ m(/* @__PURE__ */ h().mark(function r() {
|
|
28873
28870
|
return h().wrap(function(a) {
|
|
@@ -28905,7 +28902,7 @@ var SD = Object.defineProperty, ED = Object.getOwnPropertyDescriptor, Dc = funct
|
|
|
28905
28902
|
for (; ; )
|
|
28906
28903
|
switch (a.prev = a.next) {
|
|
28907
28904
|
case 0:
|
|
28908
|
-
e.logger.info("SocketService::Reconnected to socket-edge", { connectionState: { joinAttempted: l(e, Te)[Te].mediaJoinAttempted } }), l(e,
|
|
28905
|
+
e.logger.info("SocketService::Reconnected to socket-edge", { connectionState: { joinAttempted: l(e, Te)[Te].mediaJoinAttempted } }), l(e, Jr)[Jr] && (clearTimeout(l(e, Jr)[Jr]), l(e, Jr)[Jr] = void 0), l(e, Je)[Je].getValue("peerSessionStore").emit(F.SOCKET_SERVICE_RECONNECTED, { wasJoinAttempted: l(e, Te)[Te].mediaJoinAttempted }), l(e, Te)[Te].updateSocketConnectionState("reconnected");
|
|
28909
28906
|
case 4:
|
|
28910
28907
|
case "end":
|
|
28911
28908
|
return a.stop();
|
|
@@ -29935,7 +29932,7 @@ var Ma = /* @__PURE__ */ C("trackMap"), BD = /* @__PURE__ */ function(o) {
|
|
|
29935
29932
|
}() }], [{ key: "initMedia", value: function() {
|
|
29936
29933
|
var e, r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : void 0, i = (e = a == null ? void 0 : a.peerId) !== null && e !== void 0 ? e : Ks(), s = Ba.createContext(i, { peerId: i }), u = s.getValue("logger");
|
|
29937
29934
|
u.init(s);
|
|
29938
|
-
var c = new Ag(u);
|
|
29935
|
+
var c = new Ag(s, u);
|
|
29939
29936
|
return c.init(r, n, s), s.setValue("defaults", { mediaHandler: c }), c;
|
|
29940
29937
|
} }, { key: "init", value: function() {
|
|
29941
29938
|
var t = m(/* @__PURE__ */ h().mark(function r(n) {
|