hanc-webrtc-widgets 1.3.1 → 1.3.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/hanc-webrtc-widgets.es.js +192 -192
- package/dist/hanc-webrtc-widgets.umd.js +10 -10
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
6
|
const ei = globalThis, qn = ei.ShadowRoot && (ei.ShadyCSS === void 0 || ei.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, $n = Symbol(), ms = /* @__PURE__ */ new WeakMap();
|
|
7
|
-
let
|
|
7
|
+
let wr = class {
|
|
8
8
|
constructor(e, t, i) {
|
|
9
9
|
if (this._$cssResult$ = !0, i !== $n) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
10
10
|
this.cssText = e, this.t = t;
|
|
@@ -22,13 +22,13 @@ let Rr = class {
|
|
|
22
22
|
return this.cssText;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
const Io = (n) => new
|
|
25
|
+
const Io = (n) => new wr(typeof n == "string" ? n : n + "", void 0, $n), Hn = (n, ...e) => {
|
|
26
26
|
const t = n.length === 1 ? n[0] : e.reduce((i, s, r) => i + ((a) => {
|
|
27
27
|
if (a._$cssResult$ === !0) return a.cssText;
|
|
28
28
|
if (typeof a == "number") return a;
|
|
29
29
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + a + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
30
30
|
})(s) + n[r + 1], n[0]);
|
|
31
|
-
return new
|
|
31
|
+
return new wr(t, n, $n);
|
|
32
32
|
}, xo = (n, e) => {
|
|
33
33
|
if (qn) n.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
34
34
|
else for (const t of e) {
|
|
@@ -540,8 +540,8 @@ let gt = class extends ht {
|
|
|
540
540
|
return Ct;
|
|
541
541
|
}
|
|
542
542
|
};
|
|
543
|
-
var
|
|
544
|
-
gt._$litElement$ = !0, gt.finalized = !0, (
|
|
543
|
+
var Rr;
|
|
544
|
+
gt._$litElement$ = !0, gt.finalized = !0, (Rr = globalThis.litElementHydrateSupport) == null || Rr.call(globalThis, { LitElement: gt });
|
|
545
545
|
const qi = globalThis.litElementPolyfillSupport;
|
|
546
546
|
qi == null || qi({ LitElement: gt });
|
|
547
547
|
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.1");
|
|
@@ -1045,7 +1045,7 @@ function Vr(n, e) {
|
|
|
1045
1045
|
const t = n & 16777215, i = (n >>> 24 | e << 8) & 16777215, s = e >> 16 & 65535;
|
|
1046
1046
|
let r = t + i * 6777216 + s * 6710656, a = i + s * 8147497, o = s * 2;
|
|
1047
1047
|
const c = 1e7;
|
|
1048
|
-
return r >= c && (a += Math.floor(r / c), r %= c), a >= c && (o += Math.floor(a / c), a %= c), o.toString() +
|
|
1048
|
+
return r >= c && (a += Math.floor(r / c), r %= c), a >= c && (o += Math.floor(a / c), a %= c), o.toString() + Rs(a) + Rs(r);
|
|
1049
1049
|
}
|
|
1050
1050
|
function lc(n, e) {
|
|
1051
1051
|
return {
|
|
@@ -1062,11 +1062,11 @@ function Wn(n, e) {
|
|
|
1062
1062
|
function qr(n, e) {
|
|
1063
1063
|
return e = ~e, n ? n = ~n + 1 : e += 1, Wn(n, e);
|
|
1064
1064
|
}
|
|
1065
|
-
const
|
|
1065
|
+
const Rs = (n) => {
|
|
1066
1066
|
const e = String(n);
|
|
1067
1067
|
return "0000000".slice(e.length) + e;
|
|
1068
1068
|
};
|
|
1069
|
-
function
|
|
1069
|
+
function ws(n, e) {
|
|
1070
1070
|
if (n >= 0) {
|
|
1071
1071
|
for (; n > 127; )
|
|
1072
1072
|
e.push(n & 127 | 128), n = n >>> 7;
|
|
@@ -1287,7 +1287,7 @@ class fc {
|
|
|
1287
1287
|
* Write a `int32` value, a signed 32 bit varint.
|
|
1288
1288
|
*/
|
|
1289
1289
|
int32(e) {
|
|
1290
|
-
return ti(e),
|
|
1290
|
+
return ti(e), ws(e, this.buf), this;
|
|
1291
1291
|
}
|
|
1292
1292
|
/**
|
|
1293
1293
|
* Write a `bool` value, a variant.
|
|
@@ -1343,7 +1343,7 @@ class fc {
|
|
|
1343
1343
|
* Write a `sint32` value, a signed, zigzag-encoded 32-bit varint.
|
|
1344
1344
|
*/
|
|
1345
1345
|
sint32(e) {
|
|
1346
|
-
return ti(e), e = (e << 1 ^ e >> 31) >>> 0,
|
|
1346
|
+
return ti(e), e = (e << 1 ^ e >> 31) >>> 0, ws(e, this.buf), this;
|
|
1347
1347
|
}
|
|
1348
1348
|
/**
|
|
1349
1349
|
* Write a `fixed64` value, a signed, fixed-length 64-bit integer.
|
|
@@ -2143,7 +2143,7 @@ function Pc(n) {
|
|
|
2143
2143
|
function _c(n) {
|
|
2144
2144
|
return n ? Object.assign(Object.assign({}, Ns), n) : Ns;
|
|
2145
2145
|
}
|
|
2146
|
-
function
|
|
2146
|
+
function Rc() {
|
|
2147
2147
|
return {
|
|
2148
2148
|
makeReadOptions: Pc,
|
|
2149
2149
|
makeWriteOptions: _c,
|
|
@@ -2229,7 +2229,7 @@ function Ls(n, e, t, i, s) {
|
|
|
2229
2229
|
r ? n[a].push(ri(e, new d(), s, t)) : Ae(n[a]) ? ri(e, n[a], s, t) : (n[a] = ri(e, new d(), s, t), d.fieldWrapper && !t.oneof && !t.repeated && (n[a] = d.fieldWrapper.unwrapField(n[a])));
|
|
2230
2230
|
break;
|
|
2231
2231
|
case "map":
|
|
2232
|
-
let [l, u] =
|
|
2232
|
+
let [l, u] = wc(t, e, s);
|
|
2233
2233
|
n[a][l] = u;
|
|
2234
2234
|
break;
|
|
2235
2235
|
}
|
|
@@ -2245,7 +2245,7 @@ function ri(n, e, t, i) {
|
|
|
2245
2245
|
r
|
|
2246
2246
|
), e;
|
|
2247
2247
|
}
|
|
2248
|
-
function
|
|
2248
|
+
function wc(n, e, t) {
|
|
2249
2249
|
const i = e.uint32(), s = e.pos + i;
|
|
2250
2250
|
let r, a;
|
|
2251
2251
|
for (; e.pos < s; ) {
|
|
@@ -2577,7 +2577,7 @@ function Dc(n, e, t) {
|
|
|
2577
2577
|
return {
|
|
2578
2578
|
syntax: n,
|
|
2579
2579
|
json: Sc(),
|
|
2580
|
-
bin:
|
|
2580
|
+
bin: Rc(),
|
|
2581
2581
|
util: Object.assign(Object.assign({}, Ac()), {
|
|
2582
2582
|
newFieldList: e,
|
|
2583
2583
|
initFields: t
|
|
@@ -4385,7 +4385,7 @@ const $c = /* @__PURE__ */ g.makeMessageType("livekit.MetricsBatch", () => [{
|
|
|
4385
4385
|
no: 6,
|
|
4386
4386
|
name: "subscription",
|
|
4387
4387
|
kind: "message",
|
|
4388
|
-
T:
|
|
4388
|
+
T: Ri,
|
|
4389
4389
|
oneof: "message"
|
|
4390
4390
|
}, {
|
|
4391
4391
|
no: 7,
|
|
@@ -4397,7 +4397,7 @@ const $c = /* @__PURE__ */ g.makeMessageType("livekit.MetricsBatch", () => [{
|
|
|
4397
4397
|
no: 8,
|
|
4398
4398
|
name: "leave",
|
|
4399
4399
|
kind: "message",
|
|
4400
|
-
T:
|
|
4400
|
+
T: wi,
|
|
4401
4401
|
oneof: "message"
|
|
4402
4402
|
}, {
|
|
4403
4403
|
no: 10,
|
|
@@ -4493,7 +4493,7 @@ const $c = /* @__PURE__ */ g.makeMessageType("livekit.MetricsBatch", () => [{
|
|
|
4493
4493
|
no: 8,
|
|
4494
4494
|
name: "leave",
|
|
4495
4495
|
kind: "message",
|
|
4496
|
-
T:
|
|
4496
|
+
T: wi,
|
|
4497
4497
|
oneof: "message"
|
|
4498
4498
|
}, {
|
|
4499
4499
|
no: 9,
|
|
@@ -4879,7 +4879,7 @@ const $c = /* @__PURE__ */ g.makeMessageType("livekit.MetricsBatch", () => [{
|
|
|
4879
4879
|
kind: "message",
|
|
4880
4880
|
T: st,
|
|
4881
4881
|
repeated: !0
|
|
4882
|
-
}]),
|
|
4882
|
+
}]), Ri = /* @__PURE__ */ g.makeMessageType("livekit.UpdateSubscription", () => [{
|
|
4883
4883
|
no: 1,
|
|
4884
4884
|
name: "track_sids",
|
|
4885
4885
|
kind: "scalar",
|
|
@@ -4968,7 +4968,7 @@ const $c = /* @__PURE__ */ g.makeMessageType("livekit.MetricsBatch", () => [{
|
|
|
4968
4968
|
kind: "scalar",
|
|
4969
4969
|
T: 13
|
|
4970
4970
|
/* ScalarType.UINT32 */
|
|
4971
|
-
}]),
|
|
4971
|
+
}]), wi = /* @__PURE__ */ g.makeMessageType("livekit.LeaveRequest", () => [{
|
|
4972
4972
|
no: 1,
|
|
4973
4973
|
name: "can_reconnect",
|
|
4974
4974
|
kind: "scalar",
|
|
@@ -5239,7 +5239,7 @@ const $c = /* @__PURE__ */ g.makeMessageType("livekit.MetricsBatch", () => [{
|
|
|
5239
5239
|
no: 2,
|
|
5240
5240
|
name: "subscription",
|
|
5241
5241
|
kind: "message",
|
|
5242
|
-
T:
|
|
5242
|
+
T: Ri
|
|
5243
5243
|
}, {
|
|
5244
5244
|
no: 3,
|
|
5245
5245
|
name: "publish_tracks",
|
|
@@ -5451,7 +5451,7 @@ function Pd(n) {
|
|
|
5451
5451
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
5452
5452
|
}
|
|
5453
5453
|
var ai = { exports: {} }, _d = ai.exports, Vs;
|
|
5454
|
-
function
|
|
5454
|
+
function Rd() {
|
|
5455
5455
|
return Vs || (Vs = 1, function(n) {
|
|
5456
5456
|
(function(e, t) {
|
|
5457
5457
|
n.exports ? n.exports = t() : e.log = t();
|
|
@@ -5585,7 +5585,7 @@ function wd() {
|
|
|
5585
5585
|
});
|
|
5586
5586
|
}(ai)), ai.exports;
|
|
5587
5587
|
}
|
|
5588
|
-
var Ii =
|
|
5588
|
+
var Ii = Rd(), vn;
|
|
5589
5589
|
(function(n) {
|
|
5590
5590
|
n[n.trace = 0] = "trace", n[n.debug = 1] = "debug", n[n.info = 2] = "info", n[n.warn = 3] = "warn", n[n.error = 4] = "error", n[n.silent = 5] = "silent";
|
|
5591
5591
|
})(vn || (vn = {}));
|
|
@@ -5600,7 +5600,7 @@ function Ne(n) {
|
|
|
5600
5600
|
const e = Ii.getLogger(n);
|
|
5601
5601
|
return e.setDefaultLevel(F.getLevel()), e;
|
|
5602
5602
|
}
|
|
5603
|
-
const
|
|
5603
|
+
const wd = Ii.getLogger("lk-e2ee"), Ot = 7e3, Id = [0, 300, 2 * 2 * 300, 3 * 3 * 300, 4 * 4 * 300, Ot, Ot, Ot, Ot, Ot];
|
|
5604
5604
|
class xd {
|
|
5605
5605
|
constructor(e) {
|
|
5606
5606
|
this._retryDelays = e !== void 0 ? [...e] : Id;
|
|
@@ -5882,8 +5882,8 @@ function Ad() {
|
|
|
5882
5882
|
}
|
|
5883
5883
|
return Zt.exports;
|
|
5884
5884
|
}
|
|
5885
|
-
var
|
|
5886
|
-
let
|
|
5885
|
+
var we = Ad();
|
|
5886
|
+
let Ra = !0, wa = !0;
|
|
5887
5887
|
function Ut(n, e, t) {
|
|
5888
5888
|
const i = n.match(e);
|
|
5889
5889
|
return i && i.length >= t && parseFloat(i[t], 10);
|
|
@@ -5921,20 +5921,20 @@ function ct(n, e, t) {
|
|
|
5921
5921
|
});
|
|
5922
5922
|
}
|
|
5923
5923
|
function Dd(n) {
|
|
5924
|
-
return typeof n != "boolean" ? new Error("Argument type: " + typeof n + ". Please use a boolean.") : (
|
|
5924
|
+
return typeof n != "boolean" ? new Error("Argument type: " + typeof n + ". Please use a boolean.") : (Ra = n, n ? "adapter.js logging disabled" : "adapter.js logging enabled");
|
|
5925
5925
|
}
|
|
5926
5926
|
function Md(n) {
|
|
5927
|
-
return typeof n != "boolean" ? new Error("Argument type: " + typeof n + ". Please use a boolean.") : (
|
|
5927
|
+
return typeof n != "boolean" ? new Error("Argument type: " + typeof n + ". Please use a boolean.") : (wa = !n, "adapter.js deprecation warnings " + (n ? "disabled" : "enabled"));
|
|
5928
5928
|
}
|
|
5929
5929
|
function Ia() {
|
|
5930
5930
|
if (typeof window == "object") {
|
|
5931
|
-
if (
|
|
5931
|
+
if (Ra)
|
|
5932
5932
|
return;
|
|
5933
5933
|
typeof console < "u" && typeof console.log == "function" && console.log.apply(console, arguments);
|
|
5934
5934
|
}
|
|
5935
5935
|
}
|
|
5936
5936
|
function ts(n, e) {
|
|
5937
|
-
|
|
5937
|
+
wa && console.warn(n + " is deprecated, please use " + e + " instead.");
|
|
5938
5938
|
}
|
|
5939
5939
|
function Nd(n) {
|
|
5940
5940
|
const e = {
|
|
@@ -7434,7 +7434,7 @@ function zd() {
|
|
|
7434
7434
|
return typeof window.RTCRtpSender < "u" && // @ts-ignore
|
|
7435
7435
|
typeof window.RTCRtpSender.prototype.createEncodedStreams < "u";
|
|
7436
7436
|
}
|
|
7437
|
-
class Wu extends
|
|
7437
|
+
class Wu extends we.EventEmitter {
|
|
7438
7438
|
constructor() {
|
|
7439
7439
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
7440
7440
|
super(), this.onKeyRatcheted = (t, i, s) => {
|
|
@@ -7548,14 +7548,14 @@ var C;
|
|
|
7548
7548
|
(function(n) {
|
|
7549
7549
|
n.Connected = "connected", n.Reconnecting = "reconnecting", n.SignalReconnecting = "signalReconnecting", n.Reconnected = "reconnected", n.Disconnected = "disconnected", n.ConnectionStateChanged = "connectionStateChanged", n.Moved = "moved", n.MediaDevicesChanged = "mediaDevicesChanged", n.ParticipantConnected = "participantConnected", n.ParticipantDisconnected = "participantDisconnected", n.TrackPublished = "trackPublished", n.TrackSubscribed = "trackSubscribed", n.TrackSubscriptionFailed = "trackSubscriptionFailed", n.TrackUnpublished = "trackUnpublished", n.TrackUnsubscribed = "trackUnsubscribed", n.TrackMuted = "trackMuted", n.TrackUnmuted = "trackUnmuted", n.LocalTrackPublished = "localTrackPublished", n.LocalTrackUnpublished = "localTrackUnpublished", n.LocalAudioSilenceDetected = "localAudioSilenceDetected", n.ActiveSpeakersChanged = "activeSpeakersChanged", n.ParticipantMetadataChanged = "participantMetadataChanged", n.ParticipantNameChanged = "participantNameChanged", n.ParticipantAttributesChanged = "participantAttributesChanged", n.ParticipantActive = "participantActive", n.RoomMetadataChanged = "roomMetadataChanged", n.DataReceived = "dataReceived", n.SipDTMFReceived = "sipDTMFReceived", n.TranscriptionReceived = "transcriptionReceived", n.ConnectionQualityChanged = "connectionQualityChanged", n.TrackStreamStateChanged = "trackStreamStateChanged", n.TrackSubscriptionPermissionChanged = "trackSubscriptionPermissionChanged", n.TrackSubscriptionStatusChanged = "trackSubscriptionStatusChanged", n.AudioPlaybackStatusChanged = "audioPlaybackChanged", n.VideoPlaybackStatusChanged = "videoPlaybackChanged", n.MediaDevicesError = "mediaDevicesError", n.ParticipantPermissionsChanged = "participantPermissionsChanged", n.SignalConnected = "signalConnected", n.RecordingStatusChanged = "recordingStatusChanged", n.ParticipantEncryptionStatusChanged = "participantEncryptionStatusChanged", n.EncryptionError = "encryptionError", n.DCBufferStatusChanged = "dcBufferStatusChanged", n.ActiveDeviceChanged = "activeDeviceChanged", n.ChatMessage = "chatMessage", n.LocalTrackSubscribed = "localTrackSubscribed", n.MetricsReceived = "metricsReceived";
|
|
7550
7550
|
})(C || (C = {}));
|
|
7551
|
-
var
|
|
7551
|
+
var R;
|
|
7552
7552
|
(function(n) {
|
|
7553
7553
|
n.TrackPublished = "trackPublished", n.TrackSubscribed = "trackSubscribed", n.TrackSubscriptionFailed = "trackSubscriptionFailed", n.TrackUnpublished = "trackUnpublished", n.TrackUnsubscribed = "trackUnsubscribed", n.TrackMuted = "trackMuted", n.TrackUnmuted = "trackUnmuted", n.LocalTrackPublished = "localTrackPublished", n.LocalTrackUnpublished = "localTrackUnpublished", n.LocalTrackCpuConstrained = "localTrackCpuConstrained", n.LocalSenderCreated = "localSenderCreated", n.ParticipantMetadataChanged = "participantMetadataChanged", n.ParticipantNameChanged = "participantNameChanged", n.DataReceived = "dataReceived", n.SipDTMFReceived = "sipDTMFReceived", n.TranscriptionReceived = "transcriptionReceived", n.IsSpeakingChanged = "isSpeakingChanged", n.ConnectionQualityChanged = "connectionQualityChanged", n.TrackStreamStateChanged = "trackStreamStateChanged", n.TrackSubscriptionPermissionChanged = "trackSubscriptionPermissionChanged", n.TrackSubscriptionStatusChanged = "trackSubscriptionStatusChanged", n.TrackCpuConstrained = "trackCpuConstrained", n.MediaDevicesError = "mediaDevicesError", n.AudioStreamAcquired = "audioStreamAcquired", n.ParticipantPermissionsChanged = "participantPermissionsChanged", n.PCTrackAdded = "pcTrackAdded", n.AttributesChanged = "attributesChanged", n.LocalTrackSubscribed = "localTrackSubscribed", n.ChatMessage = "chatMessage", n.Active = "active";
|
|
7554
|
-
})(
|
|
7555
|
-
var
|
|
7554
|
+
})(R || (R = {}));
|
|
7555
|
+
var w;
|
|
7556
7556
|
(function(n) {
|
|
7557
7557
|
n.TransportsCreated = "transportsCreated", n.Connected = "connected", n.Disconnected = "disconnected", n.Resuming = "resuming", n.Resumed = "resumed", n.Restarting = "restarting", n.Restarted = "restarted", n.SignalResumed = "signalResumed", n.SignalRestarted = "signalRestarted", n.Closing = "closing", n.MediaTrackAdded = "mediaTrackAdded", n.ActiveSpeakersUpdate = "activeSpeakersUpdate", n.DataPacketReceived = "dataPacketReceived", n.RTPVideoMapUpdate = "rtpVideoMapUpdate", n.DCBufferStatusChanged = "dcBufferStatusChanged", n.ParticipantUpdate = "participantUpdate", n.RoomUpdate = "roomUpdate", n.SpeakersChanged = "speakersChanged", n.StreamStateChanged = "streamStateChanged", n.ConnectionQualityUpdate = "connectionQualityUpdate", n.SubscriptionError = "subscriptionError", n.SubscriptionPermissionUpdate = "subscriptionPermissionUpdate", n.RemoteMute = "remoteMute", n.SubscribedQualityUpdate = "subscribedQualityUpdate", n.LocalTrackUnpublished = "localTrackUnpublished", n.LocalTrackSubscribed = "localTrackSubscribed", n.Offline = "offline", n.SignalRequestResponse = "signalRequestResponse", n.SignalConnected = "signalConnected", n.RoomMoved = "roomMoved";
|
|
7558
|
-
})(
|
|
7558
|
+
})(w || (w = {}));
|
|
7559
7559
|
var _;
|
|
7560
7560
|
(function(n) {
|
|
7561
7561
|
n.Message = "message", n.Muted = "muted", n.Unmuted = "unmuted", n.Restarted = "restarted", n.Ended = "ended", n.Subscribed = "subscribed", n.Unsubscribed = "unsubscribed", n.CpuConstrained = "cpuConstrained", n.UpdateSettings = "updateSettings", n.UpdateSubscription = "updateSubscription", n.AudioPlaybackStarted = "audioPlaybackStarted", n.AudioPlaybackFailed = "audioPlaybackFailed", n.AudioSilenceDetected = "audioSilenceDetected", n.VisibilityChanged = "visibilityChanged", n.VideoDimensionsChanged = "videoDimensionsChanged", n.VideoPlaybackStarted = "videoPlaybackStarted", n.VideoPlaybackFailed = "videoPlaybackFailed", n.ElementAttached = "elementAttached", n.ElementDetached = "elementDetached", n.UpstreamPaused = "upstreamPaused", n.UpstreamResumed = "upstreamResumed", n.SubscriptionPermissionChanged = "subscriptionPermissionChanged", n.SubscriptionStatusChanged = "subscriptionStatusChanged", n.SubscriptionFailed = "subscriptionFailed", n.TrackProcessorUpdate = "trackProcessorUpdate", n.AudioTrackFeatureUpdate = "audioTrackFeatureUpdate", n.TranscriptionReceived = "transcriptionReceived", n.TimeSyncUpdate = "timeSyncUpdate", n.PreConnectBufferFlushed = "preConnectBufferFlushed";
|
|
@@ -7647,7 +7647,7 @@ var de;
|
|
|
7647
7647
|
(function(n) {
|
|
7648
7648
|
n[n.LOW = 0] = "LOW", n[n.MEDIUM = 1] = "MEDIUM", n[n.HIGH = 2] = "HIGH";
|
|
7649
7649
|
})(de || (de = {}));
|
|
7650
|
-
class k extends
|
|
7650
|
+
class k extends we.EventEmitter {
|
|
7651
7651
|
/**
|
|
7652
7652
|
* indicates current state of stream, it'll indicate `paused` if the track
|
|
7653
7653
|
* has been paused by congestion controller
|
|
@@ -7905,7 +7905,7 @@ const Jt = {
|
|
|
7905
7905
|
h1080: new q(1920, 1080, 3e6, 30),
|
|
7906
7906
|
h1440: new q(2560, 1440, 5e6, 30),
|
|
7907
7907
|
h2160: new q(3840, 2160, 8e6, 30)
|
|
7908
|
-
},
|
|
7908
|
+
}, Rn = {
|
|
7909
7909
|
h120: new q(160, 120, 7e4, 20),
|
|
7910
7910
|
h180: new q(240, 180, 125e3, 20),
|
|
7911
7911
|
h240: new q(320, 240, 14e4, 20),
|
|
@@ -7935,7 +7935,7 @@ function oe(n) {
|
|
|
7935
7935
|
return new Promise((e) => te.setTimeout(e, n));
|
|
7936
7936
|
});
|
|
7937
7937
|
}
|
|
7938
|
-
function
|
|
7938
|
+
function wn() {
|
|
7939
7939
|
return "addTransceiver" in RTCPeerConnection.prototype;
|
|
7940
7940
|
}
|
|
7941
7941
|
function In() {
|
|
@@ -7981,7 +7981,7 @@ function xn(n) {
|
|
|
7981
7981
|
return !document || Qt() ? !1 : (n || (n = document.createElement("audio")), "setSinkId" in n);
|
|
7982
7982
|
}
|
|
7983
7983
|
function ol() {
|
|
7984
|
-
return typeof RTCPeerConnection > "u" ? !1 :
|
|
7984
|
+
return typeof RTCPeerConnection > "u" ? !1 : wn() || In();
|
|
7985
7985
|
}
|
|
7986
7986
|
function at() {
|
|
7987
7987
|
var n;
|
|
@@ -8438,11 +8438,11 @@ function _l(n) {
|
|
|
8438
8438
|
function dr(n, e) {
|
|
8439
8439
|
return n.width * n.height < e.width * e.height;
|
|
8440
8440
|
}
|
|
8441
|
-
function
|
|
8441
|
+
function Rl(n, e) {
|
|
8442
8442
|
var t;
|
|
8443
8443
|
return (t = n.layers) === null || t === void 0 ? void 0 : t.find((i) => i.quality === e);
|
|
8444
8444
|
}
|
|
8445
|
-
class
|
|
8445
|
+
class wl extends we.EventEmitter {
|
|
8446
8446
|
constructor(e) {
|
|
8447
8447
|
super(), this.onWorkerMessage = (t) => {
|
|
8448
8448
|
var i, s;
|
|
@@ -8493,7 +8493,7 @@ class Rl extends Re.EventEmitter {
|
|
|
8493
8493
|
kind: "init",
|
|
8494
8494
|
data: {
|
|
8495
8495
|
keyProviderOptions: this.keyProvider.getOptions(),
|
|
8496
|
-
loglevel:
|
|
8496
|
+
loglevel: wd.getLevel()
|
|
8497
8497
|
}
|
|
8498
8498
|
};
|
|
8499
8499
|
this.worker && (F.info("initializing worker", {
|
|
@@ -8514,7 +8514,7 @@ class Rl extends Re.EventEmitter {
|
|
|
8514
8514
|
!e || e.length === 0 ? F.warn("ignoring server sent trailer as it's empty") : this.postSifTrailer(e);
|
|
8515
8515
|
}
|
|
8516
8516
|
setupEngine(e) {
|
|
8517
|
-
e.on(
|
|
8517
|
+
e.on(w.RTPVideoMapUpdate, (t) => {
|
|
8518
8518
|
this.postRTPMap(t);
|
|
8519
8519
|
});
|
|
8520
8520
|
}
|
|
@@ -8543,9 +8543,9 @@ class Rl extends Re.EventEmitter {
|
|
|
8543
8543
|
t.getKeys().forEach((i) => {
|
|
8544
8544
|
this.postKey(i);
|
|
8545
8545
|
}), this.setParticipantCryptorEnabled(this.room.localParticipant.isE2EEEnabled, this.room.localParticipant.identity);
|
|
8546
|
-
}), e.localParticipant.on(
|
|
8546
|
+
}), e.localParticipant.on(R.LocalSenderCreated, (i, s) => f(this, void 0, void 0, function* () {
|
|
8547
8547
|
this.setupE2EESender(s, i);
|
|
8548
|
-
})), e.localParticipant.on(
|
|
8548
|
+
})), e.localParticipant.on(R.LocalTrackPublished, (i) => {
|
|
8549
8549
|
if (!Qe(i.track) || !Qt())
|
|
8550
8550
|
return;
|
|
8551
8551
|
const s = {
|
|
@@ -9127,7 +9127,7 @@ class rs {
|
|
|
9127
9127
|
sendLeave() {
|
|
9128
9128
|
return this.sendRequest({
|
|
9129
9129
|
case: "leave",
|
|
9130
|
-
value: new
|
|
9130
|
+
value: new wi({
|
|
9131
9131
|
reason: ve.CLIENT_INITIATED,
|
|
9132
9132
|
// server doesn't process this field, keeping it here to indicate the intent of a full disconnect
|
|
9133
9133
|
action: bt.DISCONNECT
|
|
@@ -9995,7 +9995,7 @@ const Bl = 0.7, Vl = 20, St = {
|
|
|
9995
9995
|
NegotiationComplete: "negotiationComplete",
|
|
9996
9996
|
RTPVideoPayloadTypes: "rtpVideoPayloadTypes"
|
|
9997
9997
|
};
|
|
9998
|
-
class gr extends
|
|
9998
|
+
class gr extends we.EventEmitter {
|
|
9999
9999
|
get pc() {
|
|
10000
10000
|
return this._pc || (this._pc = this.createPC()), this._pc;
|
|
10001
10001
|
}
|
|
@@ -11222,7 +11222,7 @@ function Xl(n, e, t) {
|
|
|
11222
11222
|
throw new Me("unsupported track type: ".concat(n.kind));
|
|
11223
11223
|
}
|
|
11224
11224
|
}
|
|
11225
|
-
const Zl = Object.values(Jt), eu = Object.values(
|
|
11225
|
+
const Zl = Object.values(Jt), eu = Object.values(Rn), tu = Object.values(ns), iu = [Jt.h180, Jt.h360], nu = [Rn.h180, Rn.h360], su = (n) => [{
|
|
11226
11226
|
scaleResolutionDownBy: 2,
|
|
11227
11227
|
fps: n.encoding.maxFramerate
|
|
11228
11228
|
}].map((t) => {
|
|
@@ -11872,7 +11872,7 @@ var he;
|
|
|
11872
11872
|
(function(n) {
|
|
11873
11873
|
n[n.New = 0] = "New", n[n.Connected = 1] = "Connected", n[n.Disconnected = 2] = "Disconnected", n[n.Reconnecting = 3] = "Reconnecting", n[n.Closed = 4] = "Closed";
|
|
11874
11874
|
})(he || (he = {}));
|
|
11875
|
-
class hu extends
|
|
11875
|
+
class hu extends we.EventEmitter {
|
|
11876
11876
|
get isClosed() {
|
|
11877
11877
|
return this._isClosed;
|
|
11878
11878
|
}
|
|
@@ -11919,7 +11919,7 @@ class hu extends Re.EventEmitter {
|
|
|
11919
11919
|
return;
|
|
11920
11920
|
this.reliableReceivedState.set(c.participantSid, c.sequence);
|
|
11921
11921
|
}
|
|
11922
|
-
((s = c.value) === null || s === void 0 ? void 0 : s.case) === "speaker" ? this.emit(
|
|
11922
|
+
((s = c.value) === null || s === void 0 ? void 0 : s.case) === "speaker" ? this.emit(w.ActiveSpeakersUpdate, c.value.value.speakers) : (((r = c.value) === null || r === void 0 ? void 0 : r.case) === "user" && pu(c, c.value.value), this.emit(w.DataPacketReceived, c));
|
|
11923
11923
|
} finally {
|
|
11924
11924
|
a();
|
|
11925
11925
|
}
|
|
@@ -11944,7 +11944,7 @@ class hu extends Re.EventEmitter {
|
|
|
11944
11944
|
return;
|
|
11945
11945
|
this.log.warn("".concat(i, " disconnected"), this.logContext), this.reconnectAttempts === 0 && (this.reconnectStart = Date.now());
|
|
11946
11946
|
const r = (c) => {
|
|
11947
|
-
this.log.warn("could not recover connection after ".concat(this.reconnectAttempts, " attempts, ").concat(c, "ms. giving up"), this.logContext), this.emit(
|
|
11947
|
+
this.log.warn("could not recover connection after ".concat(this.reconnectAttempts, " attempts, ").concat(c, "ms. giving up"), this.logContext), this.emit(w.Disconnected), this.close();
|
|
11948
11948
|
}, a = Date.now() - this.reconnectStart;
|
|
11949
11949
|
let o = this.getNextRetryDelay({
|
|
11950
11950
|
elapsedMs: a,
|
|
@@ -11958,14 +11958,14 @@ class hu extends Re.EventEmitter {
|
|
|
11958
11958
|
}, this.waitForRestarted = () => new Promise((i, s) => {
|
|
11959
11959
|
this.pcState === he.Connected && i();
|
|
11960
11960
|
const r = () => {
|
|
11961
|
-
this.off(
|
|
11961
|
+
this.off(w.Disconnected, a), i();
|
|
11962
11962
|
}, a = () => {
|
|
11963
|
-
this.off(
|
|
11963
|
+
this.off(w.Restarted, r), s();
|
|
11964
11964
|
};
|
|
11965
|
-
this.once(
|
|
11965
|
+
this.once(w.Restarted, r), this.once(w.Disconnected, a);
|
|
11966
11966
|
}), this.updateAndEmitDCBufferStatus = (i) => {
|
|
11967
11967
|
const s = this.isBufferStatusLow(i);
|
|
11968
|
-
typeof s < "u" && s !== this.dcBufferStatus.get(i) && (this.dcBufferStatus.set(i, s), this.emit(
|
|
11968
|
+
typeof s < "u" && s !== this.dcBufferStatus.get(i) && (this.dcBufferStatus.set(i, s), this.emit(w.DCBufferStatusChanged, s, i));
|
|
11969
11969
|
}, this.isBufferStatusLow = (i) => {
|
|
11970
11970
|
const s = this.dataChannelForKind(i);
|
|
11971
11971
|
if (s)
|
|
@@ -11975,7 +11975,7 @@ class hu extends Re.EventEmitter {
|
|
|
11975
11975
|
}, this.log = Ne((t = e.loggerName) !== null && t !== void 0 ? t : be.Engine), this.loggerOptions = {
|
|
11976
11976
|
loggerName: e.loggerName,
|
|
11977
11977
|
loggerContextCb: () => this.logContext
|
|
11978
|
-
}, this.client = new rs(void 0, this.loggerOptions), this.client.signalLatency = this.options.expSignalLatency, this.reconnectPolicy = this.options.reconnectPolicy, this.registerOnLineListener(), this.closingLock = new ae(), this.dataProcessLock = new ae(), this.dcBufferStatus = /* @__PURE__ */ new Map([[L.LOSSY, !0], [L.RELIABLE, !0]]), this.client.onParticipantUpdate = (i) => this.emit(
|
|
11978
|
+
}, this.client = new rs(void 0, this.loggerOptions), this.client.signalLatency = this.options.expSignalLatency, this.reconnectPolicy = this.options.reconnectPolicy, this.registerOnLineListener(), this.closingLock = new ae(), this.dataProcessLock = new ae(), this.dcBufferStatus = /* @__PURE__ */ new Map([[L.LOSSY, !0], [L.RELIABLE, !0]]), this.client.onParticipantUpdate = (i) => this.emit(w.ParticipantUpdate, i), this.client.onConnectionQuality = (i) => this.emit(w.ConnectionQualityUpdate, i), this.client.onRoomUpdate = (i) => this.emit(w.RoomUpdate, i), this.client.onSubscriptionError = (i) => this.emit(w.SubscriptionError, i), this.client.onSubscriptionPermissionUpdate = (i) => this.emit(w.SubscriptionPermissionUpdate, i), this.client.onSpeakersChanged = (i) => this.emit(w.SpeakersChanged, i), this.client.onStreamStateUpdate = (i) => this.emit(w.StreamStateChanged, i), this.client.onRequestResponse = (i) => this.emit(w.SignalRequestResponse, i);
|
|
11979
11979
|
}
|
|
11980
11980
|
/** @internal */
|
|
11981
11981
|
get logContext() {
|
|
@@ -11993,7 +11993,7 @@ class hu extends Re.EventEmitter {
|
|
|
11993
11993
|
try {
|
|
11994
11994
|
this.joinAttempts += 1, this.setupSignalClientCallbacks();
|
|
11995
11995
|
const r = yield this.client.join(e, t, i, s);
|
|
11996
|
-
return this._isClosed = !1, this.latestJoinResponse = r, this.subscriberPrimary = r.subscriberPrimary, this.pcManager || (yield this.configure(r)), (!this.subscriberPrimary || r.fastPublish) && this.negotiate(), this.clientConfiguration = r.clientConfiguration, this.emit(
|
|
11996
|
+
return this._isClosed = !1, this.latestJoinResponse = r, this.subscriberPrimary = r.subscriberPrimary, this.pcManager || (yield this.configure(r)), (!this.subscriberPrimary || r.fastPublish) && this.negotiate(), this.clientConfiguration = r.clientConfiguration, this.emit(w.SignalConnected, r), r;
|
|
11997
11997
|
} catch (r) {
|
|
11998
11998
|
if (r instanceof $ && r.reason === j.ServerUnreachable && (this.log.warn("Couldn't connect to server, attempt ".concat(this.joinAttempts, " of ").concat(this.maxJoinAttempts), this.logContext), this.joinAttempts < this.maxJoinAttempts))
|
|
11999
11999
|
return this.join(e, t, i, s);
|
|
@@ -12009,7 +12009,7 @@ class hu extends Re.EventEmitter {
|
|
|
12009
12009
|
return;
|
|
12010
12010
|
}
|
|
12011
12011
|
try {
|
|
12012
|
-
this._isClosed = !0, this.joinAttempts = 0, this.emit(
|
|
12012
|
+
this._isClosed = !0, this.joinAttempts = 0, this.emit(w.Closing), this.removeAllListeners(), this.deregisterOnLineListener(), this.clearPendingReconnect(), yield this.cleanupPeerConnections(), yield this.cleanupClient();
|
|
12013
12013
|
} finally {
|
|
12014
12014
|
e();
|
|
12015
12015
|
}
|
|
@@ -12093,19 +12093,19 @@ class hu extends Re.EventEmitter {
|
|
|
12093
12093
|
return;
|
|
12094
12094
|
this.participantSid = (t = e.participant) === null || t === void 0 ? void 0 : t.sid;
|
|
12095
12095
|
const s = this.makeRTCConfiguration(e);
|
|
12096
|
-
this.pcManager = new zl(s, e.subscriberPrimary, this.loggerOptions), this.emit(
|
|
12096
|
+
this.pcManager = new zl(s, e.subscriberPrimary, this.loggerOptions), this.emit(w.TransportsCreated, this.pcManager.publisher, this.pcManager.subscriber), this.pcManager.onIceCandidate = (r, a) => {
|
|
12097
12097
|
this.client.sendIceCandidate(r, a);
|
|
12098
12098
|
}, this.pcManager.onPublisherOffer = (r, a) => {
|
|
12099
12099
|
this.client.sendOffer(r, a);
|
|
12100
12100
|
}, this.pcManager.onDataChannel = this.handleDataChannel, this.pcManager.onStateChange = (r, a, o) => f(this, void 0, void 0, function* () {
|
|
12101
12101
|
if (this.log.debug("primary PC state changed ".concat(r), this.logContext), ["closed", "disconnected", "failed"].includes(a) && (this.publisherConnectionPromise = void 0), r === G.CONNECTED) {
|
|
12102
12102
|
const l = this.pcState === he.New;
|
|
12103
|
-
this.pcState = he.Connected, l && this.emit(
|
|
12103
|
+
this.pcState = he.Connected, l && this.emit(w.Connected, e);
|
|
12104
12104
|
} else r === G.FAILED && this.pcState === he.Connected && (this.pcState = he.Disconnected, this.handleDisconnect("peerconnection failed", o === "failed" ? lt.RR_SUBSCRIBER_FAILED : lt.RR_PUBLISHER_FAILED));
|
|
12105
12105
|
const c = this.client.isDisconnected || this.client.currentState === H.RECONNECTING, d = [G.FAILED, G.CLOSING, G.CLOSED].includes(r);
|
|
12106
|
-
c && d && !this._isClosed && this.emit(
|
|
12106
|
+
c && d && !this._isClosed && this.emit(w.Offline);
|
|
12107
12107
|
}), this.pcManager.onTrack = (r) => {
|
|
12108
|
-
this.emit(
|
|
12108
|
+
this.emit(w.MediaTrackAdded, r.track, r.streams[0], r.receiver);
|
|
12109
12109
|
}, fu((i = e.serverInfo) === null || i === void 0 ? void 0 : i.protocol) || this.createDataChannels();
|
|
12110
12110
|
});
|
|
12111
12111
|
}
|
|
@@ -12140,18 +12140,18 @@ class hu extends Re.EventEmitter {
|
|
|
12140
12140
|
} = this.pendingTrackResolvers[e.cid];
|
|
12141
12141
|
delete this.pendingTrackResolvers[e.cid], i(e.track);
|
|
12142
12142
|
}, this.client.onLocalTrackUnpublished = (e) => {
|
|
12143
|
-
this.emit(
|
|
12143
|
+
this.emit(w.LocalTrackUnpublished, e);
|
|
12144
12144
|
}, this.client.onLocalTrackSubscribed = (e) => {
|
|
12145
|
-
this.emit(
|
|
12145
|
+
this.emit(w.LocalTrackSubscribed, e);
|
|
12146
12146
|
}, this.client.onTokenRefresh = (e) => {
|
|
12147
12147
|
this.token = e;
|
|
12148
12148
|
}, this.client.onRemoteMuteChanged = (e, t) => {
|
|
12149
|
-
this.emit(
|
|
12149
|
+
this.emit(w.RemoteMute, e, t);
|
|
12150
12150
|
}, this.client.onSubscribedQualityUpdate = (e) => {
|
|
12151
|
-
this.emit(
|
|
12151
|
+
this.emit(w.SubscribedQualityUpdate, e);
|
|
12152
12152
|
}, this.client.onRoomMoved = (e) => {
|
|
12153
12153
|
var t;
|
|
12154
|
-
this.participantSid = (t = e.participant) === null || t === void 0 ? void 0 : t.sid, this.latestJoinResponse && (this.latestJoinResponse.room = e.room), this.emit(
|
|
12154
|
+
this.participantSid = (t = e.participant) === null || t === void 0 ? void 0 : t.sid, this.latestJoinResponse && (this.latestJoinResponse.room = e.room), this.emit(w.RoomMoved, e);
|
|
12155
12155
|
}, this.client.onClose = () => {
|
|
12156
12156
|
this.handleDisconnect("signal", lt.RR_SIGNAL_DISCONNECTED);
|
|
12157
12157
|
}, this.client.onLeave = (e) => {
|
|
@@ -12159,7 +12159,7 @@ class hu extends Re.EventEmitter {
|
|
|
12159
12159
|
reason: e == null ? void 0 : e.reason
|
|
12160
12160
|
})), e.regions && this.regionUrlProvider && (this.log.debug("updating regions", this.logContext), this.regionUrlProvider.setServerReportedRegions(e.regions)), e.action) {
|
|
12161
12161
|
case bt.DISCONNECT:
|
|
12162
|
-
this.emit(
|
|
12162
|
+
this.emit(w.Disconnected, e == null ? void 0 : e.reason), this.close();
|
|
12163
12163
|
break;
|
|
12164
12164
|
case bt.RECONNECT:
|
|
12165
12165
|
this.fullReconnectOnNext = !0, this.handleDisconnect(rn);
|
|
@@ -12193,7 +12193,7 @@ class hu extends Re.EventEmitter {
|
|
|
12193
12193
|
}
|
|
12194
12194
|
createSender(e, t, i) {
|
|
12195
12195
|
return f(this, void 0, void 0, function* () {
|
|
12196
|
-
if (
|
|
12196
|
+
if (wn())
|
|
12197
12197
|
return yield this.createTransceiverRTCRtpSender(e, t, i);
|
|
12198
12198
|
if (In())
|
|
12199
12199
|
return this.log.warn("using add-track fallback", this.logContext), yield this.createRTCRtpSender(e.mediaStreamTrack);
|
|
@@ -12202,7 +12202,7 @@ class hu extends Re.EventEmitter {
|
|
|
12202
12202
|
}
|
|
12203
12203
|
createSimulcastSender(e, t, i, s) {
|
|
12204
12204
|
return f(this, void 0, void 0, function* () {
|
|
12205
|
-
if (
|
|
12205
|
+
if (wn())
|
|
12206
12206
|
return this.createSimulcastTransceiverSender(e, t, i, s);
|
|
12207
12207
|
if (In())
|
|
12208
12208
|
return this.log.debug("using add-track fallback", this.logContext), this.createRTCRtpSender(e.mediaStreamTrack);
|
|
@@ -12260,7 +12260,7 @@ class hu extends Re.EventEmitter {
|
|
|
12260
12260
|
let a = !0;
|
|
12261
12261
|
r instanceof Y ? (this.log.debug("received unrecoverable error", Object.assign(Object.assign({}, this.logContext), {
|
|
12262
12262
|
error: r
|
|
12263
|
-
})), a = !1) : r instanceof ut || (this.fullReconnectOnNext = !0), a ? this.handleDisconnect("reconnect", lt.RR_UNKNOWN) : (this.log.info("could not recover connection after ".concat(this.reconnectAttempts, " attempts, ").concat(Date.now() - this.reconnectStart, "ms. giving up"), this.logContext), this.emit(
|
|
12263
|
+
})), a = !1) : r instanceof ut || (this.fullReconnectOnNext = !0), a ? this.handleDisconnect("reconnect", lt.RR_UNKNOWN) : (this.log.info("could not recover connection after ".concat(this.reconnectAttempts, " attempts, ").concat(Date.now() - this.reconnectStart, "ms. giving up"), this.logContext), this.emit(w.Disconnected), yield this.close());
|
|
12264
12264
|
} finally {
|
|
12265
12265
|
this.attemptingReconnect = !1;
|
|
12266
12266
|
}
|
|
@@ -12283,7 +12283,7 @@ class hu extends Re.EventEmitter {
|
|
|
12283
12283
|
try {
|
|
12284
12284
|
if (!this.url || !this.token)
|
|
12285
12285
|
throw new Y("could not reconnect, url or token not saved");
|
|
12286
|
-
this.log.info("reconnecting, attempt: ".concat(this.reconnectAttempts), this.logContext), this.emit(
|
|
12286
|
+
this.log.info("reconnecting, attempt: ".concat(this.reconnectAttempts), this.logContext), this.emit(w.Restarting), this.client.isDisconnected || (yield this.client.sendLeave()), yield this.cleanupPeerConnections(), yield this.cleanupClient();
|
|
12287
12287
|
let r;
|
|
12288
12288
|
try {
|
|
12289
12289
|
if (!this.signalOpts)
|
|
@@ -12294,9 +12294,9 @@ class hu extends Re.EventEmitter {
|
|
|
12294
12294
|
}
|
|
12295
12295
|
if (this.shouldFailNext)
|
|
12296
12296
|
throw this.shouldFailNext = !1, new Error("simulated failure");
|
|
12297
|
-
if (this.client.setReconnected(), this.emit(
|
|
12297
|
+
if (this.client.setReconnected(), this.emit(w.SignalRestarted, r), yield this.waitForPCReconnected(), this.client.currentState !== H.CONNECTED)
|
|
12298
12298
|
throw new ut("Signal connection got severed during reconnect");
|
|
12299
|
-
(t = this.regionUrlProvider) === null || t === void 0 || t.resetAttempts(), this.emit(
|
|
12299
|
+
(t = this.regionUrlProvider) === null || t === void 0 || t.resetAttempts(), this.emit(w.Restarted);
|
|
12300
12300
|
} catch (r) {
|
|
12301
12301
|
const a = yield (i = this.regionUrlProvider) === null || i === void 0 ? void 0 : i.getNextBestRegionUrl();
|
|
12302
12302
|
if (a) {
|
|
@@ -12314,7 +12314,7 @@ class hu extends Re.EventEmitter {
|
|
|
12314
12314
|
throw new Y("could not reconnect, url or token not saved");
|
|
12315
12315
|
if (!this.pcManager)
|
|
12316
12316
|
throw new Y("publisher and subscriber connections unset");
|
|
12317
|
-
this.log.info("resuming signal connection, attempt ".concat(this.reconnectAttempts), this.logContext), this.emit(
|
|
12317
|
+
this.log.info("resuming signal connection, attempt ".concat(this.reconnectAttempts), this.logContext), this.emit(w.Resuming);
|
|
12318
12318
|
let i;
|
|
12319
12319
|
try {
|
|
12320
12320
|
this.setupSignalClientCallbacks(), i = yield this.client.reconnect(this.url, this.token, this.participantSid, e);
|
|
@@ -12324,7 +12324,7 @@ class hu extends Re.EventEmitter {
|
|
|
12324
12324
|
error: s
|
|
12325
12325
|
}))), s instanceof $ && s.reason === j.NotAllowed ? new Y("could not reconnect, token might be expired") : s instanceof $ && s.reason === j.LeaveRequest ? s : new ut(r);
|
|
12326
12326
|
}
|
|
12327
|
-
if (this.emit(
|
|
12327
|
+
if (this.emit(w.SignalResumed), i) {
|
|
12328
12328
|
const s = this.makeRTCConfiguration(i);
|
|
12329
12329
|
this.pcManager.updateConfiguration(s), this.latestJoinResponse && (this.latestJoinResponse.serverInfo = i.serverInfo);
|
|
12330
12330
|
} else
|
|
@@ -12333,7 +12333,7 @@ class hu extends Re.EventEmitter {
|
|
|
12333
12333
|
throw this.shouldFailNext = !1, new Error("simulated failure");
|
|
12334
12334
|
if (yield this.pcManager.triggerIceRestart(), yield this.waitForPCReconnected(), this.client.currentState !== H.CONNECTED)
|
|
12335
12335
|
throw new ut("Signal connection got severed during reconnect");
|
|
12336
|
-
this.client.setReconnected(), ((t = this.reliableDC) === null || t === void 0 ? void 0 : t.readyState) === "open" && this.reliableDC.id === null && this.createDataChannels(), i != null && i.lastMessageSeq && this.resendReliableMessagesForResume(i.lastMessageSeq), this.emit(
|
|
12336
|
+
this.client.setReconnected(), ((t = this.reliableDC) === null || t === void 0 ? void 0 : t.readyState) === "open" && this.reliableDC.id === null && this.createDataChannels(), i != null && i.lastMessageSeq && this.resendReliableMessagesForResume(i.lastMessageSeq), this.emit(w.Resumed);
|
|
12337
12337
|
});
|
|
12338
12338
|
}
|
|
12339
12339
|
waitForPCInitialConnection(e, t) {
|
|
@@ -12425,9 +12425,9 @@ class hu extends Re.EventEmitter {
|
|
|
12425
12425
|
t();
|
|
12426
12426
|
else {
|
|
12427
12427
|
const s = () => i("Engine closed");
|
|
12428
|
-
for (this.once(
|
|
12428
|
+
for (this.once(w.Closing, s); !this.dcBufferStatus.get(e); )
|
|
12429
12429
|
yield oe(10);
|
|
12430
|
-
this.off(
|
|
12430
|
+
this.off(w.Closing, s), t();
|
|
12431
12431
|
}
|
|
12432
12432
|
}));
|
|
12433
12433
|
}
|
|
@@ -12481,19 +12481,19 @@ class hu extends Re.EventEmitter {
|
|
|
12481
12481
|
const i = new AbortController(), s = () => {
|
|
12482
12482
|
i.abort(), this.log.debug("engine disconnected while negotiation was ongoing", this.logContext), e();
|
|
12483
12483
|
};
|
|
12484
|
-
this.isClosed && t("cannot negotiate on closed engine"), this.on(
|
|
12484
|
+
this.isClosed && t("cannot negotiate on closed engine"), this.on(w.Closing, s), this.pcManager.publisher.once(St.RTPVideoPayloadTypes, (r) => {
|
|
12485
12485
|
const a = /* @__PURE__ */ new Map();
|
|
12486
12486
|
r.forEach((o) => {
|
|
12487
12487
|
const c = o.codec.toLowerCase();
|
|
12488
12488
|
pl(c) && a.set(o.payload, c);
|
|
12489
|
-
}), this.emit(
|
|
12489
|
+
}), this.emit(w.RTPVideoMapUpdate, a);
|
|
12490
12490
|
});
|
|
12491
12491
|
try {
|
|
12492
12492
|
yield this.pcManager.negotiate(i), e();
|
|
12493
12493
|
} catch (r) {
|
|
12494
12494
|
r instanceof Pn && (this.fullReconnectOnNext = !0), this.handleDisconnect("negotiation", lt.RR_UNKNOWN), t(r);
|
|
12495
12495
|
} finally {
|
|
12496
|
-
this.off(
|
|
12496
|
+
this.off(w.Closing, s);
|
|
12497
12497
|
}
|
|
12498
12498
|
}));
|
|
12499
12499
|
});
|
|
@@ -12530,7 +12530,7 @@ class hu extends Re.EventEmitter {
|
|
|
12530
12530
|
sdp: a.sdp,
|
|
12531
12531
|
type: a.type
|
|
12532
12532
|
}) : void 0,
|
|
12533
|
-
subscription: new
|
|
12533
|
+
subscription: new Ri({
|
|
12534
12534
|
trackSids: c,
|
|
12535
12535
|
subscribe: !o,
|
|
12536
12536
|
participantTracks: []
|
|
@@ -13136,8 +13136,8 @@ class Tu {
|
|
|
13136
13136
|
let h = () => f(this, void 0, void 0, function* () {
|
|
13137
13137
|
yield p.close();
|
|
13138
13138
|
});
|
|
13139
|
-
l.once(
|
|
13140
|
-
const p = new yu(u, r, () => this.engine.off(
|
|
13139
|
+
l.once(w.Closing, h);
|
|
13140
|
+
const p = new yu(u, r, () => this.engine.off(w.Closing, h));
|
|
13141
13141
|
return p;
|
|
13142
13142
|
});
|
|
13143
13143
|
}
|
|
@@ -13655,7 +13655,7 @@ function Bn(n, e) {
|
|
|
13655
13655
|
n = n.offsetParent, i += n.offsetTop, s += n.offsetLeft;
|
|
13656
13656
|
return i < t.pageYOffset + t.innerHeight && s < t.pageXOffset + t.innerWidth && i + a > t.pageYOffset && s + r > t.pageXOffset && !o && c !== "none";
|
|
13657
13657
|
}
|
|
13658
|
-
class xe extends
|
|
13658
|
+
class xe extends we.EventEmitter {
|
|
13659
13659
|
constructor(e, t, i, s) {
|
|
13660
13660
|
var r;
|
|
13661
13661
|
super(), this.metadataMuted = !1, this.encryption = ce.NONE, this.log = F, this.handleMuted = () => {
|
|
@@ -13872,7 +13872,7 @@ var $e;
|
|
|
13872
13872
|
(function(n) {
|
|
13873
13873
|
n.Excellent = "excellent", n.Good = "good", n.Poor = "poor", n.Lost = "lost", n.Unknown = "unknown";
|
|
13874
13874
|
})($e || ($e = {}));
|
|
13875
|
-
function
|
|
13875
|
+
function Ru(n) {
|
|
13876
13876
|
switch (n) {
|
|
13877
13877
|
case Lt.EXCELLENT:
|
|
13878
13878
|
return $e.Excellent;
|
|
@@ -13886,7 +13886,7 @@ function wu(n) {
|
|
|
13886
13886
|
return $e.Unknown;
|
|
13887
13887
|
}
|
|
13888
13888
|
}
|
|
13889
|
-
class Co extends
|
|
13889
|
+
class Co extends we.EventEmitter {
|
|
13890
13890
|
get logContext() {
|
|
13891
13891
|
var e, t;
|
|
13892
13892
|
return Object.assign({}, (t = (e = this.loggerOptions) === null || e === void 0 ? void 0 : e.loggerContextCb) === null || t === void 0 ? void 0 : t.call(e));
|
|
@@ -13940,7 +13940,7 @@ class Co extends Re.EventEmitter {
|
|
|
13940
13940
|
* @returns a promise that resolves when the participant is active
|
|
13941
13941
|
*/
|
|
13942
13942
|
waitUntilActive() {
|
|
13943
|
-
return this.isActive ? Promise.resolve() : this.activeFuture ? this.activeFuture.promise : (this.activeFuture = new Ce(), this.once(
|
|
13943
|
+
return this.isActive ? Promise.resolve() : this.activeFuture ? this.activeFuture.promise : (this.activeFuture = new Ce(), this.once(R.Active, () => {
|
|
13944
13944
|
var e, t;
|
|
13945
13945
|
(t = (e = this.activeFuture) === null || e === void 0 ? void 0 : e.resolve) === null || t === void 0 || t.call(e), this.activeFuture = void 0;
|
|
13946
13946
|
}), this.activeFuture.promise);
|
|
@@ -13971,25 +13971,25 @@ class Co extends Re.EventEmitter {
|
|
|
13971
13971
|
/** @internal */
|
|
13972
13972
|
updateInfo(e) {
|
|
13973
13973
|
var t;
|
|
13974
|
-
return this.participantInfo && this.participantInfo.sid === e.sid && this.participantInfo.version > e.version ? !1 : (this.identity = e.identity, this.sid = e.sid, this._setName(e.name), this._setMetadata(e.metadata), this._setAttributes(e.attributes), e.state === vt.ACTIVE && ((t = this.participantInfo) === null || t === void 0 ? void 0 : t.state) !== vt.ACTIVE && this.emit(
|
|
13974
|
+
return this.participantInfo && this.participantInfo.sid === e.sid && this.participantInfo.version > e.version ? !1 : (this.identity = e.identity, this.sid = e.sid, this._setName(e.name), this._setMetadata(e.metadata), this._setAttributes(e.attributes), e.state === vt.ACTIVE && ((t = this.participantInfo) === null || t === void 0 ? void 0 : t.state) !== vt.ACTIVE && this.emit(R.Active), e.permission && this.setPermissions(e.permission), this.participantInfo = e, !0);
|
|
13975
13975
|
}
|
|
13976
13976
|
/**
|
|
13977
13977
|
* Updates metadata from server
|
|
13978
13978
|
**/
|
|
13979
13979
|
_setMetadata(e) {
|
|
13980
13980
|
const t = this.metadata !== e, i = this.metadata;
|
|
13981
|
-
this.metadata = e, t && this.emit(
|
|
13981
|
+
this.metadata = e, t && this.emit(R.ParticipantMetadataChanged, i);
|
|
13982
13982
|
}
|
|
13983
13983
|
_setName(e) {
|
|
13984
13984
|
const t = this.name !== e;
|
|
13985
|
-
this.name = e, t && this.emit(
|
|
13985
|
+
this.name = e, t && this.emit(R.ParticipantNameChanged, e);
|
|
13986
13986
|
}
|
|
13987
13987
|
/**
|
|
13988
13988
|
* Updates metadata from server
|
|
13989
13989
|
**/
|
|
13990
13990
|
_setAttributes(e) {
|
|
13991
13991
|
const t = Pl(this.attributes, e);
|
|
13992
|
-
this._attributes = e, Object.keys(t).length > 0 && this.emit(
|
|
13992
|
+
this._attributes = e, Object.keys(t).length > 0 && this.emit(R.AttributesChanged, t);
|
|
13993
13993
|
}
|
|
13994
13994
|
/** @internal */
|
|
13995
13995
|
setPermissions(e) {
|
|
@@ -13998,16 +13998,16 @@ class Co extends Re.EventEmitter {
|
|
|
13998
13998
|
var h;
|
|
13999
13999
|
return l !== ((h = this.permissions) === null || h === void 0 ? void 0 : h.canPublishSources[u]);
|
|
14000
14000
|
}) || e.canSubscribeMetrics !== ((o = this.permissions) === null || o === void 0 ? void 0 : o.canSubscribeMetrics);
|
|
14001
|
-
return this.permissions = e, d && this.emit(
|
|
14001
|
+
return this.permissions = e, d && this.emit(R.ParticipantPermissionsChanged, c), d;
|
|
14002
14002
|
}
|
|
14003
14003
|
/** @internal */
|
|
14004
14004
|
setIsSpeaking(e) {
|
|
14005
|
-
e !== this.isSpeaking && (this.isSpeaking = e, e && (this.lastSpokeAt = /* @__PURE__ */ new Date()), this.emit(
|
|
14005
|
+
e !== this.isSpeaking && (this.isSpeaking = e, e && (this.lastSpokeAt = /* @__PURE__ */ new Date()), this.emit(R.IsSpeakingChanged, e));
|
|
14006
14006
|
}
|
|
14007
14007
|
/** @internal */
|
|
14008
14008
|
setConnectionQuality(e) {
|
|
14009
14009
|
const t = this._connectionQuality;
|
|
14010
|
-
this._connectionQuality =
|
|
14010
|
+
this._connectionQuality = Ru(e), t !== this._connectionQuality && this.emit(R.ConnectionQualityChanged, this._connectionQuality);
|
|
14011
14011
|
}
|
|
14012
14012
|
/**
|
|
14013
14013
|
* @internal
|
|
@@ -14024,9 +14024,9 @@ class Co extends Re.EventEmitter {
|
|
|
14024
14024
|
}
|
|
14025
14025
|
addTrackPublication(e) {
|
|
14026
14026
|
e.on(_.Muted, () => {
|
|
14027
|
-
this.emit(
|
|
14027
|
+
this.emit(R.TrackMuted, e);
|
|
14028
14028
|
}), e.on(_.Unmuted, () => {
|
|
14029
|
-
this.emit(
|
|
14029
|
+
this.emit(R.TrackUnmuted, e);
|
|
14030
14030
|
});
|
|
14031
14031
|
const t = e;
|
|
14032
14032
|
switch (t.track && (t.track.sid = e.trackSid), this.trackPublications.set(e.trackSid, e), e.kind) {
|
|
@@ -14039,7 +14039,7 @@ class Co extends Re.EventEmitter {
|
|
|
14039
14039
|
}
|
|
14040
14040
|
}
|
|
14041
14041
|
}
|
|
14042
|
-
function
|
|
14042
|
+
function wu(n) {
|
|
14043
14043
|
var e, t, i;
|
|
14044
14044
|
if (!n.participantSid && !n.participantIdentity)
|
|
14045
14045
|
throw new Error("Invalid track permission, must provide at least one of participantIdentity and participantSid");
|
|
@@ -14089,7 +14089,7 @@ class Iu extends Co {
|
|
|
14089
14089
|
this.log.debug("updating track subscription permissions", Object.assign(Object.assign({}, this.logContext), {
|
|
14090
14090
|
allParticipantsAllowed: this.allParticipantsAllowedToSubscribe,
|
|
14091
14091
|
participantTrackPermissions: this.participantTrackPermissions
|
|
14092
|
-
})), this.engine.client.sendUpdateSubscriptionPermissions(this.allParticipantsAllowedToSubscribe, this.participantTrackPermissions.map((o) =>
|
|
14092
|
+
})), this.engine.client.sendUpdateSubscriptionPermissions(this.allParticipantsAllowedToSubscribe, this.participantTrackPermissions.map((o) => wu(o)));
|
|
14093
14093
|
}, this.onTrackUnmuted = (o) => {
|
|
14094
14094
|
this.onTrackMuted(o, o.isUpstreamPaused);
|
|
14095
14095
|
}, this.onTrackMuted = (o, c) => {
|
|
@@ -14110,7 +14110,7 @@ class Iu extends Co {
|
|
|
14110
14110
|
}
|
|
14111
14111
|
this.engine.client.sendUpdateLocalAudioTrack(c.trackSid, c.getTrackFeatures());
|
|
14112
14112
|
}, this.onTrackCpuConstrained = (o, c) => {
|
|
14113
|
-
this.log.debug("track cpu constrained", Object.assign(Object.assign({}, this.logContext), U(c))), this.emit(
|
|
14113
|
+
this.log.debug("track cpu constrained", Object.assign(Object.assign({}, this.logContext), U(c))), this.emit(R.LocalTrackCpuConstrained, o, c);
|
|
14114
14114
|
}, this.handleSubscribedQualityUpdate = (o) => f(this, void 0, void 0, function* () {
|
|
14115
14115
|
var c, d, l, u, h;
|
|
14116
14116
|
if (!(!((h = this.roomOptions) === null || h === void 0) && h.dynacast))
|
|
@@ -14203,10 +14203,10 @@ class Iu extends Co {
|
|
|
14203
14203
|
*/
|
|
14204
14204
|
setupEngine(e) {
|
|
14205
14205
|
var t;
|
|
14206
|
-
this.engine = e, this.engine.on(
|
|
14206
|
+
this.engine = e, this.engine.on(w.RemoteMute, (i, s) => {
|
|
14207
14207
|
const r = this.trackPublications.get(i);
|
|
14208
14208
|
!r || !r.track || (s ? r.mute() : r.unmute());
|
|
14209
|
-
}), !((t = this.signalConnectedFuture) === null || t === void 0) && t.isResolved && (this.signalConnectedFuture = void 0), this.engine.on(
|
|
14209
|
+
}), !((t = this.signalConnectedFuture) === null || t === void 0) && t.isResolved && (this.signalConnectedFuture = void 0), this.engine.on(w.Connected, this.handleReconnected).on(w.SignalConnected, this.handleSignalConnected).on(w.SignalRestarted, this.handleReconnected).on(w.SignalResumed, this.handleReconnected).on(w.Restarting, this.handleReconnecting).on(w.Resuming, this.handleReconnecting).on(w.LocalTrackUnpublished, this.handleLocalTrackUnpublished).on(w.SubscribedQualityUpdate, this.handleSubscribedQualityUpdate).on(w.Closing, this.handleClosing).on(w.SignalRequestResponse, this.handleSignalRequestResponse).on(w.DataPacketReceived, this.handleDataPacket);
|
|
14210
14210
|
}
|
|
14211
14211
|
/**
|
|
14212
14212
|
* Sets and updates the metadata of the local participant.
|
|
@@ -14317,7 +14317,7 @@ class Iu extends Co {
|
|
|
14317
14317
|
/** @internal */
|
|
14318
14318
|
setPermissions(e) {
|
|
14319
14319
|
const t = this.permissions, i = super.setPermissions(e);
|
|
14320
|
-
return i && t && this.emit(
|
|
14320
|
+
return i && t && this.emit(R.ParticipantPermissionsChanged, t), i;
|
|
14321
14321
|
}
|
|
14322
14322
|
/** @internal */
|
|
14323
14323
|
setE2EEEnabled(e) {
|
|
@@ -14366,7 +14366,7 @@ class Iu extends Co {
|
|
|
14366
14366
|
} catch (d) {
|
|
14367
14367
|
throw c == null || c.forEach((l) => {
|
|
14368
14368
|
l.stop();
|
|
14369
|
-
}), d instanceof Error && this.emit(
|
|
14369
|
+
}), d instanceof Error && this.emit(R.MediaDevicesError, d, Nn(e)), this.pendingPublishing.delete(e), d;
|
|
14370
14370
|
}
|
|
14371
14371
|
for (const d of c) {
|
|
14372
14372
|
const l = Object.assign(Object.assign({}, this.roomOptions.publishDefaults), i);
|
|
@@ -14431,7 +14431,7 @@ class Iu extends Co {
|
|
|
14431
14431
|
return (yield Oi(s, {
|
|
14432
14432
|
loggerName: this.roomOptions.loggerName,
|
|
14433
14433
|
loggerContextCb: () => this.logContext
|
|
14434
|
-
})).map((o) => (Ee(o) && (this.microphoneError = void 0, o.setAudioContext(this.audioContext), o.source = k.Source.Microphone, this.emit(
|
|
14434
|
+
})).map((o) => (Ee(o) && (this.microphoneError = void 0, o.setAudioContext(this.audioContext), o.source = k.Source.Microphone, this.emit(R.AudioStreamAcquired)), Qe(o) && (this.cameraError = void 0, o.source = k.Source.Camera), o));
|
|
14435
14435
|
} catch (r) {
|
|
14436
14436
|
throw r instanceof Error && (e.audio && (this.microphoneError = r), e.video && (this.cameraError = r)), r;
|
|
14437
14437
|
}
|
|
@@ -14457,7 +14457,7 @@ class Iu extends Co {
|
|
|
14457
14457
|
r.source = k.Source.ScreenShare, e.contentHint && (r.mediaStreamTrack.contentHint = e.contentHint);
|
|
14458
14458
|
const a = [r];
|
|
14459
14459
|
if (i.getAudioTracks().length > 0) {
|
|
14460
|
-
this.emit(
|
|
14460
|
+
this.emit(R.AudioStreamAcquired);
|
|
14461
14461
|
const o = new Ti(i.getAudioTracks()[0], void 0, !1, this.audioContext, {
|
|
14462
14462
|
loggerName: this.roomOptions.loggerName,
|
|
14463
14463
|
loggerContextCb: () => this.logContext
|
|
@@ -14642,7 +14642,7 @@ class Iu extends Co {
|
|
|
14642
14642
|
var O, M, N;
|
|
14643
14643
|
if (!this.engine.pcManager)
|
|
14644
14644
|
throw new Y("pcManager is not ready");
|
|
14645
|
-
if (e.sender = yield this.engine.createSender(e, t, v), this.emit(
|
|
14645
|
+
if (e.sender = yield this.engine.createSender(e, t, v), this.emit(R.LocalSenderCreated, e.sender, e), je(e) && ((O = t.degradationPreference) !== null && O !== void 0 || (t.degradationPreference = cu(e)), e.setDegradationPreference(t.degradationPreference)), v)
|
|
14646
14646
|
if (at() && e.kind === k.Kind.Audio) {
|
|
14647
14647
|
let B;
|
|
14648
14648
|
for (const ie of this.engine.pcManager.publisher.getTransceivers())
|
|
@@ -14697,9 +14697,9 @@ class Iu extends Co {
|
|
|
14697
14697
|
if (D.on(_.CpuConstrained, (O) => this.onTrackCpuConstrained(O, D)), D.options = t, e.sid = E.sid, this.log.debug("publishing ".concat(e.kind, " with encodings"), Object.assign(Object.assign({}, this.logContext), {
|
|
14698
14698
|
encodings: v,
|
|
14699
14699
|
trackInfo: E
|
|
14700
|
-
})), je(e) ? e.startMonitor(this.engine.client) : Ie(e) && e.startMonitor(), this.addTrackPublication(D), this.emit(
|
|
14700
|
+
})), je(e) ? e.startMonitor(this.engine.client) : Ie(e) && e.startMonitor(), this.addTrackPublication(D), this.emit(R.LocalTrackPublished, D), Ie(e) && E.audioFeatures.includes(X.TF_PRECONNECT_BUFFER)) {
|
|
14701
14701
|
const O = e.getPreConnectBuffer(), M = e.getPreConnectBufferMimeType();
|
|
14702
|
-
this.on(
|
|
14702
|
+
this.on(R.LocalTrackSubscribed, (N) => {
|
|
14703
14703
|
if (N.trackSid === E.sid) {
|
|
14704
14704
|
if (!e.hasPreConnectBuffer) {
|
|
14705
14705
|
this.log.warn("subscribe event came to late, buffer already closed", this.logContext);
|
|
@@ -14708,18 +14708,18 @@ class Iu extends Co {
|
|
|
14708
14708
|
this.log.debug("finished recording preconnect buffer", Object.assign(Object.assign({}, this.logContext), U(e))), e.stopPreConnectBuffer();
|
|
14709
14709
|
}
|
|
14710
14710
|
}), O && new Promise((B, ie) => f(this, void 0, void 0, function* () {
|
|
14711
|
-
var Ue,
|
|
14711
|
+
var Ue, wt, hs, fs, Ai, Di;
|
|
14712
14712
|
try {
|
|
14713
14713
|
this.log.debug("waiting for agent", Object.assign(Object.assign({}, this.logContext), U(e)));
|
|
14714
14714
|
const Ui = setTimeout(() => {
|
|
14715
14715
|
ie(new Error("agent not active within 10 seconds"));
|
|
14716
|
-
}, 1e4),
|
|
14716
|
+
}, 1e4), wo = yield this.waitUntilActiveAgentPresent();
|
|
14717
14717
|
clearTimeout(Ui), this.log.debug("sending preconnect buffer", Object.assign(Object.assign({}, this.logContext), U(e)));
|
|
14718
14718
|
const ps = yield this.streamBytes({
|
|
14719
14719
|
name: "preconnect-buffer",
|
|
14720
14720
|
mimeType: M,
|
|
14721
14721
|
topic: "lk.agent.pre-connect-audio-buffer",
|
|
14722
|
-
destinationIdentities: [
|
|
14722
|
+
destinationIdentities: [wo.identity],
|
|
14723
14723
|
attributes: {
|
|
14724
14724
|
trackId: D.trackSid,
|
|
14725
14725
|
sampleRate: String((Ai = x.sampleRate) !== null && Ai !== void 0 ? Ai : "48000"),
|
|
@@ -14733,14 +14733,14 @@ class Iu extends Co {
|
|
|
14733
14733
|
yield ps.write(Fi);
|
|
14734
14734
|
}
|
|
14735
14735
|
} catch (Fi) {
|
|
14736
|
-
|
|
14736
|
+
wt = {
|
|
14737
14737
|
error: Fi
|
|
14738
14738
|
};
|
|
14739
14739
|
} finally {
|
|
14740
14740
|
try {
|
|
14741
14741
|
!Mi && !Ue && (hs = Ni.return) && (yield hs.call(Ni));
|
|
14742
14742
|
} finally {
|
|
14743
|
-
if (
|
|
14743
|
+
if (wt) throw wt.error;
|
|
14744
14744
|
}
|
|
14745
14745
|
}
|
|
14746
14746
|
yield ps.close(), B();
|
|
@@ -14843,7 +14843,7 @@ class Iu extends Co {
|
|
|
14843
14843
|
this.videoTrackPublications.delete(r.trackSid);
|
|
14844
14844
|
break;
|
|
14845
14845
|
}
|
|
14846
|
-
return this.emit(
|
|
14846
|
+
return this.emit(R.LocalTrackUnpublished, r), r.setTrack(void 0), o && (yield this.engine.negotiate()), r;
|
|
14847
14847
|
});
|
|
14848
14848
|
}
|
|
14849
14849
|
unpublishTracks(e) {
|
|
@@ -14941,7 +14941,7 @@ class Iu extends Co {
|
|
|
14941
14941
|
}))
|
|
14942
14942
|
}
|
|
14943
14943
|
});
|
|
14944
|
-
return yield this.engine.sendDataPacket(s, L.RELIABLE), this.emit(
|
|
14944
|
+
return yield this.engine.sendDataPacket(s, L.RELIABLE), this.emit(R.ChatMessage, i), i;
|
|
14945
14945
|
});
|
|
14946
14946
|
}
|
|
14947
14947
|
/** @deprecated Consider migrating to {@link sendText} */
|
|
@@ -14959,7 +14959,7 @@ class Iu extends Co {
|
|
|
14959
14959
|
}))
|
|
14960
14960
|
}
|
|
14961
14961
|
});
|
|
14962
|
-
return yield this.engine.sendDataPacket(s, L.RELIABLE), this.emit(
|
|
14962
|
+
return yield this.engine.sendDataPacket(s, L.RELIABLE), this.emit(R.ChatMessage, i), i;
|
|
14963
14963
|
});
|
|
14964
14964
|
}
|
|
14965
14965
|
/**
|
|
@@ -15196,7 +15196,7 @@ class xu extends xe {
|
|
|
15196
15196
|
setSubscribed(e) {
|
|
15197
15197
|
const t = this.subscriptionStatus, i = this.permissionStatus;
|
|
15198
15198
|
this.subscribed = e, e && (this.allowed = !0);
|
|
15199
|
-
const s = new
|
|
15199
|
+
const s = new Ri({
|
|
15200
15200
|
trackSids: [this.trackSid],
|
|
15201
15201
|
subscribe: this.subscribed,
|
|
15202
15202
|
participantTracks: [new ca({
|
|
@@ -15313,7 +15313,7 @@ class xu extends xe {
|
|
|
15313
15313
|
if (t)
|
|
15314
15314
|
dr(this.videoDimensionsAdaptiveStream, t) && (this.log.debug("using adaptive stream dimensions instead of requested", Object.assign(Object.assign({}, this.logContext), this.videoDimensionsAdaptiveStream)), t = this.videoDimensionsAdaptiveStream);
|
|
15315
15315
|
else if (this.requestedMaxQuality !== void 0 && this.trackInfo) {
|
|
15316
|
-
const i =
|
|
15316
|
+
const i = Rl(this.trackInfo, this.requestedMaxQuality);
|
|
15317
15317
|
i && dr(this.videoDimensionsAdaptiveStream, i) && (this.log.debug("using adaptive stream dimensions instead of max quality layer", Object.assign(Object.assign({}, this.logContext), this.videoDimensionsAdaptiveStream)), t = this.videoDimensionsAdaptiveStream);
|
|
15318
15318
|
} else
|
|
15319
15319
|
this.log.debug("using adaptive stream dimensions", Object.assign(Object.assign({}, this.logContext), this.videoDimensionsAdaptiveStream)), t = this.videoDimensionsAdaptiveStream;
|
|
@@ -15352,15 +15352,15 @@ class Ci extends Co {
|
|
|
15352
15352
|
i.participantSid = this.sid;
|
|
15353
15353
|
}), this.signalClient.sendUpdateSubscription(t);
|
|
15354
15354
|
}), e.on(_.SubscriptionPermissionChanged, (t) => {
|
|
15355
|
-
this.emit(
|
|
15355
|
+
this.emit(R.TrackSubscriptionPermissionChanged, e, t);
|
|
15356
15356
|
}), e.on(_.SubscriptionStatusChanged, (t) => {
|
|
15357
|
-
this.emit(
|
|
15357
|
+
this.emit(R.TrackSubscriptionStatusChanged, e, t);
|
|
15358
15358
|
}), e.on(_.Subscribed, (t) => {
|
|
15359
|
-
this.emit(
|
|
15359
|
+
this.emit(R.TrackSubscribed, t, e);
|
|
15360
15360
|
}), e.on(_.Unsubscribed, (t) => {
|
|
15361
|
-
this.emit(
|
|
15361
|
+
this.emit(R.TrackUnsubscribed, t, e);
|
|
15362
15362
|
}), e.on(_.SubscriptionFailed, (t) => {
|
|
15363
|
-
this.emit(
|
|
15363
|
+
this.emit(R.TrackSubscriptionFailed, e.trackSid, t);
|
|
15364
15364
|
});
|
|
15365
15365
|
}
|
|
15366
15366
|
getTrackPublication(e) {
|
|
@@ -15402,7 +15402,7 @@ class Ci extends Co {
|
|
|
15402
15402
|
if (a === 0) {
|
|
15403
15403
|
this.log.error("could not find published track", Object.assign(Object.assign({}, this.logContext), {
|
|
15404
15404
|
trackSid: t
|
|
15405
|
-
})), this.emit(
|
|
15405
|
+
})), this.emit(R.TrackSubscriptionFailed, t);
|
|
15406
15406
|
return;
|
|
15407
15407
|
}
|
|
15408
15408
|
a === void 0 && (a = 20), setTimeout(() => {
|
|
@@ -15411,7 +15411,7 @@ class Ci extends Co {
|
|
|
15411
15411
|
return;
|
|
15412
15412
|
}
|
|
15413
15413
|
if (e.readyState === "ended") {
|
|
15414
|
-
this.log.error("unable to subscribe because MediaStreamTrack is ended. Do not call MediaStreamTrack.stop()", Object.assign(Object.assign({}, this.logContext), U(o))), this.emit(
|
|
15414
|
+
this.log.error("unable to subscribe because MediaStreamTrack is ended. Do not call MediaStreamTrack.stop()", Object.assign(Object.assign({}, this.logContext), U(o))), this.emit(R.TrackSubscriptionFailed, t);
|
|
15415
15415
|
return;
|
|
15416
15416
|
}
|
|
15417
15417
|
const c = e.kind === "video";
|
|
@@ -15456,7 +15456,7 @@ class Ci extends Co {
|
|
|
15456
15456
|
}), this.trackPublications.forEach((s) => {
|
|
15457
15457
|
t.has(s.trackSid) || (this.log.trace("detected removed track on remote participant, unpublishing", Object.assign(Object.assign({}, this.logContext), U(s))), this.unpublishTrack(s.trackSid, !0));
|
|
15458
15458
|
}), i.forEach((s) => {
|
|
15459
|
-
this.emit(
|
|
15459
|
+
this.emit(R.TrackPublished, s);
|
|
15460
15460
|
}), !0;
|
|
15461
15461
|
}
|
|
15462
15462
|
/** @internal */
|
|
@@ -15475,7 +15475,7 @@ class Ci extends Co {
|
|
|
15475
15475
|
this.videoTrackPublications.delete(e);
|
|
15476
15476
|
break;
|
|
15477
15477
|
}
|
|
15478
|
-
t && this.emit(
|
|
15478
|
+
t && this.emit(R.TrackUnpublished, i);
|
|
15479
15479
|
}
|
|
15480
15480
|
/**
|
|
15481
15481
|
* @internal
|
|
@@ -15505,7 +15505,7 @@ var V;
|
|
|
15505
15505
|
n.Disconnected = "disconnected", n.Connecting = "connecting", n.Connected = "connected", n.Reconnecting = "reconnecting", n.SignalReconnecting = "signalReconnecting";
|
|
15506
15506
|
})(V || (V = {}));
|
|
15507
15507
|
const Ou = 4 * 1e3;
|
|
15508
|
-
class _t extends
|
|
15508
|
+
class _t extends we.EventEmitter {
|
|
15509
15509
|
/**
|
|
15510
15510
|
* Creates a new Room, the primary construct for a LiveKit session.
|
|
15511
15511
|
* @param options
|
|
@@ -15747,7 +15747,7 @@ class _t extends Re.EventEmitter {
|
|
|
15747
15747
|
if (!d || !d.track)
|
|
15748
15748
|
return;
|
|
15749
15749
|
const l = k.streamStateFromProto(o.state);
|
|
15750
|
-
d.track.setStreamState(l), l !== d.track.streamState && (c.emit(
|
|
15750
|
+
d.track.setStreamState(l), l !== d.track.streamState && (c.emit(R.TrackStreamStateChanged, d, d.track.streamState), this.emitWhenConnected(C.TrackStreamStateChanged, d, d.track.streamState, c));
|
|
15751
15751
|
});
|
|
15752
15752
|
}, this.handleSubscriptionPermissionUpdate = (a) => {
|
|
15753
15753
|
const o = this.getRemoteParticipantBySid(a.participantSid);
|
|
@@ -15780,12 +15780,12 @@ class _t extends Re.EventEmitter {
|
|
|
15780
15780
|
this.handleIncomingRpcRequest(a.participantIdentity, c.id, c.method, c.payload, c.responseTimeoutMs, c.version);
|
|
15781
15781
|
}
|
|
15782
15782
|
}, this.handleUserPacket = (a, o, c) => {
|
|
15783
|
-
this.emit(C.DataReceived, o.payload, a, c, o.topic), a == null || a.emit(
|
|
15783
|
+
this.emit(C.DataReceived, o.payload, a, c, o.topic), a == null || a.emit(R.DataReceived, o.payload, c);
|
|
15784
15784
|
}, this.handleSipDtmf = (a, o) => {
|
|
15785
|
-
this.emit(C.SipDTMFReceived, o, a), a == null || a.emit(
|
|
15785
|
+
this.emit(C.SipDTMFReceived, o, a), a == null || a.emit(R.SipDTMFReceived, o);
|
|
15786
15786
|
}, this.handleTranscription = (a, o) => {
|
|
15787
15787
|
const c = o.transcribedParticipantIdentity === this.localParticipant.identity ? this.localParticipant : this.getParticipantByIdentity(o.transcribedParticipantIdentity), d = c == null ? void 0 : c.trackPublications.get(o.trackId), l = gl(o, this.transcriptionReceivedTimes);
|
|
15788
|
-
d == null || d.emit(_.TranscriptionReceived, l), c == null || c.emit(
|
|
15788
|
+
d == null || d.emit(_.TranscriptionReceived, l), c == null || c.emit(R.TranscriptionReceived, l, d), this.emit(C.TranscriptionReceived, l, c, d);
|
|
15789
15789
|
}, this.handleChatMessage = (a, o) => {
|
|
15790
15790
|
const c = vl(o);
|
|
15791
15791
|
this.emit(C.ChatMessage, c, a);
|
|
@@ -15923,7 +15923,7 @@ class _t extends Re.EventEmitter {
|
|
|
15923
15923
|
}
|
|
15924
15924
|
setupE2EE() {
|
|
15925
15925
|
var e;
|
|
15926
|
-
this.options.e2ee && ("e2eeManager" in this.options.e2ee ? this.e2eeManager = this.options.e2ee.e2eeManager : this.e2eeManager = new
|
|
15926
|
+
this.options.e2ee && ("e2eeManager" in this.options.e2ee ? this.e2eeManager = this.options.e2ee.e2eeManager : this.e2eeManager = new wl(this.options.e2ee), this.e2eeManager.on(He.ParticipantEncryptionStatusChanged, (t, i) => {
|
|
15927
15927
|
yl(i) && (this.isE2EEEnabled = t), this.emit(C.ParticipantEncryptionStatusChanged, t, i);
|
|
15928
15928
|
}), this.e2eeManager.on(He.EncryptionError, (t) => this.emit(C.EncryptionError, t)), (e = this.e2eeManager) === null || e === void 0 || e.setup(this));
|
|
15929
15929
|
}
|
|
@@ -15951,10 +15951,10 @@ class _t extends Re.EventEmitter {
|
|
|
15951
15951
|
return f(this, void 0, void 0, function* () {
|
|
15952
15952
|
return this.state === V.Disconnected ? "" : this.roomInfo && this.roomInfo.sid !== "" ? this.roomInfo.sid : new Promise((e, t) => {
|
|
15953
15953
|
const i = (s) => {
|
|
15954
|
-
s.sid !== "" && (this.engine.off(
|
|
15954
|
+
s.sid !== "" && (this.engine.off(w.RoomUpdate, i), e(s.sid));
|
|
15955
15955
|
};
|
|
15956
|
-
this.engine.on(
|
|
15957
|
-
this.engine.off(
|
|
15956
|
+
this.engine.on(w.RoomUpdate, i), this.once(C.Disconnected, () => {
|
|
15957
|
+
this.engine.off(w.RoomUpdate, i), t("Room disconnected before room server id was available");
|
|
15958
15958
|
});
|
|
15959
15959
|
});
|
|
15960
15960
|
});
|
|
@@ -15978,21 +15978,21 @@ class _t extends Re.EventEmitter {
|
|
|
15978
15978
|
return (t = (e = this.roomInfo) === null || e === void 0 ? void 0 : e.numPublishers) !== null && t !== void 0 ? t : 0;
|
|
15979
15979
|
}
|
|
15980
15980
|
maybeCreateEngine() {
|
|
15981
|
-
this.engine && !this.engine.isClosed || (this.engine = new hu(this.options), this.engine.on(
|
|
15981
|
+
this.engine && !this.engine.isClosed || (this.engine = new hu(this.options), this.engine.on(w.ParticipantUpdate, this.handleParticipantUpdates).on(w.RoomUpdate, this.handleRoomUpdate).on(w.SpeakersChanged, this.handleSpeakersChanged).on(w.StreamStateChanged, this.handleStreamStateUpdate).on(w.ConnectionQualityUpdate, this.handleConnectionQualityUpdate).on(w.SubscriptionError, this.handleSubscriptionError).on(w.SubscriptionPermissionUpdate, this.handleSubscriptionPermissionUpdate).on(w.MediaTrackAdded, (e, t, i) => {
|
|
15982
15982
|
this.onTrackAdded(e, t, i);
|
|
15983
|
-
}).on(
|
|
15983
|
+
}).on(w.Disconnected, (e) => {
|
|
15984
15984
|
this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, e);
|
|
15985
|
-
}).on(
|
|
15985
|
+
}).on(w.ActiveSpeakersUpdate, this.handleActiveSpeakersUpdate).on(w.DataPacketReceived, this.handleDataPacket).on(w.Resuming, () => {
|
|
15986
15986
|
this.clearConnectionReconcile(), this.isResuming = !0, this.log.info("Resuming signal connection", this.logContext), this.setAndEmitConnectionState(V.SignalReconnecting) && this.emit(C.SignalReconnecting);
|
|
15987
|
-
}).on(
|
|
15987
|
+
}).on(w.Resumed, () => {
|
|
15988
15988
|
this.registerConnectionReconcile(), this.isResuming = !1, this.log.info("Resumed signal connection", this.logContext), this.updateSubscriptions(), this.emitBufferedEvents(), this.setAndEmitConnectionState(V.Connected) && this.emit(C.Reconnected);
|
|
15989
|
-
}).on(
|
|
15989
|
+
}).on(w.SignalResumed, () => {
|
|
15990
15990
|
this.bufferedEvents = [], (this.state === V.Reconnecting || this.isResuming) && this.sendSyncState();
|
|
15991
|
-
}).on(
|
|
15991
|
+
}).on(w.Restarting, this.handleRestarting).on(w.SignalRestarted, this.handleSignalRestarted).on(w.Offline, () => {
|
|
15992
15992
|
this.setAndEmitConnectionState(V.Reconnecting) && this.emit(C.Reconnecting);
|
|
15993
|
-
}).on(
|
|
15993
|
+
}).on(w.DCBufferStatusChanged, (e, t) => {
|
|
15994
15994
|
this.emit(C.DCBufferStatusChanged, e, t);
|
|
15995
|
-
}).on(
|
|
15995
|
+
}).on(w.LocalTrackSubscribed, (e) => {
|
|
15996
15996
|
const t = this.localParticipant.getTrackPublications().find((i) => {
|
|
15997
15997
|
let {
|
|
15998
15998
|
trackSid: s
|
|
@@ -16003,8 +16003,8 @@ class _t extends Re.EventEmitter {
|
|
|
16003
16003
|
this.log.warn("could not find local track subscription for subscribed event", this.logContext);
|
|
16004
16004
|
return;
|
|
16005
16005
|
}
|
|
16006
|
-
this.localParticipant.emit(
|
|
16007
|
-
}).on(
|
|
16006
|
+
this.localParticipant.emit(R.LocalTrackSubscribed, t), this.emitWhenConnected(C.LocalTrackSubscribed, t, this.localParticipant);
|
|
16007
|
+
}).on(w.RoomMoved, (e) => {
|
|
16008
16008
|
this.log.debug("room moved", e), e.room && this.handleRoomUpdate(e.room), this.remoteParticipants.forEach((t, i) => {
|
|
16009
16009
|
this.handleParticipantDisconnected(i, t);
|
|
16010
16010
|
}), this.emit(C.Moved, e.room.name), e.participant ? this.handleParticipantUpdates([e.participant, ...e.otherParticipants]) : this.handleParticipantUpdates(e.otherParticipants);
|
|
@@ -16142,7 +16142,7 @@ class _t extends Re.EventEmitter {
|
|
|
16142
16142
|
}
|
|
16143
16143
|
}), i = () => f(this, void 0, void 0, function* () {
|
|
16144
16144
|
const r = this.engine.client.onLeave;
|
|
16145
|
-
r && r(new
|
|
16145
|
+
r && r(new wi({
|
|
16146
16146
|
reason: ve.CLIENT_INITIATED,
|
|
16147
16147
|
action: bt.RECONNECT
|
|
16148
16148
|
}));
|
|
@@ -16259,7 +16259,7 @@ class _t extends Re.EventEmitter {
|
|
|
16259
16259
|
});
|
|
16260
16260
|
}
|
|
16261
16261
|
setupLocalParticipantEvents() {
|
|
16262
|
-
this.localParticipant.on(
|
|
16262
|
+
this.localParticipant.on(R.ParticipantMetadataChanged, this.onLocalParticipantMetadataChanged).on(R.ParticipantNameChanged, this.onLocalParticipantNameChanged).on(R.AttributesChanged, this.onLocalAttributesChanged).on(R.TrackMuted, this.onLocalTrackMuted).on(R.TrackUnmuted, this.onLocalTrackUnmuted).on(R.LocalTrackPublished, this.onLocalTrackPublished).on(R.LocalTrackUnpublished, this.onLocalTrackUnpublished).on(R.ConnectionQualityChanged, this.onLocalConnectionQualityChanged).on(R.MediaDevicesError, this.onMediaDevicesError).on(R.AudioStreamAcquired, this.startAudio).on(R.ChatMessage, this.onLocalChatMessageSent).on(R.ParticipantPermissionsChanged, this.onLocalParticipantPermissionsChanged);
|
|
16263
16263
|
}
|
|
16264
16264
|
recreateEngine() {
|
|
16265
16265
|
var e;
|
|
@@ -16312,7 +16312,7 @@ class _t extends Re.EventEmitter {
|
|
|
16312
16312
|
}), this.localParticipant.trackPublications.forEach((s) => {
|
|
16313
16313
|
var r, a, o;
|
|
16314
16314
|
s.track && this.localParticipant.unpublishTrack(s.track, e), e ? ((r = s.track) === null || r === void 0 || r.detach(), (a = s.track) === null || a === void 0 || a.stop()) : (o = s.track) === null || o === void 0 || o.stopMonitor();
|
|
16315
|
-
}), this.localParticipant.off(
|
|
16315
|
+
}), this.localParticipant.off(R.ParticipantMetadataChanged, this.onLocalParticipantMetadataChanged).off(R.ParticipantNameChanged, this.onLocalParticipantNameChanged).off(R.AttributesChanged, this.onLocalAttributesChanged).off(R.TrackMuted, this.onLocalTrackMuted).off(R.TrackUnmuted, this.onLocalTrackUnmuted).off(R.LocalTrackPublished, this.onLocalTrackPublished).off(R.LocalTrackUnpublished, this.onLocalTrackUnpublished).off(R.ConnectionQualityChanged, this.onLocalConnectionQualityChanged).off(R.MediaDevicesError, this.onMediaDevicesError).off(R.AudioStreamAcquired, this.startAudio).off(R.ChatMessage, this.onLocalChatMessageSent).off(R.ParticipantPermissionsChanged, this.onLocalParticipantPermissionsChanged), this.localParticipant.trackPublications.clear(), this.localParticipant.videoTrackPublications.clear(), this.localParticipant.audioTrackPublications.clear(), this.remoteParticipants.clear(), this.sidToIdentity.clear(), this.activeSpeakers = [], this.audioContext && typeof this.options.webAudioMix == "boolean" && (this.audioContext.close(), this.audioContext = void 0), re() && (window.removeEventListener("beforeunload", this.onPageLeave), window.removeEventListener("pagehide", this.onPageLeave), window.removeEventListener("freeze", this.onPageLeave), (i = navigator.mediaDevices) === null || i === void 0 || i.removeEventListener("devicechange", this.handleDeviceChange));
|
|
16316
16316
|
} finally {
|
|
16317
16317
|
this.setAndEmitConnectionState(V.Disconnected), this.emit(C.Disconnected, t);
|
|
16318
16318
|
}
|
|
@@ -16409,35 +16409,35 @@ class _t extends Re.EventEmitter {
|
|
|
16409
16409
|
return t && s.updateInfo(t) && this.sidToIdentity.set(t.sid, t.identity), s;
|
|
16410
16410
|
}
|
|
16411
16411
|
const i = this.createParticipant(e, t);
|
|
16412
|
-
return this.remoteParticipants.set(e, i), this.sidToIdentity.set(t.sid, t.identity), this.emitWhenConnected(C.ParticipantConnected, i), i.on(
|
|
16412
|
+
return this.remoteParticipants.set(e, i), this.sidToIdentity.set(t.sid, t.identity), this.emitWhenConnected(C.ParticipantConnected, i), i.on(R.TrackPublished, (s) => {
|
|
16413
16413
|
this.emitWhenConnected(C.TrackPublished, s, i);
|
|
16414
|
-
}).on(
|
|
16414
|
+
}).on(R.TrackSubscribed, (s, r) => {
|
|
16415
16415
|
s.kind === k.Kind.Audio ? (s.on(_.AudioPlaybackStarted, this.handleAudioPlaybackStarted), s.on(_.AudioPlaybackFailed, this.handleAudioPlaybackFailed)) : s.kind === k.Kind.Video && (s.on(_.VideoPlaybackFailed, this.handleVideoPlaybackFailed), s.on(_.VideoPlaybackStarted, this.handleVideoPlaybackStarted)), this.emit(C.TrackSubscribed, s, r, i);
|
|
16416
|
-
}).on(
|
|
16416
|
+
}).on(R.TrackUnpublished, (s) => {
|
|
16417
16417
|
this.emit(C.TrackUnpublished, s, i);
|
|
16418
|
-
}).on(
|
|
16418
|
+
}).on(R.TrackUnsubscribed, (s, r) => {
|
|
16419
16419
|
this.emit(C.TrackUnsubscribed, s, r, i);
|
|
16420
|
-
}).on(
|
|
16420
|
+
}).on(R.TrackMuted, (s) => {
|
|
16421
16421
|
this.emitWhenConnected(C.TrackMuted, s, i);
|
|
16422
|
-
}).on(
|
|
16422
|
+
}).on(R.TrackUnmuted, (s) => {
|
|
16423
16423
|
this.emitWhenConnected(C.TrackUnmuted, s, i);
|
|
16424
|
-
}).on(
|
|
16424
|
+
}).on(R.ParticipantMetadataChanged, (s) => {
|
|
16425
16425
|
this.emitWhenConnected(C.ParticipantMetadataChanged, s, i);
|
|
16426
|
-
}).on(
|
|
16426
|
+
}).on(R.ParticipantNameChanged, (s) => {
|
|
16427
16427
|
this.emitWhenConnected(C.ParticipantNameChanged, s, i);
|
|
16428
|
-
}).on(
|
|
16428
|
+
}).on(R.AttributesChanged, (s) => {
|
|
16429
16429
|
this.emitWhenConnected(C.ParticipantAttributesChanged, s, i);
|
|
16430
|
-
}).on(
|
|
16430
|
+
}).on(R.ConnectionQualityChanged, (s) => {
|
|
16431
16431
|
this.emitWhenConnected(C.ConnectionQualityChanged, s, i);
|
|
16432
|
-
}).on(
|
|
16432
|
+
}).on(R.ParticipantPermissionsChanged, (s) => {
|
|
16433
16433
|
this.emitWhenConnected(C.ParticipantPermissionsChanged, s, i);
|
|
16434
|
-
}).on(
|
|
16434
|
+
}).on(R.TrackSubscriptionStatusChanged, (s, r) => {
|
|
16435
16435
|
this.emitWhenConnected(C.TrackSubscriptionStatusChanged, s, r, i);
|
|
16436
|
-
}).on(
|
|
16436
|
+
}).on(R.TrackSubscriptionFailed, (s, r) => {
|
|
16437
16437
|
this.emit(C.TrackSubscriptionFailed, s, i, r);
|
|
16438
|
-
}).on(
|
|
16438
|
+
}).on(R.TrackSubscriptionPermissionChanged, (s, r) => {
|
|
16439
16439
|
this.emitWhenConnected(C.TrackSubscriptionPermissionChanged, s, r, i);
|
|
16440
|
-
}).on(
|
|
16440
|
+
}).on(R.Active, () => {
|
|
16441
16441
|
this.emitWhenConnected(C.ParticipantActive, i), i.kind === Wt.AGENT && this.localParticipant.setActiveAgent(i);
|
|
16442
16442
|
}), t && i.updateInfo(t), i;
|
|
16443
16443
|
}
|
|
@@ -16544,7 +16544,7 @@ class _t extends Re.EventEmitter {
|
|
|
16544
16544
|
loggerName: this.options.loggerName,
|
|
16545
16545
|
loggerContextCb: () => this.logContext
|
|
16546
16546
|
});
|
|
16547
|
-
this.localParticipant.addTrackPublication(a), this.localParticipant.emit(
|
|
16547
|
+
this.localParticipant.addTrackPublication(a), this.localParticipant.emit(R.LocalTrackPublished, a);
|
|
16548
16548
|
}
|
|
16549
16549
|
if (s.audio) {
|
|
16550
16550
|
const a = new Vn(k.Kind.Audio, new ft({
|
|
@@ -16560,7 +16560,7 @@ class _t extends Re.EventEmitter {
|
|
|
16560
16560
|
loggerName: this.options.loggerName,
|
|
16561
16561
|
loggerContextCb: () => this.logContext
|
|
16562
16562
|
});
|
|
16563
|
-
this.localParticipant.addTrackPublication(a), this.localParticipant.emit(
|
|
16563
|
+
this.localParticipant.addTrackPublication(a), this.localParticipant.emit(R.LocalTrackPublished, a);
|
|
16564
16564
|
}
|
|
16565
16565
|
for (let a = 0; a < r.count - 1; a += 1) {
|
|
16566
16566
|
let o = new st({
|
|
@@ -16618,7 +16618,7 @@ var fe;
|
|
|
16618
16618
|
(function(n) {
|
|
16619
16619
|
n[n.IDLE = 0] = "IDLE", n[n.RUNNING = 1] = "RUNNING", n[n.SKIPPED = 2] = "SKIPPED", n[n.SUCCESS = 3] = "SUCCESS", n[n.FAILED = 4] = "FAILED";
|
|
16620
16620
|
})(fe || (fe = {}));
|
|
16621
|
-
class Ye extends
|
|
16621
|
+
class Ye extends we.EventEmitter {
|
|
16622
16622
|
constructor(e, t) {
|
|
16623
16623
|
let i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
16624
16624
|
super(), this.status = fe.IDLE, this.logs = [], this.options = {}, this.url = e, this.token = t, this.name = this.constructor.name, this.room = new _t(i.roomOptions), this.connectOptions = i.connectOptions, this.options = i;
|
|
@@ -16997,7 +16997,7 @@ class Bu extends Ye {
|
|
|
16997
16997
|
});
|
|
16998
16998
|
}
|
|
16999
16999
|
}
|
|
17000
|
-
class Ju extends
|
|
17000
|
+
class Ju extends we.EventEmitter {
|
|
17001
17001
|
constructor(e, t) {
|
|
17002
17002
|
let i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
17003
17003
|
super(), this.options = {}, this.checkResults = /* @__PURE__ */ new Map(), this.url = e, this.token = t, this.options = i;
|
|
@@ -17084,7 +17084,7 @@ class Po extends EventTarget {
|
|
|
17084
17084
|
this._serviceUrl = e;
|
|
17085
17085
|
}
|
|
17086
17086
|
get serviceUrl() {
|
|
17087
|
-
return this._serviceUrl ?? "https://
|
|
17087
|
+
return this._serviceUrl ?? "https://voice.dev.hanc.me";
|
|
17088
17088
|
}
|
|
17089
17089
|
get status() {
|
|
17090
17090
|
return this.callStatus;
|
|
@@ -17310,7 +17310,7 @@ const _o = mt`
|
|
|
17310
17310
|
0 0 2.81.7A2 2 0 0 1 22 16.92z"
|
|
17311
17311
|
/>
|
|
17312
17312
|
</svg>
|
|
17313
|
-
`,
|
|
17313
|
+
`, Ro = mt`
|
|
17314
17314
|
<svg
|
|
17315
17315
|
xmlns="http://www.w3.org/2000/svg"
|
|
17316
17316
|
width="22"
|
|
@@ -17334,7 +17334,7 @@ const _o = mt`
|
|
|
17334
17334
|
<line x1="22" x2="2" y1="2" y2="22" />
|
|
17335
17335
|
</svg>
|
|
17336
17336
|
`;
|
|
17337
|
-
var Vu = Object.defineProperty, qu = Object.getOwnPropertyDescriptor,
|
|
17337
|
+
var Vu = Object.defineProperty, qu = Object.getOwnPropertyDescriptor, Rt = (n, e, t, i) => {
|
|
17338
17338
|
for (var s = i > 1 ? void 0 : i ? qu(e, t) : e, r = n.length - 1, a; r >= 0; r--)
|
|
17339
17339
|
(a = n[r]) && (s = (i ? a(e, t, s) : a(s)) || s);
|
|
17340
17340
|
return i && s && Vu(e, t, s), s;
|
|
@@ -17415,7 +17415,7 @@ let Je = class extends gt {
|
|
|
17415
17415
|
?disabled=${this.callStatus === "connecting"}
|
|
17416
17416
|
>
|
|
17417
17417
|
${this.callStatus === "connected" ? mt`<div part="call-off-icon" class="call-off-icon">
|
|
17418
|
-
${
|
|
17418
|
+
${Ro}
|
|
17419
17419
|
</div>` : mt`
|
|
17420
17420
|
<div part="icon-button" class="icon-button">${_o}</div>
|
|
17421
17421
|
<span part="button-text">${this.buttonText}</span>
|
|
@@ -17427,22 +17427,22 @@ let Je = class extends gt {
|
|
|
17427
17427
|
}
|
|
17428
17428
|
};
|
|
17429
17429
|
Je.styles = [Nr, Qo];
|
|
17430
|
-
|
|
17430
|
+
Rt([
|
|
17431
17431
|
ye({ type: String, attribute: "agent-id" })
|
|
17432
17432
|
], Je.prototype, "agentId", 2);
|
|
17433
|
-
|
|
17433
|
+
Rt([
|
|
17434
17434
|
ye({ type: String, attribute: "voice-service-url" })
|
|
17435
17435
|
], Je.prototype, "voiceServiceUrl", 2);
|
|
17436
|
-
|
|
17436
|
+
Rt([
|
|
17437
17437
|
Mr()
|
|
17438
17438
|
], Je.prototype, "callStatus", 2);
|
|
17439
|
-
|
|
17439
|
+
Rt([
|
|
17440
17440
|
ye({ type: String, attribute: "button-start-text" })
|
|
17441
17441
|
], Je.prototype, "buttonStartText", 2);
|
|
17442
|
-
|
|
17442
|
+
Rt([
|
|
17443
17443
|
ye({ type: String, attribute: "button-connecting-text" })
|
|
17444
17444
|
], Je.prototype, "buttonConnectingText", 2);
|
|
17445
|
-
Je =
|
|
17445
|
+
Je = Rt([
|
|
17446
17446
|
Dr("hanc-ai-inline-call")
|
|
17447
17447
|
], Je);
|
|
17448
17448
|
const $u = Hn`
|
|
@@ -17595,7 +17595,7 @@ var Hu = Object.defineProperty, zu = Object.getOwnPropertyDescriptor, Xe = (n, e
|
|
|
17595
17595
|
(a = n[r]) && (s = (i ? a(e, t, s) : a(s)) || s);
|
|
17596
17596
|
return i && s && Hu(e, t, s), s;
|
|
17597
17597
|
};
|
|
17598
|
-
let
|
|
17598
|
+
let Re = class extends gt {
|
|
17599
17599
|
constructor() {
|
|
17600
17600
|
super(...arguments), this.callManager = new Po(), this.callStatus = "idle", this.labelText = "Need a help?", this.buttonStartText = "Start Call with ai", this.buttonConnectingText = "Connecting...", this.buttonEndText = "End call", this.handleStatusChange = (n) => {
|
|
17601
17601
|
switch (n.detail) {
|
|
@@ -17675,7 +17675,7 @@ let we = class extends gt {
|
|
|
17675
17675
|
?disabled=${this.callStatus === "connecting"}
|
|
17676
17676
|
>
|
|
17677
17677
|
<div part="icon-button" class="icon-button">
|
|
17678
|
-
${this.callStatus === "connected" ?
|
|
17678
|
+
${this.callStatus === "connected" ? Ro : _o}
|
|
17679
17679
|
</div>
|
|
17680
17680
|
<span part="button-text"> ${this.buttonText} </span>
|
|
17681
17681
|
</button>
|
|
@@ -17684,32 +17684,32 @@ let we = class extends gt {
|
|
|
17684
17684
|
`;
|
|
17685
17685
|
}
|
|
17686
17686
|
};
|
|
17687
|
-
|
|
17687
|
+
Re.styles = [Nr, $u];
|
|
17688
17688
|
Xe([
|
|
17689
17689
|
ye({ type: String, attribute: "agent-id" })
|
|
17690
|
-
],
|
|
17690
|
+
], Re.prototype, "agentId", 2);
|
|
17691
17691
|
Xe([
|
|
17692
17692
|
ye({ type: String, attribute: "voice-service-url" })
|
|
17693
|
-
],
|
|
17693
|
+
], Re.prototype, "voiceServiceUrl", 2);
|
|
17694
17694
|
Xe([
|
|
17695
17695
|
Mr()
|
|
17696
|
-
],
|
|
17696
|
+
], Re.prototype, "callStatus", 2);
|
|
17697
17697
|
Xe([
|
|
17698
17698
|
ye({ type: String, attribute: "label-text" })
|
|
17699
|
-
],
|
|
17699
|
+
], Re.prototype, "labelText", 2);
|
|
17700
17700
|
Xe([
|
|
17701
17701
|
ye({ type: String, attribute: "button-start-text" })
|
|
17702
|
-
],
|
|
17702
|
+
], Re.prototype, "buttonStartText", 2);
|
|
17703
17703
|
Xe([
|
|
17704
17704
|
ye({ type: String, attribute: "button-connecting-text" })
|
|
17705
|
-
],
|
|
17705
|
+
], Re.prototype, "buttonConnectingText", 2);
|
|
17706
17706
|
Xe([
|
|
17707
17707
|
ye({ type: String, attribute: "button-end-text" })
|
|
17708
|
-
],
|
|
17709
|
-
|
|
17708
|
+
], Re.prototype, "buttonEndText", 2);
|
|
17709
|
+
Re = Xe([
|
|
17710
17710
|
Dr("hanc-ai-floating-call")
|
|
17711
|
-
],
|
|
17711
|
+
], Re);
|
|
17712
17712
|
export {
|
|
17713
|
-
|
|
17713
|
+
Re as FloatingCall,
|
|
17714
17714
|
Je as InlineCall
|
|
17715
17715
|
};
|