@nainudhin/video-meeting-sdk 1.8.2 → 1.9.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/dist/meet-sdk.mjs +96 -58
- package/dist/meet-sdk.umd.js +12 -8
- package/package.json +1 -1
package/dist/meet-sdk.mjs
CHANGED
|
@@ -352,14 +352,14 @@ function z(r, e, t) {
|
|
|
352
352
|
const n = r.match(e);
|
|
353
353
|
return n && n.length >= t && parseFloat(n[t], 10);
|
|
354
354
|
}
|
|
355
|
-
function
|
|
355
|
+
function I(r, e, t) {
|
|
356
356
|
if (!r.RTCPeerConnection)
|
|
357
357
|
return;
|
|
358
358
|
if (!Object.getOwnPropertyDescriptor(
|
|
359
359
|
EventTarget.prototype,
|
|
360
360
|
"addEventListener"
|
|
361
361
|
).writable) {
|
|
362
|
-
|
|
362
|
+
Ie("Unable to polyfill events");
|
|
363
363
|
return;
|
|
364
364
|
}
|
|
365
365
|
const s = r.RTCPeerConnection.prototype, i = s.addEventListener;
|
|
@@ -409,14 +409,14 @@ function xn(r) {
|
|
|
409
409
|
function Tn(r) {
|
|
410
410
|
return typeof r != "boolean" ? new Error("Argument type: " + typeof r + ". Please use a boolean.") : (pt = !r, "adapter.js deprecation warnings " + (r ? "disabled" : "enabled"));
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function Ie() {
|
|
413
413
|
if (typeof window == "object") {
|
|
414
414
|
if (ft)
|
|
415
415
|
return;
|
|
416
416
|
typeof console < "u" && typeof console.log == "function" && console.log.apply(console, arguments);
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function Oe(r, e) {
|
|
420
420
|
pt && console.warn(r + " is deprecated, please use " + e + " instead.");
|
|
421
421
|
}
|
|
422
422
|
function Rn(r) {
|
|
@@ -487,7 +487,7 @@ function Xe(r, e, t) {
|
|
|
487
487
|
});
|
|
488
488
|
}), s;
|
|
489
489
|
}
|
|
490
|
-
const Ze =
|
|
490
|
+
const Ze = Ie;
|
|
491
491
|
function mt(r, e) {
|
|
492
492
|
if (e.version >= 64)
|
|
493
493
|
return;
|
|
@@ -615,7 +615,7 @@ function bt(r, e) {
|
|
|
615
615
|
}, this.addEventListener("addstream", this._ontrackpoly)), t.apply(this, arguments);
|
|
616
616
|
};
|
|
617
617
|
} else
|
|
618
|
-
|
|
618
|
+
I(r, "track", (t) => (t.transceiver || Object.defineProperty(
|
|
619
619
|
t,
|
|
620
620
|
"transceiver",
|
|
621
621
|
{ value: { receiver: t.receiver } }
|
|
@@ -702,7 +702,7 @@ function vt(r, e) {
|
|
|
702
702
|
n && (r.RTCPeerConnection.prototype.getReceivers = function() {
|
|
703
703
|
const i = n.apply(this, []);
|
|
704
704
|
return i.forEach((o) => o._pc = this), i;
|
|
705
|
-
}),
|
|
705
|
+
}), I(r, "track", (s) => (s.receiver._pc = s.srcElement, s)), r.RTCRtpReceiver.prototype.getStats = function() {
|
|
706
706
|
const i = this;
|
|
707
707
|
return this._pc.getStats().then((o) => Xe(o, i.track, !1));
|
|
708
708
|
};
|
|
@@ -909,7 +909,7 @@ function ge(r, e) {
|
|
|
909
909
|
});
|
|
910
910
|
}
|
|
911
911
|
function kt(r, e) {
|
|
912
|
-
e.version > 102 ||
|
|
912
|
+
e.version > 102 || I(r, "negotiationneeded", (t) => {
|
|
913
913
|
const n = t.target;
|
|
914
914
|
if (!((e.version < 72 || n.getConfiguration && n.getConfiguration().sdpSemantics === "plan-b") && n.signalingState !== "stable"))
|
|
915
915
|
return t;
|
|
@@ -933,7 +933,7 @@ function xt(r, e) {
|
|
|
933
933
|
return;
|
|
934
934
|
const n = r && r.MediaStreamTrack;
|
|
935
935
|
if (t.getUserMedia = function(s, i, o) {
|
|
936
|
-
|
|
936
|
+
Oe(
|
|
937
937
|
"navigator.getUserMedia",
|
|
938
938
|
"navigator.mediaDevices.getUserMedia"
|
|
939
939
|
), t.mediaDevices.getUserMedia(s).then(i, o);
|
|
@@ -1036,13 +1036,13 @@ function Et(r) {
|
|
|
1036
1036
|
e && (r.RTCPeerConnection.prototype.getReceivers = function() {
|
|
1037
1037
|
const n = e.apply(this, []);
|
|
1038
1038
|
return n.forEach((s) => s._pc = this), n;
|
|
1039
|
-
}),
|
|
1039
|
+
}), I(r, "track", (t) => (t.receiver._pc = t.srcElement, t)), r.RTCRtpReceiver.prototype.getStats = function() {
|
|
1040
1040
|
return this._pc.getStats(this.track);
|
|
1041
1041
|
};
|
|
1042
1042
|
}
|
|
1043
1043
|
function wt(r) {
|
|
1044
1044
|
!r.RTCPeerConnection || "removeStream" in r.RTCPeerConnection.prototype || (r.RTCPeerConnection.prototype.removeStream = function(t) {
|
|
1045
|
-
|
|
1045
|
+
Oe("removeStream", "removeTrack"), this.getSenders().forEach((n) => {
|
|
1046
1046
|
n.track && t.getTracks().includes(n.track) && this.removeTrack(n);
|
|
1047
1047
|
});
|
|
1048
1048
|
});
|
|
@@ -1082,7 +1082,7 @@ function At(r, e) {
|
|
|
1082
1082
|
return o;
|
|
1083
1083
|
});
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function It(r, e) {
|
|
1086
1086
|
if (!(typeof r == "object" && r.RTCRtpSender) || e.version >= 110)
|
|
1087
1087
|
return;
|
|
1088
1088
|
const t = r.RTCRtpSender.prototype.getParameters;
|
|
@@ -1091,7 +1091,7 @@ function Ot(r, e) {
|
|
|
1091
1091
|
return "encodings" in s || (s.encodings = [].concat(this.sendEncodings || [{}])), s;
|
|
1092
1092
|
});
|
|
1093
1093
|
}
|
|
1094
|
-
function
|
|
1094
|
+
function Ot(r, e) {
|
|
1095
1095
|
if (!(typeof r == "object" && r.RTCPeerConnection) || e.version >= 110)
|
|
1096
1096
|
return;
|
|
1097
1097
|
const t = r.RTCPeerConnection.prototype.createOffer;
|
|
@@ -1115,9 +1115,9 @@ const tt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1115
1115
|
__proto__: null,
|
|
1116
1116
|
shimAddTransceiver: At,
|
|
1117
1117
|
shimCreateAnswer: Dt,
|
|
1118
|
-
shimCreateOffer:
|
|
1118
|
+
shimCreateOffer: Ot,
|
|
1119
1119
|
shimGetDisplayMedia: Pn,
|
|
1120
|
-
shimGetParameters:
|
|
1120
|
+
shimGetParameters: It,
|
|
1121
1121
|
shimGetStats: Rt,
|
|
1122
1122
|
shimGetUserMedia: xt,
|
|
1123
1123
|
shimOnTrack: Tt,
|
|
@@ -1246,7 +1246,7 @@ function zt(r) {
|
|
|
1246
1246
|
const i = [];
|
|
1247
1247
|
for (let o = 0; o < n.iceServers.length; o++) {
|
|
1248
1248
|
let a = n.iceServers[o];
|
|
1249
|
-
a.urls === void 0 && a.url ? (
|
|
1249
|
+
a.urls === void 0 && a.url ? (Oe("RTCIceServer.url", "RTCIceServer.urls"), a = JSON.parse(JSON.stringify(a)), a.urls = a.url, delete a.url, i.push(a)) : i.push(n.iceServers[o]);
|
|
1250
1250
|
}
|
|
1251
1251
|
n.iceServers = i;
|
|
1252
1252
|
}
|
|
@@ -1711,13 +1711,13 @@ function J(r) {
|
|
|
1711
1711
|
}, s;
|
|
1712
1712
|
}
|
|
1713
1713
|
return new e(n);
|
|
1714
|
-
}, r.RTCIceCandidate.prototype = e.prototype,
|
|
1714
|
+
}, r.RTCIceCandidate.prototype = e.prototype, I(r, "icecandidate", (t) => (t.candidate && Object.defineProperty(t, "candidate", {
|
|
1715
1715
|
value: new r.RTCIceCandidate(t.candidate),
|
|
1716
1716
|
writable: "false"
|
|
1717
1717
|
}), t));
|
|
1718
1718
|
}
|
|
1719
1719
|
function ye(r) {
|
|
1720
|
-
!r.RTCIceCandidate || r.RTCIceCandidate && "relayProtocol" in r.RTCIceCandidate.prototype ||
|
|
1720
|
+
!r.RTCIceCandidate || r.RTCIceCandidate && "relayProtocol" in r.RTCIceCandidate.prototype || I(r, "icecandidate", (e) => {
|
|
1721
1721
|
if (e.candidate) {
|
|
1722
1722
|
const t = L.parseCandidate(e.candidate.candidate);
|
|
1723
1723
|
t.type === "relay" && (e.candidate.relayProtocol = {
|
|
@@ -1804,7 +1804,7 @@ function Y(r, e) {
|
|
|
1804
1804
|
r.RTCPeerConnection.prototype.createDataChannel = function() {
|
|
1805
1805
|
const i = n.apply(this, arguments);
|
|
1806
1806
|
return t(i, this), i;
|
|
1807
|
-
},
|
|
1807
|
+
}, I(r, "datachannel", (s) => (t(s.channel, s.target), s));
|
|
1808
1808
|
}
|
|
1809
1809
|
function be(r) {
|
|
1810
1810
|
if (!r.RTCPeerConnection || "connectionState" in r.RTCPeerConnection.prototype)
|
|
@@ -1916,7 +1916,7 @@ function An({ window: r } = {}, e = {
|
|
|
1916
1916
|
shimFirefox: !0,
|
|
1917
1917
|
shimSafari: !0
|
|
1918
1918
|
}) {
|
|
1919
|
-
const t =
|
|
1919
|
+
const t = Ie, n = Rn(r), s = {
|
|
1920
1920
|
browserDetails: n,
|
|
1921
1921
|
commonShim: Mn,
|
|
1922
1922
|
extractVersion: z,
|
|
@@ -1936,7 +1936,7 @@ function An({ window: r } = {}, e = {
|
|
|
1936
1936
|
case "firefox":
|
|
1937
1937
|
if (!tt || !me || !e.shimFirefox)
|
|
1938
1938
|
return t("Firefox shim is not included in this adapter release."), s;
|
|
1939
|
-
t("adapter.js shimming firefox."), s.browserShim = tt, G(r, n), Q(r), xt(r, n), me(r, n), Rt(r, n), Tt(r), wt(r), Pt(r), Et(r), Mt(r), At(r, n),
|
|
1939
|
+
t("adapter.js shimming firefox."), s.browserShim = tt, G(r, n), Q(r), xt(r, n), me(r, n), Rt(r, n), Tt(r), wt(r), Pt(r), Et(r), Mt(r), At(r, n), It(r, n), Ot(r, n), Dt(r, n), J(r), be(r), W(r, n), Y(r, n);
|
|
1940
1940
|
break;
|
|
1941
1941
|
case "safari":
|
|
1942
1942
|
if (!nt || !e.shimSafari)
|
|
@@ -1950,7 +1950,7 @@ function An({ window: r } = {}, e = {
|
|
|
1950
1950
|
return s;
|
|
1951
1951
|
}
|
|
1952
1952
|
const rt = An({ window: typeof window > "u" ? void 0 : window });
|
|
1953
|
-
function
|
|
1953
|
+
function O(r, e, t, n) {
|
|
1954
1954
|
Object.defineProperty(r, e, { get: t, set: n, enumerable: !0, configurable: !0 });
|
|
1955
1955
|
}
|
|
1956
1956
|
class Kt {
|
|
@@ -1971,7 +1971,7 @@ class Kt {
|
|
|
1971
1971
|
};
|
|
1972
1972
|
}
|
|
1973
1973
|
}
|
|
1974
|
-
function
|
|
1974
|
+
function In(r) {
|
|
1975
1975
|
let e = 0;
|
|
1976
1976
|
for (const s of r) e += s.byteLength;
|
|
1977
1977
|
const t = new Uint8Array(e);
|
|
@@ -2031,7 +2031,7 @@ const he = (
|
|
|
2031
2031
|
"safari"
|
|
2032
2032
|
], this.minFirefoxVersion = 59, this.minChromeVersion = 72, this.minSafariVersion = 605;
|
|
2033
2033
|
}
|
|
2034
|
-
}(),
|
|
2034
|
+
}(), On = (r) => !r || /^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.test(r), Jt = () => Math.random().toString(36).slice(2), st = {
|
|
2035
2035
|
iceServers: [
|
|
2036
2036
|
{
|
|
2037
2037
|
urls: "stun:stun.l.google.com:19302"
|
|
@@ -2109,7 +2109,7 @@ class Dn extends Kt {
|
|
|
2109
2109
|
}
|
|
2110
2110
|
return t;
|
|
2111
2111
|
}(), // Ensure alphanumeric ids
|
|
2112
|
-
this.validateId =
|
|
2112
|
+
this.validateId = On, this.randomToken = Jt;
|
|
2113
2113
|
}
|
|
2114
2114
|
}
|
|
2115
2115
|
const k = new Dn(), Ln = "PeerJS: ";
|
|
@@ -2258,13 +2258,13 @@ S.prefixed = C;
|
|
|
2258
2258
|
S.EventEmitter = S;
|
|
2259
2259
|
De = S;
|
|
2260
2260
|
var D = {};
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2261
|
+
O(D, "ConnectionType", () => w);
|
|
2262
|
+
O(D, "PeerErrorType", () => y);
|
|
2263
|
+
O(D, "BaseConnectionErrorType", () => ve);
|
|
2264
|
+
O(D, "DataConnectionErrorType", () => Le);
|
|
2265
|
+
O(D, "SerializationType", () => ie);
|
|
2266
|
+
O(D, "SocketEventType", () => E);
|
|
2267
|
+
O(D, "ServerMessageType", () => v);
|
|
2268
2268
|
var w = /* @__PURE__ */ function(r) {
|
|
2269
2269
|
return r.Data = "data", r.Media = "media", r;
|
|
2270
2270
|
}({}), y = /* @__PURE__ */ function(r) {
|
|
@@ -2801,7 +2801,7 @@ class le extends $e {
|
|
|
2801
2801
|
};
|
|
2802
2802
|
if (n.data[e.n] = new Uint8Array(e.data), n.count++, this._chunkedData[t] = n, n.total === n.count) {
|
|
2803
2803
|
delete this._chunkedData[t];
|
|
2804
|
-
const s =
|
|
2804
|
+
const s = In(n.data);
|
|
2805
2805
|
this._handleDataMessage({
|
|
2806
2806
|
data: s
|
|
2807
2807
|
});
|
|
@@ -4543,7 +4543,7 @@ function Te(r, e) {
|
|
|
4543
4543
|
}
|
|
4544
4544
|
return r;
|
|
4545
4545
|
}
|
|
4546
|
-
function
|
|
4546
|
+
function Ir(r, e) {
|
|
4547
4547
|
return r.data = Re(r.data, e), delete r.attachments, r;
|
|
4548
4548
|
}
|
|
4549
4549
|
function Re(r, e) {
|
|
@@ -4561,7 +4561,7 @@ function Re(r, e) {
|
|
|
4561
4561
|
Object.prototype.hasOwnProperty.call(r, t) && (r[t] = Re(r[t], e));
|
|
4562
4562
|
return r;
|
|
4563
4563
|
}
|
|
4564
|
-
const
|
|
4564
|
+
const Or = [
|
|
4565
4565
|
"connect",
|
|
4566
4566
|
// used on the client side
|
|
4567
4567
|
"connect_error",
|
|
@@ -4724,7 +4724,7 @@ class Fe extends b {
|
|
|
4724
4724
|
return typeof t == "string" || ht(t);
|
|
4725
4725
|
case g.EVENT:
|
|
4726
4726
|
case g.BINARY_EVENT:
|
|
4727
|
-
return Array.isArray(t) && (typeof t[0] == "number" || typeof t[0] == "string" &&
|
|
4727
|
+
return Array.isArray(t) && (typeof t[0] == "number" || typeof t[0] == "string" && Or.indexOf(t[0]) === -1);
|
|
4728
4728
|
case g.ACK:
|
|
4729
4729
|
case g.BINARY_ACK:
|
|
4730
4730
|
return Array.isArray(t);
|
|
@@ -4751,7 +4751,7 @@ class Lr {
|
|
|
4751
4751
|
*/
|
|
4752
4752
|
takeBinaryData(e) {
|
|
4753
4753
|
if (this.buffers.push(e), this.buffers.length === this.reconPack.attachments) {
|
|
4754
|
-
const t =
|
|
4754
|
+
const t = Ir(this.reconPack, this.buffers);
|
|
4755
4755
|
return this.finishedReconstruction(), t;
|
|
4756
4756
|
}
|
|
4757
4757
|
return null;
|
|
@@ -6306,16 +6306,30 @@ class Kr {
|
|
|
6306
6306
|
e && n === e ? (s.style.gridColumn = "1 / -1", s.style.aspectRatio = "16 / 9", s.style.maxHeight = "65vh") : e ? (s.style.gridColumn = "", s.style.maxHeight = "160px", s.style.aspectRatio = "16 / 9") : (s.style.gridColumn = "", s.style.maxHeight = "", s.style.aspectRatio = "16 / 9");
|
|
6307
6307
|
}));
|
|
6308
6308
|
}
|
|
6309
|
-
setParticipants(e) {
|
|
6309
|
+
setParticipants(e, t = {}) {
|
|
6310
6310
|
if (!this.container) return;
|
|
6311
|
-
const
|
|
6312
|
-
|
|
6313
|
-
|
|
6311
|
+
const n = this.container.querySelector("#participants-list"), s = this.container.querySelector("#participants-count");
|
|
6312
|
+
if (s && (s.textContent = `(${e.length})`), !n) return;
|
|
6313
|
+
const i = !!t.showControls;
|
|
6314
|
+
n.innerHTML = e.map((o, a) => {
|
|
6315
|
+
const c = o.isYou ? " (You)" : o.isHost ? " · host" : "", h = this.escapeHtml(o.label) + c, l = `<span style="display:inline-block; width:8px; height:8px; border-radius:50%; background:${o.isSharing ? "#a3e635" : "#6366f1"};"></span>`, d = i && !o.isHost && !o.isYou && o.userId ? `<span style="margin-left:auto; display:inline-flex; gap:4px;">
|
|
6316
|
+
<button data-idx="${a}" data-perm="code" title="Toggle code edit" style="padding:2px 6px; font-size:10px; border-radius:4px; border:1px solid ${o.canEditCode ? "#22c55e" : "#3a3a3a"}; background:${o.canEditCode ? "#052e16" : "#1a1a1a"}; color:${o.canEditCode ? "#4ade80" : "#888"}; cursor:pointer;">Code</button>
|
|
6317
|
+
<button data-idx="${a}" data-perm="board" title="Toggle whiteboard draw" style="padding:2px 6px; font-size:10px; border-radius:4px; border:1px solid ${o.canDrawBoard ? "#22c55e" : "#3a3a3a"}; background:${o.canDrawBoard ? "#052e16" : "#1a1a1a"}; color:${o.canDrawBoard ? "#4ade80" : "#888"}; cursor:pointer;">Board</button>
|
|
6318
|
+
</span>` : "";
|
|
6314
6319
|
return `<div style="font-size:12px; color:#ccc; padding:2px 0; display:flex; align-items:center; gap:6px;">
|
|
6315
|
-
|
|
6316
|
-
${
|
|
6320
|
+
${l}
|
|
6321
|
+
${h}${o.isSharing ? " · presenting" : ""}
|
|
6322
|
+
${d}
|
|
6317
6323
|
</div>`;
|
|
6318
|
-
}).join(""))
|
|
6324
|
+
}).join(""), i && this._onParticipantPermToggle && n.querySelectorAll("button[data-perm]").forEach((o) => {
|
|
6325
|
+
o.addEventListener("click", () => {
|
|
6326
|
+
const a = e[parseInt(o.getAttribute("data-idx"), 10)], c = o.getAttribute("data-perm");
|
|
6327
|
+
this._onParticipantPermToggle(a, c);
|
|
6328
|
+
});
|
|
6329
|
+
});
|
|
6330
|
+
}
|
|
6331
|
+
onParticipantPermToggle(e) {
|
|
6332
|
+
this._onParticipantPermToggle = e;
|
|
6319
6333
|
}
|
|
6320
6334
|
setPauseButtonVisible(e) {
|
|
6321
6335
|
const t = this.container && this.container.querySelector("#toggle-pause");
|
|
@@ -6609,7 +6623,7 @@ class Zr {
|
|
|
6609
6623
|
}), this.peerLabels = /* @__PURE__ */ new Map(), this.socketManager.on("existingPeers", (e) => {
|
|
6610
6624
|
e.forEach((t) => {
|
|
6611
6625
|
this.peerLabels.set(t.peerId, t.userName || t.userId), this.peerManager.callPeer(t.peerId);
|
|
6612
|
-
});
|
|
6626
|
+
}), this.refreshParticipantsPanel();
|
|
6613
6627
|
}), this.socketManager.on("userJoined", (e) => {
|
|
6614
6628
|
this.peerLabels.set(e.peerId, e.userName || e.userId), this.uiManager.updateVideoStreamLabel(e.peerId, e.userName || e.userId), this.peerManager.callPeer(e.peerId), this.refreshParticipantsPanel();
|
|
6615
6629
|
}), this.socketManager.on("userLeft", (e) => {
|
|
@@ -6663,18 +6677,28 @@ class Zr {
|
|
|
6663
6677
|
const e = [];
|
|
6664
6678
|
if (this.currentUser && e.push({
|
|
6665
6679
|
label: this.currentUser.name || "You",
|
|
6680
|
+
userId: this.currentUser.id,
|
|
6666
6681
|
isYou: !0,
|
|
6667
6682
|
isHost: this.myRole === "organizer",
|
|
6668
6683
|
isSharing: this.peerManager && this.peerManager.isScreenSharing && this.peerManager.isScreenSharing()
|
|
6669
|
-
}), this.peerLabels)
|
|
6670
|
-
|
|
6684
|
+
}), this.peerLabels) {
|
|
6685
|
+
const t = `${this.config.workspace}-${this.currentRoom}-`;
|
|
6686
|
+
for (const [n, s] of this.peerLabels.entries()) {
|
|
6687
|
+
const i = n.startsWith(t) ? n.slice(t.length) : n;
|
|
6671
6688
|
e.push({
|
|
6672
|
-
label:
|
|
6689
|
+
label: s,
|
|
6690
|
+
userId: i,
|
|
6673
6691
|
isYou: !1,
|
|
6674
|
-
isHost: this.hostPeerId ===
|
|
6675
|
-
isSharing: this.presentingPeerId ===
|
|
6692
|
+
isHost: this.hostPeerId === n,
|
|
6693
|
+
isSharing: this.presentingPeerId === n,
|
|
6694
|
+
canEditCode: this.codePermsByUser ? !!this.codePermsByUser.get(i) : !1,
|
|
6695
|
+
canDrawBoard: this.boardPermsByUser ? !!this.boardPermsByUser.get(i) : !1
|
|
6676
6696
|
});
|
|
6677
|
-
|
|
6697
|
+
}
|
|
6698
|
+
}
|
|
6699
|
+
this.uiManager.setParticipants(e, {
|
|
6700
|
+
showControls: this.myRole === "organizer"
|
|
6701
|
+
});
|
|
6678
6702
|
}
|
|
6679
6703
|
waitForRole(e = 3e3) {
|
|
6680
6704
|
return this.myRole ? Promise.resolve(this.myRole) : new Promise((t) => {
|
|
@@ -6716,7 +6740,17 @@ class Zr {
|
|
|
6716
6740
|
}).catch((s) => console.warn("Chat history fetch failed:", s && s.message)), console.log("MeetSDK mounted");
|
|
6717
6741
|
}
|
|
6718
6742
|
setupCollabPanels() {
|
|
6719
|
-
if (this.uiManager && !this.uiManager._panelWired && (this.uiManager.wirePanelTabs(), this.uiManager._panelWired = !0), this.
|
|
6743
|
+
if (this.uiManager && !this.uiManager._panelWired && (this.uiManager.wirePanelTabs(), this.uiManager._panelWired = !0), this.codePermsByUser = this.codePermsByUser || /* @__PURE__ */ new Map(), this.boardPermsByUser = this.boardPermsByUser || /* @__PURE__ */ new Map(), this.uiManager && this.uiManager.onParticipantPermToggle && this.uiManager.onParticipantPermToggle((e, t) => {
|
|
6744
|
+
if (!(this.myRole !== "organizer" || !e || !e.userId)) {
|
|
6745
|
+
if (t === "code") {
|
|
6746
|
+
const n = !this.codePermsByUser.get(e.userId);
|
|
6747
|
+
this.grantCodeEdit(e.userId, e.label, n);
|
|
6748
|
+
} else if (t === "board") {
|
|
6749
|
+
const n = !this.boardPermsByUser.get(e.userId);
|
|
6750
|
+
this.grantWhiteboardDraw(e.userId, e.label, n);
|
|
6751
|
+
}
|
|
6752
|
+
}
|
|
6753
|
+
}), this.config.panels.includes("code")) {
|
|
6720
6754
|
const e = this.uiManager.getPanelSlot("code");
|
|
6721
6755
|
e && (this.codeSandbox = new Jr({
|
|
6722
6756
|
container: e,
|
|
@@ -6735,14 +6769,16 @@ class Zr {
|
|
|
6735
6769
|
if (t && Array.isArray(t.editPermissions)) {
|
|
6736
6770
|
const n = t.editPermissions.find((s) => s.userId === this.currentUser.id);
|
|
6737
6771
|
this._codeEditPermission = !!(n && n.canEdit);
|
|
6772
|
+
for (const s of t.editPermissions) this.codePermsByUser.set(s.userId, !!s.canEdit);
|
|
6738
6773
|
}
|
|
6739
|
-
this.codeSandbox.handleStateSync(t);
|
|
6774
|
+
this.codeSandbox.handleStateSync(t), this.refreshParticipantsPanel();
|
|
6740
6775
|
}), this.socketManager.onRaw("code-permission-changed", (t) => {
|
|
6741
|
-
if (t && t.targetUserId === this.currentUser.id && (this._codeEditPermission = !!t.canEdit), Array.isArray(t && t.editPermissions)) {
|
|
6776
|
+
if (t && t.targetUserId === this.currentUser.id && (this._codeEditPermission = !!t.canEdit), t && t.targetUserId && this.codePermsByUser.set(t.targetUserId, !!t.canEdit), Array.isArray(t && t.editPermissions)) {
|
|
6742
6777
|
const n = t.editPermissions.find((s) => s.userId === this.currentUser.id);
|
|
6743
6778
|
n && (this._codeEditPermission = !!n.canEdit);
|
|
6779
|
+
for (const s of t.editPermissions) this.codePermsByUser.set(s.userId, !!s.canEdit);
|
|
6744
6780
|
}
|
|
6745
|
-
this.codeSandbox.refreshPermissionUI();
|
|
6781
|
+
this.codeSandbox.refreshPermissionUI(), this.refreshParticipantsPanel();
|
|
6746
6782
|
}), this.socketManager.emit("code-state-request", { roomId: this.currentRoom }));
|
|
6747
6783
|
}
|
|
6748
6784
|
if (this.config.panels.includes("whiteboard")) {
|
|
@@ -6763,14 +6799,16 @@ class Zr {
|
|
|
6763
6799
|
if (t && Array.isArray(t.drawPermissions)) {
|
|
6764
6800
|
const n = t.drawPermissions.find((s) => s.userId === this.currentUser.id);
|
|
6765
6801
|
this._whiteboardDrawPermission = !!(n && n.canDraw);
|
|
6802
|
+
for (const s of t.drawPermissions) this.boardPermsByUser.set(s.userId, !!s.canDraw);
|
|
6766
6803
|
}
|
|
6767
|
-
this.whiteboard.handleStateSync(t);
|
|
6804
|
+
this.whiteboard.handleStateSync(t), this.refreshParticipantsPanel();
|
|
6768
6805
|
}), this.socketManager.onRaw("whiteboard-permission-changed", (t) => {
|
|
6769
|
-
if (t && t.targetUserId === this.currentUser.id && (this._whiteboardDrawPermission = !!t.canDraw), Array.isArray(t && t.drawPermissions)) {
|
|
6806
|
+
if (t && t.targetUserId === this.currentUser.id && (this._whiteboardDrawPermission = !!t.canDraw), t && t.targetUserId && this.boardPermsByUser.set(t.targetUserId, !!t.canDraw), Array.isArray(t && t.drawPermissions)) {
|
|
6770
6807
|
const n = t.drawPermissions.find((s) => s.userId === this.currentUser.id);
|
|
6771
6808
|
n && (this._whiteboardDrawPermission = !!n.canDraw);
|
|
6809
|
+
for (const s of t.drawPermissions) this.boardPermsByUser.set(s.userId, !!s.canDraw);
|
|
6772
6810
|
}
|
|
6773
|
-
this.whiteboard.refreshPermissionUI();
|
|
6811
|
+
this.whiteboard.refreshPermissionUI(), this.refreshParticipantsPanel();
|
|
6774
6812
|
}), this.socketManager.emit("whiteboard-state-request", { roomId: this.currentRoom }));
|
|
6775
6813
|
}
|
|
6776
6814
|
}
|