@realsee/live 0.7.4 → 0.7.6
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/README.md +245 -91
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +44 -44
- package/docs/assets/highlight.css +6 -6
- package/docs/classes/BrowserRTC.html +2 -2
- package/docs/classes/BrowserRTC4Chime.html +2 -2
- package/docs/classes/CoreRTC.html +1 -1
- package/docs/classes/Live.html +14 -14
- package/docs/classes/Subscribe.html +1 -1
- package/docs/classes/VRWebViewRTC.html +1 -1
- package/docs/functions/GetVoiceSignFn.html +1 -1
- package/docs/functions/createLive.html +1 -1
- package/docs/functions/createLiveReact.html +10 -10
- package/docs/index.html +116 -110
- package/docs/interfaces/LiveOptions.html +1 -1
- package/docs/interfaces/VRWebViewRTCOptions.html +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -4,12 +4,12 @@ var a = (i, t, e) => cn(i, typeof t != "symbol" ? t + "" : t, e);
|
|
|
4
4
|
import le from "trtc-js-sdk";
|
|
5
5
|
import { ConsoleLogger as ln, LogLevel as an, DefaultDeviceController as hn, MeetingSessionConfiguration as un, DefaultMeetingSession as dn, DefaultModality as Fe, MeetingSessionStatusCode as fn } from "amazon-chime-sdk-js";
|
|
6
6
|
import gn from "@realsee/jsbridge-x";
|
|
7
|
-
import D, { createContext as pn, useCallback as
|
|
7
|
+
import D, { createContext as pn, useCallback as P } from "react";
|
|
8
8
|
const dt = Symbol("$$REALSEE_LIVE_EVENT$$");
|
|
9
9
|
function $t(i) {
|
|
10
10
|
return i[dt] || (i[dt] = {}), i[dt];
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function Pe(i) {
|
|
13
13
|
const t = i[dt];
|
|
14
14
|
if (!t) return;
|
|
15
15
|
Object.keys(t).some((n) => Array.isArray(t[n]) && t[n].length > 0) || delete i[dt];
|
|
@@ -63,11 +63,11 @@ class At {
|
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
if (n[t] || (n[t] = []), e === void 0) {
|
|
66
|
-
n[t].length = 0,
|
|
66
|
+
n[t].length = 0, Pe(this);
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
const s = n[t].findIndex((r) => r[0] === e);
|
|
70
|
-
s !== -1 && n[t].splice(s, 1),
|
|
70
|
+
s !== -1 && n[t].splice(s, 1), Pe(this);
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* 触发事件
|
|
@@ -262,7 +262,7 @@ class mn extends Re {
|
|
|
262
262
|
), (r = this._trtc.client) == null || r.on("error", (o) => this.emit("error", o));
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
|
-
class
|
|
265
|
+
class We extends Re {
|
|
266
266
|
/**
|
|
267
267
|
* 创建 BrowserRTC4Chime 实例
|
|
268
268
|
*
|
|
@@ -709,7 +709,7 @@ class wn extends Re {
|
|
|
709
709
|
return this.options.jsBridge;
|
|
710
710
|
}
|
|
711
711
|
}
|
|
712
|
-
var B = /* @__PURE__ */ ((i) => (i.SelfUserInfo = "SELF_USER_INFO", i.RoomInfo = "ROOM_INFO", i.RTCInfo = "RTC_INFO", i.UserList = "USER_LIST", i.BuiltinMsg = "BUILTIN_MSG", i.CustomEvent = "CUSTOM_EVENT", i.KeyframeSync = "KEYFRAME_SYNC", i.UserKickOut = "USER_KICK_OUT", i))(B || {}),
|
|
712
|
+
var B = /* @__PURE__ */ ((i) => (i.SelfUserInfo = "SELF_USER_INFO", i.RoomInfo = "ROOM_INFO", i.RTCInfo = "RTC_INFO", i.UserList = "USER_LIST", i.BuiltinMsg = "BUILTIN_MSG", i.CustomEvent = "CUSTOM_EVENT", i.KeyframeSync = "KEYFRAME_SYNC", i.UserKickOut = "USER_KICK_OUT", i))(B || {}), W = /* @__PURE__ */ ((i) => (i.UserChange = "user_change", i.RoomChange = "room_change", i))(W || {}), z = /* @__PURE__ */ ((i) => (i.UserMicroStatus = "change_micro_status", i.UserMicroStatusSync = "sync_micro_status", i.UserPermission = "change_permission", i.UserStatus = "change_status", i.UserInfo = "change_info", i.RoomClose = "close", i))(z || {}), ot = /* @__PURE__ */ ((i) => (i.OPEN = "OPEN", i.CLOSE = "CLOSE", i))(ot || {});
|
|
713
713
|
function Mr(i) {
|
|
714
714
|
try {
|
|
715
715
|
const t = JSON.parse(i), e = {
|
|
@@ -1318,7 +1318,7 @@ class $n {
|
|
|
1318
1318
|
this._observers = G();
|
|
1319
1319
|
}
|
|
1320
1320
|
}
|
|
1321
|
-
const lt = Math.floor,
|
|
1321
|
+
const lt = Math.floor, Pt = Math.abs, pi = (i, t) => i < t ? i : t, St = (i, t) => i > t ? i : t, xn = (i) => i !== 0 ? i < 0 : 1 / i < 0, Je = 1, He = 2, he = 4, ue = 8, Bn = 32, _i = 64, Ht = 128, Fn = 31, qe = 63, Ot = 127, Pn = 2147483647, Wn = Number.isInteger || ((i) => typeof i == "number" && isFinite(i) && lt(i) === i), Kn = (i) => i.toLowerCase(), Gn = /^\s*/g, Jn = (i) => i.replace(Gn, ""), Hn = /([A-Z])/g, ze = (i, t) => Jn(i.replace(Hn, (e) => `${t}${Kn(e)}`)), qn = (i) => {
|
|
1322
1322
|
const t = unescape(encodeURIComponent(i)), e = t.length, n = new Uint8Array(e);
|
|
1323
1323
|
for (let s = 0; s < e; s++)
|
|
1324
1324
|
n[s] = /** @type {number} */
|
|
@@ -1398,7 +1398,7 @@ Tt.encodeInto ? ts : es, De = (i, t) => {
|
|
|
1398
1398
|
A(i, 119), ft(i, t);
|
|
1399
1399
|
break;
|
|
1400
1400
|
case "number":
|
|
1401
|
-
|
|
1401
|
+
Wn(t) && Pt(t) <= Pn ? (A(i, 125), Te(i, t)) : rs(t) ? (A(i, 124), is(i, t)) : (A(i, 123), ns(i, t));
|
|
1402
1402
|
break;
|
|
1403
1403
|
case "bigint":
|
|
1404
1404
|
A(i, 122), ss(i, t);
|
|
@@ -1446,7 +1446,7 @@ class Xe extends jt {
|
|
|
1446
1446
|
const Ze = (i) => {
|
|
1447
1447
|
i.count > 0 && (Te(i.encoder, i.count === 1 ? i.s : -i.s), i.count > 1 && S(i.encoder, i.count - 2));
|
|
1448
1448
|
};
|
|
1449
|
-
class
|
|
1449
|
+
class Wt {
|
|
1450
1450
|
constructor() {
|
|
1451
1451
|
this.encoder = new jt(), this.s = 0, this.count = 0;
|
|
1452
1452
|
}
|
|
@@ -1492,7 +1492,7 @@ class fe {
|
|
|
1492
1492
|
}
|
|
1493
1493
|
class os {
|
|
1494
1494
|
constructor() {
|
|
1495
|
-
this.sarr = [], this.s = "", this.lensE = new
|
|
1495
|
+
this.sarr = [], this.s = "", this.lensE = new Wt();
|
|
1496
1496
|
}
|
|
1497
1497
|
/**
|
|
1498
1498
|
* @param {string} string
|
|
@@ -1960,7 +1960,7 @@ class Ct extends $n {
|
|
|
1960
1960
|
this.emit("destroyed", [!0]), this.emit("destroy", [this]), super.destroy();
|
|
1961
1961
|
}
|
|
1962
1962
|
}
|
|
1963
|
-
class
|
|
1963
|
+
class Ps {
|
|
1964
1964
|
constructor() {
|
|
1965
1965
|
this.restEncoder = Le();
|
|
1966
1966
|
}
|
|
@@ -1982,7 +1982,7 @@ class Ws {
|
|
|
1982
1982
|
S(this.restEncoder, t);
|
|
1983
1983
|
}
|
|
1984
1984
|
}
|
|
1985
|
-
class
|
|
1985
|
+
class Ws extends Ps {
|
|
1986
1986
|
/**
|
|
1987
1987
|
* @param {ID} id
|
|
1988
1988
|
*/
|
|
@@ -2085,7 +2085,7 @@ class Ks {
|
|
|
2085
2085
|
}
|
|
2086
2086
|
class Gs extends Ks {
|
|
2087
2087
|
constructor() {
|
|
2088
|
-
super(), this.keyMap = /* @__PURE__ */ new Map(), this.keyClock = 0, this.keyClockEncoder = new fe(), this.clientEncoder = new
|
|
2088
|
+
super(), this.keyMap = /* @__PURE__ */ new Map(), this.keyClock = 0, this.keyClockEncoder = new fe(), this.clientEncoder = new Wt(), this.leftClockEncoder = new fe(), this.rightClockEncoder = new fe(), this.infoEncoder = new Xe(Ce), this.stringEncoder = new os(), this.parentInfoEncoder = new Xe(Ce), this.typeRefEncoder = new Wt(), this.lenEncoder = new Wt();
|
|
2089
2089
|
}
|
|
2090
2090
|
toUint8Array() {
|
|
2091
2091
|
const t = Le();
|
|
@@ -2401,7 +2401,7 @@ const ci = (i, t) => t.deleteSet.clients.size === 0 && !Un(t.afterState, (e, n)
|
|
|
2401
2401
|
y + 1 < w.length && Gt(w, y + 1) > 1 || y > 0 && Gt(w, y);
|
|
2402
2402
|
}
|
|
2403
2403
|
if (!e.local && e.afterState.get(n.clientID) !== e.beforeState.get(n.clientID) && (Vs(Ve, Si, "[yjs] ", Ci, Ei, "Changed the client-id because another client seems to be using it."), n.clientID = Ti()), n.emit("afterTransactionCleanup", [e, n]), n._observers.has("update")) {
|
|
2404
|
-
const u = new
|
|
2404
|
+
const u = new Ws();
|
|
2405
2405
|
ci(u, e) && n.emit("update", [u.toUint8Array(), e.origin, n, e]);
|
|
2406
2406
|
}
|
|
2407
2407
|
if (n._observers.has("updateV2")) {
|
|
@@ -2608,7 +2608,7 @@ const rr = (i) => {
|
|
|
2608
2608
|
}, ie = (i, t) => {
|
|
2609
2609
|
if (i._start === null || t === 0 || i._searchMarker === null)
|
|
2610
2610
|
return null;
|
|
2611
|
-
const e = i._searchMarker.length === 0 ? null : i._searchMarker.reduce((r, o) =>
|
|
2611
|
+
const e = i._searchMarker.length === 0 ? null : i._searchMarker.reduce((r, o) => Pt(t - r.index) < Pt(t - o.index) ? r : o);
|
|
2612
2612
|
let n = i._start, s = 0;
|
|
2613
2613
|
for (e !== null && (n = e.p, s = e.index, rr(e)); n.right !== null && s < t; ) {
|
|
2614
2614
|
if (!n.deleted && n.countable) {
|
|
@@ -2622,7 +2622,7 @@ const rr = (i) => {
|
|
|
2622
2622
|
n = n.left, !n.deleted && n.countable && (s -= n.length);
|
|
2623
2623
|
for (; n.left !== null && n.left.id.client === n.id.client && n.left.id.clock + n.left.length === n.id.clock; )
|
|
2624
2624
|
n = n.left, !n.deleted && n.countable && (s -= n.length);
|
|
2625
|
-
return e !== null &&
|
|
2625
|
+
return e !== null && Pt(e.index - s) < /** @type {YText|YArray<any>} */
|
|
2626
2626
|
n.parent.length / Ui ? (ji(e, n, s), e) : or(i._searchMarker, n, s);
|
|
2627
2627
|
}, Nt = (i, t, e) => {
|
|
2628
2628
|
for (let n = i.length - 1; n >= 0; n--) {
|
|
@@ -2878,9 +2878,9 @@ const $i = (i, t, e) => {
|
|
|
2878
2878
|
}
|
|
2879
2879
|
}
|
|
2880
2880
|
}), u();
|
|
2881
|
-
},
|
|
2881
|
+
}, Pi = () => mt("Length exceeded!"), Wi = (i, t, e, n) => {
|
|
2882
2882
|
if (e > t._length)
|
|
2883
|
-
throw
|
|
2883
|
+
throw Pi();
|
|
2884
2884
|
if (e === 0)
|
|
2885
2885
|
return t._searchMarker && Nt(t._searchMarker, e, n.length), zt(i, t, null, n);
|
|
2886
2886
|
const s = e, r = ie(t, e);
|
|
@@ -2910,7 +2910,7 @@ const $i = (i, t, e) => {
|
|
|
2910
2910
|
for (; n > 0 && c !== null; )
|
|
2911
2911
|
c.deleted || (n < c.length && nt(i, k(c.id.client, c.id.clock + n)), c.delete(i), n -= c.length), c = c.right;
|
|
2912
2912
|
if (n > 0)
|
|
2913
|
-
throw
|
|
2913
|
+
throw Pi();
|
|
2914
2914
|
t._searchMarker && Nt(
|
|
2915
2915
|
t._searchMarker,
|
|
2916
2916
|
s,
|
|
@@ -3071,7 +3071,7 @@ class Rt extends M {
|
|
|
3071
3071
|
*/
|
|
3072
3072
|
insert(t, e) {
|
|
3073
3073
|
this.doc !== null ? E(this.doc, (n) => {
|
|
3074
|
-
|
|
3074
|
+
Wi(
|
|
3075
3075
|
n,
|
|
3076
3076
|
this,
|
|
3077
3077
|
t,
|
|
@@ -4326,7 +4326,7 @@ class wt extends M {
|
|
|
4326
4326
|
*/
|
|
4327
4327
|
insert(t, e) {
|
|
4328
4328
|
this.doc !== null ? E(this.doc, (n) => {
|
|
4329
|
-
|
|
4329
|
+
Wi(n, this, t, e);
|
|
4330
4330
|
}) : this._prelimContent.splice(t, 0, ...e);
|
|
4331
4331
|
}
|
|
4332
4332
|
/**
|
|
@@ -5830,7 +5830,7 @@ class Ir extends At {
|
|
|
5830
5830
|
case ct.RealseeVRWebViewRTC:
|
|
5831
5831
|
return this._createVRWebViewRTC();
|
|
5832
5832
|
case ct.RealseeBrowserChimeRTC:
|
|
5833
|
-
return new
|
|
5833
|
+
return new We({
|
|
5834
5834
|
getVoiceSign: (n = this._options.getVoiceSign) != null ? n : It,
|
|
5835
5835
|
logLevel: e.__debug__ ? 0 : 1
|
|
5836
5836
|
});
|
|
@@ -5878,7 +5878,7 @@ class Ir extends At {
|
|
|
5878
5878
|
a(this, "_createDefaultRTC", (e) => {
|
|
5879
5879
|
var s;
|
|
5880
5880
|
const n = (s = this._options.getVoiceSign) != null ? s : It;
|
|
5881
|
-
return !this._options.jsBridge || !Ge && !Ke ? e.builtInRTCType === fi.RealseeXChimeRTC ? new
|
|
5881
|
+
return !this._options.jsBridge || !Ge && !Ke ? e.builtInRTCType === fi.RealseeXChimeRTC ? new We({ getVoiceSign: n }) : this._createBrowserRTC() : Ge && (vn || In) || Ke ? this._createVRWebViewRTC() : this._createBrowserRTC();
|
|
5882
5882
|
});
|
|
5883
5883
|
/**
|
|
5884
5884
|
* 自动连接(内部方法)
|
|
@@ -5993,7 +5993,7 @@ class Ir extends At {
|
|
|
5993
5993
|
}
|
|
5994
5994
|
case B.BuiltinMsg: {
|
|
5995
5995
|
const p = u;
|
|
5996
|
-
this.emit("builtinEvent", p), p.event_type ===
|
|
5996
|
+
this.emit("builtinEvent", p), p.event_type === W.UserChange && this.emit("userChange", p), p.event_type === W.RoomChange && this.emit("roomChange", p), p.event_type === W.UserChange && p.action === z.UserMicroStatus && await this.toggleMicro(p.data.status === ot.OPEN), p.event_type === W.RoomChange && p.action === z.RoomClose && await this._exit();
|
|
5997
5997
|
break;
|
|
5998
5998
|
}
|
|
5999
5999
|
case B.UserKickOut: {
|
|
@@ -6135,7 +6135,7 @@ class Ir extends At {
|
|
|
6135
6135
|
} catch (n) {
|
|
6136
6136
|
m.warn(n);
|
|
6137
6137
|
}
|
|
6138
|
-
await this.updateStatus(
|
|
6138
|
+
await this.updateStatus(W.RoomChange, z.RoomClose, {});
|
|
6139
6139
|
});
|
|
6140
6140
|
/**
|
|
6141
6141
|
* 销毁带看实例
|
|
@@ -6184,7 +6184,7 @@ class Ir extends At {
|
|
|
6184
6184
|
* })
|
|
6185
6185
|
* ```
|
|
6186
6186
|
*/
|
|
6187
|
-
a(this, "setSelfInfo", async (e) => await this.updateStatus(
|
|
6187
|
+
a(this, "setSelfInfo", async (e) => await this.updateStatus(W.UserChange, z.UserInfo, e));
|
|
6188
6188
|
/**
|
|
6189
6189
|
* 自定义广播消息
|
|
6190
6190
|
*
|
|
@@ -6269,7 +6269,7 @@ class Ir extends At {
|
|
|
6269
6269
|
if (!((r = (s = this.selfInfo) == null ? void 0 : s.permission) != null && r.control_own_micro)) return !1;
|
|
6270
6270
|
const n = await ((o = this.$RTC) == null ? void 0 : o.toggleMicro(e));
|
|
6271
6271
|
return n && await this.updateStatus(
|
|
6272
|
-
|
|
6272
|
+
W.UserChange,
|
|
6273
6273
|
z.UserMicroStatus,
|
|
6274
6274
|
{
|
|
6275
6275
|
status: e ? ot.OPEN : ot.CLOSE
|
|
@@ -6302,7 +6302,7 @@ class Ir extends At {
|
|
|
6302
6302
|
a(this, "forbidMicro", async (e, n) => {
|
|
6303
6303
|
var s, r;
|
|
6304
6304
|
return typeof this._options.canForbidUserMicro == "function" && !this._options.canForbidUserMicro(n) || !((r = (s = this.selfInfo) == null ? void 0 : s.permission) != null && r.control_other_micro) ? !1 : await this.updateStatus(
|
|
6305
|
-
|
|
6305
|
+
W.UserChange,
|
|
6306
6306
|
z.UserMicroStatus,
|
|
6307
6307
|
{
|
|
6308
6308
|
status: e
|
|
@@ -6330,7 +6330,7 @@ class Ir extends At {
|
|
|
6330
6330
|
a(this, "forbidSync", async (e, n) => {
|
|
6331
6331
|
var s, r;
|
|
6332
6332
|
return typeof this._options.canForbidUserSync == "function" && !this._options.canForbidUserSync(n) || !((r = (s = this.selfInfo) == null ? void 0 : s.permission) != null && r.control_other_sync) ? !1 : await this.updateStatus(
|
|
6333
|
-
|
|
6333
|
+
W.UserChange,
|
|
6334
6334
|
z.UserPermission,
|
|
6335
6335
|
{ sync_frame: e },
|
|
6336
6336
|
n
|
|
@@ -6360,7 +6360,7 @@ class Ir extends At {
|
|
|
6360
6360
|
a(this, "kick", async (e) => {
|
|
6361
6361
|
var n, s;
|
|
6362
6362
|
return typeof this._options.canForbidUserKick == "function" && !this._options.canForbidUserKick(e) || !((s = (n = this.selfInfo) == null ? void 0 : n.permission) != null && s.change_other_status) ? !1 : await this.updateStatus(
|
|
6363
|
-
|
|
6363
|
+
W.UserChange,
|
|
6364
6364
|
z.UserStatus,
|
|
6365
6365
|
{
|
|
6366
6366
|
status: "KICK_OUT"
|
|
@@ -6552,52 +6552,52 @@ function Nr(i) {
|
|
|
6552
6552
|
return D.useEffect(() => (b.keyframes.on(f, C), T), I), T;
|
|
6553
6553
|
}
|
|
6554
6554
|
function d() {
|
|
6555
|
-
const f = r(), C =
|
|
6555
|
+
const f = r(), C = P(
|
|
6556
6556
|
async (O) => {
|
|
6557
6557
|
await f.connect(O);
|
|
6558
6558
|
},
|
|
6559
6559
|
[f]
|
|
6560
|
-
), R =
|
|
6560
|
+
), R = P(
|
|
6561
6561
|
(O) => {
|
|
6562
6562
|
f.toggleMicro(O);
|
|
6563
6563
|
},
|
|
6564
6564
|
[f]
|
|
6565
|
-
), b =
|
|
6565
|
+
), b = P(
|
|
6566
6566
|
async (O, H, ce = 0) => {
|
|
6567
6567
|
await f.broadcast(O, H, ce);
|
|
6568
6568
|
},
|
|
6569
6569
|
[f]
|
|
6570
|
-
), I =
|
|
6570
|
+
), I = P(async () => {
|
|
6571
6571
|
await f.exit();
|
|
6572
|
-
}, [f]), T =
|
|
6572
|
+
}, [f]), T = P(
|
|
6573
6573
|
async (O) => {
|
|
6574
6574
|
await f.kick(O);
|
|
6575
6575
|
},
|
|
6576
6576
|
[f]
|
|
6577
|
-
), F =
|
|
6577
|
+
), F = P(
|
|
6578
6578
|
async (O, H = []) => {
|
|
6579
6579
|
await f.forbidMicro(O, H);
|
|
6580
6580
|
},
|
|
6581
6581
|
[f]
|
|
6582
|
-
), rt =
|
|
6582
|
+
), rt = P(
|
|
6583
6583
|
(O, H = []) => {
|
|
6584
6584
|
f.forbidSync(O, H);
|
|
6585
6585
|
},
|
|
6586
6586
|
[f]
|
|
6587
|
-
), oe =
|
|
6587
|
+
), oe = P(
|
|
6588
6588
|
(O) => f.getFramesByKey(O),
|
|
6589
6589
|
[f]
|
|
6590
|
-
), en =
|
|
6590
|
+
), en = P(
|
|
6591
6591
|
(O, H) => {
|
|
6592
6592
|
f.sendKeyframe(O, H);
|
|
6593
6593
|
},
|
|
6594
6594
|
[f]
|
|
6595
|
-
), nn =
|
|
6595
|
+
), nn = P(
|
|
6596
6596
|
(O) => {
|
|
6597
6597
|
f.setSelfInfo(O);
|
|
6598
6598
|
},
|
|
6599
6599
|
[f]
|
|
6600
|
-
), sn =
|
|
6600
|
+
), sn = P(
|
|
6601
6601
|
(O, H, ce, rn) => {
|
|
6602
6602
|
f.updateStatus(O, H, ce, rn);
|
|
6603
6603
|
},
|
|
@@ -6695,15 +6695,15 @@ function Nr(i) {
|
|
|
6695
6695
|
}
|
|
6696
6696
|
const ye = globalThis.__REALSEE_LIVE_BADGE_LOG__;
|
|
6697
6697
|
(ye == null || ye) && console.log(
|
|
6698
|
-
"%c@realsee/live@0.7.
|
|
6698
|
+
"%c@realsee/live@0.7.6 (12/4/2025, 12:08:28 PM)",
|
|
6699
6699
|
"background: linear-gradient(to right, #1890ff, #52c41a); color: white; padding: 3px 6px; border-radius: 4px; font-weight: bold; text-shadow: 0 1px 0 rgba(0,0,0,0.2);"
|
|
6700
6700
|
);
|
|
6701
6701
|
export {
|
|
6702
6702
|
mn as BrowserRTC,
|
|
6703
|
-
|
|
6703
|
+
We as BrowserRTC4Chime,
|
|
6704
6704
|
fi as BuiltInRTCType,
|
|
6705
6705
|
z as BuiltinActionType,
|
|
6706
|
-
|
|
6706
|
+
W as BuiltinEventType,
|
|
6707
6707
|
B as Command,
|
|
6708
6708
|
Re as CoreRTC,
|
|
6709
6709
|
Ir as Live,
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
--dark-hl-5: #9CDCFE;
|
|
14
14
|
--light-hl-6: #0000FF;
|
|
15
15
|
--dark-hl-6: #569CD6;
|
|
16
|
-
--light-hl-7: #
|
|
17
|
-
--dark-hl-7: #
|
|
18
|
-
--light-hl-8: #
|
|
19
|
-
--dark-hl-8: #
|
|
20
|
-
--light-hl-9: #
|
|
21
|
-
--dark-hl-9: #
|
|
16
|
+
--light-hl-7: #267F99;
|
|
17
|
+
--dark-hl-7: #4EC9B0;
|
|
18
|
+
--light-hl-8: #0070C1;
|
|
19
|
+
--dark-hl-8: #4FC1FF;
|
|
20
|
+
--light-hl-9: #098658;
|
|
21
|
+
--dark-hl-9: #B5CEA8;
|
|
22
22
|
--light-hl-10: #000000FF;
|
|
23
23
|
--dark-hl-10: #D4D4D4;
|
|
24
24
|
--light-hl-11: #800000;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>BrowserRTC | 如视 Live SDK</title><meta name="description" content="Documentation for 如视 Live SDK"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><link rel="stylesheet" href="../assets/custom.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">如视 Live SDK</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">如视 Live SDK</a></li><li><a href="BrowserRTC.html">BrowserRTC</a></li></ul><h1> ClassBrowserRTC</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>浏览器端 TRTC RTC 实现</p>
|
|
2
2
|
<p>基于腾讯云 TRTC SDK 实现的浏览器端 RTC 类。
|
|
3
3
|
适用于在浏览器环境中进行实时语音通信。</p>
|
|
4
|
-
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-Example"><h4 class="tsd-anchor-link"><a id="Example" class="tsd-anchor"></a>Example<a href="#Example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-
|
|
4
|
+
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-Example"><h4 class="tsd-anchor-link"><a id="Example" class="tsd-anchor"></a>Example<a href="#Example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-8">rtc</span><span class="hl-2"> = </span><span class="hl-6">new</span><span class="hl-2"> </span><span class="hl-1">BrowserRTC</span><span class="hl-2">({</span><br/><span class="hl-2"> </span><span class="hl-1">getVoiceSign</span><span class="hl-5">:</span><span class="hl-2"> </span><span class="hl-6">async</span><span class="hl-2"> (</span><span class="hl-5">params</span><span class="hl-2">) </span><span class="hl-6">=></span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-8">response</span><span class="hl-2"> = </span><span class="hl-4">await</span><span class="hl-2"> </span><span class="hl-1">fetch</span><span class="hl-2">(</span><span class="hl-3">'/api/get-voice-sign'</span><span class="hl-2">, {</span><br/><span class="hl-2"> </span><span class="hl-5">method:</span><span class="hl-2"> </span><span class="hl-3">'POST'</span><span class="hl-2">,</span><br/><span class="hl-2"> </span><span class="hl-5">body:</span><span class="hl-2"> </span><span class="hl-8">JSON</span><span class="hl-2">.</span><span class="hl-1">stringify</span><span class="hl-2">(</span><span class="hl-5">params</span><span class="hl-2">)</span><br/><span class="hl-2"> })</span><br/><span class="hl-2"> </span><span class="hl-4">return</span><span class="hl-2"> </span><span class="hl-5">response</span><span class="hl-2">.</span><span class="hl-1">json</span><span class="hl-2">()</span><br/><span class="hl-2"> },</span><br/><span class="hl-2"> </span><span class="hl-1">autoPlayConfirm</span><span class="hl-5">:</span><span class="hl-2"> (</span><span class="hl-5">opts</span><span class="hl-2">) </span><span class="hl-6">=></span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-0">// 处理自动播放确认</span><br/><span class="hl-2"> </span><span class="hl-5">opts</span><span class="hl-2">.</span><span class="hl-1">onConfirm</span><span class="hl-2">()</span><br/><span class="hl-2"> }</span><br/><span class="hl-2">})</span><br/><br/><span class="hl-0">// 加入房间</span><br/><span class="hl-4">await</span><span class="hl-2"> </span><span class="hl-5">rtc</span><span class="hl-2">.</span><span class="hl-1">join</span><span class="hl-2">({</span><br/><span class="hl-2"> </span><span class="hl-5">voiceId:</span><span class="hl-2"> </span><span class="hl-3">'voice-id'</span><span class="hl-2">,</span><br/><span class="hl-2"> </span><span class="hl-5">userId:</span><span class="hl-2"> </span><span class="hl-3">'user-id'</span><span class="hl-2">,</span><br/><span class="hl-2"> </span><span class="hl-5">roomId:</span><span class="hl-2"> </span><span class="hl-3">'room-id'</span><span class="hl-2">,</span><br/><span class="hl-2"> </span><span class="hl-5">type:</span><span class="hl-2"> </span><span class="hl-5">RTCType</span><span class="hl-2">.</span><span class="hl-5">RealseeBrowserRTC</span><br/><span class="hl-2">})</span><br/><br/><span class="hl-0">// 切换麦克风</span><br/><span class="hl-4">await</span><span class="hl-2"> </span><span class="hl-5">rtc</span><span class="hl-2">.</span><span class="hl-1">toggleMicro</span><span class="hl-2">(</span><span class="hl-6">true</span><span class="hl-2">)</span>
|
|
5
5
|
</code><button type="button">Copy</button></pre>
|
|
6
6
|
|
|
7
7
|
</div></div></section><section class="tsd-panel tsd-hierarchy"><h4>Hierarchy (<a href="../hierarchy.html#BrowserRTC">view full</a>)</h4><ul class="tsd-hierarchy"><li><a href="CoreRTC.html" class="tsd-signature-type tsd-kind-class">CoreRTC</a><ul class="tsd-hierarchy"><li><span class="target">BrowserRTC</span></li></ul></li></ul></section><aside class="tsd-sources"><ul><li>Defined in rtc/BrowserRTC.ts:57</li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="BrowserRTC.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
<li>roomId: RTC的语音房间号</li>
|
|
41
41
|
<li>userSig: RTC的用户签名</li>
|
|
42
42
|
</ul>
|
|
43
|
-
<div class="tsd-comment tsd-typography"><div class="tsd-tag-Example"><h4 class="tsd-anchor-link"><a id="Example-1" class="tsd-anchor"></a>Example<a href="#Example-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-1">getVoiceSign</span><span class="hl-2">: </span><span class="hl-
|
|
43
|
+
<div class="tsd-comment tsd-typography"><div class="tsd-tag-Example"><h4 class="tsd-anchor-link"><a id="Example-1" class="tsd-anchor"></a>Example<a href="#Example-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-1">getVoiceSign</span><span class="hl-2">: </span><span class="hl-7">GetVoiceSign</span><span class="hl-2"> = </span><span class="hl-6">async</span><span class="hl-2"> (</span><span class="hl-5">params</span><span class="hl-2">) </span><span class="hl-6">=></span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-8">response</span><span class="hl-2"> = </span><span class="hl-4">await</span><span class="hl-2"> </span><span class="hl-1">fetch</span><span class="hl-2">(</span><span class="hl-3">'/api/get-voice-sign'</span><span class="hl-2">, {</span><br/><span class="hl-2"> </span><span class="hl-5">method:</span><span class="hl-2"> </span><span class="hl-3">'POST'</span><span class="hl-2">,</span><br/><span class="hl-2"> </span><span class="hl-5">headers:</span><span class="hl-2"> { </span><span class="hl-3">'Content-Type'</span><span class="hl-5">:</span><span class="hl-2"> </span><span class="hl-3">'application/json'</span><span class="hl-2"> },</span><br/><span class="hl-2"> </span><span class="hl-5">body:</span><span class="hl-2"> </span><span class="hl-8">JSON</span><span class="hl-2">.</span><span class="hl-1">stringify</span><span class="hl-2">(</span><span class="hl-5">params</span><span class="hl-2">)</span><br/><span class="hl-2"> })</span><br/><span class="hl-2"> </span><span class="hl-4">return</span><span class="hl-2"> </span><span class="hl-5">response</span><span class="hl-2">.</span><span class="hl-1">json</span><span class="hl-2">()</span><br/><span class="hl-2">}</span>
|
|
44
44
|
</code><button type="button">Copy</button></pre>
|
|
45
45
|
|
|
46
46
|
</div></div></li></ul></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <a href="BrowserRTC.html" class="tsd-signature-type tsd-kind-class">BrowserRTC</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Overrides <a href="CoreRTC.html">CoreRTC</a>.<a href="CoreRTC.html#constructor">constructor</a></p><ul><li>Defined in rtc/BrowserRTC.ts:100</li></ul></aside></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="joined" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>joined</span><a href="#joined" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">joined</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></div><div class="tsd-comment tsd-typography"><p>是否已加入语音房间</p>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>BrowserRTC4Chime | 如视 Live SDK</title><meta name="description" content="Documentation for 如视 Live SDK"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><link rel="stylesheet" href="../assets/custom.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">如视 Live SDK</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">如视 Live SDK</a></li><li><a href="BrowserRTC4Chime.html">BrowserRTC4Chime</a></li></ul><h1> ClassBrowserRTC4Chime</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>浏览器端 Amazon Chime SDK RTC 实现</p>
|
|
2
2
|
<p>基于 Amazon Chime SDK for JavaScript 实现的浏览器端 RTC 类。
|
|
3
3
|
适用于在浏览器环境中使用 Amazon Chime 进行实时语音通信。</p>
|
|
4
|
-
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-Example"><h4 class="tsd-anchor-link"><a id="Example" class="tsd-anchor"></a>Example<a href="#Example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-
|
|
4
|
+
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-Example"><h4 class="tsd-anchor-link"><a id="Example" class="tsd-anchor"></a>Example<a href="#Example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-8">rtc</span><span class="hl-2"> = </span><span class="hl-6">new</span><span class="hl-2"> </span><span class="hl-1">BrowserRTC4Chime</span><span class="hl-2">({</span><br/><span class="hl-2"> </span><span class="hl-1">getVoiceSign</span><span class="hl-5">:</span><span class="hl-2"> </span><span class="hl-6">async</span><span class="hl-2"> (</span><span class="hl-5">params</span><span class="hl-2">) </span><span class="hl-6">=></span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-8">response</span><span class="hl-2"> = </span><span class="hl-4">await</span><span class="hl-2"> </span><span class="hl-1">fetch</span><span class="hl-2">(</span><span class="hl-3">'/api/get-voice-sign'</span><span class="hl-2">, {</span><br/><span class="hl-2"> </span><span class="hl-5">method:</span><span class="hl-2"> </span><span class="hl-3">'POST'</span><span class="hl-2">,</span><br/><span class="hl-2"> </span><span class="hl-5">body:</span><span class="hl-2"> </span><span class="hl-8">JSON</span><span class="hl-2">.</span><span class="hl-1">stringify</span><span class="hl-2">(</span><span class="hl-5">params</span><span class="hl-2">)</span><br/><span class="hl-2"> })</span><br/><span class="hl-2"> </span><span class="hl-4">return</span><span class="hl-2"> </span><span class="hl-5">response</span><span class="hl-2">.</span><span class="hl-1">json</span><span class="hl-2">()</span><br/><span class="hl-2"> },</span><br/><span class="hl-2"> </span><span class="hl-5">logLevel:</span><span class="hl-2"> </span><span class="hl-5">LogLevel</span><span class="hl-2">.</span><span class="hl-8">INFO</span><br/><span class="hl-2">})</span><br/><br/><span class="hl-0">// 加入房间</span><br/><span class="hl-4">await</span><span class="hl-2"> </span><span class="hl-5">rtc</span><span class="hl-2">.</span><span class="hl-1">join</span><span class="hl-2">({</span><br/><span class="hl-2"> </span><span class="hl-5">voiceId:</span><span class="hl-2"> </span><span class="hl-3">'voice-id'</span><span class="hl-2">,</span><br/><span class="hl-2"> </span><span class="hl-5">userId:</span><span class="hl-2"> </span><span class="hl-3">'user-id'</span><span class="hl-2">,</span><br/><span class="hl-2"> </span><span class="hl-5">roomId:</span><span class="hl-2"> </span><span class="hl-3">'room-id'</span><span class="hl-2">,</span><br/><span class="hl-2"> </span><span class="hl-5">type:</span><span class="hl-2"> </span><span class="hl-5">RTCType</span><span class="hl-2">.</span><span class="hl-5">RealseeBrowserChimeRTC</span><br/><span class="hl-2">})</span>
|
|
5
5
|
</code><button type="button">Copy</button></pre>
|
|
6
6
|
|
|
7
7
|
</div></div></section><section class="tsd-panel tsd-hierarchy"><h4>Hierarchy (<a href="../hierarchy.html#BrowserRTC4Chime">view full</a>)</h4><ul class="tsd-hierarchy"><li><a href="CoreRTC.html" class="tsd-signature-type tsd-kind-class">CoreRTC</a><ul class="tsd-hierarchy"><li><span class="target">BrowserRTC4Chime</span></li></ul></li></ul></section><aside class="tsd-sources"><ul><li>Defined in rtc/BrowserRTC4Chime.ts:50</li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="BrowserRTC4Chime.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
<li>roomId: RTC的语音房间号</li>
|
|
52
52
|
<li>userSig: RTC的用户签名</li>
|
|
53
53
|
</ul>
|
|
54
|
-
<div class="tsd-comment tsd-typography"><div class="tsd-tag-Example"><h4 class="tsd-anchor-link"><a id="Example-1" class="tsd-anchor"></a>Example<a href="#Example-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-1">getVoiceSign</span><span class="hl-2">: </span><span class="hl-
|
|
54
|
+
<div class="tsd-comment tsd-typography"><div class="tsd-tag-Example"><h4 class="tsd-anchor-link"><a id="Example-1" class="tsd-anchor"></a>Example<a href="#Example-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-1">getVoiceSign</span><span class="hl-2">: </span><span class="hl-7">GetVoiceSign</span><span class="hl-2"> = </span><span class="hl-6">async</span><span class="hl-2"> (</span><span class="hl-5">params</span><span class="hl-2">) </span><span class="hl-6">=></span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-8">response</span><span class="hl-2"> = </span><span class="hl-4">await</span><span class="hl-2"> </span><span class="hl-1">fetch</span><span class="hl-2">(</span><span class="hl-3">'/api/get-voice-sign'</span><span class="hl-2">, {</span><br/><span class="hl-2"> </span><span class="hl-5">method:</span><span class="hl-2"> </span><span class="hl-3">'POST'</span><span class="hl-2">,</span><br/><span class="hl-2"> </span><span class="hl-5">headers:</span><span class="hl-2"> { </span><span class="hl-3">'Content-Type'</span><span class="hl-5">:</span><span class="hl-2"> </span><span class="hl-3">'application/json'</span><span class="hl-2"> },</span><br/><span class="hl-2"> </span><span class="hl-5">body:</span><span class="hl-2"> </span><span class="hl-8">JSON</span><span class="hl-2">.</span><span class="hl-1">stringify</span><span class="hl-2">(</span><span class="hl-5">params</span><span class="hl-2">)</span><br/><span class="hl-2"> })</span><br/><span class="hl-2"> </span><span class="hl-4">return</span><span class="hl-2"> </span><span class="hl-5">response</span><span class="hl-2">.</span><span class="hl-1">json</span><span class="hl-2">()</span><br/><span class="hl-2">}</span>
|
|
55
55
|
</code><button type="button">Copy</button></pre>
|
|
56
56
|
|
|
57
57
|
</div></div></li></ul></li></ul></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">log<wbr/>Level</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">LogLevel</span></h5><div class="tsd-comment tsd-typography"><p>日志级别(可选),默认为 <a href="http://LogLevel.INFO" target="_blank" class="external">LogLevel.INFO</a></p>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>CoreRTC | 如视 Live SDK</title><meta name="description" content="Documentation for 如视 Live SDK"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><link rel="stylesheet" href="../assets/custom.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">如视 Live SDK</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">如视 Live SDK</a></li><li><a href="CoreRTC.html">CoreRTC</a></li></ul><h1> ClassCoreRTC<code class="tsd-tag">Abstract</code></h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>RTC 基础抽象类</p>
|
|
2
2
|
<p>所有 RTC 实现的基类,定义了 RTC 协议的基本接口。
|
|
3
3
|
子类需要实现所有抽象方法和属性。</p>
|
|
4
|
-
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-Example"><h4 class="tsd-anchor-link"><a id="Example" class="tsd-anchor"></a>Example<a href="#Example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-6">class</span><span class="hl-2"> </span><span class="hl-
|
|
4
|
+
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-Example"><h4 class="tsd-anchor-link"><a id="Example" class="tsd-anchor"></a>Example<a href="#Example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-6">class</span><span class="hl-2"> </span><span class="hl-7">MyRTC</span><span class="hl-2"> </span><span class="hl-6">extends</span><span class="hl-2"> </span><span class="hl-7">CoreRTC</span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-5">joined</span><span class="hl-2"> = </span><span class="hl-6">false</span><br/><span class="hl-2"> </span><span class="hl-5">micro</span><span class="hl-2"> = </span><span class="hl-6">false</span><br/><span class="hl-2"> </span><span class="hl-5">voiceId</span><span class="hl-2"> = </span><span class="hl-3">''</span><br/><span class="hl-2"> </span><span class="hl-5">type</span><span class="hl-2"> = </span><span class="hl-5">RTCType</span><span class="hl-2">.</span><span class="hl-5">Custom</span><br/><span class="hl-2"> </span><br/><span class="hl-2"> </span><span class="hl-6">async</span><span class="hl-2"> </span><span class="hl-1">join</span><span class="hl-2">(</span><span class="hl-5">options</span><span class="hl-2">) {</span><br/><span class="hl-2"> </span><span class="hl-0">// 实现加入房间逻辑</span><br/><span class="hl-2"> }</span><br/><span class="hl-2"> </span><br/><span class="hl-2"> </span><span class="hl-6">async</span><span class="hl-2"> </span><span class="hl-1">quit</span><span class="hl-2">() {</span><br/><span class="hl-2"> </span><span class="hl-0">// 实现退出房间逻辑</span><br/><span class="hl-2"> }</span><br/><span class="hl-2"> </span><br/><span class="hl-2"> </span><span class="hl-0">// 实现其他抽象方法...</span><br/><span class="hl-2">}</span>
|
|
5
5
|
</code><button type="button">Copy</button></pre>
|
|
6
6
|
|
|
7
7
|
</div></div></section><section class="tsd-panel tsd-hierarchy"><h4>Hierarchy (<a href="../hierarchy.html#CoreRTC">view full</a>)</h4><ul class="tsd-hierarchy"><li><a href="Subscribe.html" class="tsd-signature-type tsd-kind-class">Subscribe</a><span class="tsd-signature-symbol"><</span><a href="../types/RTCEventType.html" class="tsd-signature-type tsd-kind-type-alias">RTCEventType</a><span class="tsd-signature-symbol">></span><ul class="tsd-hierarchy"><li><span class="target">CoreRTC</span><ul class="tsd-hierarchy"><li><a href="BrowserRTC.html" class="tsd-signature-type tsd-kind-class">BrowserRTC</a></li><li><a href="BrowserRTC4Chime.html" class="tsd-signature-type tsd-kind-class">BrowserRTC4Chime</a></li><li><a href="VRWebViewRTC.html" class="tsd-signature-type tsd-kind-class">VRWebViewRTC</a></li></ul></li></ul></li></ul></section><section class="tsd-panel"><h4>Implements</h4><ul class="tsd-hierarchy"><li><a href="../interfaces/RTCProtocol.html" class="tsd-signature-type tsd-kind-interface">RTCProtocol</a></li></ul></section><aside class="tsd-sources"><ul><li>Defined in rtc/CoreRTC.ts:32</li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="CoreRTC.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|