@realsee/live 0.6.8-dev.1 → 0.6.8-dev.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/index.cjs.js +7 -7
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +312 -311
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -3,13 +3,13 @@ var $t = (r, s, e) => s in r ? Vt(r, s, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var o = (r, s, e) => ($t(r, typeof s != "symbol" ? s + "" : s, e), e);
|
|
4
4
|
import xt from "@realsee/jsbridge-x";
|
|
5
5
|
import Ne from "trtc-js-sdk";
|
|
6
|
-
import { ConsoleLogger as Ut, LogLevel as Ft, DefaultDeviceController as
|
|
6
|
+
import { ConsoleLogger as Ut, LogLevel as Ft, DefaultDeviceController as Wt, MeetingSessionConfiguration as Bt, DefaultMeetingSession as Kt, DefaultModality as tt, MeetingSessionStatusCode as qt } from "amazon-chime-sdk-js";
|
|
7
7
|
import D, { createContext as Gt } from "react";
|
|
8
8
|
const ce = Symbol("$$REALSEE_LIVE_EVENT$$");
|
|
9
9
|
function pe(r) {
|
|
10
10
|
return r[ce] || (r[ce] = {}), r[ce];
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function Ht(r) {
|
|
13
13
|
r[ce] || delete r[ce];
|
|
14
14
|
}
|
|
15
15
|
class ue {
|
|
@@ -56,7 +56,7 @@ class ue {
|
|
|
56
56
|
*/
|
|
57
57
|
off(s, e) {
|
|
58
58
|
if (s === void 0) {
|
|
59
|
-
|
|
59
|
+
Ht(this);
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
const i = pe(this);
|
|
@@ -80,8 +80,8 @@ class ue {
|
|
|
80
80
|
let i = !1;
|
|
81
81
|
const c = pe(this)[s] || [];
|
|
82
82
|
for (let u of c.slice()) {
|
|
83
|
-
const [d,
|
|
84
|
-
|
|
83
|
+
const [d, m = !1] = u, p = d(...e);
|
|
84
|
+
m && this.off(s, d), p === !1 && (i = !0);
|
|
85
85
|
}
|
|
86
86
|
return i;
|
|
87
87
|
}
|
|
@@ -89,11 +89,11 @@ class ue {
|
|
|
89
89
|
class Me extends ue {
|
|
90
90
|
}
|
|
91
91
|
var Q = /* @__PURE__ */ ((r) => (r.RealseeBrowserRTC = "RealseeBrowserRTC", r.RealseeVRWebViewRTC = "RealseeVRWebViewRTC", r.RealseeBrowserChimeRTC = "RealseeBrowserChimeRTC", r))(Q || {}), ut = /* @__PURE__ */ ((r) => (r.RealseeXTRTC = "trtc", r.RealseeXChimeRTC = "chime", r))(ut || {});
|
|
92
|
-
const
|
|
92
|
+
const Yt = () => {
|
|
93
93
|
const r = new Date(), s = r.getFullYear(), e = (r.getMonth() + 1).toString().padStart(2, "0"), i = r.getDate().toString().padStart(2, "0"), n = r.getHours().toString().padStart(2, "0"), c = r.getMinutes().toString().padStart(2, "0"), u = r.getSeconds().toString().padStart(2, "0"), d = r.getMilliseconds();
|
|
94
94
|
return `[${s}-${e}-${i} ${n}:${c}:${u}.${d}]`;
|
|
95
95
|
}, be = (r, s = []) => {
|
|
96
|
-
switch (s.unshift(`Realsee Live ${
|
|
96
|
+
switch (s.unshift(`Realsee Live ${Yt()} <${r}> `), r) {
|
|
97
97
|
case "INFO":
|
|
98
98
|
return console.info(...s);
|
|
99
99
|
case "ERROR":
|
|
@@ -108,7 +108,7 @@ const Ht = () => {
|
|
|
108
108
|
info: zt,
|
|
109
109
|
error: Xt,
|
|
110
110
|
warn: Zt
|
|
111
|
-
},
|
|
111
|
+
}, _ = Qt;
|
|
112
112
|
function X() {
|
|
113
113
|
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
114
114
|
}
|
|
@@ -173,8 +173,8 @@ class rt extends Me {
|
|
|
173
173
|
u.id = c, this.$dom.appendChild(u), typeof this._autoPlayConfirm == "function" ? (i.play(c).catch((d) => {
|
|
174
174
|
}), i.on("error", (d) => {
|
|
175
175
|
if (d.getCode() === 16451) {
|
|
176
|
-
const
|
|
177
|
-
this._autoPlayConfirm({ onConfirm:
|
|
176
|
+
const p = () => i.resume();
|
|
177
|
+
this._autoPlayConfirm({ onConfirm: p });
|
|
178
178
|
}
|
|
179
179
|
})) : i.play(c);
|
|
180
180
|
});
|
|
@@ -194,7 +194,7 @@ class rt extends Me {
|
|
|
194
194
|
const i = { audio: !0, video: !1 };
|
|
195
195
|
try {
|
|
196
196
|
navigator.mediaDevices.getUserMedia(i).then(() => e(!0)).catch((n) => {
|
|
197
|
-
|
|
197
|
+
_.error(n.message), e(!1);
|
|
198
198
|
});
|
|
199
199
|
} catch (n) {
|
|
200
200
|
console.error(n), e(!1);
|
|
@@ -216,9 +216,9 @@ class rt extends Me {
|
|
|
216
216
|
"audio-volume",
|
|
217
217
|
(u) => this.emit(
|
|
218
218
|
"userVolumes",
|
|
219
|
-
u.result.map(({ userId: d, audioVolume:
|
|
219
|
+
u.result.map(({ userId: d, audioVolume: m }) => ({
|
|
220
220
|
userId: d,
|
|
221
|
-
audioVolume:
|
|
221
|
+
audioVolume: m
|
|
222
222
|
}))
|
|
223
223
|
)
|
|
224
224
|
), (c = this._trtc.client) == null || c.on("error", (u) => this.emit("error", u));
|
|
@@ -288,7 +288,7 @@ class it extends Me {
|
|
|
288
288
|
if (this.$audio.paused) {
|
|
289
289
|
const i = () => this.$audio.play().then(() => {
|
|
290
290
|
}).catch((n) => {
|
|
291
|
-
if (
|
|
291
|
+
if (_.error("播放远端流失败!", n), typeof this._autoPlayConfirm == "function") {
|
|
292
292
|
const c = () => i();
|
|
293
293
|
this._autoPlayConfirm({ onConfirm: c });
|
|
294
294
|
}
|
|
@@ -304,46 +304,46 @@ class it extends Me {
|
|
|
304
304
|
* 注册rtc事件
|
|
305
305
|
*/
|
|
306
306
|
o(this, "_registerRtcEvent", () => {
|
|
307
|
-
var i, n, c, u, d,
|
|
307
|
+
var i, n, c, u, d, m;
|
|
308
308
|
const e = ((c = (n = (i = this.meetingSession) == null ? void 0 : i.configuration) == null ? void 0 : n.credentials) == null ? void 0 : c.attendeeId) || "";
|
|
309
309
|
if (e) {
|
|
310
|
-
const
|
|
311
|
-
const
|
|
312
|
-
return
|
|
313
|
-
|
|
310
|
+
const p = /* @__PURE__ */ new Map(), y = () => {
|
|
311
|
+
const b = [];
|
|
312
|
+
return p.forEach((I, g) => {
|
|
313
|
+
b.push({
|
|
314
314
|
userId: I.userId,
|
|
315
315
|
volume: I.muted || I.signalStrength === 0 || !Boolean(I.volume) ? 0 : I.volume
|
|
316
316
|
});
|
|
317
|
-
}),
|
|
317
|
+
}), b;
|
|
318
318
|
};
|
|
319
319
|
(u = this.meetingSession) == null || u.audioVideo.realtimeSubscribeToAttendeeIdPresence(
|
|
320
|
-
(
|
|
320
|
+
(b, I, g) => {
|
|
321
321
|
var V;
|
|
322
322
|
if (!I) {
|
|
323
|
-
|
|
323
|
+
p.delete(b), this.emit("userVolumes", y());
|
|
324
324
|
return;
|
|
325
325
|
}
|
|
326
326
|
(V = this.meetingSession) == null || V.audioVideo.realtimeSubscribeToVolumeIndicator(
|
|
327
|
-
|
|
328
|
-
(
|
|
329
|
-
new tt(
|
|
330
|
-
userId:
|
|
327
|
+
b,
|
|
328
|
+
(w, k, U, P) => {
|
|
329
|
+
new tt(w).base() === w && (p.set(w, {
|
|
330
|
+
userId: g || w,
|
|
331
331
|
volume: k,
|
|
332
332
|
muted: U,
|
|
333
333
|
signalStrength: P
|
|
334
|
-
}), this.emit("userVolumes",
|
|
334
|
+
}), this.emit("userVolumes", y()));
|
|
335
335
|
}
|
|
336
336
|
);
|
|
337
337
|
}
|
|
338
338
|
), (d = this.meetingSession) == null || d.audioVideo.realtimeSubscribeToVolumeIndicator(
|
|
339
339
|
e,
|
|
340
|
-
(
|
|
341
|
-
new tt(
|
|
340
|
+
(b, I, g, V) => {
|
|
341
|
+
new tt(b).base() === b && V !== null && V !== 1 && this.emit("weakNetwork");
|
|
342
342
|
}
|
|
343
|
-
), (
|
|
343
|
+
), (m = this.meetingSession) == null || m.audioVideo.realtimeSubscribeToFatalError((b) => this.emit("error", b));
|
|
344
344
|
}
|
|
345
345
|
});
|
|
346
|
-
this._getVoiceSign = e.getVoiceSign, this._autoPlayConfirm = e.autoPlayConfirm, this._initDom(), this.logger = new Ut("WebRTCLogger", e.logLevel || Ft.INFO), this.deviceController = new
|
|
346
|
+
this._getVoiceSign = e.getVoiceSign, this._autoPlayConfirm = e.autoPlayConfirm, this._initDom(), this.logger = new Ut("WebRTCLogger", e.logLevel || Ft.INFO), this.deviceController = new Wt(this.logger), this.initObservers();
|
|
347
347
|
}
|
|
348
348
|
/**
|
|
349
349
|
* 加入语音会议
|
|
@@ -355,30 +355,30 @@ class it extends Me {
|
|
|
355
355
|
var c, u;
|
|
356
356
|
this.emit("joinWillStart");
|
|
357
357
|
try {
|
|
358
|
-
const { sdkAppId: d, userId:
|
|
358
|
+
const { sdkAppId: d, userId: m, roomId: p, userSig: y } = await this._getVoiceSign({
|
|
359
359
|
...e,
|
|
360
360
|
roomId: e.roomId || 0
|
|
361
361
|
});
|
|
362
|
-
this.userId =
|
|
363
|
-
const { attendence:
|
|
364
|
-
decodeURIComponent(
|
|
365
|
-
),
|
|
362
|
+
this.userId = m;
|
|
363
|
+
const { attendence: b, vendor_wrapper: I } = JSON.parse(
|
|
364
|
+
decodeURIComponent(y)
|
|
365
|
+
), g = new Bt(
|
|
366
366
|
{
|
|
367
367
|
Meeting: I
|
|
368
368
|
},
|
|
369
369
|
{
|
|
370
370
|
Attendee: {
|
|
371
|
-
ExternalUserId:
|
|
372
|
-
AttendeeId:
|
|
373
|
-
JoinToken:
|
|
371
|
+
ExternalUserId: b.external_user_id,
|
|
372
|
+
AttendeeId: b.attendee_id,
|
|
373
|
+
JoinToken: b.join_token
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
);
|
|
377
|
-
this.meetingSession = new Kt(
|
|
377
|
+
this.meetingSession = new Kt(g, this.logger, this.deviceController), this._registerRtcEvent(), this.meetingSession.audioVideo.addDeviceChangeObserver(this.deviceChangeObserver), this.meetingSession.audioVideo.addObserver(this.audioVideoObserver), this.meetingSession.audioVideo.bindAudioElement(this.$audio);
|
|
378
378
|
const V = {
|
|
379
379
|
audioVideoDidStart: () => {
|
|
380
|
-
var
|
|
381
|
-
(
|
|
380
|
+
var w;
|
|
381
|
+
(w = this.meetingSession) == null || w.audioVideo.realtimeMuteLocalAudio(), this.joined = !0, this.emit("joined"), i(!0);
|
|
382
382
|
},
|
|
383
383
|
audioVideoDidStop: () => {
|
|
384
384
|
this.joined = !1, i(!1);
|
|
@@ -388,20 +388,20 @@ class it extends Me {
|
|
|
388
388
|
async () => await navigator.mediaDevices.getUserMedia({ audio: !0, video: !1 })
|
|
389
389
|
);
|
|
390
390
|
try {
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
const k = ((c =
|
|
391
|
+
const w = await this.meetingSession.audioVideo.listAudioInputDevices();
|
|
392
|
+
_.info("audioInputDevices ===>", w);
|
|
393
|
+
const k = ((c = w[0]) == null ? void 0 : c.deviceId) || "default";
|
|
394
394
|
await this.meetingSession.audioVideo.startAudioInput(k);
|
|
395
|
-
} catch (
|
|
396
|
-
|
|
395
|
+
} catch (w) {
|
|
396
|
+
_.error(`设置语音输入设备失败:${w.message}`);
|
|
397
397
|
}
|
|
398
398
|
try {
|
|
399
|
-
const
|
|
400
|
-
|
|
401
|
-
const k = ((u =
|
|
399
|
+
const w = await this.meetingSession.audioVideo.listAudioOutputDevices();
|
|
400
|
+
_.info("audioOutputDevices ===>", w);
|
|
401
|
+
const k = ((u = w[0]) == null ? void 0 : u.deviceId) || "default";
|
|
402
402
|
await this.meetingSession.audioVideo.chooseAudioOutput(k);
|
|
403
|
-
} catch (
|
|
404
|
-
|
|
403
|
+
} catch (w) {
|
|
404
|
+
_.error(`设置语音输出设备失败:${w.message}`);
|
|
405
405
|
}
|
|
406
406
|
this.meetingSession.audioVideo.start();
|
|
407
407
|
} catch (d) {
|
|
@@ -415,9 +415,9 @@ class it extends Me {
|
|
|
415
415
|
this.joined = !1;
|
|
416
416
|
const n = {
|
|
417
417
|
audioVideoDidStop: async (d) => {
|
|
418
|
-
var
|
|
419
|
-
const
|
|
420
|
-
(
|
|
418
|
+
var p;
|
|
419
|
+
const m = d.statusCode();
|
|
420
|
+
(p = this.meetingSession) == null || p.deviceController.destroy(), m === qt.Left ? (this.logger.info("You left the session"), e(!0)) : (this.logger.info(`Stopped with a session status code: ${m}`), e(!0));
|
|
421
421
|
}
|
|
422
422
|
};
|
|
423
423
|
(c = this.meetingSession) == null || c.audioVideo.addObserver(n), (u = this.meetingSession) == null || u.audioVideo.stop();
|
|
@@ -506,7 +506,7 @@ class nt extends Me {
|
|
|
506
506
|
this.jsBridge.shock(1);
|
|
507
507
|
}
|
|
508
508
|
}
|
|
509
|
-
var K = /* @__PURE__ */ ((r) => (r.SelfUserInfo = "SELF_USER_INFO", r.RoomInfo = "ROOM_INFO", r.RTCInfo = "RTC_INFO", r.UserList = "USER_LIST", r.BuiltinMsg = "BUILTIN_MSG", r.CustomEvent = "CUSTOM_EVENT", r.KeyframeSync = "KEYFRAME_SYNC", r.UserKickOut = "USER_KICK_OUT", r))(K || {}), q = /* @__PURE__ */ ((r) => (r.UserChange = "user_change", r.RoomChange = "room_change", r))(q || {}),
|
|
509
|
+
var K = /* @__PURE__ */ ((r) => (r.SelfUserInfo = "SELF_USER_INFO", r.RoomInfo = "ROOM_INFO", r.RTCInfo = "RTC_INFO", r.UserList = "USER_LIST", r.BuiltinMsg = "BUILTIN_MSG", r.CustomEvent = "CUSTOM_EVENT", r.KeyframeSync = "KEYFRAME_SYNC", r.UserKickOut = "USER_KICK_OUT", r))(K || {}), q = /* @__PURE__ */ ((r) => (r.UserChange = "user_change", r.RoomChange = "room_change", r))(q || {}), Y = /* @__PURE__ */ ((r) => (r.UserMicroStatus = "change_micro_status", r.UserMicroStatusSync = "sync_micro_status", r.UserPermission = "change_permission", r.UserStatus = "change_status", r.UserInfo = "change_info", r.RoomClose = "close", r))(Y || {}), Z = /* @__PURE__ */ ((r) => (r.OPEN = "OPEN", r.CLOSE = "CLOSE", r))(Z || {});
|
|
510
510
|
function Nr(r) {
|
|
511
511
|
try {
|
|
512
512
|
const s = JSON.parse(r), e = {
|
|
@@ -651,57 +651,57 @@ class mr extends ue {
|
|
|
651
651
|
* 做一个健康检查
|
|
652
652
|
*/
|
|
653
653
|
o(this, "_healthCheck", async () => {
|
|
654
|
-
this._realWebSocket && this._realWebSocket.readyState !== this._readyState && (this._readyState = this._realWebSocket.readyState, this._readyState === Le.CLOSING && this.emit("closing")), await new Promise((e) => setTimeout(e, 2e3)), this._heathCheckTimer = requestAnimationFrame(this._healthCheck);
|
|
654
|
+
_.info("_healthCheck"), this._realWebSocket && this._realWebSocket.readyState !== this._readyState && (this._readyState = this._realWebSocket.readyState, this._readyState === Le.CLOSING && this.emit("closing")), await new Promise((e) => setTimeout(e, 2e3)), this._heathCheckTimer = requestAnimationFrame(this._healthCheck);
|
|
655
655
|
});
|
|
656
656
|
/**
|
|
657
657
|
* 清理健康检查
|
|
658
658
|
*/
|
|
659
659
|
o(this, "_clearHeathCheckIfNeed", () => {
|
|
660
|
-
this._heathCheckTimer && (cancelAnimationFrame(this._heathCheckTimer), this._heathCheckTimer = void 0);
|
|
660
|
+
_.info("_clearHeathCheckIfNeed"), this._heathCheckTimer && (cancelAnimationFrame(this._heathCheckTimer), this._heathCheckTimer = void 0);
|
|
661
661
|
});
|
|
662
662
|
/**
|
|
663
663
|
* 开启健康检查
|
|
664
664
|
*/
|
|
665
665
|
o(this, "_startHealthCheck", () => {
|
|
666
|
-
this._clearHeathCheckIfNeed(), this._heathCheckTimer = requestAnimationFrame(this._healthCheck);
|
|
666
|
+
_.info("_startHealthCheck"), this._clearHeathCheckIfNeed(), this._heathCheckTimer = requestAnimationFrame(this._healthCheck);
|
|
667
667
|
});
|
|
668
668
|
/**
|
|
669
669
|
* 停止健康检查
|
|
670
670
|
*/
|
|
671
671
|
o(this, "_stopHealthCheck", () => {
|
|
672
|
-
this._clearHeathCheckIfNeed();
|
|
672
|
+
_.info("_stopHealthCheck"), this._clearHeathCheckIfNeed();
|
|
673
673
|
});
|
|
674
674
|
/**
|
|
675
675
|
* 清理连接中的请求
|
|
676
676
|
*/
|
|
677
677
|
o(this, "_clearPendingReconnectIfNeeded", () => {
|
|
678
|
-
this._pendingReconnect && (clearTimeout(this._pendingReconnect), this._pendingReconnect = void 0);
|
|
678
|
+
_.info("_clearPendingReconnectIfNeeded"), this._pendingReconnect && (clearTimeout(this._pendingReconnect), this._pendingReconnect = void 0);
|
|
679
679
|
});
|
|
680
680
|
/**
|
|
681
681
|
* 当网页连接上网络进行重连
|
|
682
682
|
* @param event
|
|
683
683
|
*/
|
|
684
684
|
o(this, "_online", (e) => {
|
|
685
|
-
this._reconnectWhenOnlineAgain && (this._clearPendingReconnectIfNeeded(), this._reconnect(e));
|
|
685
|
+
_.info("_online"), this._reconnectWhenOnlineAgain && (this._clearPendingReconnectIfNeeded(), this._reconnect(e));
|
|
686
686
|
});
|
|
687
687
|
/**
|
|
688
688
|
* 当网页断开网络进行关闭
|
|
689
689
|
*/
|
|
690
690
|
o(this, "_offline", () => {
|
|
691
691
|
var e;
|
|
692
|
-
this._reconnectWhenOnlineAgain = !0, (e = this._realWebSocket) == null || e.close(1e3, "offline");
|
|
692
|
+
_.info("_offline"), this._reconnectWhenOnlineAgain = !0, (e = this._realWebSocket) == null || e.close(1e3, "offline");
|
|
693
693
|
});
|
|
694
694
|
/**
|
|
695
695
|
* 解除网络监听事件
|
|
696
696
|
*/
|
|
697
697
|
o(this, "_detachConnectivityEvents", () => {
|
|
698
|
-
this._connectivityEventsAttached && (globalThis == null || globalThis.removeEventListener("online", this._online), globalThis == null || globalThis.removeEventListener("offline", this._offline), this._connectivityEventsAttached = !1);
|
|
698
|
+
_.info("_detachConnectivityEvents"), this._connectivityEventsAttached && (globalThis == null || globalThis.removeEventListener("online", this._online), globalThis == null || globalThis.removeEventListener("offline", this._offline), this._connectivityEventsAttached = !1);
|
|
699
699
|
});
|
|
700
700
|
/**
|
|
701
701
|
* 注册网络监听事件
|
|
702
702
|
*/
|
|
703
703
|
o(this, "_attachConnectivityEvents", () => {
|
|
704
|
-
this._connectivityEventsAttached || (globalThis == null || globalThis.addEventListener("online", this._online), globalThis == null || globalThis.addEventListener("offline", this._offline), this._connectivityEventsAttached = !0);
|
|
704
|
+
_.info("_attachConnectivityEvents"), this._connectivityEventsAttached || (globalThis == null || globalThis.addEventListener("online", this._online), globalThis == null || globalThis.addEventListener("offline", this._offline), this._connectivityEventsAttached = !0);
|
|
705
705
|
});
|
|
706
706
|
/**
|
|
707
707
|
* 发送消息
|
|
@@ -710,7 +710,7 @@ class mr extends ue {
|
|
|
710
710
|
*/
|
|
711
711
|
o(this, "send", (e) => {
|
|
712
712
|
var i, n, c;
|
|
713
|
-
((i = this._realWebSocket) == null ? void 0 : i.readyState) === ((n = this._realWebSocket) == null ? void 0 : n.OPEN) && ((c = this._realWebSocket) == null || c.send(e));
|
|
713
|
+
_.info("send", e), ((i = this._realWebSocket) == null ? void 0 : i.readyState) === ((n = this._realWebSocket) == null ? void 0 : n.OPEN) && ((c = this._realWebSocket) == null || c.send(e));
|
|
714
714
|
});
|
|
715
715
|
/**
|
|
716
716
|
* 关闭连接
|
|
@@ -720,20 +720,21 @@ class mr extends ue {
|
|
|
720
720
|
*/
|
|
721
721
|
o(this, "close", (e, i) => {
|
|
722
722
|
var n;
|
|
723
|
-
return typeof e != "number" && (i = e, e = 1e3), this._clearPendingReconnectIfNeeded(), this._reconnectWhenOnlineAgain = !1, this._explicitlyClosed = !0, this._detachConnectivityEvents(), (n = this._realWebSocket) == null ? void 0 : n.close(e, i);
|
|
723
|
+
return _.info("close", e, i), typeof e != "number" && (i = e, e = 1e3), this._clearPendingReconnectIfNeeded(), this._reconnectWhenOnlineAgain = !1, this._explicitlyClosed = !0, this._detachConnectivityEvents(), (n = this._realWebSocket) == null ? void 0 : n.close(e, i);
|
|
724
724
|
});
|
|
725
725
|
/**
|
|
726
726
|
* 进行ws连接
|
|
727
727
|
*/
|
|
728
728
|
o(this, "open", (e) => {
|
|
729
729
|
var i, n;
|
|
730
|
-
e && (this._url = e), ((i = this._realWebSocket) == null ? void 0 : i.readyState) !== WebSocket.OPEN && ((n = this._realWebSocket) == null ? void 0 : n.readyState) !== WebSocket.CONNECTING && (this._clearPendingReconnectIfNeeded(), this._reconnectWhenOnlineAgain = !1, this._explicitlyClosed = !1, this._createWebSocket());
|
|
730
|
+
_.info("open", e), e && (this._url = e), ((i = this._realWebSocket) == null ? void 0 : i.readyState) !== WebSocket.OPEN && ((n = this._realWebSocket) == null ? void 0 : n.readyState) !== WebSocket.CONNECTING && (this._clearPendingReconnectIfNeeded(), this._reconnectWhenOnlineAgain = !1, this._explicitlyClosed = !1, this._createWebSocket());
|
|
731
731
|
});
|
|
732
732
|
/**
|
|
733
733
|
* 创建ws连接
|
|
734
734
|
*/
|
|
735
735
|
o(this, "_createWebSocket", () => {
|
|
736
736
|
var n, c, u;
|
|
737
|
+
_.info("_createWebSocket");
|
|
737
738
|
const e = typeof this._url == "string" ? this._url : (n = this._url) == null ? void 0 : n.call(this, this);
|
|
738
739
|
if (!e)
|
|
739
740
|
return;
|
|
@@ -761,21 +762,21 @@ class mr extends ue {
|
|
|
761
762
|
*/
|
|
762
763
|
o(this, "_removeWebSocketEvent", () => {
|
|
763
764
|
var e, i, n, c;
|
|
764
|
-
(e = this._realWebSocket) == null || e.removeEventListener("open", this._webSocketOpenHandler), (i = this._realWebSocket) == null || i.removeEventListener("close", this._webSocketCloseHandler), (n = this._realWebSocket) == null || n.removeEventListener("error", this._webSocketErrorHandler), (c = this._realWebSocket) == null || c.removeEventListener("message", this._webSocketMessageHandler);
|
|
765
|
+
_.info("_removeWebSocketEvent"), (e = this._realWebSocket) == null || e.removeEventListener("open", this._webSocketOpenHandler), (i = this._realWebSocket) == null || i.removeEventListener("close", this._webSocketCloseHandler), (n = this._realWebSocket) == null || n.removeEventListener("error", this._webSocketErrorHandler), (c = this._realWebSocket) == null || c.removeEventListener("message", this._webSocketMessageHandler);
|
|
765
766
|
});
|
|
766
767
|
/**
|
|
767
768
|
* 分发ws事件
|
|
768
769
|
*/
|
|
769
770
|
o(this, "_dispatchWebSocketEvent", () => {
|
|
770
771
|
var e, i, n, c;
|
|
771
|
-
(e = this._realWebSocket) == null || e.addEventListener("open", this._webSocketOpenHandler), (i = this._realWebSocket) == null || i.addEventListener("close", this._webSocketCloseHandler), (n = this._realWebSocket) == null || n.addEventListener("error", this._webSocketErrorHandler), (c = this._realWebSocket) == null || c.addEventListener("message", this._webSocketMessageHandler);
|
|
772
|
+
_.info("_dispatchWebSocketEvent"), (e = this._realWebSocket) == null || e.addEventListener("open", this._webSocketOpenHandler), (i = this._realWebSocket) == null || i.addEventListener("close", this._webSocketCloseHandler), (n = this._realWebSocket) == null || n.addEventListener("error", this._webSocketErrorHandler), (c = this._realWebSocket) == null || c.addEventListener("message", this._webSocketMessageHandler);
|
|
772
773
|
});
|
|
773
774
|
/**
|
|
774
775
|
* ws连接事件
|
|
775
776
|
* @returns
|
|
776
777
|
*/
|
|
777
778
|
o(this, "_webSocketOpenHandler", (e) => {
|
|
778
|
-
this._clearPendingReconnectIfNeeded(), this._connectTimeout && (clearTimeout(this._connectTimeout), this._connectTimeout = void 0);
|
|
779
|
+
_.info("_webSocketOpenHandler"), this._clearPendingReconnectIfNeeded(), this._connectTimeout && (clearTimeout(this._connectTimeout), this._connectTimeout = void 0);
|
|
779
780
|
const i = ++this._reconnects, n = this._attempts;
|
|
780
781
|
return this._attempts = 0, this._reconnectWhenOnlineAgain = !1, this._startHealthCheck(), this.emit("open", Object.assign(e, { detail: { reconnects: i, attempts: n } }));
|
|
781
782
|
});
|
|
@@ -784,26 +785,26 @@ class mr extends ue {
|
|
|
784
785
|
* @param event
|
|
785
786
|
* @returns
|
|
786
787
|
*/
|
|
787
|
-
o(this, "_webSocketCloseHandler", (e) => (this._reconnect(e), this._stopHealthCheck(), this.emit("close", e)));
|
|
788
|
+
o(this, "_webSocketCloseHandler", (e) => (_.info("_webSocketCloseHandler"), this._reconnect(e), this._stopHealthCheck(), this.emit("close", e)));
|
|
788
789
|
/**
|
|
789
790
|
* ws 异常
|
|
790
791
|
* @param event
|
|
791
792
|
* @returns
|
|
792
793
|
*/
|
|
793
|
-
o(this, "_webSocketErrorHandler", (e) => this.emit("error", new CustomEvent("error", { detail: { error: e } })));
|
|
794
|
+
o(this, "_webSocketErrorHandler", (e) => (_.info("_webSocketErrorHandler"), this.emit("error", new CustomEvent("error", { detail: { error: e } }))));
|
|
794
795
|
/**
|
|
795
796
|
* ws消息
|
|
796
797
|
* @param event
|
|
797
798
|
* @returns
|
|
798
799
|
*/
|
|
799
|
-
o(this, "_webSocketMessageHandler", (e) => this.emit("message", e));
|
|
800
|
+
o(this, "_webSocketMessageHandler", (e) => (_.info("_webSocketMessageHandler"), this.emit("message", e)));
|
|
800
801
|
e && this.setOptions(e), this._startHealthCheck();
|
|
801
802
|
}
|
|
802
803
|
get attempts() {
|
|
803
804
|
return this._attempts;
|
|
804
805
|
}
|
|
805
806
|
setOptions(e) {
|
|
806
|
-
if (!e)
|
|
807
|
+
if (_.info("setOptions", e), !e)
|
|
807
808
|
return;
|
|
808
809
|
this._url = e.url, this._protocols = e.protocols;
|
|
809
810
|
const i = Object.assign(this._options, e.robustOptions || {});
|
|
@@ -822,7 +823,7 @@ class mr extends ue {
|
|
|
822
823
|
*/
|
|
823
824
|
_reconnect(e) {
|
|
824
825
|
var n, c, u, d;
|
|
825
|
-
if (!((n = this._options) != null && n.should1000Reconnect) && e.code === 1e3 || this._explicitlyClosed) {
|
|
826
|
+
if (_.info("_reconnect"), !((n = this._options) != null && n.should1000Reconnect) && e.code === 1e3 || this._explicitlyClosed) {
|
|
826
827
|
this._attempts = 0;
|
|
827
828
|
return;
|
|
828
829
|
}
|
|
@@ -864,28 +865,28 @@ class vr extends ue {
|
|
|
864
865
|
* @param event
|
|
865
866
|
*/
|
|
866
867
|
o(this, "_handleCloseEvent", (e) => {
|
|
867
|
-
|
|
868
|
+
_.info(`live room closed bacause of ${e.code}-${e.reason || nr(e.code)}`), this.state = x.CLOSED;
|
|
868
869
|
});
|
|
869
870
|
/**
|
|
870
871
|
* 处理房间正在关闭事件(这个时候可能是断网了)
|
|
871
872
|
*/
|
|
872
873
|
o(this, "_handleClosingEvent", () => {
|
|
873
874
|
var e;
|
|
874
|
-
|
|
875
|
+
_.info("live room is closing, onLine:", (e = globalThis == null ? void 0 : globalThis.navigator) == null ? void 0 : e.onLine), this.state = x.CLOSED;
|
|
875
876
|
});
|
|
876
877
|
/**
|
|
877
878
|
* 连接中
|
|
878
879
|
* @param event
|
|
879
880
|
*/
|
|
880
881
|
o(this, "_handleConnectingEvent", () => {
|
|
881
|
-
|
|
882
|
+
_.info("live room is connecting"), this.state = x.CONNECTING;
|
|
882
883
|
});
|
|
883
884
|
/**
|
|
884
885
|
* 连接发送异常
|
|
885
886
|
* @param event
|
|
886
887
|
*/
|
|
887
888
|
o(this, "_handleErrorEvent", (e) => {
|
|
888
|
-
|
|
889
|
+
_.error("live room error", e), this.state = x.CLOSED;
|
|
889
890
|
});
|
|
890
891
|
/**
|
|
891
892
|
* 接收到消息
|
|
@@ -906,14 +907,14 @@ class vr extends ue {
|
|
|
906
907
|
* @param event
|
|
907
908
|
*/
|
|
908
909
|
o(this, "_handleOpenEvent", (e) => {
|
|
909
|
-
|
|
910
|
+
_.info("live room open", e.detail), this.state = x.OPEN, e.detail.reconnects > 0 && this.emit("reconnected", e.detail);
|
|
910
911
|
});
|
|
911
912
|
/**
|
|
912
913
|
* 处理超时
|
|
913
914
|
* @param event
|
|
914
915
|
*/
|
|
915
916
|
o(this, "_handleTimeoutEvent", (e) => {
|
|
916
|
-
|
|
917
|
+
_.error("live room connect timeout!", e.detail), this.state = x.CLOSED;
|
|
917
918
|
});
|
|
918
919
|
/**
|
|
919
920
|
* 释放资源,释放之后需要重新实例化
|
|
@@ -1007,7 +1008,7 @@ class yr extends ue {
|
|
|
1007
1008
|
try {
|
|
1008
1009
|
return this._controller.sendMessage(n), !0;
|
|
1009
1010
|
} catch (c) {
|
|
1010
|
-
return
|
|
1011
|
+
return _.error(c), !1;
|
|
1011
1012
|
}
|
|
1012
1013
|
});
|
|
1013
1014
|
/**
|
|
@@ -1039,32 +1040,32 @@ class yr extends ue {
|
|
|
1039
1040
|
o(this, "_handleMessage", async (e) => {
|
|
1040
1041
|
var i, n, c, u, d;
|
|
1041
1042
|
if (typeof e == "object") {
|
|
1042
|
-
const { command:
|
|
1043
|
-
if (
|
|
1044
|
-
switch (
|
|
1043
|
+
const { command: m, data: p = {}, frontRequestId: y, code: b, message: I } = e;
|
|
1044
|
+
if (b === "SUCCESS")
|
|
1045
|
+
switch (m) {
|
|
1045
1046
|
case K.SelfUserInfo: {
|
|
1046
|
-
const
|
|
1047
|
-
ot(this.selfInfo,
|
|
1047
|
+
const g = p;
|
|
1048
|
+
ot(this.selfInfo, g, { deep: !0 }) || (this._buildInData.selfInfo = g, this.emit(
|
|
1048
1049
|
"selfInfoUpdate",
|
|
1049
1050
|
this._buildInData.selfInfo,
|
|
1050
|
-
|
|
1051
|
+
y
|
|
1051
1052
|
));
|
|
1052
1053
|
break;
|
|
1053
1054
|
}
|
|
1054
1055
|
case K.RoomInfo: {
|
|
1055
|
-
const
|
|
1056
|
-
this._buildInData.roomInfo = Object.assign({},
|
|
1056
|
+
const g = p;
|
|
1057
|
+
this._buildInData.roomInfo = Object.assign({}, g), this.emit(
|
|
1057
1058
|
"readyKeyframeSync",
|
|
1058
|
-
|
|
1059
|
+
g.last_frame || {}
|
|
1059
1060
|
);
|
|
1060
1061
|
break;
|
|
1061
1062
|
}
|
|
1062
1063
|
case K.RTCInfo: {
|
|
1063
|
-
const { voice_id:
|
|
1064
|
-
if (this._buildInData.rtcInfo = { voiceId:
|
|
1065
|
-
|
|
1064
|
+
const { voice_id: g, type: V } = p;
|
|
1065
|
+
if (this._buildInData.rtcInfo = { voiceId: g, type: V }, (i = this.$RTC) != null && i.joined)
|
|
1066
|
+
_.warn("已加入语音房间,无需重复加入!");
|
|
1066
1067
|
else if (await ((u = this.$RTC) == null ? void 0 : u.join({
|
|
1067
|
-
voiceId:
|
|
1068
|
+
voiceId: g,
|
|
1068
1069
|
userId: ((n = this.selfInfo) == null ? void 0 : n.id) || "",
|
|
1069
1070
|
roomId: (c = this.roomInfo) == null ? void 0 : c.info.room_code,
|
|
1070
1071
|
type: V
|
|
@@ -1072,52 +1073,52 @@ class yr extends ue {
|
|
|
1072
1073
|
const k = (d = this._options.initialMicroStatus) != null ? d : Z.OPEN;
|
|
1073
1074
|
await this.toggleMicro(k === Z.OPEN);
|
|
1074
1075
|
} else
|
|
1075
|
-
|
|
1076
|
+
_.error("加入语音房间失败");
|
|
1076
1077
|
break;
|
|
1077
1078
|
}
|
|
1078
1079
|
case K.UserList: {
|
|
1079
|
-
const
|
|
1080
|
-
this._buildInData.userList =
|
|
1080
|
+
const g = p;
|
|
1081
|
+
this._buildInData.userList = g, this.emit("userListUpdate", this.userList, y);
|
|
1081
1082
|
break;
|
|
1082
1083
|
}
|
|
1083
1084
|
case K.CustomEvent: {
|
|
1084
|
-
const
|
|
1085
|
-
this.emit("broadcast",
|
|
1085
|
+
const g = p;
|
|
1086
|
+
this.emit("broadcast", g, y);
|
|
1086
1087
|
break;
|
|
1087
1088
|
}
|
|
1088
1089
|
case K.KeyframeSync: {
|
|
1089
|
-
const
|
|
1090
|
-
|
|
1090
|
+
const g = p, V = Object.keys(
|
|
1091
|
+
g
|
|
1091
1092
|
).reduce(
|
|
1092
|
-
(
|
|
1093
|
+
(w, k) => {
|
|
1093
1094
|
if (ot(
|
|
1094
|
-
|
|
1095
|
+
g[k],
|
|
1095
1096
|
this._buildInData.keyframes[k],
|
|
1096
1097
|
{
|
|
1097
1098
|
deep: !0
|
|
1098
1099
|
}
|
|
1099
1100
|
))
|
|
1100
|
-
return
|
|
1101
|
+
return w;
|
|
1101
1102
|
const U = [
|
|
1102
|
-
|
|
1103
|
+
g[k],
|
|
1103
1104
|
this._buildInData.keyframes[k],
|
|
1104
|
-
|
|
1105
|
+
y
|
|
1105
1106
|
], P = k;
|
|
1106
1107
|
return this.keyframes.emit(
|
|
1107
1108
|
P,
|
|
1108
1109
|
...U
|
|
1109
|
-
), this._buildInData.keyframes[k] =
|
|
1110
|
+
), this._buildInData.keyframes[k] = g[k], w[k] = g[k], w;
|
|
1110
1111
|
},
|
|
1111
1112
|
{}
|
|
1112
1113
|
);
|
|
1113
|
-
this.emit("keyframes", V,
|
|
1114
|
+
this.emit("keyframes", V, y);
|
|
1114
1115
|
break;
|
|
1115
1116
|
}
|
|
1116
1117
|
case K.BuiltinMsg: {
|
|
1117
|
-
const
|
|
1118
|
-
this.emit("builtinEvent",
|
|
1119
|
-
|
|
1120
|
-
),
|
|
1118
|
+
const g = p;
|
|
1119
|
+
this.emit("builtinEvent", g), g.event_type === q.UserChange && this.emit("userChange", g), g.event_type === q.RoomChange && this.emit("roomChange", g), g.event_type === q.UserChange && g.action === Y.UserMicroStatus && await this.toggleMicro(
|
|
1120
|
+
g.data.status === Z.OPEN
|
|
1121
|
+
), g.event_type === q.RoomChange && g.action === Y.RoomClose && await this.exit();
|
|
1121
1122
|
break;
|
|
1122
1123
|
}
|
|
1123
1124
|
case K.UserKickOut: {
|
|
@@ -1125,7 +1126,7 @@ class yr extends ue {
|
|
|
1125
1126
|
break;
|
|
1126
1127
|
}
|
|
1127
1128
|
default:
|
|
1128
|
-
console.warn("unknown command: ",
|
|
1129
|
+
console.warn("unknown command: ", m);
|
|
1129
1130
|
}
|
|
1130
1131
|
else
|
|
1131
1132
|
this.emit("error", e);
|
|
@@ -1143,8 +1144,8 @@ class yr extends ue {
|
|
|
1143
1144
|
* @returns
|
|
1144
1145
|
*/
|
|
1145
1146
|
o(this, "connect", async (e = {}) => {
|
|
1146
|
-
var u, d,
|
|
1147
|
-
if (this._options.url = (d = (u = e.url) != null ? u : this._options.url) != null ? d : "", this._options.getTicket = (
|
|
1147
|
+
var u, d, m, p;
|
|
1148
|
+
if (this._options.url = (d = (u = e.url) != null ? u : this._options.url) != null ? d : "", this._options.getTicket = (m = e.getTicket) != null ? m : this._options.getTicket, this._options.initialMicroStatus = (p = e.rtcMicStatus) != null ? p : this._options.initialMicroStatus, !/^ws(s):\/\//.test(this._options.url) || typeof this._options.getTicket != "function")
|
|
1148
1149
|
return /^ws(s):\/\//.test(this._options.url) ? typeof this._options.getTicket != "function" ? new Error("getTicket muse be function") : !1 : new Error("Illegal realsee live room link");
|
|
1149
1150
|
const { force: i = !1 } = e;
|
|
1150
1151
|
if (this._options.rtc && !await this._options.rtc.detectMicro())
|
|
@@ -1154,8 +1155,8 @@ class yr extends ue {
|
|
|
1154
1155
|
if (i)
|
|
1155
1156
|
try {
|
|
1156
1157
|
await this._controller.close("force close by connect");
|
|
1157
|
-
} catch (
|
|
1158
|
-
console.warn(
|
|
1158
|
+
} catch (y) {
|
|
1159
|
+
console.warn(y);
|
|
1159
1160
|
}
|
|
1160
1161
|
else
|
|
1161
1162
|
return new Error("已有Live实例正在连接中,请勿重复连接!");
|
|
@@ -1177,7 +1178,7 @@ class yr extends ue {
|
|
|
1177
1178
|
try {
|
|
1178
1179
|
await ((e = this.$RTC) == null ? void 0 : e.quit());
|
|
1179
1180
|
} catch (i) {
|
|
1180
|
-
|
|
1181
|
+
_.warn(i);
|
|
1181
1182
|
}
|
|
1182
1183
|
return await this._controller.close();
|
|
1183
1184
|
});
|
|
@@ -1192,7 +1193,7 @@ class yr extends ue {
|
|
|
1192
1193
|
if ((i = (e = this.selfInfo) == null ? void 0 : e.permission) != null && i.close_live_room)
|
|
1193
1194
|
return await this.updateStatus(
|
|
1194
1195
|
q.RoomChange,
|
|
1195
|
-
|
|
1196
|
+
Y.RoomClose,
|
|
1196
1197
|
{}
|
|
1197
1198
|
);
|
|
1198
1199
|
});
|
|
@@ -1208,7 +1209,7 @@ class yr extends ue {
|
|
|
1208
1209
|
*/
|
|
1209
1210
|
o(this, "setSelfInfo", async (e) => await this.updateStatus(
|
|
1210
1211
|
q.UserChange,
|
|
1211
|
-
|
|
1212
|
+
Y.UserInfo,
|
|
1212
1213
|
e
|
|
1213
1214
|
));
|
|
1214
1215
|
// 仅用于用户自己的麦克风控制
|
|
@@ -1219,7 +1220,7 @@ class yr extends ue {
|
|
|
1219
1220
|
const i = await ((u = this.$RTC) == null ? void 0 : u.toggleMicro(e));
|
|
1220
1221
|
return i && await this.updateStatus(
|
|
1221
1222
|
q.UserChange,
|
|
1222
|
-
|
|
1223
|
+
Y.UserMicroStatus,
|
|
1223
1224
|
{
|
|
1224
1225
|
status: e ? Z.OPEN : Z.CLOSE
|
|
1225
1226
|
},
|
|
@@ -1236,7 +1237,7 @@ class yr extends ue {
|
|
|
1236
1237
|
var n, c;
|
|
1237
1238
|
return typeof this._options.canForbidUserMicro == "function" && !this._options.canForbidUserMicro(i) || !((c = (n = this.selfInfo) == null ? void 0 : n.permission) != null && c.control_other_micro) ? !1 : await this.updateStatus(
|
|
1238
1239
|
q.UserChange,
|
|
1239
|
-
|
|
1240
|
+
Y.UserMicroStatus,
|
|
1240
1241
|
{
|
|
1241
1242
|
status: e
|
|
1242
1243
|
},
|
|
@@ -1253,7 +1254,7 @@ class yr extends ue {
|
|
|
1253
1254
|
var n, c;
|
|
1254
1255
|
return typeof this._options.canForbidUserSync == "function" && !this._options.canForbidUserSync(i) || !((c = (n = this.selfInfo) == null ? void 0 : n.permission) != null && c.control_other_sync) ? !1 : await this.updateStatus(
|
|
1255
1256
|
q.UserChange,
|
|
1256
|
-
|
|
1257
|
+
Y.UserPermission,
|
|
1257
1258
|
{ sync_frame: e },
|
|
1258
1259
|
i
|
|
1259
1260
|
);
|
|
@@ -1267,7 +1268,7 @@ class yr extends ue {
|
|
|
1267
1268
|
var i, n;
|
|
1268
1269
|
return typeof this._options.canForbidUserKick == "function" && !this._options.canForbidUserKick(e) || !((n = (i = this.selfInfo) == null ? void 0 : i.permission) != null && n.change_other_status) ? !1 : await this.updateStatus(
|
|
1269
1270
|
q.UserChange,
|
|
1270
|
-
|
|
1271
|
+
Y.UserStatus,
|
|
1271
1272
|
{
|
|
1272
1273
|
status: "KICK_OUT"
|
|
1273
1274
|
},
|
|
@@ -1286,7 +1287,7 @@ class yr extends ue {
|
|
|
1286
1287
|
if (e.rtc)
|
|
1287
1288
|
return e.rtc;
|
|
1288
1289
|
if (e.rtcType)
|
|
1289
|
-
switch (e.getVoiceSign ||
|
|
1290
|
+
switch (e.getVoiceSign || _.error(
|
|
1290
1291
|
"GetVoiceSign method must be passed when using built-in RTC instances"
|
|
1291
1292
|
), e.rtcType) {
|
|
1292
1293
|
case Q.RealseeVRWebViewRTC: {
|
|
@@ -1295,7 +1296,7 @@ class yr extends ue {
|
|
|
1295
1296
|
jsBridge: this._options.jsBridge,
|
|
1296
1297
|
getVoiceSign: this._options.getVoiceSign
|
|
1297
1298
|
});
|
|
1298
|
-
|
|
1299
|
+
_.error(
|
|
1299
1300
|
"JsBridge instance must be passed when using built-in VRWebViewRTC instances"
|
|
1300
1301
|
);
|
|
1301
1302
|
return;
|
|
@@ -1306,19 +1307,19 @@ class yr extends ue {
|
|
|
1306
1307
|
logLevel: e.__debug__ ? st.DEBUG : st.INFO
|
|
1307
1308
|
});
|
|
1308
1309
|
case Q.RealseeBrowserRTC:
|
|
1309
|
-
return this._options.autoPlayConfirm ||
|
|
1310
|
+
return this._options.autoPlayConfirm || _.error(
|
|
1310
1311
|
"autoPlayConfirm method must be passed when using built-in RealseeBrowserRTC instances"
|
|
1311
1312
|
), new rt({
|
|
1312
1313
|
getVoiceSign: this._options.getVoiceSign,
|
|
1313
1314
|
autoPlayConfirm: this._options.autoPlayConfirm
|
|
1314
1315
|
});
|
|
1315
1316
|
default: {
|
|
1316
|
-
|
|
1317
|
+
_.error("unknown built-in RTC type");
|
|
1317
1318
|
return;
|
|
1318
1319
|
}
|
|
1319
1320
|
}
|
|
1320
1321
|
if (e.useBuiltInRTC) {
|
|
1321
|
-
if (e.getVoiceSign ||
|
|
1322
|
+
if (e.getVoiceSign || _.error(
|
|
1322
1323
|
"GetVoiceSign method must be passed when using built-in RTC instances"
|
|
1323
1324
|
), this._options.jsBridge)
|
|
1324
1325
|
return lr && (ar || cr) || ur ? new nt({
|
|
@@ -1330,12 +1331,12 @@ class yr extends ue {
|
|
|
1330
1331
|
getVoiceSign: this._options.getVoiceSign,
|
|
1331
1332
|
autoPlayConfirm: this._options.autoPlayConfirm
|
|
1332
1333
|
});
|
|
1333
|
-
|
|
1334
|
+
_.error(
|
|
1334
1335
|
"jsBridge instance must be passed when using built-in RTC instances"
|
|
1335
1336
|
);
|
|
1336
1337
|
return;
|
|
1337
1338
|
}
|
|
1338
|
-
})(), this._options.rtc ||
|
|
1339
|
+
})(), this._options.rtc || _.warn("unused rtc"), this._options.url && this._options.getTicket && this.connect(), this._options.__debug__ && Object.assign(window, { $liveController: this._controller, $live: this });
|
|
1339
1340
|
}
|
|
1340
1341
|
get options() {
|
|
1341
1342
|
return Object.freeze(this._options || {});
|
|
@@ -1413,8 +1414,8 @@ class yr extends ue {
|
|
|
1413
1414
|
), d = je(K.BuiltinMsg, u, c);
|
|
1414
1415
|
try {
|
|
1415
1416
|
return this._controller.sendMessage(d), !0;
|
|
1416
|
-
} catch (
|
|
1417
|
-
return
|
|
1417
|
+
} catch (m) {
|
|
1418
|
+
return _.error(m), !1;
|
|
1418
1419
|
}
|
|
1419
1420
|
}
|
|
1420
1421
|
/**
|
|
@@ -1430,16 +1431,16 @@ class yr extends ue {
|
|
|
1430
1431
|
K.CustomEvent,
|
|
1431
1432
|
e,
|
|
1432
1433
|
i
|
|
1433
|
-
),
|
|
1434
|
-
u(new Error("RESPONSE TIMEOUT")), this.off("broadcast",
|
|
1435
|
-
}, n) : void 0,
|
|
1436
|
-
I ===
|
|
1434
|
+
), m = d.front_request_id, p = n ? setTimeout(() => {
|
|
1435
|
+
u(new Error("RESPONSE TIMEOUT")), this.off("broadcast", y);
|
|
1436
|
+
}, n) : void 0, y = (b, I) => {
|
|
1437
|
+
I === m && (p && clearTimeout(p), this.off("broadcast", y), c(b));
|
|
1437
1438
|
};
|
|
1438
|
-
this.on("broadcast",
|
|
1439
|
+
this.on("broadcast", y);
|
|
1439
1440
|
try {
|
|
1440
1441
|
this._controller.sendMessage(d);
|
|
1441
|
-
} catch (
|
|
1442
|
-
u(
|
|
1442
|
+
} catch (b) {
|
|
1443
|
+
u(b);
|
|
1443
1444
|
}
|
|
1444
1445
|
});
|
|
1445
1446
|
}
|
|
@@ -1468,15 +1469,15 @@ function Cr() {
|
|
|
1468
1469
|
return oe;
|
|
1469
1470
|
at = 1;
|
|
1470
1471
|
var r = D, s = Symbol.for("react.element"), e = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, n = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
1471
|
-
function u(d,
|
|
1472
|
-
var
|
|
1473
|
-
|
|
1474
|
-
for (
|
|
1475
|
-
i.call(
|
|
1472
|
+
function u(d, m, p) {
|
|
1473
|
+
var y, b = {}, I = null, g = null;
|
|
1474
|
+
p !== void 0 && (I = "" + p), m.key !== void 0 && (I = "" + m.key), m.ref !== void 0 && (g = m.ref);
|
|
1475
|
+
for (y in m)
|
|
1476
|
+
i.call(m, y) && !c.hasOwnProperty(y) && (b[y] = m[y]);
|
|
1476
1477
|
if (d && d.defaultProps)
|
|
1477
|
-
for (
|
|
1478
|
-
y
|
|
1479
|
-
return { $$typeof: s, type: d, key: I, ref:
|
|
1478
|
+
for (y in m = d.defaultProps, m)
|
|
1479
|
+
b[y] === void 0 && (b[y] = m[y]);
|
|
1480
|
+
return { $$typeof: s, type: d, key: I, ref: g, props: b, _owner: n.current };
|
|
1480
1481
|
}
|
|
1481
1482
|
return oe.Fragment = e, oe.jsx = u, oe.jsxs = u, oe;
|
|
1482
1483
|
}
|
|
@@ -1493,11 +1494,11 @@ var ae = {};
|
|
|
1493
1494
|
var ct;
|
|
1494
1495
|
function wr() {
|
|
1495
1496
|
return ct || (ct = 1, process.env.NODE_ENV !== "production" && function() {
|
|
1496
|
-
var r = D, s = Symbol.for("react.element"), e = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), d = Symbol.for("react.context"),
|
|
1497
|
+
var r = D, s = Symbol.for("react.element"), e = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), d = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), I = Symbol.for("react.lazy"), g = Symbol.for("react.offscreen"), V = Symbol.iterator, w = "@@iterator";
|
|
1497
1498
|
function k(t) {
|
|
1498
1499
|
if (t === null || typeof t != "object")
|
|
1499
1500
|
return null;
|
|
1500
|
-
var a = V && t[V] || t[
|
|
1501
|
+
var a = V && t[V] || t[w];
|
|
1501
1502
|
return typeof a == "function" ? a : null;
|
|
1502
1503
|
}
|
|
1503
1504
|
var U = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
@@ -1510,18 +1511,18 @@ function wr() {
|
|
|
1510
1511
|
}
|
|
1511
1512
|
function fe(t, a, l) {
|
|
1512
1513
|
{
|
|
1513
|
-
var h = U.ReactDebugCurrentFrame,
|
|
1514
|
-
|
|
1515
|
-
var
|
|
1516
|
-
return String(
|
|
1514
|
+
var h = U.ReactDebugCurrentFrame, S = h.getStackAddendum();
|
|
1515
|
+
S !== "" && (a += "%s", l = l.concat([S]));
|
|
1516
|
+
var O = l.map(function(E) {
|
|
1517
|
+
return String(E);
|
|
1517
1518
|
});
|
|
1518
|
-
|
|
1519
|
+
O.unshift("Warning: " + a), Function.prototype.apply.call(console[t], console, O);
|
|
1519
1520
|
}
|
|
1520
1521
|
}
|
|
1521
|
-
var f = !1,
|
|
1522
|
+
var f = !1, R = !1, A = !1, C = !1, N = !1, M;
|
|
1522
1523
|
M = Symbol.for("react.module.reference");
|
|
1523
1524
|
function F(t) {
|
|
1524
|
-
return !!(typeof t == "string" || typeof t == "function" || t === i || t === c || N || t === n || t ===
|
|
1525
|
+
return !!(typeof t == "string" || typeof t == "function" || t === i || t === c || N || t === n || t === p || t === y || C || t === g || f || R || A || typeof t == "object" && t !== null && (t.$$typeof === I || t.$$typeof === b || t.$$typeof === u || t.$$typeof === d || t.$$typeof === m || // This needs to include all possible module reference object
|
|
1525
1526
|
// types supported by any Flight configuration anywhere since
|
|
1526
1527
|
// we don't know which Flight build this will end up being used
|
|
1527
1528
|
// with.
|
|
@@ -1531,8 +1532,8 @@ function wr() {
|
|
|
1531
1532
|
var h = t.displayName;
|
|
1532
1533
|
if (h)
|
|
1533
1534
|
return h;
|
|
1534
|
-
var
|
|
1535
|
-
return
|
|
1535
|
+
var S = a.displayName || a.name || "";
|
|
1536
|
+
return S !== "" ? l + "(" + S + ")" : l;
|
|
1536
1537
|
}
|
|
1537
1538
|
function ne(t) {
|
|
1538
1539
|
return t.displayName || "Context";
|
|
@@ -1553,9 +1554,9 @@ function wr() {
|
|
|
1553
1554
|
return "Profiler";
|
|
1554
1555
|
case n:
|
|
1555
1556
|
return "StrictMode";
|
|
1556
|
-
case
|
|
1557
|
+
case p:
|
|
1557
1558
|
return "Suspense";
|
|
1558
|
-
case
|
|
1559
|
+
case y:
|
|
1559
1560
|
return "SuspenseList";
|
|
1560
1561
|
}
|
|
1561
1562
|
if (typeof t == "object")
|
|
@@ -1566,30 +1567,30 @@ function wr() {
|
|
|
1566
1567
|
case u:
|
|
1567
1568
|
var l = t;
|
|
1568
1569
|
return ne(l._context) + ".Provider";
|
|
1569
|
-
case
|
|
1570
|
+
case m:
|
|
1570
1571
|
return J(t, t.render, "ForwardRef");
|
|
1571
|
-
case
|
|
1572
|
+
case b:
|
|
1572
1573
|
var h = t.displayName || null;
|
|
1573
1574
|
return h !== null ? h : G(t.type) || "Memo";
|
|
1574
1575
|
case I: {
|
|
1575
|
-
var
|
|
1576
|
+
var S = t, O = S._payload, E = S._init;
|
|
1576
1577
|
try {
|
|
1577
|
-
return G(
|
|
1578
|
-
} catch (
|
|
1578
|
+
return G(E(O));
|
|
1579
|
+
} catch (v) {
|
|
1579
1580
|
return null;
|
|
1580
1581
|
}
|
|
1581
1582
|
}
|
|
1582
1583
|
}
|
|
1583
1584
|
return null;
|
|
1584
1585
|
}
|
|
1585
|
-
var z = Object.assign, ee = 0, T,
|
|
1586
|
+
var z = Object.assign, ee = 0, T, W, te, de, Ve, $e, xe;
|
|
1586
1587
|
function Ue() {
|
|
1587
1588
|
}
|
|
1588
1589
|
Ue.__reactDisabledLog = !0;
|
|
1589
1590
|
function dt() {
|
|
1590
1591
|
{
|
|
1591
1592
|
if (ee === 0) {
|
|
1592
|
-
T = console.log,
|
|
1593
|
+
T = console.log, W = console.info, te = console.warn, de = console.error, Ve = console.group, $e = console.groupCollapsed, xe = console.groupEnd;
|
|
1593
1594
|
var t = {
|
|
1594
1595
|
configurable: !0,
|
|
1595
1596
|
enumerable: !0,
|
|
@@ -1622,7 +1623,7 @@ function wr() {
|
|
|
1622
1623
|
value: T
|
|
1623
1624
|
}),
|
|
1624
1625
|
info: z({}, t, {
|
|
1625
|
-
value:
|
|
1626
|
+
value: W
|
|
1626
1627
|
}),
|
|
1627
1628
|
warn: z({}, t, {
|
|
1628
1629
|
value: te
|
|
@@ -1650,8 +1651,8 @@ function wr() {
|
|
|
1650
1651
|
if (we === void 0)
|
|
1651
1652
|
try {
|
|
1652
1653
|
throw Error();
|
|
1653
|
-
} catch (
|
|
1654
|
-
var h =
|
|
1654
|
+
} catch (S) {
|
|
1655
|
+
var h = S.stack.trim().match(/\n( *(at )?)/);
|
|
1655
1656
|
we = h && h[1] || "";
|
|
1656
1657
|
}
|
|
1657
1658
|
return `
|
|
@@ -1673,63 +1674,63 @@ function wr() {
|
|
|
1673
1674
|
}
|
|
1674
1675
|
var h;
|
|
1675
1676
|
Re = !0;
|
|
1676
|
-
var
|
|
1677
|
+
var S = Error.prepareStackTrace;
|
|
1677
1678
|
Error.prepareStackTrace = void 0;
|
|
1678
|
-
var
|
|
1679
|
-
|
|
1679
|
+
var O;
|
|
1680
|
+
O = Ce.current, Ce.current = null, dt();
|
|
1680
1681
|
try {
|
|
1681
1682
|
if (a) {
|
|
1682
|
-
var
|
|
1683
|
+
var E = function() {
|
|
1683
1684
|
throw Error();
|
|
1684
1685
|
};
|
|
1685
|
-
if (Object.defineProperty(
|
|
1686
|
+
if (Object.defineProperty(E.prototype, "props", {
|
|
1686
1687
|
set: function() {
|
|
1687
1688
|
throw Error();
|
|
1688
1689
|
}
|
|
1689
1690
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
1690
1691
|
try {
|
|
1691
|
-
Reflect.construct(
|
|
1692
|
-
} catch (
|
|
1693
|
-
h =
|
|
1692
|
+
Reflect.construct(E, []);
|
|
1693
|
+
} catch (H) {
|
|
1694
|
+
h = H;
|
|
1694
1695
|
}
|
|
1695
|
-
Reflect.construct(t, [],
|
|
1696
|
+
Reflect.construct(t, [], E);
|
|
1696
1697
|
} else {
|
|
1697
1698
|
try {
|
|
1698
|
-
|
|
1699
|
-
} catch (
|
|
1700
|
-
h =
|
|
1699
|
+
E.call();
|
|
1700
|
+
} catch (H) {
|
|
1701
|
+
h = H;
|
|
1701
1702
|
}
|
|
1702
|
-
t.call(
|
|
1703
|
+
t.call(E.prototype);
|
|
1703
1704
|
}
|
|
1704
1705
|
} else {
|
|
1705
1706
|
try {
|
|
1706
1707
|
throw Error();
|
|
1707
|
-
} catch (
|
|
1708
|
-
h =
|
|
1708
|
+
} catch (H) {
|
|
1709
|
+
h = H;
|
|
1709
1710
|
}
|
|
1710
1711
|
t();
|
|
1711
1712
|
}
|
|
1712
|
-
} catch (
|
|
1713
|
-
if (
|
|
1714
|
-
for (var
|
|
1713
|
+
} catch (H) {
|
|
1714
|
+
if (H && h && typeof H.stack == "string") {
|
|
1715
|
+
for (var v = H.stack.split(`
|
|
1715
1716
|
`), $ = h.stack.split(`
|
|
1716
|
-
`), j =
|
|
1717
|
+
`), j = v.length - 1, L = $.length - 1; j >= 1 && L >= 0 && v[j] !== $[L]; )
|
|
1717
1718
|
L--;
|
|
1718
1719
|
for (; j >= 1 && L >= 0; j--, L--)
|
|
1719
|
-
if (
|
|
1720
|
+
if (v[j] !== $[L]) {
|
|
1720
1721
|
if (j !== 1 || L !== 1)
|
|
1721
1722
|
do
|
|
1722
|
-
if (j--, L--, L < 0 ||
|
|
1723
|
-
var
|
|
1724
|
-
` +
|
|
1725
|
-
return t.displayName &&
|
|
1723
|
+
if (j--, L--, L < 0 || v[j] !== $[L]) {
|
|
1724
|
+
var B = `
|
|
1725
|
+
` + v[j].replace(" at new ", " at ");
|
|
1726
|
+
return t.displayName && B.includes("<anonymous>") && (B = B.replace("<anonymous>", t.displayName)), typeof t == "function" && _e.set(t, B), B;
|
|
1726
1727
|
}
|
|
1727
1728
|
while (j >= 1 && L >= 0);
|
|
1728
1729
|
break;
|
|
1729
1730
|
}
|
|
1730
1731
|
}
|
|
1731
1732
|
} finally {
|
|
1732
|
-
Re = !1, Ce.current =
|
|
1733
|
+
Re = !1, Ce.current = O, ht(), Error.prepareStackTrace = S;
|
|
1733
1734
|
}
|
|
1734
1735
|
var ie = t ? t.displayName || t.name : "", et = ie ? he(ie) : "";
|
|
1735
1736
|
return typeof t == "function" && _e.set(t, et), et;
|
|
@@ -1749,51 +1750,51 @@ function wr() {
|
|
|
1749
1750
|
if (typeof t == "string")
|
|
1750
1751
|
return he(t);
|
|
1751
1752
|
switch (t) {
|
|
1752
|
-
case
|
|
1753
|
+
case p:
|
|
1753
1754
|
return he("Suspense");
|
|
1754
|
-
case
|
|
1755
|
+
case y:
|
|
1755
1756
|
return he("SuspenseList");
|
|
1756
1757
|
}
|
|
1757
1758
|
if (typeof t == "object")
|
|
1758
1759
|
switch (t.$$typeof) {
|
|
1759
|
-
case
|
|
1760
|
+
case m:
|
|
1760
1761
|
return gt(t.render);
|
|
1761
|
-
case
|
|
1762
|
+
case b:
|
|
1762
1763
|
return ge(t.type, a, l);
|
|
1763
1764
|
case I: {
|
|
1764
|
-
var h = t,
|
|
1765
|
+
var h = t, S = h._payload, O = h._init;
|
|
1765
1766
|
try {
|
|
1766
|
-
return ge(
|
|
1767
|
-
} catch (
|
|
1767
|
+
return ge(O(S), a, l);
|
|
1768
|
+
} catch (E) {
|
|
1768
1769
|
}
|
|
1769
1770
|
}
|
|
1770
1771
|
}
|
|
1771
1772
|
return "";
|
|
1772
1773
|
}
|
|
1773
|
-
var me = Object.prototype.hasOwnProperty,
|
|
1774
|
+
var me = Object.prototype.hasOwnProperty, We = {}, Be = U.ReactDebugCurrentFrame;
|
|
1774
1775
|
function ve(t) {
|
|
1775
1776
|
if (t) {
|
|
1776
1777
|
var a = t._owner, l = ge(t.type, t._source, a ? a.type : null);
|
|
1777
|
-
|
|
1778
|
+
Be.setExtraStackFrame(l);
|
|
1778
1779
|
} else
|
|
1779
|
-
|
|
1780
|
+
Be.setExtraStackFrame(null);
|
|
1780
1781
|
}
|
|
1781
|
-
function vt(t, a, l, h,
|
|
1782
|
+
function vt(t, a, l, h, S) {
|
|
1782
1783
|
{
|
|
1783
|
-
var
|
|
1784
|
-
for (var
|
|
1785
|
-
if (
|
|
1786
|
-
var
|
|
1784
|
+
var O = Function.call.bind(me);
|
|
1785
|
+
for (var E in t)
|
|
1786
|
+
if (O(t, E)) {
|
|
1787
|
+
var v = void 0;
|
|
1787
1788
|
try {
|
|
1788
|
-
if (typeof t[
|
|
1789
|
-
var $ = Error((h || "React class") + ": " + l + " type `" +
|
|
1789
|
+
if (typeof t[E] != "function") {
|
|
1790
|
+
var $ = Error((h || "React class") + ": " + l + " type `" + E + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[E] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
1790
1791
|
throw $.name = "Invariant Violation", $;
|
|
1791
1792
|
}
|
|
1792
|
-
|
|
1793
|
+
v = t[E](a, E, h, l, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
1793
1794
|
} catch (j) {
|
|
1794
|
-
|
|
1795
|
+
v = j;
|
|
1795
1796
|
}
|
|
1796
|
-
|
|
1797
|
+
v && !(v instanceof Error) && (ve(S), P("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", h || "React class", l, E, typeof v), ve(null)), v instanceof Error && !(v.message in We) && (We[v.message] = !0, ve(S), P("Failed %s type: %s", l, v.message), ve(null));
|
|
1797
1798
|
}
|
|
1798
1799
|
}
|
|
1799
1800
|
}
|
|
@@ -1826,7 +1827,7 @@ function wr() {
|
|
|
1826
1827
|
ref: !0,
|
|
1827
1828
|
__self: !0,
|
|
1828
1829
|
__source: !0
|
|
1829
|
-
}, Ge,
|
|
1830
|
+
}, Ge, He, Ie;
|
|
1830
1831
|
Ie = {};
|
|
1831
1832
|
function St(t) {
|
|
1832
1833
|
if (me.call(t, "ref")) {
|
|
@@ -1864,7 +1865,7 @@ function wr() {
|
|
|
1864
1865
|
function Ot(t, a) {
|
|
1865
1866
|
{
|
|
1866
1867
|
var l = function() {
|
|
1867
|
-
|
|
1868
|
+
He || (He = !0, P("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", a));
|
|
1868
1869
|
};
|
|
1869
1870
|
l.isReactWarning = !0, Object.defineProperty(t, "ref", {
|
|
1870
1871
|
get: l,
|
|
@@ -1872,60 +1873,60 @@ function wr() {
|
|
|
1872
1873
|
});
|
|
1873
1874
|
}
|
|
1874
1875
|
}
|
|
1875
|
-
var It = function(t, a, l, h,
|
|
1876
|
-
var
|
|
1876
|
+
var It = function(t, a, l, h, S, O, E) {
|
|
1877
|
+
var v = {
|
|
1877
1878
|
// This tag allows us to uniquely identify this as a React Element
|
|
1878
1879
|
$$typeof: s,
|
|
1879
1880
|
// Built-in properties that belong on the element
|
|
1880
1881
|
type: t,
|
|
1881
1882
|
key: a,
|
|
1882
1883
|
ref: l,
|
|
1883
|
-
props:
|
|
1884
|
+
props: E,
|
|
1884
1885
|
// Record the component responsible for creating this element.
|
|
1885
|
-
_owner:
|
|
1886
|
+
_owner: O
|
|
1886
1887
|
};
|
|
1887
|
-
return
|
|
1888
|
+
return v._store = {}, Object.defineProperty(v._store, "validated", {
|
|
1888
1889
|
configurable: !1,
|
|
1889
1890
|
enumerable: !1,
|
|
1890
1891
|
writable: !0,
|
|
1891
1892
|
value: !1
|
|
1892
|
-
}), Object.defineProperty(
|
|
1893
|
+
}), Object.defineProperty(v, "_self", {
|
|
1893
1894
|
configurable: !1,
|
|
1894
1895
|
enumerable: !1,
|
|
1895
1896
|
writable: !1,
|
|
1896
1897
|
value: h
|
|
1897
|
-
}), Object.defineProperty(
|
|
1898
|
+
}), Object.defineProperty(v, "_source", {
|
|
1898
1899
|
configurable: !1,
|
|
1899
1900
|
enumerable: !1,
|
|
1900
1901
|
writable: !1,
|
|
1901
|
-
value:
|
|
1902
|
-
}), Object.freeze && (Object.freeze(
|
|
1902
|
+
value: S
|
|
1903
|
+
}), Object.freeze && (Object.freeze(v.props), Object.freeze(v)), v;
|
|
1903
1904
|
};
|
|
1904
|
-
function Tt(t, a, l, h,
|
|
1905
|
+
function Tt(t, a, l, h, S) {
|
|
1905
1906
|
{
|
|
1906
|
-
var
|
|
1907
|
-
l !== void 0 && (qe(l),
|
|
1908
|
-
for (
|
|
1909
|
-
me.call(a,
|
|
1907
|
+
var O, E = {}, v = null, $ = null;
|
|
1908
|
+
l !== void 0 && (qe(l), v = "" + l), Ct(a) && (qe(a.key), v = "" + a.key), St(a) && ($ = a.ref, wt(a, S));
|
|
1909
|
+
for (O in a)
|
|
1910
|
+
me.call(a, O) && !bt.hasOwnProperty(O) && (E[O] = a[O]);
|
|
1910
1911
|
if (t && t.defaultProps) {
|
|
1911
1912
|
var j = t.defaultProps;
|
|
1912
|
-
for (
|
|
1913
|
-
|
|
1913
|
+
for (O in j)
|
|
1914
|
+
E[O] === void 0 && (E[O] = j[O]);
|
|
1914
1915
|
}
|
|
1915
|
-
if (
|
|
1916
|
+
if (v || $) {
|
|
1916
1917
|
var L = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
|
|
1917
|
-
|
|
1918
|
+
v && Rt(E, L), $ && Ot(E, L);
|
|
1918
1919
|
}
|
|
1919
|
-
return It(t,
|
|
1920
|
+
return It(t, v, $, S, h, se.current, E);
|
|
1920
1921
|
}
|
|
1921
1922
|
}
|
|
1922
|
-
var Te = U.ReactCurrentOwner,
|
|
1923
|
+
var Te = U.ReactCurrentOwner, Ye = U.ReactDebugCurrentFrame;
|
|
1923
1924
|
function re(t) {
|
|
1924
1925
|
if (t) {
|
|
1925
1926
|
var a = t._owner, l = ge(t.type, t._source, a ? a.type : null);
|
|
1926
|
-
|
|
1927
|
+
Ye.setExtraStackFrame(l);
|
|
1927
1928
|
} else
|
|
1928
|
-
|
|
1929
|
+
Ye.setExtraStackFrame(null);
|
|
1929
1930
|
}
|
|
1930
1931
|
var ke;
|
|
1931
1932
|
ke = !1;
|
|
@@ -1993,10 +1994,10 @@ Check the top-level render call using <` + l + ">.");
|
|
|
1993
1994
|
else if (Pe(t))
|
|
1994
1995
|
t._store && (t._store.validated = !0);
|
|
1995
1996
|
else if (t) {
|
|
1996
|
-
var
|
|
1997
|
-
if (typeof
|
|
1998
|
-
for (var
|
|
1999
|
-
Pe(
|
|
1997
|
+
var S = k(t);
|
|
1998
|
+
if (typeof S == "function" && S !== t.entries)
|
|
1999
|
+
for (var O = S.call(t), E; !(E = O.next()).done; )
|
|
2000
|
+
Pe(E.value) && Xe(E.value, a);
|
|
2000
2001
|
}
|
|
2001
2002
|
}
|
|
2002
2003
|
}
|
|
@@ -2008,9 +2009,9 @@ Check the top-level render call using <` + l + ">.");
|
|
|
2008
2009
|
var l;
|
|
2009
2010
|
if (typeof a == "function")
|
|
2010
2011
|
l = a.propTypes;
|
|
2011
|
-
else if (typeof a == "object" && (a.$$typeof ===
|
|
2012
|
+
else if (typeof a == "object" && (a.$$typeof === m || // Note: Memo only checks outer props here.
|
|
2012
2013
|
// Inner props are checked in the reconciler.
|
|
2013
|
-
a.$$typeof ===
|
|
2014
|
+
a.$$typeof === b))
|
|
2014
2015
|
l = a.propTypes;
|
|
2015
2016
|
else
|
|
2016
2017
|
return;
|
|
@@ -2019,8 +2020,8 @@ Check the top-level render call using <` + l + ">.");
|
|
|
2019
2020
|
vt(l, t.props, "prop", h, t);
|
|
2020
2021
|
} else if (a.PropTypes !== void 0 && !ke) {
|
|
2021
2022
|
ke = !0;
|
|
2022
|
-
var
|
|
2023
|
-
P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",
|
|
2023
|
+
var S = G(a);
|
|
2024
|
+
P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", S || "Unknown");
|
|
2024
2025
|
}
|
|
2025
2026
|
typeof a.getDefaultProps == "function" && !a.getDefaultProps.isReactClassApproved && P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
2026
2027
|
}
|
|
@@ -2037,32 +2038,32 @@ Check the top-level render call using <` + l + ">.");
|
|
|
2037
2038
|
t.ref !== null && (re(t), P("Invalid attribute `ref` supplied to `React.Fragment`."), re(null));
|
|
2038
2039
|
}
|
|
2039
2040
|
}
|
|
2040
|
-
function Qe(t, a, l, h,
|
|
2041
|
+
function Qe(t, a, l, h, S, O) {
|
|
2041
2042
|
{
|
|
2042
|
-
var
|
|
2043
|
-
if (!
|
|
2044
|
-
var
|
|
2045
|
-
(t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (
|
|
2046
|
-
var $ = kt(
|
|
2047
|
-
$ ?
|
|
2043
|
+
var E = F(t);
|
|
2044
|
+
if (!E) {
|
|
2045
|
+
var v = "";
|
|
2046
|
+
(t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (v += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
2047
|
+
var $ = kt(S);
|
|
2048
|
+
$ ? v += $ : v += Je();
|
|
2048
2049
|
var j;
|
|
2049
|
-
t === null ? j = "null" : Oe(t) ? j = "array" : t !== void 0 && t.$$typeof === s ? (j = "<" + (G(t.type) || "Unknown") + " />",
|
|
2050
|
+
t === null ? j = "null" : Oe(t) ? j = "array" : t !== void 0 && t.$$typeof === s ? (j = "<" + (G(t.type) || "Unknown") + " />", v = " Did you accidentally export a JSX literal instead of a component?") : j = typeof t, P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", j, v);
|
|
2050
2051
|
}
|
|
2051
|
-
var L = Tt(t, a, l,
|
|
2052
|
+
var L = Tt(t, a, l, S, O);
|
|
2052
2053
|
if (L == null)
|
|
2053
2054
|
return L;
|
|
2054
|
-
if (
|
|
2055
|
-
var
|
|
2056
|
-
if (
|
|
2055
|
+
if (E) {
|
|
2056
|
+
var B = a.children;
|
|
2057
|
+
if (B !== void 0)
|
|
2057
2058
|
if (h)
|
|
2058
|
-
if (Oe(
|
|
2059
|
-
for (var ie = 0; ie <
|
|
2060
|
-
Ze(
|
|
2061
|
-
Object.freeze && Object.freeze(
|
|
2059
|
+
if (Oe(B)) {
|
|
2060
|
+
for (var ie = 0; ie < B.length; ie++)
|
|
2061
|
+
Ze(B[ie], t);
|
|
2062
|
+
Object.freeze && Object.freeze(B);
|
|
2062
2063
|
} else
|
|
2063
2064
|
P("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
2064
2065
|
else
|
|
2065
|
-
Ze(
|
|
2066
|
+
Ze(B, t);
|
|
2066
2067
|
}
|
|
2067
2068
|
return t === i ? jt(L) : Nt(L), L;
|
|
2068
2069
|
}
|
|
@@ -2087,51 +2088,51 @@ function jr(r) {
|
|
|
2087
2088
|
if (!f)
|
|
2088
2089
|
throw new Error("LiveProvider never found.");
|
|
2089
2090
|
return f;
|
|
2090
|
-
}, u = () => e, d = () => e.$RTC,
|
|
2091
|
-
function
|
|
2092
|
-
const
|
|
2093
|
-
return D.useEffect(() => (
|
|
2091
|
+
}, u = () => e, d = () => e.$RTC, m = () => d(), p = () => async (f) => await e.connect(f);
|
|
2092
|
+
function y(f, R, A = []) {
|
|
2093
|
+
const C = c(), N = [C, name, ...A], M = () => C.keyframes.off(f, R);
|
|
2094
|
+
return D.useEffect(() => (C.keyframes.on(f, R), M), N), M;
|
|
2094
2095
|
}
|
|
2095
|
-
function
|
|
2096
|
+
function b() {
|
|
2096
2097
|
const f = c();
|
|
2097
2098
|
return {
|
|
2098
2099
|
connect: async (T) => await f.connect(T),
|
|
2099
|
-
broadcast: async (T,
|
|
2100
|
+
broadcast: async (T, W, te = 0) => await f.broadcast(T, W, te),
|
|
2100
2101
|
exit: async () => await f.exit(),
|
|
2101
2102
|
kick: async (T) => await f.kick(T),
|
|
2102
2103
|
toggleMicro: (T) => f.toggleMicro(T),
|
|
2103
|
-
forbidMicro: async (T,
|
|
2104
|
-
forbidSync: (T,
|
|
2105
|
-
sendKeyframe: (T,
|
|
2104
|
+
forbidMicro: async (T, W = []) => await f.forbidMicro(T, W),
|
|
2105
|
+
forbidSync: (T, W = []) => f.forbidSync(T, W),
|
|
2106
|
+
sendKeyframe: (T, W) => f.sendKeyframe(T, W),
|
|
2106
2107
|
getFramesByKey: (T) => f.getFramesByKey(T),
|
|
2107
2108
|
setSelfInfo: (T) => f.setSelfInfo(T),
|
|
2108
|
-
updateStatus: (T,
|
|
2109
|
+
updateStatus: (T, W, te, de) => f.updateStatus(T, W, te, de)
|
|
2109
2110
|
};
|
|
2110
2111
|
}
|
|
2111
2112
|
function I(f) {
|
|
2112
|
-
const
|
|
2113
|
+
const R = c(), [A, C] = D.useState(R.getFramesByKey(f));
|
|
2113
2114
|
D.useEffect(() => {
|
|
2114
|
-
const M = (ne) =>
|
|
2115
|
-
return
|
|
2116
|
-
}, [
|
|
2115
|
+
const M = (ne) => C(ne), F = f, J = M;
|
|
2116
|
+
return R.keyframes.on(F, J), () => R.keyframes.off(F, J);
|
|
2117
|
+
}, [R]);
|
|
2117
2118
|
const N = D.useCallback(
|
|
2118
|
-
(M) =>
|
|
2119
|
-
[
|
|
2119
|
+
(M) => R.sendKeyframe(f, M),
|
|
2120
|
+
[R]
|
|
2120
2121
|
);
|
|
2121
2122
|
return [A, N];
|
|
2122
2123
|
}
|
|
2123
|
-
function
|
|
2124
|
-
const
|
|
2125
|
-
return D.useEffect(() => (
|
|
2124
|
+
function g(f, R, A = []) {
|
|
2125
|
+
const C = c(), N = () => C.off(f, R), M = [C, f, ...A];
|
|
2126
|
+
return D.useEffect(() => (C.on(f, R), N), M), N;
|
|
2126
2127
|
}
|
|
2127
2128
|
function V() {
|
|
2128
|
-
const f = c(), [
|
|
2129
|
+
const f = c(), [R, A] = D.useState(f.state);
|
|
2129
2130
|
return D.useEffect(() => {
|
|
2130
|
-
const
|
|
2131
|
-
return f.on("stateChange",
|
|
2132
|
-
}, [f]),
|
|
2131
|
+
const C = (N) => A(N);
|
|
2132
|
+
return f.on("stateChange", C), () => f.off("stateChange", C);
|
|
2133
|
+
}, [f]), R;
|
|
2133
2134
|
}
|
|
2134
|
-
function
|
|
2135
|
+
function w() {
|
|
2135
2136
|
const f = c();
|
|
2136
2137
|
return {
|
|
2137
2138
|
join: (F) => f.$RTC.join(F),
|
|
@@ -2144,47 +2145,47 @@ function jr(r) {
|
|
|
2144
2145
|
detectMicro: () => f.$RTC.detectMicro()
|
|
2145
2146
|
};
|
|
2146
2147
|
}
|
|
2147
|
-
function k(f,
|
|
2148
|
-
const
|
|
2149
|
-
return D.useEffect(() => (
|
|
2148
|
+
function k(f, R, A = []) {
|
|
2149
|
+
const C = c(), N = () => C.$RTC.off(f, R), M = [C, f, ...A];
|
|
2150
|
+
return D.useEffect(() => (C.$RTC.on(f, R), N), M), N;
|
|
2150
2151
|
}
|
|
2151
2152
|
function U() {
|
|
2152
|
-
const f = c(), [
|
|
2153
|
+
const f = c(), [R, A] = D.useState(
|
|
2153
2154
|
f.selfInfo || {}
|
|
2154
|
-
),
|
|
2155
|
-
D.useEffect(() => (f.on("selfInfoUpdate",
|
|
2155
|
+
), C = (M) => A(M);
|
|
2156
|
+
D.useEffect(() => (f.on("selfInfoUpdate", C), () => f.off("selfInfoUpdate", C)), [f]);
|
|
2156
2157
|
const N = D.useCallback(
|
|
2157
2158
|
async (M) => await f.setSelfInfo(M),
|
|
2158
2159
|
[f]
|
|
2159
2160
|
);
|
|
2160
|
-
return [
|
|
2161
|
+
return [R, N];
|
|
2161
2162
|
}
|
|
2162
2163
|
function P() {
|
|
2163
|
-
const f = c(), [
|
|
2164
|
+
const f = c(), [R, A] = D.useState(
|
|
2164
2165
|
f.snapshot
|
|
2165
2166
|
);
|
|
2166
2167
|
return D.useEffect(() => {
|
|
2167
|
-
const
|
|
2168
|
-
return f.on("keyframes",
|
|
2169
|
-
}),
|
|
2168
|
+
const C = (N) => A(N);
|
|
2169
|
+
return f.on("keyframes", C), () => f.off("keyframes", C);
|
|
2170
|
+
}), R;
|
|
2170
2171
|
}
|
|
2171
2172
|
function fe() {
|
|
2172
|
-
const f = c(), [
|
|
2173
|
-
return D.useEffect(() => (f.on("userListUpdate",
|
|
2173
|
+
const f = c(), [R, A] = D.useState(f.userList), C = (N) => A(N);
|
|
2174
|
+
return D.useEffect(() => (f.on("userListUpdate", C), () => f.off("userListUpdate", C)), [f]), R;
|
|
2174
2175
|
}
|
|
2175
2176
|
return {
|
|
2176
2177
|
live: e,
|
|
2177
2178
|
jsBridge: i,
|
|
2178
2179
|
LiveProvider: n,
|
|
2179
2180
|
unsafe__useLiveInstance: u,
|
|
2180
|
-
unsafe__useRTCInstance:
|
|
2181
|
-
useConnect:
|
|
2181
|
+
unsafe__useRTCInstance: m,
|
|
2182
|
+
useConnect: p,
|
|
2182
2183
|
useKeyframe: I,
|
|
2183
|
-
useKeyframeUpdateCallback:
|
|
2184
|
-
useLiveAction:
|
|
2185
|
-
useLiveEventCallback:
|
|
2184
|
+
useKeyframeUpdateCallback: y,
|
|
2185
|
+
useLiveAction: b,
|
|
2186
|
+
useLiveEventCallback: g,
|
|
2186
2187
|
useLiveState: V,
|
|
2187
|
-
useRTCAction:
|
|
2188
|
+
useRTCAction: w,
|
|
2188
2189
|
useRTCEventCallback: k,
|
|
2189
2190
|
useSelfInfo: U,
|
|
2190
2191
|
useKeyframesSnapshot: P,
|
|
@@ -2195,7 +2196,7 @@ export {
|
|
|
2195
2196
|
rt as BrowserRTC,
|
|
2196
2197
|
it as BrowserRTC4Chime,
|
|
2197
2198
|
ut as BuiltInRTCType,
|
|
2198
|
-
|
|
2199
|
+
Y as BuiltinActionType,
|
|
2199
2200
|
q as BuiltinEventType,
|
|
2200
2201
|
K as Command,
|
|
2201
2202
|
Me as CoreRTC,
|