@realsee/live 0.6.12 → 0.6.14
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 +5 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +191 -179
- package/dist/index.es.js.map +1 -1
- package/dist/live/createLiveReact.d.ts +1 -1
- package/dist/live/live.d.ts +6 -1
- package/docs/functions/createLiveReact.html +8 -8
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var Vt = Object.defineProperty;
|
|
2
|
-
var $t = (r,
|
|
3
|
-
var
|
|
2
|
+
var $t = (r, o, e) => o in r ? Vt(r, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[o] = e;
|
|
3
|
+
var s = (r, o, e) => ($t(r, typeof o != "symbol" ? o + "" : o, e), e);
|
|
4
4
|
import xt from "@realsee/jsbridge-x";
|
|
5
5
|
import Ne from "trtc-js-sdk";
|
|
6
6
|
import { ConsoleLogger as Ut, LogLevel as Ft, DefaultDeviceController as Bt, MeetingSessionConfiguration as Wt, DefaultMeetingSession as Kt, DefaultModality as tt, MeetingSessionStatusCode as qt } from "amazon-chime-sdk-js";
|
|
@@ -17,9 +17,9 @@ class ue {
|
|
|
17
17
|
* 判断是否注册了事件
|
|
18
18
|
* @param name 事件类型
|
|
19
19
|
*/
|
|
20
|
-
hasListener(
|
|
20
|
+
hasListener(o) {
|
|
21
21
|
const e = pe(this);
|
|
22
|
-
return e && e[
|
|
22
|
+
return e && e[o] && e[o].length > 0;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* 注册事件
|
|
@@ -30,9 +30,9 @@ class ue {
|
|
|
30
30
|
* @template K 预设的监听事件名称
|
|
31
31
|
* @template C 回调函数函数上下文
|
|
32
32
|
*/
|
|
33
|
-
on(
|
|
33
|
+
on(o, e, i) {
|
|
34
34
|
const n = pe(this);
|
|
35
|
-
return n[
|
|
35
|
+
return n[o] || (n[o] = []), n[o].push([e, i || !1]), () => this.off(o, e);
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* 注册事件(是否只执行一次)
|
|
@@ -42,8 +42,8 @@ class ue {
|
|
|
42
42
|
* @template K 预设的监听事件名称
|
|
43
43
|
* @template C 回调函数函数上下文
|
|
44
44
|
*/
|
|
45
|
-
once(
|
|
46
|
-
return this.on(
|
|
45
|
+
once(o, e) {
|
|
46
|
+
return this.on(o, e, !0);
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* 解除事件
|
|
@@ -54,20 +54,20 @@ class ue {
|
|
|
54
54
|
* @param callback 事件回调函数
|
|
55
55
|
* @template K 预设的监听事件名称
|
|
56
56
|
*/
|
|
57
|
-
off(
|
|
58
|
-
if (
|
|
57
|
+
off(o, e) {
|
|
58
|
+
if (o === void 0) {
|
|
59
59
|
Yt(this);
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
const i = pe(this);
|
|
63
|
-
if (i[
|
|
64
|
-
i[
|
|
63
|
+
if (i[o] || (i[o] = []), e === void 0) {
|
|
64
|
+
i[o].length = 0;
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
let n = 0;
|
|
68
|
-
for (; n < i[
|
|
68
|
+
for (; n < i[o].length && i[o][n][0] !== e; n++)
|
|
69
69
|
;
|
|
70
|
-
n < i[
|
|
70
|
+
n < i[o].length && i[o].splice(n, 1);
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* 触发事件
|
|
@@ -76,12 +76,12 @@ class ue {
|
|
|
76
76
|
* @returns canceled 是否被触发取消
|
|
77
77
|
* @template K 预设的监听事件名称
|
|
78
78
|
*/
|
|
79
|
-
emit(
|
|
79
|
+
emit(o, ...e) {
|
|
80
80
|
let i = !1;
|
|
81
|
-
const c = pe(this)[
|
|
81
|
+
const c = pe(this)[o] || [];
|
|
82
82
|
for (let u of c.slice()) {
|
|
83
83
|
const [d, g = !1] = u, v = d(...e);
|
|
84
|
-
g && this.off(
|
|
84
|
+
g && this.off(o, d), v === !1 && (i = !0);
|
|
85
85
|
}
|
|
86
86
|
return i;
|
|
87
87
|
}
|
|
@@ -90,18 +90,18 @@ 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
92
|
const Ht = () => {
|
|
93
|
-
const r = new Date(),
|
|
94
|
-
return `[${
|
|
95
|
-
}, be = (r,
|
|
96
|
-
switch (
|
|
93
|
+
const r = new Date(), o = 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
|
+
return `[${o}-${e}-${i} ${n}:${c}:${u}.${d}]`;
|
|
95
|
+
}, be = (r, o = []) => {
|
|
96
|
+
switch (o.unshift(`Realsee Live ${Ht()} <${r}> `), r) {
|
|
97
97
|
case "INFO":
|
|
98
|
-
return console.info(...
|
|
98
|
+
return console.info(...o);
|
|
99
99
|
case "ERROR":
|
|
100
|
-
return console.error(...
|
|
100
|
+
return console.error(...o);
|
|
101
101
|
case "WARN":
|
|
102
|
-
return console.warn(...
|
|
102
|
+
return console.warn(...o);
|
|
103
103
|
default:
|
|
104
|
-
return console.log(...
|
|
104
|
+
return console.log(...o);
|
|
105
105
|
}
|
|
106
106
|
}, Jt = (...r) => be("LOG", r), zt = (...r) => be("INFO", r), Xt = (...r) => be("ERROR", r), Zt = (...r) => be("WARN", r), Qt = {
|
|
107
107
|
log: Jt,
|
|
@@ -118,21 +118,21 @@ function Ee() {
|
|
|
118
118
|
class rt extends Me {
|
|
119
119
|
constructor(e) {
|
|
120
120
|
super();
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
s(this, "type", Q.RealseeBrowserRTC);
|
|
122
|
+
s(this, "joined", !1);
|
|
123
|
+
s(this, "micro", !1);
|
|
124
|
+
s(this, "voiceId", "");
|
|
125
|
+
s(this, "_getVoiceSign", () => {
|
|
126
126
|
throw new Error("方法 getVoiceSign 未实现");
|
|
127
127
|
});
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
128
|
+
s(this, "_autoPlayConfirm");
|
|
129
|
+
s(this, "checkRequirement", () => Ne.checkSystemRequirements());
|
|
130
|
+
s(this, "$dom", document.createElement("div"));
|
|
131
|
+
s(this, "_trtc", {
|
|
132
132
|
client: null,
|
|
133
133
|
stream: null
|
|
134
134
|
});
|
|
135
|
-
|
|
135
|
+
s(this, "join", async (e) => {
|
|
136
136
|
var c;
|
|
137
137
|
this.emit("joinWillStart");
|
|
138
138
|
const i = await this._getVoiceSign({
|
|
@@ -161,12 +161,12 @@ class rt extends Me {
|
|
|
161
161
|
(d = this._trtc.client) == null || d.publish(this._trtc.stream).then(() => u(!0)).catch(() => u(!1));
|
|
162
162
|
}), this.joined = n, this.joined && this.emit("joined"), n) : !1;
|
|
163
163
|
});
|
|
164
|
-
|
|
164
|
+
s(this, "_handleStreamAdded", (e) => {
|
|
165
165
|
var n;
|
|
166
166
|
const i = e.stream;
|
|
167
167
|
console.log("远端流增加: " + i.getId()), (n = this._trtc.client) == null || n.subscribe(i);
|
|
168
168
|
});
|
|
169
|
-
|
|
169
|
+
s(this, "_handleStreamSubscribed", (e) => {
|
|
170
170
|
const i = e.stream;
|
|
171
171
|
console.log("远端流订阅成功:" + i.getId());
|
|
172
172
|
const c = `rs-rtc-remote_stream-${i.getId()}`, u = document.createElement("div");
|
|
@@ -227,35 +227,35 @@ class rt extends Me {
|
|
|
227
227
|
class it extends Me {
|
|
228
228
|
constructor(e) {
|
|
229
229
|
super();
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
230
|
+
s(this, "type", Q.RealseeBrowserChimeRTC);
|
|
231
|
+
s(this, "joined", !1);
|
|
232
|
+
s(this, "micro", !1);
|
|
233
|
+
s(this, "voiceId", "");
|
|
234
|
+
s(this, "userId", "");
|
|
235
|
+
s(this, "logger");
|
|
236
|
+
s(this, "deviceController");
|
|
237
|
+
s(this, "meetingSession");
|
|
238
|
+
s(this, "audioInput");
|
|
239
|
+
s(this, "audioOutput");
|
|
240
|
+
s(this, "deviceChangeObserver", {});
|
|
241
|
+
s(this, "audioVideoObserver", {});
|
|
242
|
+
s(this, "audioMixObserver");
|
|
243
|
+
s(this, "_getVoiceSign", () => {
|
|
244
244
|
throw new Error("方法 getVoiceSign 未实现");
|
|
245
245
|
});
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
246
|
+
s(this, "_autoPlayConfirm");
|
|
247
|
+
s(this, "$dom", document.createElement("div"));
|
|
248
|
+
s(this, "$audio", document.createElement("audio"));
|
|
249
249
|
/**
|
|
250
250
|
* 对audio标签初始化
|
|
251
251
|
*/
|
|
252
|
-
|
|
252
|
+
s(this, "_initDom", () => {
|
|
253
253
|
this.$audio.id = `rs-rtc-${Ee()}`, this.$dom.id = `rs-rtc-${Ee()}`, this.$dom.appendChild(this.$audio), document.body.appendChild(this.$dom);
|
|
254
254
|
});
|
|
255
255
|
/**
|
|
256
256
|
* 初始化事件监听器
|
|
257
257
|
*/
|
|
258
|
-
|
|
258
|
+
s(this, "initObservers", () => {
|
|
259
259
|
this.deviceChangeObserver = {
|
|
260
260
|
audioInputsChanged: (e) => {
|
|
261
261
|
this.logger.info(`audioInputsChanged ${typeof e}`), e == null || e.forEach((i) => {
|
|
@@ -303,7 +303,7 @@ class it extends Me {
|
|
|
303
303
|
/**
|
|
304
304
|
* 注册rtc事件
|
|
305
305
|
*/
|
|
306
|
-
|
|
306
|
+
s(this, "_registerRtcEvent", () => {
|
|
307
307
|
var i, n, c, u, d, g;
|
|
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) {
|
|
@@ -447,11 +447,11 @@ var lt = /* @__PURE__ */ ((r) => (r[r.Success = 0] = "Success", r[r.Failure = 1]
|
|
|
447
447
|
class nt extends Me {
|
|
448
448
|
constructor({ jsBridge: e, getVoiceSign: i }) {
|
|
449
449
|
super();
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
450
|
+
s(this, "type", Q.RealseeVRWebViewRTC);
|
|
451
|
+
s(this, "joined", !1);
|
|
452
|
+
s(this, "micro", !1);
|
|
453
|
+
s(this, "voiceId", "");
|
|
454
|
+
s(this, "options");
|
|
455
455
|
this.options = { jsBridge: e, getVoiceSign: i }, this.jsBridge.webViewType !== "WxMiniProgramWebView" && this.jsBridge.callAndListen("live/userVolumes", (n) => {
|
|
456
456
|
this.emit("userVolumes", n);
|
|
457
457
|
}), this.jsBridge.callAndListen("live/weakNetwork", (n) => {
|
|
@@ -495,21 +495,21 @@ class nt extends Me {
|
|
|
495
495
|
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 || {}), H = /* @__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))(H || {}), Z = /* @__PURE__ */ ((r) => (r.OPEN = "OPEN", r.CLOSE = "CLOSE", r))(Z || {});
|
|
496
496
|
function Nr(r) {
|
|
497
497
|
try {
|
|
498
|
-
const
|
|
499
|
-
code:
|
|
500
|
-
message:
|
|
501
|
-
command:
|
|
502
|
-
roomCode:
|
|
503
|
-
appID:
|
|
504
|
-
requestId:
|
|
505
|
-
frontRequestId:
|
|
506
|
-
triggerUserID:
|
|
507
|
-
data:
|
|
498
|
+
const o = JSON.parse(r), e = {
|
|
499
|
+
code: o.code,
|
|
500
|
+
message: o.message,
|
|
501
|
+
command: o.command,
|
|
502
|
+
roomCode: o.room_code,
|
|
503
|
+
appID: o.app_id,
|
|
504
|
+
requestId: o.request_id,
|
|
505
|
+
frontRequestId: o.front_request_id,
|
|
506
|
+
triggerUserID: o.trigger_user_id,
|
|
507
|
+
data: o.data || {}
|
|
508
508
|
}, i = Object.keys(e).filter(
|
|
509
509
|
(n) => e[n] === void 0
|
|
510
510
|
);
|
|
511
511
|
return i.length > 0 && console.warn(`推送数据格式异常:${i.join(" ")} 值不存在!`), e;
|
|
512
|
-
} catch (
|
|
512
|
+
} catch (o) {
|
|
513
513
|
return !1;
|
|
514
514
|
}
|
|
515
515
|
}
|
|
@@ -541,15 +541,15 @@ function sr(r) {
|
|
|
541
541
|
var ft = {};
|
|
542
542
|
(function(r) {
|
|
543
543
|
Object.defineProperty(r, "__esModule", { value: !0 }), r.LogLevel = void 0;
|
|
544
|
-
var
|
|
544
|
+
var o;
|
|
545
545
|
(function(e) {
|
|
546
546
|
e[e.DEBUG = 0] = "DEBUG", e[e.INFO = 1] = "INFO", e[e.WARN = 2] = "WARN", e[e.ERROR = 3] = "ERROR", e[e.OFF = 4] = "OFF";
|
|
547
|
-
})(
|
|
547
|
+
})(o = r.LogLevel || (r.LogLevel = {})), r.default = o;
|
|
548
548
|
})(ft);
|
|
549
549
|
const st = /* @__PURE__ */ sr(ft);
|
|
550
|
-
function or(r,
|
|
551
|
-
const e = r.indexOf("?") !== -1, i = Object.keys(
|
|
552
|
-
(n, c, u) => `${n}${u === 0 && !e ? "?" : "&"}${c}=${
|
|
550
|
+
function or(r, o = {}) {
|
|
551
|
+
const e = r.indexOf("?") !== -1, i = Object.keys(o).reduce(
|
|
552
|
+
(n, c, u) => `${n}${u === 0 && !e ? "?" : "&"}${c}=${o[c]}`,
|
|
553
553
|
""
|
|
554
554
|
);
|
|
555
555
|
return r + i;
|
|
@@ -558,64 +558,64 @@ const le = globalThis.navigator.userAgent, ar = /android/gi.test(le), cr = /iPho
|
|
|
558
558
|
function ye(r) {
|
|
559
559
|
return Object.prototype.toString.call(r) === "[object Object]";
|
|
560
560
|
}
|
|
561
|
-
function Se(r,
|
|
562
|
-
return r ===
|
|
561
|
+
function Se(r, o) {
|
|
562
|
+
return r === o ? !0 : typeof r != typeof o ? !1 : !!(Number.isNaN(r) && Number.isNaN(o));
|
|
563
563
|
}
|
|
564
|
-
function fr(r,
|
|
565
|
-
const e = Object.getOwnPropertyNames(r), i = Object.getOwnPropertyNames(
|
|
564
|
+
function fr(r, o) {
|
|
565
|
+
const e = Object.getOwnPropertyNames(r), i = Object.getOwnPropertyNames(o);
|
|
566
566
|
if (e.length !== i.length)
|
|
567
567
|
return !1;
|
|
568
568
|
for (let n = 0, c = e.length; n < c; n++) {
|
|
569
569
|
const u = e[n];
|
|
570
|
-
if (!Se(r[u],
|
|
570
|
+
if (!Se(r[u], o[u]))
|
|
571
571
|
return !1;
|
|
572
572
|
}
|
|
573
573
|
return !0;
|
|
574
574
|
}
|
|
575
|
-
function dr(r,
|
|
576
|
-
if (r.length !==
|
|
575
|
+
function dr(r, o) {
|
|
576
|
+
if (r.length !== o.length)
|
|
577
577
|
return !1;
|
|
578
578
|
for (let e = 0, i = r.length; e < i; e++)
|
|
579
|
-
if (!Se(r[e],
|
|
579
|
+
if (!Se(r[e], o[e]))
|
|
580
580
|
return !1;
|
|
581
581
|
return !0;
|
|
582
582
|
}
|
|
583
|
-
function hr(r,
|
|
584
|
-
return Se(r,
|
|
583
|
+
function hr(r, o) {
|
|
584
|
+
return Se(r, o) ? !0 : ye(r) && ye(o) ? fr(r, o) : Array.isArray(r) && Array.isArray(o) ? dr(r, o) : !1;
|
|
585
585
|
}
|
|
586
|
-
function De(r,
|
|
587
|
-
return Se(r,
|
|
586
|
+
function De(r, o) {
|
|
587
|
+
return Se(r, o) ? !0 : ye(r) && ye(o) ? gr(r, o) : Array.isArray(r) && Array.isArray(o) ? _r(r, o) : !1;
|
|
588
588
|
}
|
|
589
|
-
function _r(r,
|
|
590
|
-
if (r.length !==
|
|
589
|
+
function _r(r, o) {
|
|
590
|
+
if (r.length !== o.length)
|
|
591
591
|
return !1;
|
|
592
592
|
for (let e = 0, i = r.length; e < i; e++)
|
|
593
|
-
if (!De(r[e],
|
|
593
|
+
if (!De(r[e], o[e]))
|
|
594
594
|
return !1;
|
|
595
595
|
return !0;
|
|
596
596
|
}
|
|
597
|
-
function gr(r,
|
|
598
|
-
const e = Object.getOwnPropertyNames(r), i = Object.getOwnPropertyNames(
|
|
597
|
+
function gr(r, o) {
|
|
598
|
+
const e = Object.getOwnPropertyNames(r), i = Object.getOwnPropertyNames(o);
|
|
599
599
|
if (e.length !== i.length)
|
|
600
600
|
return !1;
|
|
601
601
|
for (let n = 0, c = e.length; n < c; n++) {
|
|
602
602
|
const u = e[n];
|
|
603
|
-
if (!De(r[u],
|
|
603
|
+
if (!De(r[u], o[u]))
|
|
604
604
|
return !1;
|
|
605
605
|
}
|
|
606
606
|
return !0;
|
|
607
607
|
}
|
|
608
|
-
function ot(r,
|
|
609
|
-
return e.deep ? De(r,
|
|
608
|
+
function ot(r, o, e = { deep: !1 }) {
|
|
609
|
+
return e.deep ? De(r, o) : hr(r, o);
|
|
610
610
|
}
|
|
611
611
|
class mr extends ue {
|
|
612
612
|
constructor(e) {
|
|
613
613
|
super();
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
614
|
+
s(this, "_realWebSocket");
|
|
615
|
+
s(this, "_url");
|
|
616
|
+
s(this, "_protocols");
|
|
617
|
+
s(this, "_readyState", Le.NOTINITIALIZED);
|
|
618
|
+
s(this, "_options", {
|
|
619
619
|
timeout: 1e4,
|
|
620
620
|
shouldReconnect: (e, i) => {
|
|
621
621
|
if (!(e.code === 1008 || e.code === 1011))
|
|
@@ -625,74 +625,74 @@ class mr extends ue {
|
|
|
625
625
|
ignoreConnectivityEvents: !1,
|
|
626
626
|
automaticOpen: !1
|
|
627
627
|
});
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
628
|
+
s(this, "_connectTimeout");
|
|
629
|
+
s(this, "_attempts", 0);
|
|
630
|
+
s(this, "_reconnects", -1);
|
|
631
|
+
s(this, "_reconnectWhenOnlineAgain", !1);
|
|
632
|
+
s(this, "_explicitlyClosed", !1);
|
|
633
|
+
s(this, "_pendingReconnect");
|
|
634
|
+
s(this, "_connectivityEventsAttached", !1);
|
|
635
|
+
s(this, "_heathCheckTimer");
|
|
636
636
|
/**
|
|
637
637
|
* 做一个健康检查
|
|
638
638
|
*/
|
|
639
|
-
|
|
639
|
+
s(this, "_healthCheck", async () => {
|
|
640
640
|
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);
|
|
641
641
|
});
|
|
642
642
|
/**
|
|
643
643
|
* 清理超时计时器
|
|
644
644
|
*/
|
|
645
|
-
|
|
645
|
+
s(this, "_clearConnectTimeoutIfNeed", () => {
|
|
646
646
|
this._connectTimeout && (clearTimeout(this._connectTimeout), this._connectTimeout = void 0);
|
|
647
647
|
});
|
|
648
648
|
/**
|
|
649
649
|
* 清理健康检查
|
|
650
650
|
*/
|
|
651
|
-
|
|
651
|
+
s(this, "_clearHeathCheckIfNeed", () => {
|
|
652
652
|
this._heathCheckTimer && (cancelAnimationFrame(this._heathCheckTimer), this._heathCheckTimer = void 0);
|
|
653
653
|
});
|
|
654
654
|
/**
|
|
655
655
|
* 开启健康检查
|
|
656
656
|
*/
|
|
657
|
-
|
|
657
|
+
s(this, "_startHealthCheck", () => {
|
|
658
658
|
this._clearHeathCheckIfNeed(), this._heathCheckTimer = requestAnimationFrame(this._healthCheck);
|
|
659
659
|
});
|
|
660
660
|
/**
|
|
661
661
|
* 停止健康检查
|
|
662
662
|
*/
|
|
663
|
-
|
|
663
|
+
s(this, "_stopHealthCheck", () => {
|
|
664
664
|
this._clearHeathCheckIfNeed();
|
|
665
665
|
});
|
|
666
666
|
/**
|
|
667
667
|
* 清理连接中的请求
|
|
668
668
|
*/
|
|
669
|
-
|
|
669
|
+
s(this, "_clearPendingReconnectIfNeeded", () => {
|
|
670
670
|
this._pendingReconnect && (clearTimeout(this._pendingReconnect), this._pendingReconnect = void 0);
|
|
671
671
|
});
|
|
672
672
|
/**
|
|
673
673
|
* 当网页连接上网络进行重连
|
|
674
674
|
* @param event
|
|
675
675
|
*/
|
|
676
|
-
|
|
676
|
+
s(this, "_online", (e) => {
|
|
677
677
|
this._reconnectWhenOnlineAgain && (this._clearPendingReconnectIfNeeded(), this._reconnect(e));
|
|
678
678
|
});
|
|
679
679
|
/**
|
|
680
680
|
* 当网页断开网络进行关闭
|
|
681
681
|
*/
|
|
682
|
-
|
|
682
|
+
s(this, "_offline", () => {
|
|
683
683
|
var e;
|
|
684
684
|
this._reconnectWhenOnlineAgain = !0, (e = this._realWebSocket) == null || e.close(1e3, "offline");
|
|
685
685
|
});
|
|
686
686
|
/**
|
|
687
687
|
* 解除网络监听事件
|
|
688
688
|
*/
|
|
689
|
-
|
|
689
|
+
s(this, "_detachConnectivityEvents", () => {
|
|
690
690
|
this._connectivityEventsAttached && (globalThis == null || globalThis.removeEventListener("online", this._online), globalThis == null || globalThis.removeEventListener("offline", this._offline), this._connectivityEventsAttached = !1);
|
|
691
691
|
});
|
|
692
692
|
/**
|
|
693
693
|
* 注册网络监听事件
|
|
694
694
|
*/
|
|
695
|
-
|
|
695
|
+
s(this, "_attachConnectivityEvents", () => {
|
|
696
696
|
this._connectivityEventsAttached || (globalThis == null || globalThis.addEventListener("online", this._online), globalThis == null || globalThis.addEventListener("offline", this._offline), this._connectivityEventsAttached = !0);
|
|
697
697
|
});
|
|
698
698
|
/**
|
|
@@ -700,7 +700,7 @@ class mr extends ue {
|
|
|
700
700
|
* @param data
|
|
701
701
|
* @returns
|
|
702
702
|
*/
|
|
703
|
-
|
|
703
|
+
s(this, "send", (e) => {
|
|
704
704
|
var i, n, c;
|
|
705
705
|
((i = this._realWebSocket) == null ? void 0 : i.readyState) === ((n = this._realWebSocket) == null ? void 0 : n.OPEN) && ((c = this._realWebSocket) == null || c.send(e));
|
|
706
706
|
});
|
|
@@ -710,21 +710,21 @@ class mr extends ue {
|
|
|
710
710
|
* @param reason 原因
|
|
711
711
|
* @returns
|
|
712
712
|
*/
|
|
713
|
-
|
|
713
|
+
s(this, "close", (e, i) => {
|
|
714
714
|
var n;
|
|
715
715
|
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);
|
|
716
716
|
});
|
|
717
717
|
/**
|
|
718
718
|
* 进行ws连接
|
|
719
719
|
*/
|
|
720
|
-
|
|
720
|
+
s(this, "open", (e) => {
|
|
721
721
|
var i, n;
|
|
722
722
|
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());
|
|
723
723
|
});
|
|
724
724
|
/**
|
|
725
725
|
* 创建ws连接
|
|
726
726
|
*/
|
|
727
|
-
|
|
727
|
+
s(this, "_createWebSocket", () => {
|
|
728
728
|
var n, c, u;
|
|
729
729
|
const e = typeof this._url == "string" ? this._url : (n = this._url) == null ? void 0 : n.call(this, this);
|
|
730
730
|
if (!e)
|
|
@@ -751,14 +751,14 @@ class mr extends ue {
|
|
|
751
751
|
/**
|
|
752
752
|
* 断开ws事件
|
|
753
753
|
*/
|
|
754
|
-
|
|
754
|
+
s(this, "_removeWebSocketEvent", () => {
|
|
755
755
|
var e, i, n, c;
|
|
756
756
|
(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);
|
|
757
757
|
});
|
|
758
758
|
/**
|
|
759
759
|
* 分发ws事件
|
|
760
760
|
*/
|
|
761
|
-
|
|
761
|
+
s(this, "_dispatchWebSocketEvent", () => {
|
|
762
762
|
var e, i, n, c;
|
|
763
763
|
(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);
|
|
764
764
|
});
|
|
@@ -766,7 +766,7 @@ class mr extends ue {
|
|
|
766
766
|
* ws连接事件
|
|
767
767
|
* @returns
|
|
768
768
|
*/
|
|
769
|
-
|
|
769
|
+
s(this, "_webSocketOpenHandler", (e) => {
|
|
770
770
|
this._connectTimeout && (clearTimeout(this._connectTimeout), this._connectTimeout = void 0);
|
|
771
771
|
const i = ++this._reconnects, n = this._attempts;
|
|
772
772
|
return this._attempts = 0, this._reconnectWhenOnlineAgain = !1, this._startHealthCheck(), this.emit("open", Object.assign(e, { detail: { reconnects: i, attempts: n } }));
|
|
@@ -776,19 +776,19 @@ class mr extends ue {
|
|
|
776
776
|
* @param event
|
|
777
777
|
* @returns
|
|
778
778
|
*/
|
|
779
|
-
|
|
779
|
+
s(this, "_webSocketCloseHandler", (e) => (this._reconnect(e), this._stopHealthCheck(), this.emit("close", e)));
|
|
780
780
|
/**
|
|
781
781
|
* ws 异常
|
|
782
782
|
* @param event
|
|
783
783
|
* @returns
|
|
784
784
|
*/
|
|
785
|
-
|
|
785
|
+
s(this, "_webSocketErrorHandler", (e) => this.emit("error", new CustomEvent("error", { detail: { error: e } })));
|
|
786
786
|
/**
|
|
787
787
|
* ws消息
|
|
788
788
|
* @param event
|
|
789
789
|
* @returns
|
|
790
790
|
*/
|
|
791
|
-
|
|
791
|
+
s(this, "_webSocketMessageHandler", (e) => this.emit("message", e));
|
|
792
792
|
e && this.setOptions(e), this._startHealthCheck();
|
|
793
793
|
}
|
|
794
794
|
get attempts() {
|
|
@@ -832,31 +832,31 @@ class vr extends ue {
|
|
|
832
832
|
/**
|
|
833
833
|
* ws代理器
|
|
834
834
|
*/
|
|
835
|
-
|
|
835
|
+
s(this, "_ws", new mr({
|
|
836
836
|
url: "",
|
|
837
837
|
robustOptions: { should1000Reconnect: !0, ignoreConnectivityEvents: !0 }
|
|
838
838
|
}));
|
|
839
839
|
/**
|
|
840
840
|
* 带看连接状态
|
|
841
841
|
*/
|
|
842
|
-
|
|
842
|
+
s(this, "_state", x.NOTINITIALIZED);
|
|
843
843
|
/**
|
|
844
844
|
* 添加事件监听
|
|
845
845
|
*/
|
|
846
|
-
|
|
846
|
+
s(this, "_addWebSocketEventListeners", () => {
|
|
847
847
|
this._ws.on("close", this._handleCloseEvent), this._ws.on("closing", this._handleClosingEvent), this._ws.on("connecting", this._handleConnectingEvent), this._ws.on("error", this._handleErrorEvent), this._ws.on("message", this._handleMessageEvent), this._ws.on("open", this._handleOpenEvent), this._ws.on("timeout", this._handleTimeoutEvent);
|
|
848
848
|
});
|
|
849
849
|
/**
|
|
850
850
|
* 移除事件监听
|
|
851
851
|
*/
|
|
852
|
-
|
|
852
|
+
s(this, "_removeWebSocketEventListeners", () => {
|
|
853
853
|
this._ws.off("close", this._handleCloseEvent), this._ws.off("closing", this._handleClosingEvent), this._ws.off("connecting", this._handleConnectingEvent), this._ws.off("error", this._handleErrorEvent), this._ws.off("message", this._handleMessageEvent), this._ws.off("open", this._handleOpenEvent), this._ws.off("timeout", this._handleTimeoutEvent);
|
|
854
854
|
});
|
|
855
855
|
/**
|
|
856
856
|
* 处理房间关闭事件
|
|
857
857
|
* @param event
|
|
858
858
|
*/
|
|
859
|
-
|
|
859
|
+
s(this, "_handleCloseEvent", (e) => {
|
|
860
860
|
O.info(
|
|
861
861
|
`live room closed bacause of ${e.code}-${e.reason || nr(e.code)}`
|
|
862
862
|
), this.state = x.CLOSED;
|
|
@@ -864,7 +864,7 @@ class vr extends ue {
|
|
|
864
864
|
/**
|
|
865
865
|
* 处理房间正在关闭事件(这个时候可能是断网了)
|
|
866
866
|
*/
|
|
867
|
-
|
|
867
|
+
s(this, "_handleClosingEvent", () => {
|
|
868
868
|
var e;
|
|
869
869
|
O.info("live room is closing, onLine:", (e = globalThis == null ? void 0 : globalThis.navigator) == null ? void 0 : e.onLine), this.state = x.CLOSED;
|
|
870
870
|
});
|
|
@@ -872,21 +872,21 @@ class vr extends ue {
|
|
|
872
872
|
* 连接中
|
|
873
873
|
* @param event
|
|
874
874
|
*/
|
|
875
|
-
|
|
875
|
+
s(this, "_handleConnectingEvent", () => {
|
|
876
876
|
O.info("live room is connecting"), this.state = x.CONNECTING;
|
|
877
877
|
});
|
|
878
878
|
/**
|
|
879
879
|
* 连接发送异常
|
|
880
880
|
* @param event
|
|
881
881
|
*/
|
|
882
|
-
|
|
882
|
+
s(this, "_handleErrorEvent", (e) => {
|
|
883
883
|
O.error("live room error", e), this.state = x.CLOSED;
|
|
884
884
|
});
|
|
885
885
|
/**
|
|
886
886
|
* 接收到消息
|
|
887
887
|
* @param event
|
|
888
888
|
*/
|
|
889
|
-
|
|
889
|
+
s(this, "_handleMessageEvent", (e) => {
|
|
890
890
|
let i = (() => {
|
|
891
891
|
try {
|
|
892
892
|
return JSON.parse(e.data);
|
|
@@ -900,33 +900,33 @@ class vr extends ue {
|
|
|
900
900
|
* 连接建立成功
|
|
901
901
|
* @param event
|
|
902
902
|
*/
|
|
903
|
-
|
|
903
|
+
s(this, "_handleOpenEvent", (e) => {
|
|
904
904
|
O.info("live room open", e.detail), this.state = x.OPEN, e.detail.reconnects > 0 && this.emit("reconnected", e.detail);
|
|
905
905
|
});
|
|
906
906
|
/**
|
|
907
907
|
* 处理超时
|
|
908
908
|
* @param event
|
|
909
909
|
*/
|
|
910
|
-
|
|
910
|
+
s(this, "_handleTimeoutEvent", (e) => {
|
|
911
911
|
O.error("live room connect timeout!", e.detail), this.state = x.CLOSED;
|
|
912
912
|
});
|
|
913
913
|
/**
|
|
914
914
|
* 释放资源,释放之后需要重新实例化
|
|
915
915
|
* @returns
|
|
916
916
|
*/
|
|
917
|
-
|
|
917
|
+
s(this, "dispose", async () => (this._removeWebSocketEventListeners(), await this.close("live room close by controller disposed!")));
|
|
918
918
|
/**
|
|
919
919
|
* 开启房间链接
|
|
920
920
|
* @param url 房间链接
|
|
921
921
|
* @returns
|
|
922
922
|
*/
|
|
923
|
-
|
|
923
|
+
s(this, "open", (e) => this._ws.open(e));
|
|
924
924
|
/**
|
|
925
925
|
* 关闭房间
|
|
926
926
|
* @param code
|
|
927
927
|
* @param reason
|
|
928
928
|
*/
|
|
929
|
-
|
|
929
|
+
s(this, "close", (e, i) => new Promise((n) => {
|
|
930
930
|
this._ws.once("close", () => n(!0)), this._ws.close(e, i);
|
|
931
931
|
}));
|
|
932
932
|
this._addWebSocketEventListeners();
|
|
@@ -956,16 +956,16 @@ class vr extends ue {
|
|
|
956
956
|
this._ws && (this._ws._explicitlyClosed = !0);
|
|
957
957
|
}
|
|
958
958
|
}
|
|
959
|
-
const pr = (r) => Promise.reject("unimplemented method GetVoiceSign"), je = (r,
|
|
959
|
+
const pr = (r) => Promise.reject("unimplemented method GetVoiceSign"), je = (r, o = {}, e = []) => ({
|
|
960
960
|
command: r,
|
|
961
961
|
front_request_id: Ee(),
|
|
962
962
|
data: {
|
|
963
|
-
...
|
|
963
|
+
...o,
|
|
964
964
|
to_user_ids: Array.isArray(e) ? e : [e]
|
|
965
965
|
}
|
|
966
966
|
}), Er = () => {
|
|
967
|
-
var r,
|
|
968
|
-
window != null && window.__Realsee_Live__ && ((
|
|
967
|
+
var r, o;
|
|
968
|
+
window != null && window.__Realsee_Live__ && ((o = (r = window == null ? void 0 : window.__Realsee_Live__) == null ? void 0 : r.dispose) == null || o.call(r), window.__Realsee_Live__ = null);
|
|
969
969
|
};
|
|
970
970
|
class yr extends ue {
|
|
971
971
|
constructor(e) {
|
|
@@ -974,15 +974,15 @@ class yr extends ue {
|
|
|
974
974
|
/**
|
|
975
975
|
* 带看的配置
|
|
976
976
|
*/
|
|
977
|
-
|
|
977
|
+
s(this, "_options", {});
|
|
978
978
|
/**
|
|
979
979
|
* 帧数据监听
|
|
980
980
|
*/
|
|
981
|
-
|
|
981
|
+
s(this, "keyframes", new ue());
|
|
982
982
|
/**
|
|
983
983
|
* 内置的一些数据
|
|
984
984
|
*/
|
|
985
|
-
|
|
985
|
+
s(this, "_buildInData", {
|
|
986
986
|
keyframes: {}
|
|
987
987
|
});
|
|
988
988
|
/**
|
|
@@ -990,14 +990,14 @@ class yr extends ue {
|
|
|
990
990
|
* @param key 帧数据的键值
|
|
991
991
|
* @returns
|
|
992
992
|
*/
|
|
993
|
-
|
|
993
|
+
s(this, "getFramesByKey", (e) => this.snapshot[e]);
|
|
994
994
|
/**
|
|
995
995
|
* 发送帧数据(需要能够被序列化)
|
|
996
996
|
* @param key 帧数据键值
|
|
997
997
|
* @param frame 帧数据本体
|
|
998
998
|
* @returns
|
|
999
999
|
*/
|
|
1000
|
-
|
|
1000
|
+
s(this, "sendKeyframe", (e, i) => {
|
|
1001
1001
|
if (this.state !== x.OPEN)
|
|
1002
1002
|
return !1;
|
|
1003
1003
|
this._buildInData.keyframes = {
|
|
@@ -1014,17 +1014,17 @@ class yr extends ue {
|
|
|
1014
1014
|
/**
|
|
1015
1015
|
* 带看控制器
|
|
1016
1016
|
*/
|
|
1017
|
-
|
|
1017
|
+
s(this, "_controller", new vr());
|
|
1018
1018
|
/**
|
|
1019
1019
|
* 添加带看控制的事件监听
|
|
1020
1020
|
*/
|
|
1021
|
-
|
|
1021
|
+
s(this, "_addLiveControllerEventListeners", () => {
|
|
1022
1022
|
this._controller.on("stateChange", this._handleStateChange), this._controller.on("message", this._handleMessage);
|
|
1023
1023
|
});
|
|
1024
1024
|
/**
|
|
1025
1025
|
* 移除带看控制的事件监听
|
|
1026
1026
|
*/
|
|
1027
|
-
|
|
1027
|
+
s(this, "_removeLiveControllerEventListeners", () => {
|
|
1028
1028
|
this._controller.off("stateChange", this._handleStateChange), this._controller.off("message", this._handleMessage);
|
|
1029
1029
|
});
|
|
1030
1030
|
/**
|
|
@@ -1032,12 +1032,12 @@ class yr extends ue {
|
|
|
1032
1032
|
* @param state
|
|
1033
1033
|
* @returns
|
|
1034
1034
|
*/
|
|
1035
|
-
|
|
1035
|
+
s(this, "_handleStateChange", (e, i) => this.emit("stateChange", e, i));
|
|
1036
1036
|
/**
|
|
1037
1037
|
* 消息接收
|
|
1038
1038
|
* @param liveMsg
|
|
1039
1039
|
*/
|
|
1040
|
-
|
|
1040
|
+
s(this, "_handleMessage", async (e) => {
|
|
1041
1041
|
var i, n, c, u, d;
|
|
1042
1042
|
if (typeof e == "object") {
|
|
1043
1043
|
const { command: g, data: v = {}, frontRequestId: E, code: y, message: I } = e;
|
|
@@ -1099,7 +1099,7 @@ class yr extends ue {
|
|
|
1099
1099
|
}
|
|
1100
1100
|
case K.BuiltinMsg: {
|
|
1101
1101
|
const _ = v;
|
|
1102
|
-
this.emit("builtinEvent", _), _.event_type === q.UserChange && this.emit("userChange", _), _.event_type === q.RoomChange && this.emit("roomChange", _), _.event_type === q.UserChange && _.action === H.UserMicroStatus && await this.toggleMicro(_.data.status === Z.OPEN), _.event_type === q.RoomChange && _.action === H.RoomClose && await this.
|
|
1102
|
+
this.emit("builtinEvent", _), _.event_type === q.UserChange && this.emit("userChange", _), _.event_type === q.RoomChange && this.emit("roomChange", _), _.event_type === q.UserChange && _.action === H.UserMicroStatus && await this.toggleMicro(_.data.status === Z.OPEN), _.event_type === q.RoomChange && _.action === H.RoomClose && await this._exit();
|
|
1103
1103
|
break;
|
|
1104
1104
|
}
|
|
1105
1105
|
case K.UserKickOut: {
|
|
@@ -1116,7 +1116,7 @@ class yr extends ue {
|
|
|
1116
1116
|
/**
|
|
1117
1117
|
* 清理带看缓存的数据
|
|
1118
1118
|
*/
|
|
1119
|
-
|
|
1119
|
+
s(this, "_clearLiveData", () => {
|
|
1120
1120
|
this._buildInData = { keyframes: {} };
|
|
1121
1121
|
});
|
|
1122
1122
|
/**
|
|
@@ -1124,7 +1124,7 @@ class yr extends ue {
|
|
|
1124
1124
|
* @param options
|
|
1125
1125
|
* @returns
|
|
1126
1126
|
*/
|
|
1127
|
-
|
|
1127
|
+
s(this, "connect", async (e = {}) => {
|
|
1128
1128
|
var u, d, g, v;
|
|
1129
1129
|
if (this._options.url = (d = (u = e.url) != null ? u : this._options.url) != null ? d : "", this._options.getTicket = (g = e.getTicket) != null ? g : this._options.getTicket, this._options.initialMicroStatus = (v = e.rtcMicStatus) != null ? v : this._options.initialMicroStatus, !/^ws(s):\/\//.test(this._options.url) || typeof this._options.getTicket != "function")
|
|
1130
1130
|
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");
|
|
@@ -1152,7 +1152,7 @@ class yr extends ue {
|
|
|
1152
1152
|
* 退出带看
|
|
1153
1153
|
* @returns
|
|
1154
1154
|
*/
|
|
1155
|
-
|
|
1155
|
+
s(this, "_exit", async () => {
|
|
1156
1156
|
var e;
|
|
1157
1157
|
this._clearLiveData();
|
|
1158
1158
|
try {
|
|
@@ -1162,28 +1162,40 @@ class yr extends ue {
|
|
|
1162
1162
|
}
|
|
1163
1163
|
return this.state !== x.OPEN ? !0 : await this._controller.close();
|
|
1164
1164
|
});
|
|
1165
|
+
/**
|
|
1166
|
+
* 退出带看
|
|
1167
|
+
* @returns
|
|
1168
|
+
*/
|
|
1169
|
+
s(this, "exit", async () => this.close());
|
|
1165
1170
|
/**
|
|
1166
1171
|
* 关闭带看房间
|
|
1167
1172
|
* @param code
|
|
1168
1173
|
* @param reason
|
|
1169
1174
|
* @returns
|
|
1170
1175
|
*/
|
|
1171
|
-
|
|
1172
|
-
|
|
1176
|
+
s(this, "close", async () => {
|
|
1177
|
+
var e;
|
|
1178
|
+
await this._controller.readyClose();
|
|
1179
|
+
try {
|
|
1180
|
+
await ((e = this.$RTC) == null ? void 0 : e.quit());
|
|
1181
|
+
} catch (i) {
|
|
1182
|
+
O.warn(i);
|
|
1183
|
+
}
|
|
1184
|
+
await this.updateStatus(q.RoomChange, H.RoomClose, {});
|
|
1173
1185
|
});
|
|
1174
1186
|
/**
|
|
1175
1187
|
* 销毁带看
|
|
1176
1188
|
* @returns
|
|
1177
1189
|
*/
|
|
1178
|
-
|
|
1190
|
+
s(this, "dispose", async () => (this._removeLiveControllerEventListeners(), this._clearLiveData(), await this._controller.dispose()));
|
|
1179
1191
|
/**
|
|
1180
1192
|
* 设置自己的用户信息
|
|
1181
1193
|
* @param userInfo
|
|
1182
1194
|
* @returns
|
|
1183
1195
|
*/
|
|
1184
|
-
|
|
1196
|
+
s(this, "setSelfInfo", async (e) => await this.updateStatus(q.UserChange, H.UserInfo, e));
|
|
1185
1197
|
// 仅用于用户自己的麦克风控制
|
|
1186
|
-
|
|
1198
|
+
s(this, "toggleMicro", async (e) => {
|
|
1187
1199
|
var n, c, u;
|
|
1188
1200
|
if (!((c = (n = this.selfInfo) == null ? void 0 : n.permission) != null && c.control_own_micro))
|
|
1189
1201
|
return !1;
|
|
@@ -1203,7 +1215,7 @@ class yr extends ue {
|
|
|
1203
1215
|
* @param toUserIds
|
|
1204
1216
|
* @returns
|
|
1205
1217
|
*/
|
|
1206
|
-
|
|
1218
|
+
s(this, "forbidMicro", async (e, i) => {
|
|
1207
1219
|
var n, c;
|
|
1208
1220
|
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(
|
|
1209
1221
|
q.UserChange,
|
|
@@ -1220,7 +1232,7 @@ class yr extends ue {
|
|
|
1220
1232
|
* @param toUserIds
|
|
1221
1233
|
* @returns
|
|
1222
1234
|
*/
|
|
1223
|
-
|
|
1235
|
+
s(this, "forbidSync", async (e, i) => {
|
|
1224
1236
|
var n, c;
|
|
1225
1237
|
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(
|
|
1226
1238
|
q.UserChange,
|
|
@@ -1234,7 +1246,7 @@ class yr extends ue {
|
|
|
1234
1246
|
* @param toUserIds
|
|
1235
1247
|
* @returns
|
|
1236
1248
|
*/
|
|
1237
|
-
|
|
1249
|
+
s(this, "kick", async (e) => {
|
|
1238
1250
|
var i, n;
|
|
1239
1251
|
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(
|
|
1240
1252
|
q.UserChange,
|
|
@@ -1418,7 +1430,7 @@ function Cr() {
|
|
|
1418
1430
|
if (at)
|
|
1419
1431
|
return oe;
|
|
1420
1432
|
at = 1;
|
|
1421
|
-
var r = D,
|
|
1433
|
+
var r = D, o = 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 };
|
|
1422
1434
|
function u(d, g, v) {
|
|
1423
1435
|
var E, y = {}, I = null, _ = null;
|
|
1424
1436
|
v !== void 0 && (I = "" + v), g.key !== void 0 && (I = "" + g.key), g.ref !== void 0 && (_ = g.ref);
|
|
@@ -1427,7 +1439,7 @@ function Cr() {
|
|
|
1427
1439
|
if (d && d.defaultProps)
|
|
1428
1440
|
for (E in g = d.defaultProps, g)
|
|
1429
1441
|
y[E] === void 0 && (y[E] = g[E]);
|
|
1430
|
-
return { $$typeof:
|
|
1442
|
+
return { $$typeof: o, type: d, key: I, ref: _, props: y, _owner: n.current };
|
|
1431
1443
|
}
|
|
1432
1444
|
return oe.Fragment = e, oe.jsx = u, oe.jsxs = u, oe;
|
|
1433
1445
|
}
|
|
@@ -1444,7 +1456,7 @@ var ae = {};
|
|
|
1444
1456
|
var ct;
|
|
1445
1457
|
function wr() {
|
|
1446
1458
|
return ct || (ct = 1, process.env.NODE_ENV !== "production" && function() {
|
|
1447
|
-
var r = D,
|
|
1459
|
+
var r = D, o = 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"), g = Symbol.for("react.forward_ref"), v = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), y = Symbol.for("react.memo"), I = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), V = Symbol.iterator, C = "@@iterator";
|
|
1448
1460
|
function k(t) {
|
|
1449
1461
|
if (t === null || typeof t != "object")
|
|
1450
1462
|
return null;
|
|
@@ -1826,7 +1838,7 @@ function wr() {
|
|
|
1826
1838
|
var It = function(t, a, l, h, b, R, p) {
|
|
1827
1839
|
var m = {
|
|
1828
1840
|
// This tag allows us to uniquely identify this as a React Element
|
|
1829
|
-
$$typeof:
|
|
1841
|
+
$$typeof: o,
|
|
1830
1842
|
// Built-in properties that belong on the element
|
|
1831
1843
|
type: t,
|
|
1832
1844
|
key: a,
|
|
@@ -1881,7 +1893,7 @@ function wr() {
|
|
|
1881
1893
|
var ke;
|
|
1882
1894
|
ke = !1;
|
|
1883
1895
|
function Pe(t) {
|
|
1884
|
-
return typeof t == "object" && t !== null && t.$$typeof ===
|
|
1896
|
+
return typeof t == "object" && t !== null && t.$$typeof === o;
|
|
1885
1897
|
}
|
|
1886
1898
|
function Je() {
|
|
1887
1899
|
{
|
|
@@ -1997,7 +2009,7 @@ Check the top-level render call using <` + l + ">.");
|
|
|
1997
2009
|
var $ = kt(b);
|
|
1998
2010
|
$ ? m += $ : m += Je();
|
|
1999
2011
|
var j;
|
|
2000
|
-
t === null ? j = "null" : Oe(t) ? j = "array" : t !== void 0 && t.$$typeof ===
|
|
2012
|
+
t === null ? j = "null" : Oe(t) ? j = "array" : t !== void 0 && t.$$typeof === o ? (j = "<" + (G(t.type) || "Unknown") + " />", m = " 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, m);
|
|
2001
2013
|
}
|
|
2002
2014
|
var L = Tt(t, a, l, b, R);
|
|
2003
2015
|
if (L == null)
|
|
@@ -2033,8 +2045,8 @@ Check the top-level render call using <` + l + ">.");
|
|
|
2033
2045
|
})(Sr);
|
|
2034
2046
|
const Rr = Ae.jsx;
|
|
2035
2047
|
function jr(r) {
|
|
2036
|
-
const
|
|
2037
|
-
const f = D.useContext(
|
|
2048
|
+
const o = Gt(null), e = br(r), i = e.jsBridge, n = (f) => /* @__PURE__ */ Rr(o.Provider, { value: e, children: f.children }), c = () => {
|
|
2049
|
+
const f = D.useContext(o);
|
|
2038
2050
|
if (!f)
|
|
2039
2051
|
throw new Error("LiveProvider never found.");
|
|
2040
2052
|
return f;
|