aliyun-rtc-sdk 7.1.2-beta.1 → 7.1.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var Mn = Object.defineProperty, Nn = Object.defineProperties;
|
|
2
2
|
var Ln = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var vi = Object.getOwnPropertySymbols, xn = Object.getPrototypeOf, Kr = Object.prototype.hasOwnProperty, $r = Object.prototype.propertyIsEnumerable,
|
|
3
|
+
var vi = Object.getOwnPropertySymbols, xn = Object.getPrototypeOf, Kr = Object.prototype.hasOwnProperty, $r = Object.prototype.propertyIsEnumerable, On = Reflect.get;
|
|
4
4
|
var Ui = (r, a, e) => a in r ? Mn(r, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[a] = e, J = (r, a) => {
|
|
5
5
|
for (var e in a || (a = {}))
|
|
6
6
|
Kr.call(a, e) && Ui(r, e, a[e]);
|
|
@@ -19,7 +19,7 @@ var xt = (r, a) => {
|
|
|
19
19
|
return e;
|
|
20
20
|
};
|
|
21
21
|
var g = (r, a, e) => (Ui(r, typeof a != "symbol" ? a + "" : a, e), e);
|
|
22
|
-
var Bi = (r, a, e) =>
|
|
22
|
+
var Bi = (r, a, e) => On(xn(r), e, a);
|
|
23
23
|
var I = (r, a, e) => new Promise((t, i) => {
|
|
24
24
|
var s = (c) => {
|
|
25
25
|
try {
|
|
@@ -38,8 +38,8 @@ var I = (r, a, e) => new Promise((t, i) => {
|
|
|
38
38
|
});
|
|
39
39
|
import { AliRTS as Se, EConnectStatus as Jr, EDatachannelStatus as Gr } from "aliyun-rts-sdk";
|
|
40
40
|
import He from "eventemitter3";
|
|
41
|
-
var qr, Xr,
|
|
42
|
-
i in t ?
|
|
41
|
+
var qr, Xr, Vn = Object.defineProperty, Ot = (r, a, e) => (((t, i, s) => {
|
|
42
|
+
i in t ? Vn(t, i, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[i] = s;
|
|
43
43
|
})(r, typeof a != "symbol" ? a + "" : a, e), e), Hi = { exports: {} }, Fi = { exports: {} };
|
|
44
44
|
function Ye() {
|
|
45
45
|
if (Xr)
|
|
@@ -1557,7 +1557,7 @@ let Kn = 1;
|
|
|
1557
1557
|
class Er {
|
|
1558
1558
|
constructor(a) {
|
|
1559
1559
|
var e, t;
|
|
1560
|
-
|
|
1560
|
+
Ot(this, "armsLogger"), Ot(this, "isReady", !1), Ot(this, "isDestroyed", !1), Ot(this, "options"), Ot(this, "queue", []), Ot(this, "marker"), Ot(this, "helper", { MediaboxWrapperQueue: (i) => new Es(i), MediaboxWrapperInitiative: (i) => new Es(i) }), this.options = bt(J({}, a), { region: a.deferRegionSet ? void 0 : (e = a.region) != null ? e : "cn", env: (t = a.env) != null ? t : "prod" }), this.marker = `-${Kn++}-`, this.initArmsLogger();
|
|
1561
1561
|
}
|
|
1562
1562
|
static get version() {
|
|
1563
1563
|
return "0.23.0";
|
|
@@ -1644,7 +1644,7 @@ function dt(r, a, e) {
|
|
|
1644
1644
|
}(t);
|
|
1645
1645
|
}
|
|
1646
1646
|
var we = ((r) => (r.PullStreamStats = "remoteStat", r.RtsSubscribeExceeds = "rtsSubscribeExceeds", r.UserJoined = "userJoined", r.UserLeft = "userLeft", r.Bye = "bye", r.MuteAudio = "muteAudio", r.UnmuteAudio = "unmuteAudio", r.MuteVideo = "muteVideo", r.UnmuteVideo = "unmuteVideo", r.MuteScreen = "muteScreen", r.UnmuteScreen = "unmuteScreen", r.Error = "error", r))(we || {}), Ze = ((r) => (r.Local = "local-device-status-change", r.Remote = "remote-device-status-change", r))(Ze || {}), k = ((r) => (r.Audio = "sophon_audio", r.VideoLarge = "sophon_video_camera_large", r.VideoSmall = "sophon_video_camera_small", r.Screen = "sophon_video_screen_share", r.Data = "sophon_data", r))(k || {}), ur = ((r) => (r.Audio = "rts audio", r.VideoLarge = "rts video", r))(ur || {}), Et = ((r) => (r.Add = "add", r.Delete = "delete", r.Replace = "replace", r.Stop = "stop", r.UnPublish = "unpublish", r))(Et || {}), ui = ((r) => (r[r.Camera = 0] = "Camera", r[r.Screen = 1] = "Screen", r[r.Image = 2] = "Image", r))(ui || {}), Ti = ((r) => (r[r.Microphone = 0] = "Microphone", r[r.Screen = 1] = "Screen", r[r.Mixed = 2] = "Mixed", r))(Ti || {}), fe = ((r) => (r.InRoom = "inRoom", r.Join = "join", r.Publish = "publish", r.User = "user", r.Resume = "resume", r.Retry = "retry", r.Reconnect = "reconnect", r))(fe || {}), St = ((r) => (r[r.MANUAL = 0] = "MANUAL", r[r.JOIN_CHANNEL = 1] = "JOIN_CHANNEL", r[r.ROLE_CHANGE = 2] = "ROLE_CHANGE", r[r.RECONNECT = 3] = "RECONNECT", r))(St || {}), Ci = ((r) => (r.prod = "rs.rtn.aliyuncs.com", r.pre = "prs.rtn.aliyuncs.com", r))(Ci || {});
|
|
1647
|
-
const Li = "7.1.2
|
|
1647
|
+
const Li = "7.1.2";
|
|
1648
1648
|
class it {
|
|
1649
1649
|
static getVersionNumber() {
|
|
1650
1650
|
let a = Li.split("."), e = "";
|
|
@@ -2045,9 +2045,9 @@ function eo() {
|
|
|
2045
2045
|
}(), r.lib.WordArray;
|
|
2046
2046
|
}(he())), Ls.exports;
|
|
2047
2047
|
}
|
|
2048
|
-
var xs,
|
|
2048
|
+
var xs, Os = { exports: {} };
|
|
2049
2049
|
function to() {
|
|
2050
|
-
return xs || (xs = 1,
|
|
2050
|
+
return xs || (xs = 1, Os.exports = function(r) {
|
|
2051
2051
|
return function() {
|
|
2052
2052
|
var a = r, e = a.lib.WordArray, t = a.enc;
|
|
2053
2053
|
function i(s) {
|
|
@@ -2075,11 +2075,11 @@ function to() {
|
|
|
2075
2075
|
return e.create(o, 2 * n);
|
|
2076
2076
|
} };
|
|
2077
2077
|
}(), r.enc.Utf16;
|
|
2078
|
-
}(he())),
|
|
2078
|
+
}(he())), Os.exports;
|
|
2079
2079
|
}
|
|
2080
|
-
var
|
|
2080
|
+
var Vs, Us = { exports: {} };
|
|
2081
2081
|
function Ht() {
|
|
2082
|
-
return
|
|
2082
|
+
return Vs || (Vs = 1, Us.exports = function(r) {
|
|
2083
2083
|
return function() {
|
|
2084
2084
|
var a = r, e = a.lib.WordArray;
|
|
2085
2085
|
function t(i, s, n) {
|
|
@@ -2304,8 +2304,8 @@ function Xs() {
|
|
|
2304
2304
|
if (Z < 16)
|
|
2305
2305
|
Ie = ie.high = 0 | d[b + 2 * Z], ue = ie.low = 0 | d[b + 2 * Z + 1];
|
|
2306
2306
|
else {
|
|
2307
|
-
var je = h[Z - 15], q = je.high, Ee = je.low, Je = (q >>> 1 | Ee << 31) ^ (q >>> 8 | Ee << 24) ^ q >>> 7,
|
|
2308
|
-
Ie = (Ie = (Ie = Je + Si + ((ue =
|
|
2307
|
+
var je = h[Z - 15], q = je.high, Ee = je.low, Je = (q >>> 1 | Ee << 31) ^ (q >>> 8 | Ee << 24) ^ q >>> 7, Ve = (Ee >>> 1 | q << 31) ^ (Ee >>> 8 | q << 24) ^ (Ee >>> 7 | q << 25), Gt = h[Z - 2], Ge = Gt.high, pt = Gt.low, qt = (Ge >>> 19 | pt << 13) ^ (Ge << 3 | pt >>> 29) ^ Ge >>> 6, nt = (pt >>> 19 | Ge << 13) ^ (pt << 3 | Ge >>> 29) ^ (pt >>> 6 | Ge << 26), wt = h[Z - 7], Si = wt.high, bi = wt.low, Ur = h[Z - 16], wn = Ur.high, Br = Ur.low;
|
|
2308
|
+
Ie = (Ie = (Ie = Je + Si + ((ue = Ve + bi) >>> 0 < Ve >>> 0 ? 1 : 0)) + qt + ((ue += nt) >>> 0 < nt >>> 0 ? 1 : 0)) + wn + ((ue += Br) >>> 0 < Br >>> 0 ? 1 : 0), ie.high = Ie, ie.low = ue;
|
|
2309
2309
|
}
|
|
2310
2310
|
var Lt, En = de & Fe ^ ~de & Ae, Hr = ge & te ^ ~ge & ke, In = N & me ^ N & $ ^ me & $, Tn = ce & ye ^ ce & le ^ ye & le, Cn = (N >>> 28 | ce << 4) ^ (N << 30 | ce >>> 2) ^ (N << 25 | ce >>> 7), Fr = (ce >>> 28 | N << 4) ^ (ce << 30 | N >>> 2) ^ (ce << 25 | N >>> 7), kn = (de >>> 14 | ge << 18) ^ (de >>> 18 | ge << 14) ^ (de << 23 | ge >>> 9), Pn = (ge >>> 14 | de << 18) ^ (ge >>> 18 | de << 14) ^ (ge << 23 | de >>> 9), jr = c[Z], Dn = jr.high, zr = jr.low, ri = se + kn + ((Lt = re + Pn) >>> 0 < re >>> 0 ? 1 : 0), Wr = Fr + Tn;
|
|
2311
2311
|
se = Ae, re = ke, Ae = Fe, ke = te, Fe = de, te = ge, de = Pe + (ri = (ri = (ri = ri + En + ((Lt += Hr) >>> 0 < Hr >>> 0 ? 1 : 0)) + Dn + ((Lt += zr) >>> 0 < zr >>> 0 ? 1 : 0)) + Ie + ((Lt += ue) >>> 0 < ue >>> 0 ? 1 : 0)) + ((ge = be + Lt | 0) >>> 0 < be >>> 0 ? 1 : 0) | 0, Pe = $, be = le, $ = me, le = ye, me = N, ye = ce, N = ri + (Cn + In + (Wr >>> 0 < Fr >>> 0 ? 1 : 0)) + ((ce = Lt + Wr | 0) >>> 0 < Lt >>> 0 ? 1 : 0) | 0;
|
|
@@ -3233,7 +3233,7 @@ var Da = { default: "ddd mmm dd yyyy HH:MM:ss", shortDate: "m/d/yy", paddedShort
|
|
|
3233
3233
|
}, Mo = function(r) {
|
|
3234
3234
|
return (String(r).match(Co) || [""]).pop().replace(ko, "").replace(/GMT\+0000/g, "UTC");
|
|
3235
3235
|
};
|
|
3236
|
-
const { BrowserUtil: No } = Se, Lo = "EdgeHTML", Na = "Blink", xo = "Trident",
|
|
3236
|
+
const { BrowserUtil: No } = Se, Lo = "EdgeHTML", Na = "Blink", xo = "Trident", Oo = "Gecko", Vo = "WebKit", yi = (r, a) => {
|
|
3237
3237
|
const e = a.match(r);
|
|
3238
3238
|
return e && e.length > 0 && e[1] || "";
|
|
3239
3239
|
}, Uo = [{ test: [/\sedg\//i, [/edg([ea]|ios)/i]], describe(r) {
|
|
@@ -3248,10 +3248,10 @@ const { BrowserUtil: No } = Se, Lo = "EdgeHTML", Na = "Blink", xo = "Trident", V
|
|
|
3248
3248
|
const a = /gecko/i.test(r), e = /like gecko/i.test(r);
|
|
3249
3249
|
return a && !e;
|
|
3250
3250
|
}, describe(r) {
|
|
3251
|
-
const a = { name:
|
|
3251
|
+
const a = { name: Oo }, e = yi(/gecko\/(\d+(\.?_?\d+)+)/i, r);
|
|
3252
3252
|
return e && (a.version = e), a;
|
|
3253
3253
|
} }, { test: [/(apple)?webkit\/537\.36/i], describe: () => ({ name: Na }) }, { test: [/(apple)?webkit/i], describe(r) {
|
|
3254
|
-
const a = { name:
|
|
3254
|
+
const a = { name: Vo }, e = yi(/webkit\/(\d+(\.?_?\d+)+)/i, r);
|
|
3255
3255
|
return e && (a.version = e), a;
|
|
3256
3256
|
} }], kr = (r, a) => r.find((e) => typeof e.test == "function" ? e.test(a) : Array.isArray(e.test) ? e.test.some((t) => typeof t == "string" ? a.indexOf(t) > -1 : t instanceof RegExp && t.test(a)) : void 0), Bo = () => {
|
|
3257
3257
|
try {
|
|
@@ -3287,7 +3287,7 @@ const { BrowserUtil: No } = Se, Lo = "EdgeHTML", Na = "Blink", xo = "Trident", V
|
|
|
3287
3287
|
function ir() {
|
|
3288
3288
|
return Cr(/* @__PURE__ */ new Date(), "HH:MM:ss.l");
|
|
3289
3289
|
}
|
|
3290
|
-
function
|
|
3290
|
+
function Oa() {
|
|
3291
3291
|
return Cr(/* @__PURE__ */ new Date(), "isoDate");
|
|
3292
3292
|
}
|
|
3293
3293
|
var sn = ((r) => (r[r.DEBUG = 0] = "DEBUG", r[r.INFO = 1] = "INFO", r[r.API = 2] = "API", r[r.WARNING = 3] = "WARNING", r[r.ERROR = 4] = "ERROR", r[r.NONE = 5] = "NONE", r))(sn || {});
|
|
@@ -3309,7 +3309,7 @@ class Wo {
|
|
|
3309
3309
|
g(this, "sendLogBeforeUnload", (a) => I(this, null, function* () {
|
|
3310
3310
|
if (!this.slsPlugin)
|
|
3311
3311
|
return;
|
|
3312
|
-
this.logSequence += 1, a.unshift(this.getLogParams(710203, { log: `[${
|
|
3312
|
+
this.logSequence += 1, a.unshift(this.getLogParams(710203, { log: `[${Oa()} ${ir()}] [INF] beforeunload`, stat_log_seq: this.logSequence }));
|
|
3313
3313
|
const e = `https://${Ri.project}.${Ri.host}/logstores/${Ri.logstore}`, t = { __logs__: a.map((n) => this.slsPlugin.transString(n)) }, { data: i, header: s } = yield this.slsPlugin.process(e, JSON.stringify(t));
|
|
3314
3314
|
fetch(e, { keepalive: !0, method: "POST", headers: s, body: i });
|
|
3315
3315
|
}));
|
|
@@ -3425,11 +3425,11 @@ class Wo {
|
|
|
3425
3425
|
this.tracker.send(e);
|
|
3426
3426
|
}
|
|
3427
3427
|
addLog(a) {
|
|
3428
|
-
const e = ir(), t = `[${
|
|
3428
|
+
const e = ir(), t = `[${Oa()} ${e}] ${a}`;
|
|
3429
3429
|
this.sessionId && this.tracker ? this.sendLog(t) : (this.logCache.push(t), this.logCache.length >= 200 && this.logCache.shift());
|
|
3430
3430
|
}
|
|
3431
3431
|
}
|
|
3432
|
-
class
|
|
3432
|
+
class O {
|
|
3433
3433
|
static getLogger() {
|
|
3434
3434
|
return this.logger || (this.logger = new Wo()), this.logger;
|
|
3435
3435
|
}
|
|
@@ -3470,7 +3470,7 @@ class V {
|
|
|
3470
3470
|
this.getLogger().e("[ERR]", ...a);
|
|
3471
3471
|
}
|
|
3472
3472
|
}
|
|
3473
|
-
g(
|
|
3473
|
+
g(O, "logger");
|
|
3474
3474
|
const Ko = (r) => I(void 0, null, function* () {
|
|
3475
3475
|
const a = new Se.SupportUtil();
|
|
3476
3476
|
let e = { support: !1, detail: { isWebRTCSupported: a.checkMediaDevices() && a.checkWebRtcSupport(), isH264DecodeSupported: !1, isH264EncodeSupported: !1, isScreenShareSupported: !1, isSendMediaExtensionMsgSupported: !1, isBrowserSupported: !0 } }, t = !1;
|
|
@@ -3644,7 +3644,7 @@ const ei = class ei extends He {
|
|
|
3644
3644
|
this.reconnectTimeoutId && (clearTimeout(this.reconnectTimeoutId), this.reconnectTimeoutId = 0), this.emit("onReconnectStart"), this.isReconnecting = !0, this.initWebSocket();
|
|
3645
3645
|
}
|
|
3646
3646
|
onOpen(e) {
|
|
3647
|
-
|
|
3647
|
+
O.info(`[${ei.logName}]`, "onOpen"), this.socketStatus = 2, this.connectRetryCount = 0, this.networkAvailableChecked = !1, this.closedByInvoke = !1, this.gotErr = !1, this.isReconnecting = !1, this.emit("onOpen", e);
|
|
3648
3648
|
}
|
|
3649
3649
|
onMessage(e) {
|
|
3650
3650
|
this.emit("onMessage", e);
|
|
@@ -3659,7 +3659,7 @@ const ei = class ei extends He {
|
|
|
3659
3659
|
if (this.closedByInvoke)
|
|
3660
3660
|
this.socketStatus = 0;
|
|
3661
3661
|
else {
|
|
3662
|
-
if (
|
|
3662
|
+
if (O.info(`[${ei.logName}]`, `onClose, code: ${e.code}, reason: ${e.reason}, status: ${status}, retryCount: ${this.connectRetryCount}`), (yield it.isNetworkAvailable()) && !this.networkAvailableChecked)
|
|
3663
3663
|
return this.reconnect(), void (this.networkAvailableChecked = !0);
|
|
3664
3664
|
this.connectRetryCount || this.emit("onNetworkError"), !this.reconnectTimeoutId && (this.connectRetryCount += 1, this.connectRetryCount > this.maxConnectRetryCount ? this.emit("onConnectFail") : Date.now() - this.lastConnectStartTime >= 5e3 ? this.reconnect() : this.reconnectTimeoutId = window.setTimeout(() => {
|
|
3665
3665
|
this.reconnect();
|
|
@@ -3691,11 +3691,11 @@ rr = fr, sr = fr.exports, function(r, a) {
|
|
|
3691
3691
|
return se = se.replace(/^\s\s*/, ""), typeof re === t ? se : se.substring(0, 500);
|
|
3692
3692
|
}, be = function(se, re) {
|
|
3693
3693
|
for (var Z, ue, Ie, ie, je, q, Ee = 0; Ee < re.length && !je; ) {
|
|
3694
|
-
var Je = re[Ee],
|
|
3694
|
+
var Je = re[Ee], Ve = re[Ee + 1];
|
|
3695
3695
|
for (Z = ue = 0; Z < Je.length && !je && Je[Z]; )
|
|
3696
3696
|
if (je = Je[Z++].exec(se))
|
|
3697
|
-
for (Ie = 0; Ie <
|
|
3698
|
-
q = je[++ue], typeof (ie =
|
|
3697
|
+
for (Ie = 0; Ie < Ve.length; Ie++)
|
|
3698
|
+
q = je[++ue], typeof (ie = Ve[Ie]) === i && ie.length > 0 ? ie.length === 2 ? typeof ie[1] == e ? this[ie[0]] = ie[1].call(this, q) : this[ie[0]] = ie[1] : ie.length === 3 ? typeof ie[1] !== e || ie[1].exec && ie[1].test ? this[ie[0]] = q ? q.replace(ie[1], ie[2]) : a : this[ie[0]] = q ? ie[1].call(this, q, ie[2]) : a : ie.length === 4 && (this[ie[0]] = q ? ie[3].call(this, q.replace(ie[1], ie[2])) : a) : this[ie] = q || a;
|
|
3699
3699
|
Ee += 2;
|
|
3700
3700
|
}
|
|
3701
3701
|
}, de = function(se, re) {
|
|
@@ -3712,8 +3712,8 @@ rr = fr, sr = fr.exports, function(r, a) {
|
|
|
3712
3712
|
return new te(se, re).getResult();
|
|
3713
3713
|
var Z = typeof r !== t && r.navigator ? r.navigator : a, ue = se || (Z && Z.userAgent ? Z.userAgent : ""), Ie = Z && Z.userAgentData ? Z.userAgentData : a, ie = re ? function(q, Ee) {
|
|
3714
3714
|
var Je = {};
|
|
3715
|
-
for (var
|
|
3716
|
-
Ee[
|
|
3715
|
+
for (var Ve in q)
|
|
3716
|
+
Ee[Ve] && Ee[Ve].length % 2 == 0 ? Je[Ve] = Ee[Ve].concat(q[Ve]) : Je[Ve] = q[Ve];
|
|
3717
3717
|
return Je;
|
|
3718
3718
|
}(Fe, re) : Fe, je = Z && Z.userAgent == ue;
|
|
3719
3719
|
return this.getBrowser = function() {
|
|
@@ -3770,7 +3770,7 @@ class Xo {
|
|
|
3770
3770
|
get adaptInfo() {
|
|
3771
3771
|
var e, t, i, s;
|
|
3772
3772
|
let a = new qo.UAParser().getResult();
|
|
3773
|
-
return { os_name: ((e = a.os.name) == null ? void 0 : e.replace(" ", "")) + "_" + ((t = a.browser.name) == null ? void 0 : t.replace(" ", "")), device_name: ((i = a.device.model) == null ? void 0 : i.replace(" ", "")) || "", brand_name: ((s = a.device.vendor) == null ? void 0 : s.replace(" ", "")) || "", device_key: window.navigator.userAgent, os_version: a.browser.version || "", sdk_version: "7.1.2
|
|
3773
|
+
return { os_name: ((e = a.os.name) == null ? void 0 : e.replace(" ", "")) + "_" + ((t = a.browser.name) == null ? void 0 : t.replace(" ", "")), device_name: ((i = a.device.model) == null ? void 0 : i.replace(" ", "")) || "", brand_name: ((s = a.device.vendor) == null ? void 0 : s.replace(" ", "")) || "", device_key: window.navigator.userAgent, os_version: a.browser.version || "", sdk_version: "7.1.2", version: "v1" };
|
|
3774
3774
|
}
|
|
3775
3775
|
refreshAuthInfo(a) {
|
|
3776
3776
|
this.authInfo = a;
|
|
@@ -3817,7 +3817,7 @@ class Xo {
|
|
|
3817
3817
|
}
|
|
3818
3818
|
}
|
|
3819
3819
|
var B = ((r) => (r[r.ERR_JOIN_ALREADY_JOINED = 16843521] = "ERR_JOIN_ALREADY_JOINED", r[r.ERR_JOIN_BAD_APPID = 33620481] = "ERR_JOIN_BAD_APPID", r[r.ERR_JOIN_INVALID_APPID = 33620482] = "ERR_JOIN_INVALID_APPID", r[r.ERR_JOIN_BAD_CHANNEL = 33620484] = "ERR_JOIN_BAD_CHANNEL", r[r.ERR_JOIN_INVALID_CHANNEL = 33620483] = "ERR_JOIN_INVALID_CHANNEL", r[r.ERR_JOIN_BAD_TOKEN = 33620485] = "ERR_JOIN_BAD_TOKEN", r[r.ERR_JOIN_TIMEOUT = 16908804] = "ERR_JOIN_TIMEOUT", r[r.ERR_JOIN_ERR_JOIN_BAD_PARAMBAD = 16974081] = "ERR_JOIN_ERR_JOIN_BAD_PARAMBAD", r[r.ERR_JOIN_CHANNEL_FAILED = 16974338] = "ERR_JOIN_CHANNEL_FAILED", r[r.ERR_LOG_ALREADY_INIT = 16974085] = "ERR_LOG_ALREADY_INIT", r[r.ERR_LOG_ROOT_PATH_ERROR = 16974086] = "ERR_LOG_ROOT_PATH_ERROR", r[r.ERR_MIC_OPEN_FAIL = 17040388] = "ERR_MIC_OPEN_FAIL", r[r.ERR_SPEAKER_OPEN_FAIL = 17040389] = "ERR_SPEAKER_OPEN_FAIL", r[r.ERR_MIC_INTERRUPT = 17040390] = "ERR_MIC_INTERRUPT", r[r.ERR_SPEAKER_INTERRUPT = 17040391] = "ERR_SPEAKER_INTERRUPT", r[r.ERR_MIC_AUTH_FAIL = 17040392] = "ERR_MIC_AUTH_FAIL", r[r.ERR_MIC_NOT_AVAILABLE = 17040393] = "ERR_MIC_NOT_AVAILABLE", r[r.ERR_SPEAKER_NOT_AVAILABLE = 17040400] = "ERR_SPEAKER_NOT_AVAILABLE", r[r.ERR_CAMERA_OPEN_FAIL = 17039620] = "ERR_CAMERA_OPEN_FAIL", r[r.ERR_CAMERA_AUTH_FAIL = 17039621] = "ERR_CAMERA_AUTH_FAIL", r[r.ERR_CAMERA_INTERRUPT = 17039622] = "ERR_CAMERA_INTERRUPT", r[r.ERR_CAMERA_NOT_AVAILABLE = 17039623] = "ERR_CAMERA_NOT_AVAILABLE", r[r.ERR_VIDEO_DISPLAY_OPEN_FAIL = 17039873] = "ERR_VIDEO_DISPLAY_OPEN_FAIL", r[r.ERR_VIDEO_DISPLAY_INTERRUPT = 1064992] = "ERR_VIDEO_DISPLAY_INTERRUPT", r[r.ERR_ICE_CONNECTION_CONNECT_FAIL = 17105409] = "ERR_ICE_CONNECTION_CONNECT_FAIL", r[r.ERR_ICE_CONNECTION_RECONNECT_FAI = 17105410] = "ERR_ICE_CONNECTION_RECONNECT_FAI", r[r.ERR_ICE_CONNECTION_MOBILITY_FAIL = 17105411] = "ERR_ICE_CONNECTION_MOBILITY_FAIL", r[r.ERR_ICE_CONNECTION_HEARTBEAT_TIMEOUT = 16908812] = "ERR_ICE_CONNECTION_HEARTBEAT_TIMEOUT", r[r.ERR_LATENCY_LIVE_COMMUNICATION_FAILED = 17235971] = "ERR_LATENCY_LIVE_COMMUNICATION_FAILED", r[r.ERR_LATENCY_LIVE_MEIDASETTING_FAILED = 17235972] = "ERR_LATENCY_LIVE_MEIDASETTING_FAILED", r[r.ERR_LATENCY_LIVE_NONE_BROADCASTER = 17235973] = "ERR_LATENCY_LIVE_NONE_BROADCASTER", r[r.ERR_LATENCY_LIVE_NEED_RESTART = 17235974] = "ERR_LATENCY_LIVE_NEED_RESTART", r[r.ERR_LATENCY_LIVE_NEED_RESTART_AGAIN_LATER = 17235975] = "ERR_LATENCY_LIVE_NEED_RESTART_AGAIN_LATER", r[r.ERR_LATENCY_LIVE_SERVICE_UNAVAILABLE = 17235976] = "ERR_LATENCY_LIVE_SERVICE_UNAVAILABLE", r[r.ERR_LATENCY_LIVE_MEDIACONNECTION_INTERRUPTION = 17235977] = "ERR_LATENCY_LIVE_MEDIACONNECTION_INTERRUPTION", r[r.ERR_SDK_PUBLISH_INVAILD = 16974597] = "ERR_SDK_PUBLISH_INVAILD", r[r.ERR_SDK_PUBLISH_NOT_JOIN_CHANNEL = 16843782] = "ERR_SDK_PUBLISH_NOT_JOIN_CHANNEL", r[r.ERR_SDK_PUBLISH_AUDIO_STREAM_FAILED = 16843856] = "ERR_SDK_PUBLISH_AUDIO_STREAM_FAILED", r[r.ERR_SDK_PUBLISH_VIDEO_STREAM_FAILED = 16843857] = "ERR_SDK_PUBLISH_VIDEO_STREAM_FAILED", r[r.ERR_SDK_PUBLISH_DUAL_STREAM_FAILED = 16843858] = "ERR_SDK_PUBLISH_DUAL_STREAM_FAILED", r[r.ERR_SDK_PUBLISH_SCEEN_SHARE_FAILED = 16843859] = "ERR_SDK_PUBLISH_SCEEN_SHARE_FAILED", r[r.ERR_SDK_PUBLISH_SCREEN_SHARE_CONFIG_ERROR = 16843860] = "ERR_SDK_PUBLISH_SCREEN_SHARE_CONFIG_ERROR", r[r.ERR_SDK_SUBSCRIBE_INVAILD = 16974852] = "ERR_SDK_SUBSCRIBE_INVAILD", r[r.ERR_SDK_SUBSCRIBE_NOT_JOIN_CHANNEL = 16844112] = "ERR_SDK_SUBSCRIBE_NOT_JOIN_CHANNEL", r[r.ERR_SDK_SUBSCRIBE_AUDIO_STREAM_FAILED = 16844113] = "ERR_SDK_SUBSCRIBE_AUDIO_STREAM_FAILED", r[r.ERR_SDK_SUBSCRIBE_VIDEO_STREAM_FAILED = 16844114] = "ERR_SDK_SUBSCRIBE_VIDEO_STREAM_FAILED", r[r.ERR_SDK_SUBSCRIBE_DUAL_STREAM_FAILED = 16844115] = "ERR_SDK_SUBSCRIBE_DUAL_STREAM_FAILED", r[r.ERR_SDK_SUBSCRIBE_SCREEN_SHARE_FAILED = 16844116] = "ERR_SDK_SUBSCRIBE_SCREEN_SHARE_FAILED", r[r.ERR_SDK_SUBSCRIBE_DATA_FAILED = 16844117] = "ERR_SDK_SUBSCRIBE_DATA_FAILED", r[r.ERR_SDK_SUBSCRIBE_DATA_ERROR = 16844118] = "ERR_SDK_SUBSCRIBE_DATA_ERROR", r[r.ERR_SDK_INVALID_STATE = 16974340] = "ERR_SDK_INVALID_STATE", r[r.ERR_INVALID_ARGUMENTS = 16974083] = "ERR_INVALID_ARGUMENTS", r[r.ERR_SESSION_REMOVED = 33620229] = "ERR_SESSION_REMOVED", r[r.ERR_SDK_UPDATE_ROLE_CHANNEL = 16908801] = "ERR_SDK_UPDATE_ROLE_CHANNEL", r[r.ERR_INNER = -1] = "ERR_INNER", r[r.ERR_SDK_MPU_TASK_PUBLISH_OK = 0] = "ERR_SDK_MPU_TASK_PUBLISH_OK", r[r.ERR_SDK_MPU_TASK_STREAM_NOT_FOUND = 17825793] = "ERR_SDK_MPU_TASK_STREAM_NOT_FOUND", r[r.ERR_SDK_MPU_TASK_STREAM_ALREADY_EXIST = 17825794] = "ERR_SDK_MPU_TASK_STREAM_ALREADY_EXIST", r[r.ERR_SDK_MPU_TASK_INVALID_PARAM = 17825795] = "ERR_SDK_MPU_TASK_INVALID_PARAM", r[r.ERR_SDK_MPU_TASK_INTERNAL_ERROR = 17825796] = "ERR_SDK_MPU_TASK_INTERNAL_ERROR", r[r.ERR_SDK_MPU_TASK_RTMP_SERVER_ERROR = 17825797] = "ERR_SDK_MPU_TASK_RTMP_SERVER_ERROR", r[r.ERR_SDK_MPU_TASK_RTMP_STREAM_URL_ERROR = 17825798] = "ERR_SDK_MPU_TASK_RTMP_STREAM_URL_ERROR", r[r.ERR_SDK_MPU_TASK_PUBLISH_TIMEOUT = 17825799] = "ERR_SDK_MPU_TASK_PUBLISH_TIMEOUT", r[r.ERR_SDK_MPU_TASK_NOT_AUTHORIZED = 17825800] = "ERR_SDK_MPU_TASK_NOT_AUTHORIZED", r[r.ERR_SDK_CHANNEL_RELAY_STATE_ERROR = 18874369] = "ERR_SDK_CHANNEL_RELAY_STATE_ERROR", r[r.ERR_SDK_CHANNEL_RELAY_SRC_NOT_ALLOW = 18874370] = "ERR_SDK_CHANNEL_RELAY_SRC_NOT_ALLOW", r[r.ERR_SDK_CHANNEL_RELAY_JOIN_DEST_FAILED = 18874371] = "ERR_SDK_CHANNEL_RELAY_JOIN_DEST_FAILED", r[r.ERR_SDK_CHANNEL_RELAY_TOKEN_INVALID = 18874372] = "ERR_SDK_CHANNEL_RELAY_TOKEN_INVALID", r[r.ERR_SDK_CHANNEL_RELAY_ROLE_ERROR = 18874373] = "ERR_SDK_CHANNEL_RELAY_ROLE_ERROR", r[r.ERR_SDK_CHANNEL_RELAY_INVALID_PARAM = 18874374] = "ERR_SDK_CHANNEL_RELAY_INVALID_PARAM", r[r.ERR_SDK_CHANNEL_RELAY_TO_SELF_ERROR = 18874375] = "ERR_SDK_CHANNEL_RELAY_TO_SELF_ERROR", r))(B || {});
|
|
3820
|
-
class
|
|
3820
|
+
class V extends Error {
|
|
3821
3821
|
constructor(e, t, i) {
|
|
3822
3822
|
super(t);
|
|
3823
3823
|
g(this, "_code");
|
|
@@ -3825,10 +3825,10 @@ class O extends Error {
|
|
|
3825
3825
|
this._code = e, this._extra = i;
|
|
3826
3826
|
}
|
|
3827
3827
|
static fromRtsError(e) {
|
|
3828
|
-
return e instanceof
|
|
3828
|
+
return e instanceof V ? e : new V((e == null ? void 0 : e.errorCode) || -1, (e == null ? void 0 : e.message) || (e == null ? void 0 : e.errorCodeName) || "rts error", e);
|
|
3829
3829
|
}
|
|
3830
3830
|
static fromError(e, t = -1, i = "") {
|
|
3831
|
-
return new
|
|
3831
|
+
return new V(t, (e == null ? void 0 : e.message) || (e == null ? void 0 : e.reason) || i || "error", e);
|
|
3832
3832
|
}
|
|
3833
3833
|
get code() {
|
|
3834
3834
|
return this._code;
|
|
@@ -3894,7 +3894,7 @@ const st = class st extends He {
|
|
|
3894
3894
|
let s = this.packageCreater.createPublishPackage();
|
|
3895
3895
|
s.data.users = [], s.data.l1ip = t, i.subscribe.signal = this.wsClient.connectUrl;
|
|
3896
3896
|
const { tracks: n, resume: o } = i;
|
|
3897
|
-
let c = "7.1.2
|
|
3897
|
+
let c = "7.1.2";
|
|
3898
3898
|
c && (c = c.split("-")[0]), n.forEach((l) => {
|
|
3899
3899
|
const { codec: d, ssrc: b } = l;
|
|
3900
3900
|
l.userdata = JSON.stringify({ sdk_version: c, codec: d }), l.ssrc = `${b}`, o && (l.attr = { reason: "reconnect" });
|
|
@@ -3912,7 +3912,7 @@ const st = class st extends He {
|
|
|
3912
3912
|
this.authInfo = e, this.packageCreater.refreshAuthInfo(e);
|
|
3913
3913
|
}
|
|
3914
3914
|
close() {
|
|
3915
|
-
|
|
3915
|
+
O.info(`[${st.logName}] close`), this.stopKeepAlive(), this.wsClient.off("onOpen", this.onOpen.bind(this)), this.wsClient.off("onMessage", this.onMessage.bind(this)), this.wsClient.off("onError", this.onError.bind(this)), this.wsClient.off("onClose", this.onClose.bind(this)), this.wsClient.off("onConnectFail", this.onConnectFail.bind(this)), this.wsClient.off("onAuthInvalid", this.onAuthInvalid.bind(this)), this.wsClient.off("onReconnectStart"), this.wsClient.off("onReconnectFail"), this.wsClient.close();
|
|
3916
3916
|
}
|
|
3917
3917
|
sendPackage(e) {
|
|
3918
3918
|
[Ne.KEEPALIVE, Ne.RECONNECT, Ne.JOINCHANNEL].includes(e.msgtype) || this.packageCache.set(e.tid, e), this.wsClient.send(e), e.msgtype !== Ne.KEEPALIVE && this.slsReporter.reportRoomServerEvent(!0, e.msgtype, e.tid, e);
|
|
@@ -3921,7 +3921,7 @@ const st = class st extends He {
|
|
|
3921
3921
|
this.reconnectData = e;
|
|
3922
3922
|
}
|
|
3923
3923
|
onOpen() {
|
|
3924
|
-
if (
|
|
3924
|
+
if (O.info(`[${st.logName}] onOpen`), this.isFirstConnect) {
|
|
3925
3925
|
let e = this.packageCreater.createJoinPackage(this.joinChannelExtraData);
|
|
3926
3926
|
e.data.configure = { channelprofile: this.channelProfile }, this.channelProfile !== Ct.AliRtcSdkInteractiveLive && this.channelProfile !== Ct.AliRtcSdkInteractiveWithLowLatencyLive || (e.data.configure.clientrole = this.clientRole), this.sendPackage(e);
|
|
3927
3927
|
} else {
|
|
@@ -3935,27 +3935,27 @@ const st = class st extends He {
|
|
|
3935
3935
|
let t = JSON.parse(e.data);
|
|
3936
3936
|
this.packageCache.delete(t.tid), this.onRecvMessage(t), t != null && t.msgtype && (t == null ? void 0 : t.msgtype) !== Ne.KEEPALIVE && this.slsReporter.reportRoomServerEvent(!1, t.msgtype, t.tid, t);
|
|
3937
3937
|
} catch (t) {
|
|
3938
|
-
|
|
3938
|
+
O.warn(`[${st.logName}] onMessage err`, t, e);
|
|
3939
3939
|
}
|
|
3940
3940
|
}
|
|
3941
3941
|
onError(e) {
|
|
3942
|
-
|
|
3942
|
+
O.warn(`[${st.logName}] onError`, e), this.isFirstConnect && this.onConnectFail();
|
|
3943
3943
|
}
|
|
3944
3944
|
onConnectFail() {
|
|
3945
|
-
|
|
3946
|
-
const e = new
|
|
3945
|
+
O.warn(`[${st.logName}] onConnectFail`);
|
|
3946
|
+
const e = new V(B.ERR_INNER, "Signaling connect failed.");
|
|
3947
3947
|
this.isFirstConnect ? this.emit("onJoinChannelResult", e) : this.emit("onConnectFail", e);
|
|
3948
3948
|
}
|
|
3949
3949
|
onAuthInvalid() {
|
|
3950
|
-
|
|
3950
|
+
O.warn(`[${st.logName}] onAuthInvalid`), this.isFirstConnect && this.emit("onAuthInvalid");
|
|
3951
3951
|
}
|
|
3952
3952
|
onNetworkError() {
|
|
3953
|
-
|
|
3954
|
-
const e = new
|
|
3953
|
+
O.warn(`[${st.logName}] onNetworkError`);
|
|
3954
|
+
const e = new V(B.ERR_INNER, "Network error, signaling connect failed.");
|
|
3955
3955
|
this.emit("onNetworkError", e);
|
|
3956
3956
|
}
|
|
3957
3957
|
onClose(e) {
|
|
3958
|
-
|
|
3958
|
+
O.info(`[${st.logName}] onClose`, e), this.stopKeepAlive();
|
|
3959
3959
|
}
|
|
3960
3960
|
onKeepAliveRsp() {
|
|
3961
3961
|
this.emit("onKeepAliveRsp"), this.checkAlive();
|
|
@@ -3964,15 +3964,15 @@ const st = class st extends He {
|
|
|
3964
3964
|
this.emit("onReconnectStart");
|
|
3965
3965
|
}
|
|
3966
3966
|
onReconnectFail() {
|
|
3967
|
-
this.emit("onReconnectFail", new
|
|
3967
|
+
this.emit("onReconnectFail", new V(B.ERR_INNER, "signaling reconnect failed."));
|
|
3968
3968
|
}
|
|
3969
3969
|
checkAlive() {
|
|
3970
3970
|
window.clearTimeout(this.aliveChecker), this.aliveChecker = window.setTimeout(() => {
|
|
3971
|
-
|
|
3971
|
+
O.info(`[${st.logName}] not alive, reconnect`), this.stopKeepAlive(), this.emit("onReconnectStart"), this.wsClient.reconnect();
|
|
3972
3972
|
}, 3e4);
|
|
3973
3973
|
}
|
|
3974
3974
|
onRecvMessage(e) {
|
|
3975
|
-
switch (e.msgtype !== Ne.KEEPALIVE &&
|
|
3975
|
+
switch (e.msgtype !== Ne.KEEPALIVE && O.info(`[${st.logName}] recv msg: ${e.msgtype}`), e.msgtype) {
|
|
3976
3976
|
case Ne.JOINCHANNEL:
|
|
3977
3977
|
this.onJoinResult(e);
|
|
3978
3978
|
break;
|
|
@@ -4035,7 +4035,7 @@ const st = class st extends He {
|
|
|
4035
4035
|
if (e.code === 200)
|
|
4036
4036
|
this.sendPkgCache(), this.startKeepAlive(), this.emit("onReconnectSuccess", e.data.users);
|
|
4037
4037
|
else {
|
|
4038
|
-
const t = new
|
|
4038
|
+
const t = new V(B.ERR_INNER, `reconnect failed, code: ${e.code};description: ${e.description}`);
|
|
4039
4039
|
e.code === 403 && (t.code = 403), this.emit("onReconnectFail", t), this.close();
|
|
4040
4040
|
}
|
|
4041
4041
|
}
|
|
@@ -4078,7 +4078,7 @@ const T = (r, a) => (e, t, i) => {
|
|
|
4078
4078
|
h = r(n);
|
|
4079
4079
|
} catch (b) {
|
|
4080
4080
|
}
|
|
4081
|
-
|
|
4081
|
+
O.interface(o, t, ...h);
|
|
4082
4082
|
const l = s.apply(this, n);
|
|
4083
4083
|
return Promise.resolve(l).then((b) => b).catch((b) => b).then((b) => {
|
|
4084
4084
|
var m;
|
|
@@ -4100,7 +4100,7 @@ const T = (r, a) => (e, t, i) => {
|
|
|
4100
4100
|
} catch (S) {
|
|
4101
4101
|
}
|
|
4102
4102
|
}
|
|
4103
|
-
|
|
4103
|
+
O.interfaceResult(o, t, !(f && p), Date.now() - c + "ms", u);
|
|
4104
4104
|
}
|
|
4105
4105
|
}), l;
|
|
4106
4106
|
}, i;
|
|
@@ -4130,7 +4130,7 @@ const Ii = (qe = class extends He {
|
|
|
4130
4130
|
this.reconnectData = e, (t = this.messageCenter) == null || t.updateReconnectData(this.reconnectData);
|
|
4131
4131
|
}
|
|
4132
4132
|
reset() {
|
|
4133
|
-
|
|
4133
|
+
O.info("[roomsig] reset"), this.messageCenter && (this.messageCenter.close(), this.messageCenter = void 0), this.authInfo = void 0;
|
|
4134
4134
|
}
|
|
4135
4135
|
join(e, t, i, s) {
|
|
4136
4136
|
return I(this, null, function* () {
|
|
@@ -4138,40 +4138,40 @@ const Ii = (qe = class extends He {
|
|
|
4138
4138
|
const c = {};
|
|
4139
4139
|
this.authInfo = e, this.userName = t, this.messageCenter = new Sr(e, t, this.channelProfile, this.clientRole, this.slsReporter, i), this.initMessageCenter(), this.messageCenter.once("onJoinChannelResult", (l) => {
|
|
4140
4140
|
var d, b, u;
|
|
4141
|
-
if (
|
|
4141
|
+
if (O.info(`[${qe.logName}]`, "join result: ", l), c.taskretrynum = ((d = this.messageCenter) == null ? void 0 : d.retryCount) || 0, l.code == 200) {
|
|
4142
4142
|
(b = this.messageCenter) == null || b.sendPkgCache(), (u = this.messageCenter) == null || u.startKeepAlive();
|
|
4143
4143
|
let f = l.data;
|
|
4144
4144
|
f.tid = l.tid, f.users = l.data.users, f.timestamp = l.timestamp, c.est && (c.joinconnecttc = Date.now() - c.est), this.slsReporter.reportJoinConnection(c), n(f);
|
|
4145
4145
|
} else
|
|
4146
4146
|
this.reset(), o(this.handleSignalError(l.code, l.reason, B.ERR_JOIN_CHANNEL_FAILED));
|
|
4147
4147
|
}), this.messageCenter.once("onAuthInvalid", () => {
|
|
4148
|
-
this.reset(), o(new
|
|
4149
|
-
}),
|
|
4148
|
+
this.reset(), o(new V(B.ERR_JOIN_BAD_TOKEN, "join failed because authentication failed"));
|
|
4149
|
+
}), O.info(`[${qe.logName}]`, "start ws connecting roomserver and auto join when connected");
|
|
4150
4150
|
const h = { appid: this.authInfo.appId, callid: this.authInfo.sessionId, channelid: this.authInfo.channelId, userid: this.authInfo.userId, nonce: this.authInfo.nonce || "", timestamp: this.authInfo.timestamp, token: this.authInfo.token, authtype: "app", tid: dt() };
|
|
4151
4151
|
e.role && (h.tokenrole = e.role), c.est = Date.now(), this.messageCenter.start(this.roomServerUri + "?" + it.queryingParam(h), s);
|
|
4152
4152
|
});
|
|
4153
4153
|
});
|
|
4154
4154
|
}
|
|
4155
4155
|
leave() {
|
|
4156
|
-
return
|
|
4156
|
+
return O.info("[roomsig] leave .."), new Promise((e, t) => {
|
|
4157
4157
|
this.messageCenter ? (this.messageCenter.on("onLeaveResult", (i, s) => {
|
|
4158
|
-
|
|
4159
|
-
}),
|
|
4158
|
+
O.info(`[${qe.logName}]`, "recv leave response " + i), i === 200 ? (this.updateReconnectData(), this.reset(), e({ tid: s })) : t(this.handleSignalError(i, "leave error"));
|
|
4159
|
+
}), O.info(`[${qe.logName}]`, "send leave request"), this.messageCenter.leave()) : (O.info(`[${qe.logName}]`, "no message center, ok to leave"), e({ tid: "" }));
|
|
4160
4160
|
});
|
|
4161
4161
|
}
|
|
4162
4162
|
publish(e) {
|
|
4163
4163
|
return new Promise((t, i) => {
|
|
4164
4164
|
var s;
|
|
4165
4165
|
this.messageCenter ? (this.messageCenter.once("onPublishResult", (n, o, c) => {
|
|
4166
|
-
|
|
4167
|
-
}), this.authInfo && (e.sessionid = (s = this.authInfo.sessionId) != null ? s : ""), e.callid || (e.callid = dt()),
|
|
4166
|
+
O.info(`[${qe.logName}]`, "recv pubish response " + n), n === 200 ? (this.updateReconnectData(bt(J({}, this.reconnectData), { publish: { users: [e] } })), t({ tid: o })) : i(this.handleSignalError(n, `publish error, ${c}`));
|
|
4167
|
+
}), this.authInfo && (e.sessionid = (s = this.authInfo.sessionId) != null ? s : ""), e.callid || (e.callid = dt()), O.info(`[${qe.logName}]`, "assign callid " + e.callid + " and send publish request"), this.messageCenter.publish(e)) : i(this.handleSignalError(-1, "publish error, no message center"));
|
|
4168
4168
|
});
|
|
4169
4169
|
}
|
|
4170
4170
|
roleUpdate(e) {
|
|
4171
4171
|
return new Promise((t, i) => {
|
|
4172
4172
|
this.messageCenter ? (this.messageCenter.on("onRoleUpdateResult", (s, n, o) => {
|
|
4173
4173
|
var c, h;
|
|
4174
|
-
|
|
4174
|
+
O.info(`[${qe.logName}]`, "recv role update response " + s), s === 200 ? ((h = (c = this.reconnectData) == null ? void 0 : c.role) != null && h.clientrole && (this.reconnectData.role.clientrole = e, this.updateReconnectData(this.reconnectData)), t({ tid: n })) : i(this.handleSignalError(s, `role update error, ${o}`));
|
|
4175
4175
|
}), this.messageCenter.roleUpdate(e)) : i(this.handleSignalError(-1, "role update error, no message center"));
|
|
4176
4176
|
});
|
|
4177
4177
|
}
|
|
@@ -4179,22 +4179,22 @@ const Ii = (qe = class extends He {
|
|
|
4179
4179
|
this.channelProfile = e;
|
|
4180
4180
|
}
|
|
4181
4181
|
refreshUrl(e) {
|
|
4182
|
-
return
|
|
4182
|
+
return O.info(`[${qe.logName}]`, "refreshUrl .."), new Promise((t, i) => {
|
|
4183
4183
|
this.messageCenter ? (this.messageCenter.on("onRefreshUrlResult", (s) => {
|
|
4184
4184
|
const { code: n, description: o, data: c = {} } = s || {};
|
|
4185
|
-
|
|
4186
|
-
}),
|
|
4185
|
+
O.info("recv refresh url response " + n), n === 200 ? t(c) : i(this.handleSignalError(n, `refresh url error, ${o}`));
|
|
4186
|
+
}), O.info("send refresh url request"), this.messageCenter.refreshUrl(e)) : i(this.handleSignalError(-1, "refresh url error, no message center"));
|
|
4187
4187
|
});
|
|
4188
4188
|
}
|
|
4189
4189
|
reportStatus(e) {
|
|
4190
|
-
return
|
|
4190
|
+
return O.info(`[${qe.logName}]`, "reportStatus " + e), new Promise((t, i) => {
|
|
4191
4191
|
this.messageCenter ? (this.messageCenter.once("onStatusReport", (s, n) => {
|
|
4192
|
-
s === 200 ? t() : i(new
|
|
4193
|
-
}), this.messageCenter.reportStatus(e)) : i(new
|
|
4192
|
+
s === 200 ? t() : i(new V(s, n));
|
|
4193
|
+
}), this.messageCenter.reportStatus(e)) : i(new V(-1, "No messageCenter"));
|
|
4194
4194
|
});
|
|
4195
4195
|
}
|
|
4196
4196
|
handleSignalError(e, t, i = B.ERR_INNER) {
|
|
4197
|
-
return new
|
|
4197
|
+
return new V(i, `signal error: code - ${e}; description - ${t}`);
|
|
4198
4198
|
}
|
|
4199
4199
|
refreshAuthInfo(e) {
|
|
4200
4200
|
return I(this, null, function* () {
|
|
@@ -4257,11 +4257,11 @@ const ec = 6e5, li = class li extends He {
|
|
|
4257
4257
|
throw new Error();
|
|
4258
4258
|
{
|
|
4259
4259
|
const m = (f = u.data) == null ? void 0 : f.oss, S = (p = u.data) == null ? void 0 : p.sls;
|
|
4260
|
-
this.expiration = m.expiration || S.expiration, this.emit("onTokenUpdate", m, S),
|
|
4260
|
+
this.expiration = m.expiration || S.expiration, this.emit("onTokenUpdate", m, S), O.event(`[${li.logName}]`, "getToken", m, S);
|
|
4261
4261
|
}
|
|
4262
4262
|
this.slsReporter.reportSTSResult(200, b);
|
|
4263
4263
|
}).catch((u) => {
|
|
4264
|
-
this.slsReporter.reportSTSResult(-1, b),
|
|
4264
|
+
this.slsReporter.reportSTSResult(-1, b), O.error(`[${li.logName}]`, "getToken", u.message);
|
|
4265
4265
|
});
|
|
4266
4266
|
}));
|
|
4267
4267
|
this.slsReporter = e, this.env = t;
|
|
@@ -4297,11 +4297,11 @@ class Lr extends He {
|
|
|
4297
4297
|
}
|
|
4298
4298
|
reset() {
|
|
4299
4299
|
var e;
|
|
4300
|
-
|
|
4300
|
+
O.info("[signalingmanager] reset"), (e = this.signaling) == null || e.reset(), this.stsManager.clear(), this.signaling = void 0, this.authInfo = void 0;
|
|
4301
4301
|
}
|
|
4302
4302
|
join(e, t = e.userId, i, s, n) {
|
|
4303
4303
|
return this.maxConnectRetryCount = i, this.userName = t, new Promise((o, c) => {
|
|
4304
|
-
this.signaling ? c(new
|
|
4304
|
+
this.signaling ? c(new V(B.ERR_JOIN_ALREADY_JOINED, "already joined")) : (O.info("[signalingmanager] create signaling"), this.signaling = new Qo(this.channelProfile, this.clientRole, this.slsReporter, this.env), this.initSignaling(), s && (s.rs = Date.now()), this.signaling.join(e, t, i, n).then((h) => {
|
|
4305
4305
|
this.authInfo = e, s && (s.re = Date.now()), o(h);
|
|
4306
4306
|
}).catch((h) => {
|
|
4307
4307
|
this.reset(), c(h);
|
|
@@ -4328,7 +4328,7 @@ class Lr extends He {
|
|
|
4328
4328
|
t(n);
|
|
4329
4329
|
}).catch((n) => {
|
|
4330
4330
|
i(n);
|
|
4331
|
-
})) : i(new
|
|
4331
|
+
})) : i(new V(B.ERR_SDK_PUBLISH_NOT_JOIN_CHANNEL, "no signaling"));
|
|
4332
4332
|
});
|
|
4333
4333
|
}
|
|
4334
4334
|
reportStatus(e) {
|
|
@@ -4337,7 +4337,7 @@ class Lr extends He {
|
|
|
4337
4337
|
t();
|
|
4338
4338
|
}).catch((s) => {
|
|
4339
4339
|
i(s);
|
|
4340
|
-
}) : i(new
|
|
4340
|
+
}) : i(new V(-1, "no signaling"));
|
|
4341
4341
|
});
|
|
4342
4342
|
}
|
|
4343
4343
|
setClientRole(e) {
|
|
@@ -4358,7 +4358,7 @@ class Lr extends He {
|
|
|
4358
4358
|
this.signaling ? this.signaling.setChannelProfile(e) : this.channelProfile = e;
|
|
4359
4359
|
}
|
|
4360
4360
|
refreshUrl(e) {
|
|
4361
|
-
return this.signaling ? this.signaling.refreshUrl(e) : Promise.reject(new
|
|
4361
|
+
return this.signaling ? this.signaling.refreshUrl(e) : Promise.reject(new V(B.ERR_SDK_INVALID_STATE, "should join first"));
|
|
4362
4362
|
}
|
|
4363
4363
|
refreshAuthInfo(e) {
|
|
4364
4364
|
return I(this, null, function* () {
|
|
@@ -4536,7 +4536,7 @@ class un {
|
|
|
4536
4536
|
return { micOpen: !!(1 & e), micInterrupted: !!(2 & e), cameraOpen: !!(4 & e), screenShare: !!(128 & e), audioDisable: !!(8 & e), videoDisable: !!(16 & e), screenDisable: !!(256 & e), backgroundMode: !!(32 & e), accompanyPlaying: !!(64 & e) };
|
|
4537
4537
|
}
|
|
4538
4538
|
}
|
|
4539
|
-
const pn = "customVideoProfile", mn = "customScreenProfile", vr = { width: 1280, height: 720, frameRate: 30, maxBitrate: 2e3 },
|
|
4539
|
+
const pn = "customVideoProfile", mn = "customScreenProfile", vr = { width: 1280, height: 720, frameRate: 30, maxBitrate: 2e3 }, Va = { width: 1920, height: 1080, frameRate: 30, maxBitrate: 2600 };
|
|
4540
4540
|
var oi = ((r) => (r[r.ERROR_DEVICE_UNKNOWNERROR = 1e4] = "ERROR_DEVICE_UNKNOWNERROR", r[r.ERROR_DEVICE_AUDIODEVICE_NOTFOUND = 10001] = "ERROR_DEVICE_AUDIODEVICE_NOTFOUND", r[r.ERROR_DEVICE_AUDIODEVICE_NOTALLOWED = 10002] = "ERROR_DEVICE_AUDIODEVICE_NOTALLOWED", r[r.ERROR_DEVICE_AUDIODEVICE_NOTREADABLE = 10003] = "ERROR_DEVICE_AUDIODEVICE_NOTREADABLE", r[r.ERROR_DEVICE_VIDEODEVICE_NOTFOUND = 10004] = "ERROR_DEVICE_VIDEODEVICE_NOTFOUND", r[r.ERROR_DEVICE_VIDEODEVICE_NOTALLOWED = 10005] = "ERROR_DEVICE_VIDEODEVICE_NOTALLOWED", r[r.ERROR_DEVICE_VIDEODEVICE_NOTREADABLE = 10006] = "ERROR_DEVICE_VIDEODEVICE_NOTREADABLE", r[r.ERROR_SCREENSHARE_NOTSUPPORT = 10010] = "ERROR_SCREENSHARE_NOTSUPPORT", r[r.ERROR_SCREENSHARE_NOTALLOWED = 10011] = "ERROR_SCREENSHARE_NOTALLOWED", r[r.ERROR_SCREENSHARE_ENDED = 10012] = "ERROR_SCREENSHARE_ENDED", r[r.ERROR_SCREENSHARE_NOPERMISSION = 10013] = "ERROR_SCREENSHARE_NOPERMISSION", r[r.ERROR_SCREENSHARE_SAFARI_INVALIDACCESS = 10014] = "ERROR_SCREENSHARE_SAFARI_INVALIDACCESS", r[r.ERROR_SCREENSHARE_UNKNOWNERRO = 10019] = "ERROR_SCREENSHARE_UNKNOWNERRO", r[r.ERROR_DEVICE_NOTSUPPORT = 2e4] = "ERROR_DEVICE_NOTSUPPORT", r))(oi || {});
|
|
4541
4541
|
const sc = { 1e4: xe.AliEngineLocalDeviceExceptionTypeUnknown, 2e4: xe.AliEngineLocalDeviceExceptionTypeUnknown, 10001: xe.AliEngineLocalDeviceExceptionTypeMicNotAvailable, 10002: xe.AliEngineLocalDeviceExceptionTypeMicAuthFail, 10003: xe.AliEngineLocalDeviceExceptionTypeMicOpenFail, 10005: xe.AliEngineLocalDeviceExceptionTypeCameraAuthFail, 10004: xe.AliEngineLocalDeviceExceptionTypeVideoDeviceException, 10006: xe.AliEngineLocalDeviceExceptionTypeCameraOpenFail, 10010: xe.AliEngineLocalDeviceExceptionTypeDisplayException, 10011: xe.AliEngineLocalDeviceExceptionTypeDisplayException, 10012: xe.AliEngineLocalDeviceExceptionTypeDisplayException, 10013: xe.AliEngineLocalDeviceExceptionTypeDisplayException, 10014: xe.AliEngineLocalDeviceExceptionTypeDisplayException, 10019: xe.AliEngineLocalDeviceExceptionTypeDisplayException };
|
|
4542
4542
|
var at = ((r) => (r.CREATE_ENGINE = "create_engine", r.JOIN = "join", r.WANT_INSERT_PUB_TASK = "wantInsertPubTask", r.INSERT_PUB_TASK = "InsertPubTask", r.HANDLE_PUB_TASK = "HandlePubTask", r.RECV_NOTIFY_PUBLISH = "RecvNotifyPublish", r.INSERT_SUB_TASK = "InsertSubTask", r.HANDLE_SUB_TASK = "HandleSubTask", r.FIRST_REMOTE = "first_remote", r))(at || {}), ht = ((r) => (r.START = "start", r.SEND_SIG = "send_sig", r.RECV_RST = "recv_rst", r.END = "end", r.RECEIVED = "received", r.DECODED = "decoded", r.PLAYED = "played", r))(ht || {});
|
|
@@ -4549,11 +4549,11 @@ function Ua(r) {
|
|
|
4549
4549
|
if (e) {
|
|
4550
4550
|
if (e.nodeName.toLocaleLowerCase() === "video")
|
|
4551
4551
|
return e.setAttribute("playsinline", ""), e;
|
|
4552
|
-
throw new
|
|
4552
|
+
throw new V(B.ERR_INVALID_ARGUMENTS, "element should be HtmlVideoElement");
|
|
4553
4553
|
}
|
|
4554
|
-
throw new
|
|
4554
|
+
throw new V(B.ERR_INVALID_ARGUMENTS, "element not founded");
|
|
4555
4555
|
}
|
|
4556
|
-
throw new
|
|
4556
|
+
throw new V(B.ERR_INVALID_ARGUMENTS, "element id should be string");
|
|
4557
4557
|
}
|
|
4558
4558
|
function yr(r) {
|
|
4559
4559
|
var e;
|
|
@@ -4642,7 +4642,7 @@ const gn = (r, a, e = !1) => {
|
|
|
4642
4642
|
});
|
|
4643
4643
|
};
|
|
4644
4644
|
var fn = ((r) => (r[r.AliEngineDataMsgNone = 0] = "AliEngineDataMsgNone", r[r.AliEngineDataMsgMusicProgress = 1] = "AliEngineDataMsgMusicProgress", r[r.AliEngineDataMsgCustom = 2] = "AliEngineDataMsgCustom", r))(fn || {});
|
|
4645
|
-
class
|
|
4645
|
+
class Oi {
|
|
4646
4646
|
constructor(a, e, t, i = 0) {
|
|
4647
4647
|
g(this, "msgType");
|
|
4648
4648
|
g(this, "msgId");
|
|
@@ -4656,14 +4656,14 @@ class Vi {
|
|
|
4656
4656
|
}
|
|
4657
4657
|
static parse(a) {
|
|
4658
4658
|
const e = new DataView(a), t = e.getUint8(0), i = e.getUint8(1) >> 4, s = 15 & e.getUint8(1), n = e.getUint16(2);
|
|
4659
|
-
return new
|
|
4659
|
+
return new Oi(s, n, t, i);
|
|
4660
4660
|
}
|
|
4661
4661
|
}
|
|
4662
4662
|
class _i {
|
|
4663
4663
|
constructor(a, e, t) {
|
|
4664
4664
|
g(this, "_byteArray");
|
|
4665
4665
|
if (this._byteArray = new Uint8Array(0), a !== void 0 && e !== void 0 && t !== void 0) {
|
|
4666
|
-
const i = new
|
|
4666
|
+
const i = new Oi(a, e, t).build();
|
|
4667
4667
|
this._byteArray = new Uint8Array(i.byteLength + this._byteArray.byteLength), this._byteArray.set(i, 0);
|
|
4668
4668
|
}
|
|
4669
4669
|
}
|
|
@@ -4736,7 +4736,7 @@ class gi {
|
|
|
4736
4736
|
return new gi(l, t, n, i, s, o, c, h);
|
|
4737
4737
|
}
|
|
4738
4738
|
}
|
|
4739
|
-
class
|
|
4739
|
+
class Vi {
|
|
4740
4740
|
constructor(a, e) {
|
|
4741
4741
|
g(this, "_body");
|
|
4742
4742
|
g(this, "_header", new gi());
|
|
@@ -4760,7 +4760,7 @@ class Oi {
|
|
|
4760
4760
|
static parse(a) {
|
|
4761
4761
|
const e = a.slice(0, 4), t = gi.parse(e);
|
|
4762
4762
|
let i = new ArrayBuffer(0);
|
|
4763
|
-
return a.byteLength - 4 >= t.payloadLength && (i = a.slice(4, 4 + t.payloadLength)), new
|
|
4763
|
+
return a.byteLength - 4 >= t.payloadLength && (i = a.slice(4, 4 + t.payloadLength)), new Vi(t, i);
|
|
4764
4764
|
}
|
|
4765
4765
|
}
|
|
4766
4766
|
const or = (r) => {
|
|
@@ -4788,7 +4788,7 @@ class Kt {
|
|
|
4788
4788
|
static parse(a) {
|
|
4789
4789
|
if (!a || a.byteLength < 4)
|
|
4790
4790
|
return;
|
|
4791
|
-
|
|
4791
|
+
Oi.parse(a.slice(0, 4));
|
|
4792
4792
|
const e = _i.parse(a.slice(4))[30];
|
|
4793
4793
|
if (!e)
|
|
4794
4794
|
return;
|
|
@@ -4973,7 +4973,7 @@ const Te = (ft = class extends dn {
|
|
|
4973
4973
|
this.streamManager.setCameraVideoConstraints({ facingMode: "user" });
|
|
4974
4974
|
else {
|
|
4975
4975
|
if (e !== mi.CAMERA_REAR)
|
|
4976
|
-
throw new
|
|
4976
|
+
throw new V(B.ERR_CAMERA_OPEN_FAIL, `camera direction set to ${e} failed`);
|
|
4977
4977
|
this.streamManager.setCameraVideoConstraints({ facingMode: "environment" });
|
|
4978
4978
|
}
|
|
4979
4979
|
}
|
|
@@ -5027,7 +5027,7 @@ const Te = (ft = class extends dn {
|
|
|
5027
5027
|
} catch (n) {
|
|
5028
5028
|
const o = n.errorCode;
|
|
5029
5029
|
let c = B.ERR_CAMERA_OPEN_FAIL;
|
|
5030
|
-
throw o === oi.ERROR_DEVICE_AUDIODEVICE_NOTFOUND ? c = B.ERR_CAMERA_NOT_AVAILABLE : o === oi.ERROR_DEVICE_VIDEODEVICE_NOTALLOWED && (c = B.ERR_CAMERA_AUTH_FAIL), new
|
|
5030
|
+
throw o === oi.ERROR_DEVICE_AUDIODEVICE_NOTFOUND ? c = B.ERR_CAMERA_NOT_AVAILABLE : o === oi.ERROR_DEVICE_VIDEODEVICE_NOTALLOWED && (c = B.ERR_CAMERA_AUTH_FAIL), new V(c, `camera open fail: ${n.message}`);
|
|
5031
5031
|
}
|
|
5032
5032
|
});
|
|
5033
5033
|
}
|
|
@@ -5040,14 +5040,14 @@ const Te = (ft = class extends dn {
|
|
|
5040
5040
|
} catch (s) {
|
|
5041
5041
|
const n = s.errorCode;
|
|
5042
5042
|
let o = B.ERR_MIC_OPEN_FAIL;
|
|
5043
|
-
throw n === oi.ERROR_DEVICE_AUDIODEVICE_NOTFOUND ? o = B.ERR_MIC_NOT_AVAILABLE : n === oi.ERROR_DEVICE_AUDIODEVICE_NOTALLOWED && (o = B.ERR_MIC_AUTH_FAIL), new
|
|
5043
|
+
throw n === oi.ERROR_DEVICE_AUDIODEVICE_NOTFOUND ? o = B.ERR_MIC_NOT_AVAILABLE : n === oi.ERROR_DEVICE_AUDIODEVICE_NOTALLOWED && (o = B.ERR_MIC_AUTH_FAIL), new V(o, `mic open fail: ${s.message}`);
|
|
5044
5044
|
}
|
|
5045
5045
|
});
|
|
5046
5046
|
}
|
|
5047
5047
|
setViewConfig(e, t) {
|
|
5048
5048
|
if (e) {
|
|
5049
5049
|
if (![oe.AliRtcVideoTrackCamera, oe.AliRtcVideoTrackScreen].includes(t))
|
|
5050
|
-
throw new
|
|
5050
|
+
throw new V(B.ERR_INVALID_ARGUMENTS, "set view config invalid track", { track: t });
|
|
5051
5051
|
e.forEach((i) => {
|
|
5052
5052
|
this.setPreviewElement({ videoElement: i, screen: t === oe.AliRtcVideoTrackScreen });
|
|
5053
5053
|
});
|
|
@@ -5080,11 +5080,11 @@ const Te = (ft = class extends dn {
|
|
|
5080
5080
|
try {
|
|
5081
5081
|
let s = i ? this.streamManager.screenStreamInfo.previewStream : this.streamManager.cameraStreamInfo.previewStream;
|
|
5082
5082
|
if (!t)
|
|
5083
|
-
throw new
|
|
5084
|
-
return s ? (gn(t, s.mediaStream), this.setPreviewElement(e), s.mediaStream) : void
|
|
5083
|
+
throw new V(B.ERR_INVALID_ARGUMENTS, "no video element found", { videoElement: t });
|
|
5084
|
+
return s ? (gn(t, s.mediaStream), this.setPreviewElement(e), s.mediaStream) : void O.info(`[${ft.logName}]`, "preview no stream founded");
|
|
5085
5085
|
} catch (s) {
|
|
5086
5086
|
const n = B.ERR_INNER;
|
|
5087
|
-
throw
|
|
5087
|
+
throw V.fromError(s, n, "preview failed");
|
|
5088
5088
|
}
|
|
5089
5089
|
});
|
|
5090
5090
|
}
|
|
@@ -5188,9 +5188,9 @@ const Te = (ft = class extends dn {
|
|
|
5188
5188
|
this.dataPubState.setState(Q.AliRtcStatePublishing);
|
|
5189
5189
|
try {
|
|
5190
5190
|
const e = yield this.rtsManager.publishAddDataChannel(this.url);
|
|
5191
|
-
e ? (this.updateDataChannel(e), this.dataPubState.setState(Q.AliRtcStatePublished)) : (this.dataPubState.setState(Q.AliRtcStateNoPublish), this.emit("publishDataError", new
|
|
5191
|
+
e ? (this.updateDataChannel(e), this.dataPubState.setState(Q.AliRtcStatePublished)) : (this.dataPubState.setState(Q.AliRtcStateNoPublish), this.emit("publishDataError", new V(B.ERR_INNER, "publishDataError")));
|
|
5192
5192
|
} catch (e) {
|
|
5193
|
-
|
|
5193
|
+
O.error("[LocalUser]", "publishDataChannel error", e), this.dataPubState.setState(Q.AliRtcStateNoPublish);
|
|
5194
5194
|
}
|
|
5195
5195
|
}
|
|
5196
5196
|
});
|
|
@@ -5217,7 +5217,7 @@ const Te = (ft = class extends dn {
|
|
|
5217
5217
|
throw s && this.audioPubState.setState(Q.AliRtcStateNoPublish), n && this.videoPubState.setState(Q.AliRtcStateNoPublish), o && this.videoSmallPubState.setState(Q.AliRtcStateNoPublish), c && this.screenPubState.setState(Q.AliRtcStateNoPublish), l;
|
|
5218
5218
|
}
|
|
5219
5219
|
} else
|
|
5220
|
-
|
|
5220
|
+
O.event(`[${ft.logName}]`, "startPublish no stream founded");
|
|
5221
5221
|
});
|
|
5222
5222
|
}
|
|
5223
5223
|
updateStreams() {
|
|
@@ -5228,7 +5228,7 @@ const Te = (ft = class extends dn {
|
|
|
5228
5228
|
publishUpdate(e) {
|
|
5229
5229
|
return I(this, null, function* () {
|
|
5230
5230
|
var n, o, c, h, l, d;
|
|
5231
|
-
if (
|
|
5231
|
+
if (O.info(`[${ft.logName}]`, "publishUpdate", e || "-", this.shouldPublish), !this.shouldPublish)
|
|
5232
5232
|
return;
|
|
5233
5233
|
if (!this.rtsManager.isConnecting && !this.rtsManager.isConnected)
|
|
5234
5234
|
return void (yield this.startPublish());
|
|
@@ -5268,7 +5268,7 @@ const Te = (ft = class extends dn {
|
|
|
5268
5268
|
return I(this, null, function* () {
|
|
5269
5269
|
var c;
|
|
5270
5270
|
if (!e)
|
|
5271
|
-
throw new
|
|
5271
|
+
throw new V(B.ERR_INNER, "sync publish to room server failed because no publishInfo");
|
|
5272
5272
|
let s = e;
|
|
5273
5273
|
if (this.dc) {
|
|
5274
5274
|
const o = e, { tracks: h } = o, l = xt(o, ["tracks"]);
|
|
@@ -5280,7 +5280,7 @@ const Te = (ft = class extends dn {
|
|
|
5280
5280
|
}
|
|
5281
5281
|
refreshPushStreamUrl() {
|
|
5282
5282
|
return I(this, null, function* () {
|
|
5283
|
-
const e = new
|
|
5283
|
+
const e = new V(B.ERR_INNER, "refresh push stream url error"), t = this.url;
|
|
5284
5284
|
if (!t)
|
|
5285
5285
|
throw e;
|
|
5286
5286
|
const i = yield this.signalingManager.refreshUrl({ pushstreamurl: t });
|
|
@@ -5303,7 +5303,7 @@ const Te = (ft = class extends dn {
|
|
|
5303
5303
|
let d = B.ERR_SDK_PUBLISH_INVAILD;
|
|
5304
5304
|
if (n && (this.audioPubState.setState(Q.AliRtcStateNoPublish), d = B.ERR_SDK_PUBLISH_AUDIO_STREAM_FAILED), o && (this.videoPubState.setState(Q.AliRtcStateNoPublish), d = B.ERR_SDK_PUBLISH_VIDEO_STREAM_FAILED), c && (this.videoSmallPubState.setState(Q.AliRtcStateNoPublish), d = B.ERR_SDK_PUBLISH_DUAL_STREAM_FAILED), h && (this.screenPubState.setState(Q.AliRtcStateNoPublish), d = B.ERR_SDK_PUBLISH_SCEEN_SHARE_FAILED), l.errorCode === 15006 && s < 3)
|
|
5305
5305
|
return this.publishAdd(e, t, i, s + 1);
|
|
5306
|
-
throw
|
|
5306
|
+
throw V.fromError(l, d, "publish add failed");
|
|
5307
5307
|
}
|
|
5308
5308
|
});
|
|
5309
5309
|
}
|
|
@@ -5316,7 +5316,7 @@ const Te = (ft = class extends dn {
|
|
|
5316
5316
|
const n = { type: Et.Replace, userid: this.userId, sessionid: "", pubid: this.publishId, displayname: this.name, subscribe: { signal: "", pullstreamurl: this.url }, callid: this.callId, tracks: this.streamTracks };
|
|
5317
5317
|
return this.reportSelfDeviceStatus(), n;
|
|
5318
5318
|
} catch (i) {
|
|
5319
|
-
throw
|
|
5319
|
+
throw V.fromError(i, B.ERR_INNER, `publish replace failed, vMsid: ${t == null ? void 0 : t.vMsid} aMsid: ${t == null ? void 0 : t.aMsid}`);
|
|
5320
5320
|
}
|
|
5321
5321
|
});
|
|
5322
5322
|
}
|
|
@@ -5326,13 +5326,13 @@ const Te = (ft = class extends dn {
|
|
|
5326
5326
|
try {
|
|
5327
5327
|
return yield this.rtsManager.publishDelete(this.url, e), this.streamTracks = this.rtsManager.publishingTracks, e.audio && this.audioPubState.setState(Q.AliRtcStateNoPublish), e.video && (e.vMsid === k.VideoSmall ? this.videoSmallPubState.setState(Q.AliRtcStateNoPublish) : this.videoPubState.setState(Q.AliRtcStateNoPublish)), e.screen && this.screenPubState.setState(Q.AliRtcStateNoPublish), t.tracks = this.streamTracks, this.reportSelfDeviceStatus(), t;
|
|
5328
5328
|
} catch (i) {
|
|
5329
|
-
throw
|
|
5329
|
+
throw V.fromError(i, B.ERR_INNER, "publish delete tracks failed");
|
|
5330
5330
|
}
|
|
5331
5331
|
});
|
|
5332
5332
|
}
|
|
5333
5333
|
publishStop() {
|
|
5334
5334
|
return I(this, null, function* () {
|
|
5335
|
-
|
|
5335
|
+
O.info(`[${ft.logName}]`, "publishStop", { url: this.url });
|
|
5336
5336
|
const e = (/* @__PURE__ */ new Date()).getTime();
|
|
5337
5337
|
try {
|
|
5338
5338
|
const t = this.hasAudioTrackInMS, i = this.hasCameraTrackInMS, s = this.hasCameraDualTrackInMS, n = this.hasScreenTrackInMS;
|
|
@@ -5342,7 +5342,7 @@ const Te = (ft = class extends dn {
|
|
|
5342
5342
|
const o = { type: Et.Stop, userid: this.userId, sessionid: "", displayname: this.displayname, callid: this.callId, pubid: this.publishId, subscribe: { signal: "", pullstreamurl: this.url }, tracks: [] };
|
|
5343
5343
|
return this.syncPublishToRoomServer(o, {}, e), o;
|
|
5344
5344
|
} catch (t) {
|
|
5345
|
-
throw
|
|
5345
|
+
throw V.fromError(t, B.ERR_INNER, "publish stop failed");
|
|
5346
5346
|
}
|
|
5347
5347
|
});
|
|
5348
5348
|
}
|
|
@@ -5358,7 +5358,7 @@ const Te = (ft = class extends dn {
|
|
|
5358
5358
|
}
|
|
5359
5359
|
return this.dc && (this.rtsManager.publishStopDataChannel(this.url, this.dc), this.dataPubState.setState(Q.AliRtcStateNoPublish), this.dc = void 0), this.slsReporter.reportUnpublish(this.callId || "", e, 0, ""), t;
|
|
5360
5360
|
} catch (i) {
|
|
5361
|
-
throw
|
|
5361
|
+
throw V.fromError(i, B.ERR_INNER, "unpublish failed");
|
|
5362
5362
|
}
|
|
5363
5363
|
});
|
|
5364
5364
|
}
|
|
@@ -5469,9 +5469,9 @@ const Te = (ft = class extends dn {
|
|
|
5469
5469
|
sendDataChannelMessage(e) {
|
|
5470
5470
|
var i;
|
|
5471
5471
|
if (!((i = this.parameter.data) != null && i.enablePubDataChannel))
|
|
5472
|
-
throw new
|
|
5472
|
+
throw new V(B.ERR_INNER, "data channel publish is not enabled");
|
|
5473
5473
|
if (!this.dc)
|
|
5474
|
-
throw new
|
|
5474
|
+
throw new V(B.ERR_INNER, "data channel is not ready");
|
|
5475
5475
|
const t = function(s, n) {
|
|
5476
5476
|
let o = 0;
|
|
5477
5477
|
const c = [];
|
|
@@ -5482,7 +5482,7 @@ const Te = (ft = class extends dn {
|
|
|
5482
5482
|
return c;
|
|
5483
5483
|
}(e.toBuffer(), 1156);
|
|
5484
5484
|
t.forEach((s, n) => {
|
|
5485
|
-
const o = new
|
|
5485
|
+
const o = new Vi(new gi(s.byteLength, n === t.length - 1, n === 0 ? 1 : 0), s);
|
|
5486
5486
|
this.dc.send(o.toGRTNBuffer());
|
|
5487
5487
|
});
|
|
5488
5488
|
}
|
|
@@ -5785,7 +5785,7 @@ const Ue = (Xe = class extends dn {
|
|
|
5785
5785
|
});
|
|
5786
5786
|
g(this, "onDataChannelMessage", (e) => {
|
|
5787
5787
|
var s;
|
|
5788
|
-
const t =
|
|
5788
|
+
const t = Vi.parse(e.slice(4));
|
|
5789
5789
|
let i;
|
|
5790
5790
|
if (t.body) {
|
|
5791
5791
|
if (!t.isFin)
|
|
@@ -5805,12 +5805,12 @@ const Ue = (Xe = class extends dn {
|
|
|
5805
5805
|
this.dcMsgWaitingPieces = [], i || (i = Kt.parse(t.body));
|
|
5806
5806
|
} else
|
|
5807
5807
|
i = Kt.parse(t.body);
|
|
5808
|
-
i ||
|
|
5808
|
+
i || O.event(`[${Xe.logName}]`, `parse data channel message fail, piece count: ${this.dcMsgWaitingPieces.length + 1}`);
|
|
5809
5809
|
}
|
|
5810
|
-
i && (
|
|
5810
|
+
i && (O.event(`[${Xe.logName}]`, `receive dc message, length(${(s = i.data) == null ? void 0 : s.byteLength})`), this.emit("remoteDataChannelMessage", this.uid, i));
|
|
5811
5811
|
});
|
|
5812
5812
|
g(this, "onDataChannelError", (e) => {
|
|
5813
|
-
this.emit("occurError",
|
|
5813
|
+
this.emit("occurError", V.fromError(e, B.ERR_SDK_SUBSCRIBE_DATA_ERROR));
|
|
5814
5814
|
});
|
|
5815
5815
|
g(this, "dataChannelConnected", (e) => {
|
|
5816
5816
|
e && (this.dc = e, this.dc.datachannel && (this.dc.datachannel.binaryType = "arraybuffer"), this.dc.off("message", this.onDataChannelMessage), this.dc.off("error", this.onDataChannelError), this.dc.on("message", this.onDataChannelMessage), this.dc.on("error", this.onDataChannelError));
|
|
@@ -5950,7 +5950,7 @@ const Ue = (Xe = class extends dn {
|
|
|
5950
5950
|
}
|
|
5951
5951
|
setViewConfig(e, t) {
|
|
5952
5952
|
if (t !== oe.AliRtcVideoTrackScreen && t !== oe.AliRtcVideoTrackCamera)
|
|
5953
|
-
throw new
|
|
5953
|
+
throw new V(B.ERR_INVALID_ARGUMENTS, "track is not AliRtcVideoTrackScreen or AliRtcVideoTrackCamera");
|
|
5954
5954
|
e ? yr(e).forEach((i) => {
|
|
5955
5955
|
i.setAttribute("playsinline", ""), Se.BrowserUtil.isMicroMessenger && (i.setAttribute("x5-video-player-type", "h5-page"), i.setAttribute("x5-playsinline", ""), Se.SystenUtil.isAndroid || Se.SystenUtil.isIos && i.setAttribute("x-webkit-airplay", "allow")), t === oe.AliRtcVideoTrackScreen ? this.viewMap.screenViews.push(i) : this.viewMap.cameraViews.push(i), this.play(i, t === oe.AliRtcVideoTrackScreen);
|
|
5956
5956
|
}) : (this.stopPlayAll(t === oe.AliRtcVideoTrackScreen), t === oe.AliRtcVideoTrackScreen ? this.viewMap.screenViews = [] : this.viewMap.cameraViews = []);
|
|
@@ -6006,7 +6006,7 @@ const Ue = (Xe = class extends dn {
|
|
|
6006
6006
|
e.audio && this.audioSubState.setState(pe.AliRtcStateNoSubscribe), e.video && this.videoSubState.setState(pe.AliRtcStateNoSubscribe), e.screen && this.screenSubState.setState(pe.AliRtcStateNoSubscribe), d && (d.message = `user(${this.uid}) subscribe error, ${(d == null ? void 0 : d.message) || ""}`);
|
|
6007
6007
|
let u = B.ERR_INNER;
|
|
6008
6008
|
e.audio && (u = B.ERR_SDK_SUBSCRIBE_AUDIO_STREAM_FAILED), e.video && (u = e.vMsid === k.VideoSmall ? B.ERR_SDK_SUBSCRIBE_DUAL_STREAM_FAILED : B.ERR_SDK_SUBSCRIBE_VIDEO_STREAM_FAILED), e.screen && (u = B.ERR_SDK_SUBSCRIBE_SCREEN_SHARE_FAILED), this.slsReporter.reportSubscribe(((l = this.localUser) == null ? void 0 : l.callId) || "", this.callId, !!e.video && e.vMsid === k.VideoLarge, !!e.video && e.vMsid === k.VideoSmall, !!e.screen, !!e.audio, u, "", b, { pctid: this.rtsManager.pcTraceId, subtid: "", ajsub: t === fe.Join ? 1 : 0, url: this.streamUrl, est: s });
|
|
6009
|
-
const f =
|
|
6009
|
+
const f = V.fromError(d, u);
|
|
6010
6010
|
throw this.emit("remoteSubscribeError", f), f;
|
|
6011
6011
|
}
|
|
6012
6012
|
});
|
|
@@ -6025,7 +6025,7 @@ const Ue = (Xe = class extends dn {
|
|
|
6025
6025
|
const { callId: n, remoteCallid: o } = this, c = { callid: n, remoteCallid: o, remoteStream: i };
|
|
6026
6026
|
return e.audio && (this.audioLevelMonitor.stop(), this.stopPlayAudio(), this.audioTrack = void 0), this.streamInfo.updateRemoteTrackSubState({ audio: e.audio !== !0 && void 0, video: e.video !== !0 && void 0, screen: e.screen !== !0 && void 0, vMsid: e.vMsid }), c;
|
|
6027
6027
|
} catch (t) {
|
|
6028
|
-
throw
|
|
6028
|
+
throw V.fromError(t, B.ERR_INNER, "subscribe delete failed");
|
|
6029
6029
|
}
|
|
6030
6030
|
});
|
|
6031
6031
|
}
|
|
@@ -6069,7 +6069,7 @@ const Ue = (Xe = class extends dn {
|
|
|
6069
6069
|
return this.callId = "", h;
|
|
6070
6070
|
} catch (h) {
|
|
6071
6071
|
if (((c = (o = (n = (s = h == null ? void 0 : h.extraInfo) == null ? void 0 : s.parsedData) == null ? void 0 : n.streams) == null ? void 0 : o[0]) == null ? void 0 : c.res_code) !== 404)
|
|
6072
|
-
throw
|
|
6072
|
+
throw V.fromError(h, B.ERR_INNER, "subscribe stop failed");
|
|
6073
6073
|
}
|
|
6074
6074
|
});
|
|
6075
6075
|
}
|
|
@@ -6080,7 +6080,7 @@ const Ue = (Xe = class extends dn {
|
|
|
6080
6080
|
if (e.mediaStream) {
|
|
6081
6081
|
n = document.createElement("video");
|
|
6082
6082
|
const o = () => {
|
|
6083
|
-
|
|
6083
|
+
O.event(`uid: ${this.userId} new mediaStream canplay`), n && n.removeEventListener("canplaythrough", o, !1), n = void 0, clearTimeout(s), i(!0);
|
|
6084
6084
|
};
|
|
6085
6085
|
n.addEventListener("canplaythrough", o, !1), (n._playPromise || Promise.resolve()).then(() => {
|
|
6086
6086
|
n && e.mediaStream && (n.srcObject = e.mediaStream);
|
|
@@ -6088,7 +6088,7 @@ const Ue = (Xe = class extends dn {
|
|
|
6088
6088
|
} else
|
|
6089
6089
|
i(!0);
|
|
6090
6090
|
s = window.setTimeout(() => {
|
|
6091
|
-
|
|
6091
|
+
O.event(`uid: ${this.userId} new mediaStream timeout`), n = void 0, i(!0);
|
|
6092
6092
|
}, 3e3);
|
|
6093
6093
|
}), this.updateSubscribe(fe.User)), this.stream = e, this.playAll(!1, t), !this.subscribed && e && (this.subscribed = !0), e.hasAudio && this.isAudioSubscribing && e.enableAudio(), e.hasVideo && this.isVideoSubscribing && e.enableVideo();
|
|
6094
6094
|
});
|
|
@@ -6115,7 +6115,7 @@ const Ue = (Xe = class extends dn {
|
|
|
6115
6115
|
return this.dataChannelConnected(e), this.dataSubState.setState(pe.AliRtcStateSubscribed), void this.streamInfo.updateRemoteTrackSubState({ data: !0 });
|
|
6116
6116
|
throw new Error("no dc founded");
|
|
6117
6117
|
}).catch((e) => {
|
|
6118
|
-
const t =
|
|
6118
|
+
const t = V.fromError(e, B.ERR_INNER, "subscribe data failed");
|
|
6119
6119
|
this.emit("remoteSubscribeError", t), this.dataSubState.setState(pe.AliRtcStateNoSubscribe);
|
|
6120
6120
|
}));
|
|
6121
6121
|
}
|
|
@@ -6146,7 +6146,7 @@ const Ue = (Xe = class extends dn {
|
|
|
6146
6146
|
var n, o, c, h, l, d, b, u, f, p, m, S, A, _, y, v, w;
|
|
6147
6147
|
const t = Date.now(), i = {}, s = {};
|
|
6148
6148
|
if (this.wantSubAudio && !this.isAudioSubscribing && ((n = this.streamInfo) != null && n.hasAudio) ? (i.audio = !0, i.aMsid = ((o = this.streamInfo.getAudioInfo()) == null ? void 0 : o.msid) || k.Audio) : this.wantSubAudio && ((c = this.streamInfo) != null && c.hasAudio) || !this.isAudioSubscribing || (s.audio = !0, s.aMsid = ((h = this.streamInfo.getAudioInfo()) == null ? void 0 : h.msid) || k.Audio), this.wantSubVideo && ((l = this.streamInfo) != null && l.hasVideo) ? (this.defaultVideoStreamType === Ke.AliRtcVideoStreamTypeLow && !this.isVideoSmallSubscribing && ((d = this.streamInfo) != null && d.hasVideoSmall) ? (i.video = !0, i.vMsid = k.VideoSmall) : this.isVideoLargeSubscribing || !((b = this.streamInfo) != null && b.hasVideoLarge) || this.defaultVideoStreamType === Ke.AliRtcVideoStreamTypeLow && this.isVideoSmallSubscribing || (i.video = !0, i.vMsid = ((u = this.streamInfo.getVideoLargeInfo()) == null ? void 0 : u.msid) || k.VideoLarge), this.defaultVideoStreamType === Ke.AliRtcVideoStreamTypeLow && this.isVideoLargeSubscribing && this.isVideoSmallSubscribing && this.streamInfo.hasVideoSmall ? (s.video = !0, s.vMsid = k.VideoLarge) : this.defaultVideoStreamType === Ke.AliRtcVideoStreamTypeHigh && this.isVideoLargeSubscribing && this.isVideoSmallSubscribing && (s.video = !0, s.vMsid = k.VideoSmall)) : this.wantSubVideo && ((f = this.streamInfo) != null && f.hasVideo) || !this.isVideoSubscribing || (s.video = !0, s.vMsid = this.streamInfo.isVideoSmallSubscribed || this.streamInfo.isVideoSmallSubscribing ? k.VideoSmall : ((p = this.streamInfo.getVideoLargeInfo()) == null ? void 0 : p.msid) || k.VideoLarge), this.wantSubScreen && !this.isScreenSubscribing && ((m = this.streamInfo) != null && m.hasScreen) ? i.screen = !0 : this.wantSubScreen && ((S = this.streamInfo) != null && S.hasScreen) || !this.isScreenSubscribing || (s.screen = !0), (A = this.parameter.data) != null && A.enableSubDataChannel && !this.isDataSubscribing && ((_ = this.streamInfo) != null && _.hasData) ? i.data = !0 : (y = this.parameter.data) != null && y.enableSubDataChannel && ((v = this.streamInfo) != null && v.hasData) || !this.isDataSubscribing || (s.data = !0), (i.audio || i.video || i.screen || i.data) && (this.createCallId(), this.subscribe(i, e, t)), (s.audio || s.video || s.screen) && this.subscribeDeleteTracks(s), e === fe.Reconnect) {
|
|
6149
|
-
if (
|
|
6149
|
+
if (O.event(`[${Xe.logName}]`, "reconnect, try to resume"), this.streamInfo.hasData && !i.data) {
|
|
6150
6150
|
const R = this.rtsManager.getDatachannelByMsid({ url: this.streamUrl, msid: this.streamInfo.getDataInfo().msid || k.Data });
|
|
6151
6151
|
this.dataChannelConnected(R);
|
|
6152
6152
|
}
|
|
@@ -6166,7 +6166,7 @@ const Ue = (Xe = class extends dn {
|
|
|
6166
6166
|
return { addOption: i, deleteOption: s };
|
|
6167
6167
|
}
|
|
6168
6168
|
handleAutoPlayFailed() {
|
|
6169
|
-
|
|
6169
|
+
O.event(`[${Xe.logName}]`, "auto play failed"), this.emit("remoteAudioAutoPlayFail", this.uid);
|
|
6170
6170
|
const e = () => {
|
|
6171
6171
|
this.resumeAudio().then(() => {
|
|
6172
6172
|
document.removeEventListener("click", e, !1), document.removeEventListener("touchstart", e, !1);
|
|
@@ -6187,14 +6187,14 @@ const Ue = (Xe = class extends dn {
|
|
|
6187
6187
|
return I(this, null, function* () {
|
|
6188
6188
|
var e, t;
|
|
6189
6189
|
if (this.audioTrack) {
|
|
6190
|
-
if (this.toggleAudio(!this.audioMuted), this.audioElement || (
|
|
6190
|
+
if (this.toggleAudio(!this.audioMuted), this.audioElement || (O.event(`[${Xe.logName}]`, this.userId, "create audio element"), this.audioElement = document.createElement("audio"), this.audioElement.setAttribute("autoplay", "autoplay"), this.audioElement.addEventListener("pause", this.handleAudioPaused), this.setPlayoutVolume(this.playoutVolume)), ((t = (e = this.audioElement.srcObject) == null ? void 0 : e.getAudioTracks()) == null ? void 0 : t[0]) !== this.audioTrack) {
|
|
6191
6191
|
let i = this.audioElement.srcObject;
|
|
6192
6192
|
i ? i.getAudioTracks().forEach((s) => {
|
|
6193
6193
|
i.removeTrack(s);
|
|
6194
6194
|
}) : (i = new MediaStream(), this.audioElement.srcObject = i), i.addTrack(this.audioTrack);
|
|
6195
6195
|
}
|
|
6196
6196
|
if (Se.SystenUtil.isIos && parseInt(Se.SystenUtil.systemVersion) <= 13) {
|
|
6197
|
-
|
|
6197
|
+
O.event(`[${Xe.logName}]`, "play audio for iOS 13-");
|
|
6198
6198
|
const i = this.audioElement;
|
|
6199
6199
|
i.setAttribute("autoplay", "");
|
|
6200
6200
|
const s = () => {
|
|
@@ -6206,14 +6206,14 @@ const Ue = (Xe = class extends dn {
|
|
|
6206
6206
|
} else
|
|
6207
6207
|
(() => {
|
|
6208
6208
|
var i;
|
|
6209
|
-
|
|
6210
|
-
|
|
6209
|
+
O.event(`[${Xe.logName}]`, "try play audio"), (i = this.audioElement) == null || i.play().then(() => {
|
|
6210
|
+
O.event(`[${Xe.logName}]`, "play audio success");
|
|
6211
6211
|
}).catch(() => {
|
|
6212
6212
|
this.handleAutoPlayFailed();
|
|
6213
6213
|
});
|
|
6214
6214
|
})();
|
|
6215
6215
|
} else
|
|
6216
|
-
|
|
6216
|
+
O.event(`[${Xe.logName}]`, this.userId, "audio track is null");
|
|
6217
6217
|
});
|
|
6218
6218
|
}
|
|
6219
6219
|
stopPlayAudio() {
|
|
@@ -6331,13 +6331,13 @@ class mc extends He {
|
|
|
6331
6331
|
}
|
|
6332
6332
|
add(e, t) {
|
|
6333
6333
|
if (this.plugins.has(e.name))
|
|
6334
|
-
throw new
|
|
6334
|
+
throw new V(Dt.AliRtcPluginErrorCreateError, `Plugin ${e.name} already exists`);
|
|
6335
6335
|
this.plugins.set(e.name, e), t && e.setOptions(t), this.emit("added", e), e.on("enabled", () => this.emit("added", e)), e.on("disabled", () => this.emit("removed", e)), e.on("updated", () => this.emit("updated", e));
|
|
6336
6336
|
}
|
|
6337
6337
|
remove(e) {
|
|
6338
6338
|
const t = this.plugins.get(e);
|
|
6339
6339
|
if (!t)
|
|
6340
|
-
throw new
|
|
6340
|
+
throw new V(Dt.AliRtcPluginErrorNoFindPlugin, `Plugin ${e} not founded`);
|
|
6341
6341
|
this.plugins.delete(e), t.removeAllListeners(), this.emit("removed", t);
|
|
6342
6342
|
}
|
|
6343
6343
|
removeAll() {
|
|
@@ -6364,8 +6364,8 @@ const wi = ([r]) => {
|
|
|
6364
6364
|
const { remoteUser: a, options: e } = r;
|
|
6365
6365
|
return [`user(${a.userId})`, e];
|
|
6366
6366
|
};
|
|
6367
|
-
var
|
|
6368
|
-
const De = (
|
|
6367
|
+
var Oe;
|
|
6368
|
+
const De = (Oe = class extends He {
|
|
6369
6369
|
constructor(e, t, i) {
|
|
6370
6370
|
super();
|
|
6371
6371
|
g(this, "rts");
|
|
@@ -6391,29 +6391,29 @@ const De = (Ve = class extends He {
|
|
|
6391
6391
|
addRTSListener() {
|
|
6392
6392
|
this.rts.on("connectStatusChange", (e) => {
|
|
6393
6393
|
var t, i, s, n;
|
|
6394
|
-
if (
|
|
6394
|
+
if (O.event(`[${Oe.logName}]`, "rts connectStatusChange to:", e.status), e.status === Jr.CONNECT_STATUS_DISCONNECTED)
|
|
6395
6395
|
this.dcReject && this.dcReject(), this.setConnected(!1), this.slsReporter.reportWarning("rts disconnected"), this.emit("disconnected");
|
|
6396
6396
|
else if (e.status === Jr.CONNECT_STATUS_CONNECTED) {
|
|
6397
6397
|
const o = (n = (s = (i = (t = this.rts.commonController) == null ? void 0 : t.peerCore) == null ? void 0 : i.getSignal()) == null ? void 0 : s.getDatachannelCore()) == null ? void 0 : n.readyState;
|
|
6398
|
-
|
|
6398
|
+
O.event(`[${Oe.logName}]`, "dcReadyState:", o), o === "open" && this.dcResolve && this.dcResolve(!0), this.setConnected(!0);
|
|
6399
6399
|
}
|
|
6400
6400
|
}), this.rts.on("reconnectFinish", () => {
|
|
6401
|
-
|
|
6401
|
+
O.event(`[${Oe.logName}]`, "rts reconnectFinish");
|
|
6402
6402
|
try {
|
|
6403
6403
|
this.emit("connected", !0, this._rtsPeerConnectionType);
|
|
6404
6404
|
} catch (e) {
|
|
6405
|
-
|
|
6405
|
+
O.error(`[${Oe.logName}]`, "emit connected error:", e);
|
|
6406
6406
|
}
|
|
6407
6407
|
}), this.rts.on("datachannelStatusChange", (e) => {
|
|
6408
|
-
|
|
6408
|
+
O.event(`[${Oe.logName}]`, "rts datachannelStatusChange to:", e.status), e.status === Gr.DATACHANNEL_STATUS_OPEN ? this.dcResolve && this.dcResolve(!0) : e.status === Gr.DATACHANNEL_STATUS_CLOSE && (this.dcReject && this.dcReject(), this.dcConnectingPromise = new Promise((t, i) => {
|
|
6409
6409
|
this.dcResolve = t, this.dcReject = i;
|
|
6410
6410
|
}));
|
|
6411
6411
|
}), this.rts.on("receivedSEI", (e) => {
|
|
6412
6412
|
this.emit("seimessage", e.url, e.sei.payloadType, e.sei.data);
|
|
6413
6413
|
}), this.rts.on("onError", (e) => {
|
|
6414
|
-
|
|
6414
|
+
O.event(`[${Oe.logName}]`, "rts onError event:", e);
|
|
6415
6415
|
}), this.rts.on("reconnect", (e) => {
|
|
6416
|
-
|
|
6416
|
+
O.event(`[${Oe.logName}]`, "rts reconnect event:", e);
|
|
6417
6417
|
});
|
|
6418
6418
|
}
|
|
6419
6419
|
updateAuth(e) {
|
|
@@ -6491,7 +6491,7 @@ const De = (Ve = class extends He {
|
|
|
6491
6491
|
this.startConnect();
|
|
6492
6492
|
const { publishStream: l, videoSmallStream: d, screenStream: b, vMsid: u } = yield this.localStreamManager.createHTTPPublishStream();
|
|
6493
6493
|
if (!l)
|
|
6494
|
-
return
|
|
6494
|
+
return O.warn(`[${Oe.logName}]`, "publishStream is null"), { traceId: "", l1ip: c };
|
|
6495
6495
|
const f = this.getPubMsid(l, { vMsid: u });
|
|
6496
6496
|
this.encodedInsertableStreams && (f.encodedInsertableStreams = !0), f.answerSdpHook = (v) => {
|
|
6497
6497
|
const w = /\d+\.\d+\.\d+\.\d+(?=\s+1106|\s+8000)/.exec(v);
|
|
@@ -6506,14 +6506,14 @@ const De = (Ve = class extends He {
|
|
|
6506
6506
|
const w = 2e3 - (Date.now() - A);
|
|
6507
6507
|
throw w <= 0 ? this.emit("disconnected") : setTimeout(() => {
|
|
6508
6508
|
this.emit("disconnected");
|
|
6509
|
-
}, w), this.slsReporter.reportPublish(i, e, t, l.hasVideo && (!u || u === k.VideoLarge), l.hasVideo && u === k.VideoSmall, l.hasVideo && u === k.Screen, l.hasAudio, (v == null ? void 0 : v.errorCode) || -1, this.pcTraceId, "", A),
|
|
6509
|
+
}, w), this.slsReporter.reportPublish(i, e, t, l.hasVideo && (!u || u === k.VideoLarge), l.hasVideo && u === k.VideoSmall, l.hasVideo && u === k.Screen, l.hasAudio, (v == null ? void 0 : v.errorCode) || -1, this.pcTraceId, "", A), V.fromRtsError(v);
|
|
6510
6510
|
}
|
|
6511
|
-
|
|
6511
|
+
O.event(`[${Oe.logName}]`, "rts publish success", S), this.slsReporter.reportPublish(i, e, t, l.hasVideo && (!u || u === k.VideoLarge), l.hasVideo && u === k.VideoSmall, l.hasVideo && u === k.Screen, l.hasAudio, 0, S, S, A), this.slsReporter.reportConnectionLatencyEvent(at.HANDLE_PUB_TASK, ht.START, t, S, h), this.slsReporter.reportConnectionLatencyEvent(at.HANDLE_PUB_TASK, ht.END, t, S, Date.now());
|
|
6512
6512
|
try {
|
|
6513
6513
|
const v = Date.now();
|
|
6514
6514
|
return this._pcTraceId = S, this.setConnected(!0), this._publishingTracks = this.rts.getPublishTrackInfoList(), d && (yield this.publishAdd(e, d, t, { vMsid: k.VideoSmall }, i), p = !1, m = k.VideoSmall), b && (yield this.publishAdd(e, b, t, { vMsid: k.Screen }, i), p = !1, m = k.Screen), yield this.waitPublishSender(e, p, m), this.slsReporter.reportPublishFirstPacket(i, t, A, v, this._localJoinTime, p ? k.Audio : f.vMsid, S || "", S || "", s), { traceId: S, l1ip: c };
|
|
6515
6515
|
} catch (v) {
|
|
6516
|
-
throw this.setConnected(!1),
|
|
6516
|
+
throw this.setConnected(!1), V.fromError(v);
|
|
6517
6517
|
}
|
|
6518
6518
|
});
|
|
6519
6519
|
}
|
|
@@ -6544,14 +6544,14 @@ const De = (Ve = class extends He {
|
|
|
6544
6544
|
const u = Date.now(), f = this.getPubMsid(t, s);
|
|
6545
6545
|
try {
|
|
6546
6546
|
const R = yield Ba((E) => I(this, null, function* () {
|
|
6547
|
-
return E > 0 &&
|
|
6547
|
+
return E > 0 && O.event(`[${Oe.logName}]`, `publishAdd retry times: ${E}`), this.isConnected ? (yield this.dcConnectingPromise, this.rts.publishAdd([J({ url: e, stream: t, updateSourceStream: !1 }, f)])) : Promise.reject(new V(B.ERR_INNER, "rts not connected"));
|
|
6548
6548
|
}), 5, 0, (E) => (E == null ? void 0 : E.errorCode) === 15006);
|
|
6549
6549
|
if (R) {
|
|
6550
6550
|
const E = Date.now(), [C] = R;
|
|
6551
6551
|
return this.slsReporter.reportPublish(!1, e, i, ((p = f.vMsid) == null ? void 0 : p[0]) === k.VideoLarge, ((m = f.vMsid) == null ? void 0 : m[0]) === k.VideoSmall, ((S = f.vMsid) == null ? void 0 : S[0]) === k.Screen, ((A = f.aMsid) == null ? void 0 : A[0]) === k.Audio, 0, this.pcTraceId, C.traceId || "", u), this.updatePublishingTracks(C.trackInfoList), o && (yield this.waitPublishSender(e, !t.hasVideo, t.hasVideo ? s == null ? void 0 : s.vMsid : s == null ? void 0 : s.aMsid)), this.slsReporter.reportPublishFirstPacket(n, i, u, E, this._localJoinTime, (t.hasVideo ? s == null ? void 0 : s.vMsid : s == null ? void 0 : s.aMsid) || "", this.pcTraceId, C.traceId || "", c), C.traceId || "";
|
|
6552
6552
|
}
|
|
6553
6553
|
} catch (R) {
|
|
6554
|
-
throw this.slsReporter.reportPublish(!1, e, i, ((_ = f.vMsid) == null ? void 0 : _[0]) === k.VideoLarge, ((y = f.vMsid) == null ? void 0 : y[0]) === k.VideoSmall, ((v = f.vMsid) == null ? void 0 : v[0]) === k.Screen, ((w = f.aMsid) == null ? void 0 : w[0]) === k.Audio, (R == null ? void 0 : R.errorCode) || -1, this.pcTraceId, "", u), R != null && R.errorCode ?
|
|
6554
|
+
throw this.slsReporter.reportPublish(!1, e, i, ((_ = f.vMsid) == null ? void 0 : _[0]) === k.VideoLarge, ((y = f.vMsid) == null ? void 0 : y[0]) === k.VideoSmall, ((v = f.vMsid) == null ? void 0 : v[0]) === k.Screen, ((w = f.aMsid) == null ? void 0 : w[0]) === k.Audio, (R == null ? void 0 : R.errorCode) || -1, this.pcTraceId, "", u), R != null && R.errorCode ? V.fromRtsError(R) : V.fromError(R);
|
|
6555
6555
|
}
|
|
6556
6556
|
return "";
|
|
6557
6557
|
});
|
|
@@ -6563,12 +6563,12 @@ const De = (Ve = class extends He {
|
|
|
6563
6563
|
const i = (l = (h = this.publishingTracks) == null ? void 0 : h.find(({ msid: S }) => S === k.Audio)) == null ? void 0 : l.msid, s = (b = (d = this.publishingTracks) == null ? void 0 : d.find(({ msid: S }) => S === k.VideoLarge)) == null ? void 0 : b.msid, n = (f = (u = this.publishingTracks) == null ? void 0 : u.find(({ msid: S }) => S === k.Screen)) == null ? void 0 : f.msid, o = [];
|
|
6564
6564
|
t.screen && n ? o.push(n) : t.video && o.push(t.vMsid || s);
|
|
6565
6565
|
const c = [];
|
|
6566
|
-
t.audio && i && c.push(i),
|
|
6566
|
+
t.audio && i && c.push(i), O.event(Oe.logName, "publishDelete", { streamUrl: e, aMsid: c, vMsid: o });
|
|
6567
6567
|
try {
|
|
6568
6568
|
const [S] = (yield this.rts.publishDeleteTracks([{ url: e, aMsid: c, vMsid: o }])) || [];
|
|
6569
|
-
return
|
|
6569
|
+
return O.event(Oe.logName, "publishDelete", { result: S }), S && this.updatePublishingTracks(S.trackInfoList), ((m = (p = S == null ? void 0 : S.trackInfoList) == null ? void 0 : p[0]) == null ? void 0 : m.trackId) || "";
|
|
6570
6570
|
} catch (S) {
|
|
6571
|
-
throw
|
|
6571
|
+
throw V.fromRtsError(S);
|
|
6572
6572
|
}
|
|
6573
6573
|
});
|
|
6574
6574
|
}
|
|
@@ -6581,7 +6581,7 @@ const De = (Ve = class extends He {
|
|
|
6581
6581
|
const h = yield this.rts.publishReplaceTracks([{ url: e, stream: t, vMsid: s, aMsid: n }]), [l] = h;
|
|
6582
6582
|
return this.updatePublishingTracks(l.trackInfoList), ((c = (o = l == null ? void 0 : l.trackInfoList) == null ? void 0 : o[0]) == null ? void 0 : c.trackId) || "";
|
|
6583
6583
|
} catch (h) {
|
|
6584
|
-
throw
|
|
6584
|
+
throw V.fromRtsError(h);
|
|
6585
6585
|
}
|
|
6586
6586
|
});
|
|
6587
6587
|
}
|
|
@@ -6634,7 +6634,7 @@ const De = (Ve = class extends He {
|
|
|
6634
6634
|
const u = yield this.rts.subscribe(nr(s), n);
|
|
6635
6635
|
return this._pcTraceId = u.traceId, this.setConnected(!0), { traceId: u.traceId, stream: u };
|
|
6636
6636
|
} catch (u) {
|
|
6637
|
-
throw this.setConnected(!1), this.emit("disconnected"),
|
|
6637
|
+
throw this.setConnected(!1), this.emit("disconnected"), V.fromRtsError(u);
|
|
6638
6638
|
}
|
|
6639
6639
|
});
|
|
6640
6640
|
}
|
|
@@ -6645,12 +6645,12 @@ const De = (Ve = class extends He {
|
|
|
6645
6645
|
yield this.dcConnectingPromise;
|
|
6646
6646
|
try {
|
|
6647
6647
|
return (yield Ba((l) => I(this, null, function* () {
|
|
6648
|
-
return yield this.dcConnectingPromise, l > 0 &&
|
|
6648
|
+
return yield this.dcConnectingPromise, l > 0 && O.event(`[${Oe.logName}]`, `subscribeAdd retry times: ${l}`), this.isConnected ? this.rts.subscribeAdd([s]) : Promise.reject();
|
|
6649
6649
|
}), 5, 0, (l) => (l == null ? void 0 : l.errorCode) === 15006))[0];
|
|
6650
6650
|
} catch (l) {
|
|
6651
6651
|
if (((h = (c = (o = (n = l == null ? void 0 : l.extraInfo) == null ? void 0 : n.parsedData) == null ? void 0 : o.streams) == null ? void 0 : c[0]) == null ? void 0 : h.res_code) === 508)
|
|
6652
6652
|
return this.emit("subscribeexceeds"), null;
|
|
6653
|
-
throw
|
|
6653
|
+
throw V.fromRtsError(l);
|
|
6654
6654
|
}
|
|
6655
6655
|
});
|
|
6656
6656
|
}
|
|
@@ -6664,7 +6664,7 @@ const De = (Ve = class extends He {
|
|
|
6664
6664
|
} catch (l) {
|
|
6665
6665
|
if (((h = (c = (o = (n = l == null ? void 0 : l.extraInfo) == null ? void 0 : n.parsedData) == null ? void 0 : o.streams) == null ? void 0 : c[0]) == null ? void 0 : h.res_code) === 404)
|
|
6666
6666
|
return;
|
|
6667
|
-
throw
|
|
6667
|
+
throw V.fromRtsError(l);
|
|
6668
6668
|
}
|
|
6669
6669
|
});
|
|
6670
6670
|
}
|
|
@@ -6676,7 +6676,7 @@ const De = (Ve = class extends He {
|
|
|
6676
6676
|
} catch (o) {
|
|
6677
6677
|
if (((n = (s = (i = (t = o == null ? void 0 : o.extraInfo) == null ? void 0 : t.parsedData) == null ? void 0 : i.streams) == null ? void 0 : s[0]) == null ? void 0 : n.res_code) === 404)
|
|
6678
6678
|
return;
|
|
6679
|
-
throw
|
|
6679
|
+
throw V.fromRtsError(o);
|
|
6680
6680
|
}
|
|
6681
6681
|
});
|
|
6682
6682
|
}
|
|
@@ -6727,7 +6727,7 @@ const De = (Ve = class extends He {
|
|
|
6727
6727
|
let o = !1;
|
|
6728
6728
|
const { options: c, remoteUser: h } = e;
|
|
6729
6729
|
if (c.video && c.screen)
|
|
6730
|
-
throw new
|
|
6730
|
+
throw new V(B.ERR_INNER, "subscribe error, video and screen cannot be subscribed at the same time");
|
|
6731
6731
|
let l;
|
|
6732
6732
|
this.connecting && (yield this.connectingPromise);
|
|
6733
6733
|
let d = Date.now();
|
|
@@ -6746,12 +6746,12 @@ const De = (Ve = class extends He {
|
|
|
6746
6746
|
else if (!f)
|
|
6747
6747
|
return w < y && (w++, new Promise((x) => setTimeout(() => x(R()), v)));
|
|
6748
6748
|
return !0;
|
|
6749
|
-
})), f && !A && (E = this.rts.getSubscribeVideoStats(h.streamUrl, u).then((C) => (C.packetsReceived > 0 && (S = Date.now()), C.framesDecoded > 0 ? (A = Date.now(), !0) : w < y ? (w++, new Promise((x) => setTimeout(() => x(R()), v))) : (
|
|
6749
|
+
})), f && !A && (E = this.rts.getSubscribeVideoStats(h.streamUrl, u).then((C) => (C.packetsReceived > 0 && (S = Date.now()), C.framesDecoded > 0 ? (A = Date.now(), !0) : w < y ? (w++, new Promise((x) => setTimeout(() => x(R()), v))) : (O.event(`[${Oe.logName}]`, h.userId, "尝试获取首帧数据失败"), !1)))), Promise.resolve(E);
|
|
6750
6750
|
};
|
|
6751
6751
|
return R();
|
|
6752
|
-
})(
|
|
6753
|
-
return _.then((
|
|
6754
|
-
S && this.slsReporter.reportSubscribeFirstPacket(t === fe.Resume, i, s, u, { fprt: S - d, ifsprtc: A ? A - d : 0, ajsub: t === fe.Join ? 1 : 0, pctid: this.pcTraceId, subtid: (l == null ? void 0 : l.traceId) || "", sstc: b - d }), A && this.slsReporter.reportSubscribeFirstFrame(t === fe.Resume, i, s, u, { fvfrt: A - d, fp2fftc: A - S, ajsub: t === fe.Join ? 1 : 0, tffrtc: t === fe.Join ? A - this.localJoinTime : A - n, pctid: this.pcTraceId, subtid: (l == null ? void 0 : l.traceId) || "", fvfdtc: A - d }), m && (this.slsReporter.reportConnectionLatencyEvent(at.FIRST_REMOTE, ht.DECODED, i, k.Audio, m), this.slsReporter.reportSubscribeFirstPacket(t === fe.Resume, i, s, k.Audio, { fprt: m - d, ifsprtc: m - d, ajsub: t === fe.Join ? 1 : 0, pctid: this.pcTraceId, subtid: (l == null ? void 0 : l.traceId) || "", sstc: b - d }))
|
|
6752
|
+
})(40, 100);
|
|
6753
|
+
return _.then(() => {
|
|
6754
|
+
S && this.slsReporter.reportSubscribeFirstPacket(t === fe.Resume, i, s, u, { fprt: S - d, ifsprtc: A ? A - d : 0, ajsub: t === fe.Join ? 1 : 0, pctid: this.pcTraceId, subtid: (l == null ? void 0 : l.traceId) || "", sstc: b - d }), A && this.slsReporter.reportSubscribeFirstFrame(t === fe.Resume, i, s, u, { fvfrt: A - d, fp2fftc: A - S, ajsub: t === fe.Join ? 1 : 0, tffrtc: t === fe.Join ? A - this.localJoinTime : A - n, pctid: this.pcTraceId, subtid: (l == null ? void 0 : l.traceId) || "", fvfdtc: A - d }), m && (this.slsReporter.reportConnectionLatencyEvent(at.FIRST_REMOTE, ht.DECODED, i, k.Audio, m), this.slsReporter.reportSubscribeFirstPacket(t === fe.Resume, i, s, k.Audio, { fprt: m - d, ifsprtc: m - d, ajsub: t === fe.Join ? 1 : 0, pctid: this.pcTraceId, subtid: (l == null ? void 0 : l.traceId) || "", sstc: b - d }));
|
|
6755
6755
|
}), o && (yield Promise.race([_, kt(1500)])), l;
|
|
6756
6756
|
});
|
|
6757
6757
|
}
|
|
@@ -6782,7 +6782,7 @@ const De = (Ve = class extends He {
|
|
|
6782
6782
|
return this.rts.sendSEI({ url: e, vMsid: k.VideoLarge, data: t, repeatCount: i, payloadType: s });
|
|
6783
6783
|
});
|
|
6784
6784
|
}
|
|
6785
|
-
}, g(
|
|
6785
|
+
}, g(Oe, "logName", "RtsManager"), Oe);
|
|
6786
6786
|
Me([T(U)], De.prototype, "startConnect", 1), Me([T()], De.prototype, "updatePublishingTracks", 1), Me([T(U, U)], De.prototype, "httpPublish", 1), Me([T(U, U)], De.prototype, "waitPublishSender", 1), Me([T(([r, a, e]) => [r, JSON.stringify(e)], U)], De.prototype, "publishAdd", 1), Me([T(U, U)], De.prototype, "publishDelete", 1), Me([T(([r, a, e]) => [r, JSON.stringify(e)])], De.prototype, "publishReplace", 1), Me([T(U)], De.prototype, "publishStop", 1), Me([T(U)], De.prototype, "publishAddDataChannel", 1), Me([T(U)], De.prototype, "publishStopDataChannel", 1), Me([T()], De.prototype, "unpublish", 1), Me([T(wi, ({ traceId: r }) => r)], De.prototype, "httpSubscribe", 1), Me([T(wi, ({ traceId: r }) => r)], De.prototype, "subscribeAdd", 1), Me([T(wi)], De.prototype, "subscribeDelete", 1), Me([T(U)], De.prototype, "subscibeStop", 1), Me([T(U)], De.prototype, "subscribeAddDataChannel", 1), Me([T(U)], De.prototype, "subscribeStopDatachannel", 1), Me([T(U)], De.prototype, "publish", 1), Me([T(wi)], De.prototype, "subscribe", 1), Me([T()], De.prototype, "sendSEI", 1);
|
|
6787
6787
|
let Sc = De;
|
|
6788
6788
|
class cr {
|
|
@@ -6948,7 +6948,7 @@ class Fa extends He {
|
|
|
6948
6948
|
}
|
|
6949
6949
|
updateVideoProfile(e, t, i = !1) {
|
|
6950
6950
|
return I(this, null, function* () {
|
|
6951
|
-
this._profileManager || (this._profileManager = new cr(this.type === Le.AliRtcSdkStreamTypeScreen ?
|
|
6951
|
+
this._profileManager || (this._profileManager = new cr(this.type === Le.AliRtcSdkStreamTypeScreen ? Va : vr)), e && this._profileManager.updateProfile(e, t), yield this._profileManager.setVideoProfile(this.originVideoTrack, this._publishVideoStream, i);
|
|
6952
6952
|
});
|
|
6953
6953
|
}
|
|
6954
6954
|
get videoProfile() {
|
|
@@ -6956,7 +6956,7 @@ class Fa extends He {
|
|
|
6956
6956
|
return (e = this.profileManager) == null ? void 0 : e.videoProfile;
|
|
6957
6957
|
}
|
|
6958
6958
|
setVideoContentHint(e) {
|
|
6959
|
-
this._profileManager || (this._profileManager = new cr(this.type === Le.AliRtcSdkStreamTypeScreen ?
|
|
6959
|
+
this._profileManager || (this._profileManager = new cr(this.type === Le.AliRtcSdkStreamTypeScreen ? Va : vr)), this._profileManager.setContentHint(this.currentVideoTrack, e);
|
|
6960
6960
|
}
|
|
6961
6961
|
updateAudioProfile(e) {
|
|
6962
6962
|
return I(this, null, function* () {
|
|
@@ -7005,12 +7005,12 @@ const ct = (Mt = class extends He {
|
|
|
7005
7005
|
})), this.screenStreamInfo.on("videotrackended", () => I(this, null, function* () {
|
|
7006
7006
|
yield this.stopLocalStream({ screen: !0 }), this.emit("trackended", $t.ScreenTrackEnded);
|
|
7007
7007
|
})), this.pluginManager.on("added", (i) => I(this, null, function* () {
|
|
7008
|
-
if (
|
|
7008
|
+
if (O.info(`[${Mt.logName}]`, "plugin added", i.name), !i.isSupported("7.1.2"))
|
|
7009
7009
|
return console.warn(`${i.name} is not supported!!!`), void i.emit("unsupported");
|
|
7010
7010
|
try {
|
|
7011
7011
|
yield i.init();
|
|
7012
7012
|
} catch (s) {
|
|
7013
|
-
i.emit("error",
|
|
7013
|
+
i.emit("error", V.fromError(s, Dt.AliRtcPluginErrorInitError));
|
|
7014
7014
|
}
|
|
7015
7015
|
i.streamType === Le.AliRtcSdkStreamTypeCapture && (this.cameraStreamInfo.addPlugin(i), yield this.cameraStreamInfo.process(this.streamInfos)), i.streamType === Le.AliRtcSdkStreamTypeScreen && (this.screenStreamInfo.addPlugin(i), yield this.screenStreamInfo.process(this.streamInfos)), this.emit("publishupdate");
|
|
7016
7016
|
})), this.pluginManager.on("removed", (i) => I(this, null, function* () {
|
|
@@ -7103,7 +7103,7 @@ const ct = (Mt = class extends He {
|
|
|
7103
7103
|
const h = ((b) => {
|
|
7104
7104
|
const { audio: u, video: f, screen: p } = b;
|
|
7105
7105
|
if (f && p)
|
|
7106
|
-
throw new
|
|
7106
|
+
throw new V(B.ERR_INNER, "create stream error, cannot create video && screen together");
|
|
7107
7107
|
return !!(f || u || p);
|
|
7108
7108
|
})(e);
|
|
7109
7109
|
let l;
|
|
@@ -7111,7 +7111,7 @@ const ct = (Mt = class extends He {
|
|
|
7111
7111
|
i || (o === !0 && this.cameraStreamInfo.cameraVideoConstraints ? (yield this.setAvailableCameraDeviceId(), o = J({}, this.cameraStreamInfo.cameraVideoConstraints)) : typeof o == "object" && (yield this.setAvailableCameraDeviceId(), o = J(J({}, o), this.cameraStreamInfo.cameraVideoConstraints)), c === void 0 && this.audioCaptureDisabled ? c = !1 : c && (c === !0 && this.cameraStreamInfo.micAudioConstraints ? (yield this.setAvailableMicrophoneDeviceId(), c = J({}, this.cameraStreamInfo.micAudioConstraints)) : typeof c == "object" && (yield this.setAvailableMicrophoneDeviceId(), c = J(J({}, c), this.cameraStreamInfo.micAudioConstraints)), this._audioCaptureDisabled = !1));
|
|
7112
7112
|
const b = Date.now();
|
|
7113
7113
|
try {
|
|
7114
|
-
l = yield Se.createStream({ audio: c, video: o, screen: t, custom: !!i, mediaStream: i, skipProfile: !0 }),
|
|
7114
|
+
l = yield Se.createStream({ audio: c, video: o, screen: t, custom: !!i, mediaStream: i, skipProfile: !0 }), O.info(`[${Mt.logName}]`, "createLocalStream", { audio: c, video: o, screen: t, custom: !!i, time: Date.now() - b }), c && !i && this.slsReporter.reportAudio(null, Date.now() - b, ((d = l == null ? void 0 : l.audioTrack) == null ? void 0 : d.label) || ""), t && !i && this.slsReporter.reportScreen(null, Date.now() - b);
|
|
7115
7115
|
} catch (u) {
|
|
7116
7116
|
throw c && !i && this.slsReporter.reportAudio(u, Date.now() - b, ""), t && !i && this.slsReporter.reportScreen(null, Date.now() - b), u;
|
|
7117
7117
|
}
|
|
@@ -7143,7 +7143,7 @@ const ct = (Mt = class extends He {
|
|
|
7143
7143
|
const o = this.publishStreams;
|
|
7144
7144
|
try {
|
|
7145
7145
|
if (!(o.audio || o.video || o.videoSmall || o.screen))
|
|
7146
|
-
throw
|
|
7146
|
+
throw O.error(`[${Mt.logName}]`, "no tracks founded"), new V(B.ERR_SDK_PUBLISH_INVAILD, "no tracks founded");
|
|
7147
7147
|
const b = new MediaStream();
|
|
7148
7148
|
(c = o.audio) != null && c.audioTrack && b.addTrack(o.audio.audioTrack), (h = o.video) != null && h.videoTrack ? (b.addTrack(o.video.videoTrack), i = o.videoSmall, s = o.screen) : (l = o.screen) != null && l.videoTrack && (t = k.Screen, b.addTrack((d = o.screen) == null ? void 0 : d.videoTrack), n = !0), e = yield Sn(b), n ? (this.screenStreamInfo.cloneVideoProfile(e), this.publishingScreenVideoStream = e) : (this.cameraStreamInfo.cloneVideoProfile(e), this.publishingCameraVideoStream = e);
|
|
7149
7149
|
} catch (b) {
|
|
@@ -8005,11 +8005,12 @@ class Cc extends Jt {
|
|
|
8005
8005
|
g(this, "audioProcessor");
|
|
8006
8006
|
g(this, "slsReporter");
|
|
8007
8007
|
g(this, "enableSoft3ACheck", !1);
|
|
8008
|
+
g(this, "useHardOnly", !1);
|
|
8008
8009
|
g(this, "lastDiffOutputLog", "");
|
|
8009
8010
|
g(this, "audioContext", new AudioContext({ sampleRate: 48e3 }));
|
|
8010
8011
|
g(this, "farNode");
|
|
8011
8012
|
g(this, "createNode", (e) => this.audioContext.createMediaStreamSource(new MediaStream([e])));
|
|
8012
|
-
this.options = e, this.slsReporter = e == null ? void 0 : e.slsReporter, this.enableSoft3ACheck = (e == null ? void 0 : e.enableSoft3ACheck) || !1, this.zIndex = 7, document.addEventListener("click", this.activeAudioContext);
|
|
8013
|
+
this.options = e, this.slsReporter = e == null ? void 0 : e.slsReporter, this.enableSoft3ACheck = (e == null ? void 0 : e.enableSoft3ACheck) || !1, this.useHardOnly = (e == null ? void 0 : e.useHardOnly) || !1, this.zIndex = 7, document.addEventListener("click", this.activeAudioContext);
|
|
8013
8014
|
}
|
|
8014
8015
|
activeAudioContext() {
|
|
8015
8016
|
this.audioContext.resume(), document.removeEventListener("click", this.activeAudioContext);
|
|
@@ -8037,7 +8038,7 @@ class Cc extends Jt {
|
|
|
8037
8038
|
if (!e.currentAudioTrack)
|
|
8038
8039
|
return e.updateAudioTrack(), void this.clear(e);
|
|
8039
8040
|
if (!this.audioProcessor) {
|
|
8040
|
-
|
|
8041
|
+
O.info(ni, "create audio processor this.options:", this.options), this.audioProcessor = new $a({ aecOn: !0, ansOn: !0, agcOn: !0, dumpOn: ((t = this.options) == null ? void 0 : t.dumpAudioData) || !1, aiaecOn: this.options.aiaecOn || !1, useHardOnly: this.useHardOnly, wasmCdnPath: this.options.wasmCdnPath || "https://g.alicdn.com/code/npm/@ali/aliyun-audio-3a/0.0.6/" }), this.audioProcessor.on("dumpdata", (s, n) => {
|
|
8041
8042
|
let o = 3e3;
|
|
8042
8043
|
n.includes("far") ? o = 5e3 : n.includes("output") ? o = 1e4 : n.includes("meta") && (o = 8e3), setTimeout(() => {
|
|
8043
8044
|
const c = URL.createObjectURL(s), h = document.createElement("a");
|
|
@@ -8045,11 +8046,11 @@ class Cc extends Jt {
|
|
|
8045
8046
|
}, o);
|
|
8046
8047
|
}), this.audioProcessor.on("loadsuccess", () => {
|
|
8047
8048
|
var s, n;
|
|
8048
|
-
|
|
8049
|
+
O.info(ni, "loadsuccess"), this.enableSoft3ACheck || e.updateAudioTrack((s = this.audioProcessor) == null ? void 0 : s.targetMediaTrack), this.options.dumpAudioData && ((n = this.audioProcessor) == null || n.startDump());
|
|
8049
8050
|
}), this.audioProcessor.on("loaderror", (s) => {
|
|
8050
|
-
|
|
8051
|
+
O.error(ni, "loaderror:", s == null ? void 0 : s.message), this.emit("error", s);
|
|
8051
8052
|
}), this.audioProcessor.on("outputlog", (s) => {
|
|
8052
|
-
|
|
8053
|
+
O.info(ni, "outputlog:", s), s != null && s.includes("diff") && (this.lastDiffOutputLog = s || "");
|
|
8053
8054
|
}), this.audioProcessor.on("statdata", (s) => {
|
|
8054
8055
|
var n;
|
|
8055
8056
|
if (s)
|
|
@@ -8063,7 +8064,7 @@ class Cc extends Jt {
|
|
|
8063
8064
|
}
|
|
8064
8065
|
(n = this.slsReporter) == null || n.reportPublishAudio3A("", "", "", o);
|
|
8065
8066
|
} catch (o) {
|
|
8066
|
-
|
|
8067
|
+
O.error(ni, "statdata error:", o);
|
|
8067
8068
|
}
|
|
8068
8069
|
});
|
|
8069
8070
|
const i = this.createNode(e.currentAudioTrack);
|
|
@@ -8092,7 +8093,7 @@ class Cc extends Jt {
|
|
|
8092
8093
|
(e = this.audioProcessor) == null || e.stopDump();
|
|
8093
8094
|
}
|
|
8094
8095
|
}
|
|
8095
|
-
var
|
|
8096
|
+
var Or = ((r) => (r[r.Default = 0] = "Default", r[r.Human = 1] = "Human", r[r.Robot = 2] = "Robot", r))(Or || {}), kc = Object.defineProperty, Pc = Object.getOwnPropertyDescriptor, Ja = (r, a, e, t) => {
|
|
8096
8097
|
for (var i, s = t > 1 ? void 0 : t ? Pc(a, e) : a, n = r.length - 1; n >= 0; n--)
|
|
8097
8098
|
(i = r[n]) && (s = (t ? i(a, e, s) : i(s)) || s);
|
|
8098
8099
|
return t && s && kc(a, e, s), s;
|
|
@@ -8116,7 +8117,7 @@ const Rr = (Nt = class extends He {
|
|
|
8116
8117
|
if (this.sendReadyMsg && !this.readyMsgSuccess)
|
|
8117
8118
|
try {
|
|
8118
8119
|
const n = new TextDecoder().decode(t.data), o = JSON.parse(n);
|
|
8119
|
-
o.key === "aliyun_aigc" && o.type === "ready_resp" && ((i = o.data) == null ? void 0 : i.ready) === !0 && (
|
|
8120
|
+
o.key === "aliyun_aigc" && o.type === "ready_resp" && ((i = o.data) == null ? void 0 : i.ready) === !0 && (O.event(`[${Nt.logName}]`, "onCheckReadyMsg success"), this.readyMsgSuccess = !0, this.emit("dcready", e), (s = this.remoteUser) == null || s.off("remoteDataChannelMessage", this.onCheckReadyMsg), window.clearTimeout(this.sendReadyMsgTimer));
|
|
8120
8121
|
} catch (n) {
|
|
8121
8122
|
}
|
|
8122
8123
|
});
|
|
@@ -8129,7 +8130,7 @@ const Rr = (Nt = class extends He {
|
|
|
8129
8130
|
this.self.off("dataPublishStateChanged", this.onDataPublishStateChange), window.clearTimeout(this.sendReadyMsgTimer), this.remoteUser = void 0, this.sendReadyMsg = !1, this.hasPubDataChannel = !1, this.hasSubDataChannel = !1, this.readyMsgSuccess = !1, this.startReadyMsgTime = 0;
|
|
8130
8131
|
}
|
|
8131
8132
|
trySendReadyMsg() {
|
|
8132
|
-
|
|
8133
|
+
O.event(`[${Nt.logName}]`, `trySendReadyMsg: pub(${this.hasPubDataChannel}, sub: ${this.hasSubDataChannel})`), this.hasPubDataChannel && this.hasSubDataChannel && (this.sendReadyMsg = !0, this.sendReadyMsgLoop());
|
|
8133
8134
|
}
|
|
8134
8135
|
sendReadyMsgLoop(e = 0) {
|
|
8135
8136
|
return I(this, null, function* () {
|
|
@@ -8141,7 +8142,7 @@ const Rr = (Nt = class extends He {
|
|
|
8141
8142
|
this.startReadyMsgTime || (this.startReadyMsgTime = Date.now());
|
|
8142
8143
|
let i = 50;
|
|
8143
8144
|
const s = Date.now() - this.startReadyMsgTime;
|
|
8144
|
-
i = s < 1e3 ? 50 : s < 2e3 ? 100 : s < 3e3 ? 500 : 2e3, e > 30 ?
|
|
8145
|
+
i = s < 1e3 ? 50 : s < 2e3 ? 100 : s < 3e3 ? 500 : 2e3, e > 30 ? O.event(`[${Nt.logName}]`, "sendReadyMsgLoop fail after 30 times") : this.sendReadyMsgTimer = window.setTimeout(() => {
|
|
8145
8146
|
this.sendReadyMsgLoop(e + 1);
|
|
8146
8147
|
}, i);
|
|
8147
8148
|
});
|
|
@@ -8157,6 +8158,7 @@ class Mc {
|
|
|
8157
8158
|
g(this, "_useAIAEC", !1);
|
|
8158
8159
|
g(this, "_enableSoft3A", !1);
|
|
8159
8160
|
g(this, "_enableSoft3ACheck", !1);
|
|
8161
|
+
g(this, "_useHardOnly", !1);
|
|
8160
8162
|
g(this, "_dumpAudioData", !1);
|
|
8161
8163
|
g(this, "_useAudio3AConfigFromServer", !0);
|
|
8162
8164
|
a && Object.assign(this, a);
|
|
@@ -8197,6 +8199,12 @@ class Mc {
|
|
|
8197
8199
|
set enableSoft3ACheck(a) {
|
|
8198
8200
|
this._enableSoft3ACheck = a;
|
|
8199
8201
|
}
|
|
8202
|
+
get useHardOnly() {
|
|
8203
|
+
return this._useHardOnly;
|
|
8204
|
+
}
|
|
8205
|
+
set useHardOnly(a) {
|
|
8206
|
+
this._useHardOnly = a;
|
|
8207
|
+
}
|
|
8200
8208
|
get dumpAudioData() {
|
|
8201
8209
|
return this._dumpAudioData;
|
|
8202
8210
|
}
|
|
@@ -8210,8 +8218,8 @@ class Mc {
|
|
|
8210
8218
|
this._useAudio3AConfigFromServer = a;
|
|
8211
8219
|
}
|
|
8212
8220
|
loadFromLocalConfig(a) {
|
|
8213
|
-
var e, t, i, s, n, o, c, h;
|
|
8214
|
-
this.useAudio3AConfigFromServer = (e = a.useAudio3AConfigFromServer) != null ? e : this.useAudio3AConfigFromServer, this.useSysEchoCancellation = (t = a.useSysEchoCancellation) != null ? t : this.useSysEchoCancellation, this.useSysNoiseSuppression = (i = a.useSysNoiseSuppression) != null ? i : this.useSysNoiseSuppression, this.useSysAutoGainControl = (s = a.useSysAutoGainControl) != null ? s : this.useSysAutoGainControl, this.useAIAEC = (n = a.useAIAEC) != null ? n : this.useAIAEC, this.enableSoft3A = (o = a.enableSoft3A) != null ? o : this.enableSoft3A, this.dumpAudioData = (c = a.dumpAudioData) != null ? c : this.dumpAudioData, this.enableSoft3ACheck = (h = a.enableSoft3ACheck) != null ? h : this.enableSoft3ACheck;
|
|
8221
|
+
var e, t, i, s, n, o, c, h, l;
|
|
8222
|
+
this.useAudio3AConfigFromServer = (e = a.useAudio3AConfigFromServer) != null ? e : this.useAudio3AConfigFromServer, this.useSysEchoCancellation = (t = a.useSysEchoCancellation) != null ? t : this.useSysEchoCancellation, this.useSysNoiseSuppression = (i = a.useSysNoiseSuppression) != null ? i : this.useSysNoiseSuppression, this.useSysAutoGainControl = (s = a.useSysAutoGainControl) != null ? s : this.useSysAutoGainControl, this.useAIAEC = (n = a.useAIAEC) != null ? n : this.useAIAEC, this.enableSoft3A = (o = a.enableSoft3A) != null ? o : this.enableSoft3A, this.dumpAudioData = (c = a.dumpAudioData) != null ? c : this.dumpAudioData, this.enableSoft3ACheck = (h = a.enableSoft3ACheck) != null ? h : this.enableSoft3ACheck, this.useHardOnly = (l = a.useHardOnly) != null ? l : this.useHardOnly;
|
|
8215
8223
|
}
|
|
8216
8224
|
loadFromServerConfig(a) {
|
|
8217
8225
|
if (a && typeof a == "object") {
|
|
@@ -8241,7 +8249,7 @@ class Mc {
|
|
|
8241
8249
|
const c = Yt(a, "useSysAutoGainControl");
|
|
8242
8250
|
c !== void 0 && (this.useSysAutoGainControl = c);
|
|
8243
8251
|
}
|
|
8244
|
-
|
|
8252
|
+
O.info("setAudio3AConfig:", "enableSoft3A", this.enableSoft3A, ", enableSoft3ACheck", this.enableSoft3ACheck, ", useAIAEC", this.useAIAEC, ", useSysNoiseSuppression", this.useSysNoiseSuppression, ", useSysEchoCancellation", this.useSysEchoCancellation, ", useSysAutoGainControl", this.useSysAutoGainControl);
|
|
8245
8253
|
}
|
|
8246
8254
|
}
|
|
8247
8255
|
}
|
|
@@ -8300,7 +8308,7 @@ class $e extends He {
|
|
|
8300
8308
|
console.error("Failed to parse userdata:", o);
|
|
8301
8309
|
}
|
|
8302
8310
|
});
|
|
8303
|
-
}), this.slsReporter.reportConnectionLatencyEvent(at.RECV_NOTIFY_PUBLISH, "", "", ""),
|
|
8311
|
+
}), this.slsReporter.reportConnectionLatencyEvent(at.RECV_NOTIFY_PUBLISH, "", "", ""), O.event("[Signaling] Notify Publish ", e), e.forEach((t) => {
|
|
8304
8312
|
this.onRemotePublishStateChange(t);
|
|
8305
8313
|
});
|
|
8306
8314
|
}), this.signalingManager.stsManager.on("onTokenUpdate", (e, t) => {
|
|
@@ -8443,7 +8451,7 @@ class $e extends He {
|
|
|
8443
8451
|
}
|
|
8444
8452
|
init(e, t, i) {
|
|
8445
8453
|
var s;
|
|
8446
|
-
this.authInfo = e, this.self.enableAudioVolumeIndication(this.audioVolumeIndicationInterval), this.self.initInfo(e, t.pushstreamurl), this.audio3AConfig.useAudio3AConfigFromServer && this.audio3AConfig.loadFromServerConfig((s = t == null ? void 0 : t.config) == null ? void 0 : s.data), this.setupAudioProcessingPluginIfNeeded(), i.capabilityProfile ===
|
|
8454
|
+
this.authInfo = e, this.self.enableAudioVolumeIndication(this.audioVolumeIndicationInterval), this.self.initInfo(e, t.pushstreamurl), this.audio3AConfig.useAudio3AConfigFromServer && this.audio3AConfig.loadFromServerConfig((s = t == null ? void 0 : t.config) == null ? void 0 : s.data), this.setupAudioProcessingPluginIfNeeded(), i.capabilityProfile === Or.Human && (this.dcReadyHelper = new Dc(this.self), this.dcReadyHelper.on("dcready", (n) => {
|
|
8447
8455
|
var o;
|
|
8448
8456
|
this.emit("remoteUserSubscribedDataChannel", n), (o = this.dcReadyHelper) == null || o.destory(), this.dcReadyHelper = void 0;
|
|
8449
8457
|
})), this.setTimeoutToUpdateAllStreamUrls(t.pushstreamurl), t.users.forEach((n) => {
|
|
@@ -8560,19 +8568,19 @@ class $e extends He {
|
|
|
8560
8568
|
updateAudioWant(e, t) {
|
|
8561
8569
|
const i = this.userMap[e];
|
|
8562
8570
|
if (!i)
|
|
8563
|
-
throw new
|
|
8571
|
+
throw new V(B.ERR_INNER, `no remote user(${e}) founded`);
|
|
8564
8572
|
i.setWantSubAudio(t), t ? i.updateSubscribe(fe.User) : i.stopSubscribe({ audio: !0 });
|
|
8565
8573
|
}
|
|
8566
8574
|
updateVideoWant(e, t) {
|
|
8567
8575
|
const i = this.userMap[e];
|
|
8568
8576
|
if (!i)
|
|
8569
|
-
throw new
|
|
8577
|
+
throw new V(B.ERR_INNER, `no remote user(${e}) founded`);
|
|
8570
8578
|
i.setWantSubVideo(t), t ? i.updateSubscribe(fe.User) : i.stopSubscribe({ video: !0 });
|
|
8571
8579
|
}
|
|
8572
8580
|
updateScreenWant(e, t) {
|
|
8573
8581
|
const i = this.userMap[e];
|
|
8574
8582
|
if (!i)
|
|
8575
|
-
throw new
|
|
8583
|
+
throw new V(B.ERR_INNER, `no remote user(${e}) founded`);
|
|
8576
8584
|
i.setWantSubScreen(t), t ? i.updateSubscribe(fe.User) : i.stopSubscribe({ screen: !0 });
|
|
8577
8585
|
}
|
|
8578
8586
|
stopIndication() {
|
|
@@ -8623,10 +8631,17 @@ class $e extends He {
|
|
|
8623
8631
|
}), t.enableBlankAudio === !0 ? (this.blankAudioPlugin || (this.blankAudioPlugin = new Rc()), this.pluginManager.has((i = this.blankAudioPlugin) == null ? void 0 : i.name) || this.pluginManager.add(this.blankAudioPlugin)) : t.enableBlankAudio === !1 && (this.blankAudioPlugin && this.pluginManager.remove((s = this.blankAudioPlugin) == null ? void 0 : s.name), (n = this.blankAudioPlugin) == null || n.clear(), this.blankAudioPlugin = void 0), t.audio && ((o = this.audio3AConfig) == null || o.loadFromLocalConfig(t.audio));
|
|
8624
8632
|
}
|
|
8625
8633
|
setupAudioProcessingPluginIfNeeded() {
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
|
|
8629
|
-
|
|
8634
|
+
if (this.audio3AConfig.enableSoft3A) {
|
|
8635
|
+
let e = 0;
|
|
8636
|
+
this.audio3AConfig.enableSoft3ACheck && (e = 1e4), setTimeout(() => {
|
|
8637
|
+
this.audioProcessorPlugin || (this.audioProcessorPlugin = new Cc({ dumpAudioData: this.audio3AConfig.dumpAudioData, aiaecOn: this.audio3AConfig.useAIAEC, slsReporter: this.slsReporter, enableSoft3ACheck: this.audio3AConfig.enableSoft3ACheck, useHardOnly: this.audio3AConfig.useHardOnly })), this.audioProcessorPlugin && !this.pluginManager.has(this.audioProcessorPlugin.name) && (this.audioProcessorPlugin.on("error", ({ message: t }) => {
|
|
8638
|
+
var i;
|
|
8639
|
+
O.error("audioProcessorPlugin error:", t), (i = this.self.audioTrack) == null || i.applyConstraints({ echoCancellation: !0, noiseSuppression: !0, autoGainControl: !0 });
|
|
8640
|
+
}), this.pluginManager.add(this.audioProcessorPlugin));
|
|
8641
|
+
}, e);
|
|
8642
|
+
} else
|
|
8643
|
+
this.audioProcessorPlugin && (this.pluginManager.remove(this.audioProcessorPlugin.name), this.audioProcessorPlugin = void 0);
|
|
8644
|
+
this.self.setMicrophoneConstraints({ echoCancellation: this.audio3AConfig.useSysEchoCancellation, noiseSuppression: this.audio3AConfig.useSysNoiseSuppression, autoGainControl: this.audio3AConfig.useSysAutoGainControl });
|
|
8630
8645
|
}
|
|
8631
8646
|
getParameter() {
|
|
8632
8647
|
return JSON.stringify(this.parameter);
|
|
@@ -8653,7 +8668,7 @@ class xc {
|
|
|
8653
8668
|
if (!t)
|
|
8654
8669
|
return Promise.reject(At.LiveTranscodingErrorInvalidParam);
|
|
8655
8670
|
const i = Go[a], s = { appid: t.appId, userid: t.userId, channelid: t.channelId, timestamp: t.timestamp, token: t.token, nonce: t.nonce ? t.nonce : "", requestid: it.createCallid(), tokensid: !1, session: (o = t.sessionId) != null ? o : it.createCallid() }, n = Object.keys(s).map((c) => `${c}=${encodeURIComponent(s[c])}`).join("&");
|
|
8656
|
-
return fetch(`https://gw.rtn.aliyuncs.com${i}?${n}`, { method: "POST", headers: { "Content-Type": "application/json; charset=UTF-8" }, body: JSON.stringify(e) }).then((c) => c.status !== 200 ? (this.slsReporter.reportTranscodingError(c.status, e.taskid || ""), Promise.reject(new
|
|
8671
|
+
return fetch(`https://gw.rtn.aliyuncs.com${i}?${n}`, { method: "POST", headers: { "Content-Type": "application/json; charset=UTF-8" }, body: JSON.stringify(e) }).then((c) => c.status !== 200 ? (this.slsReporter.reportTranscodingError(c.status, e.taskid || ""), Promise.reject(new V(B.ERR_INNER, `transcoding request failed, status: ${c.status}`))) : c).catch((c) => Promise.reject(new V(B.ERR_INNER, `transcoding request failed, err: ${c.message}`)));
|
|
8657
8672
|
}
|
|
8658
8673
|
setAuthInfo(a) {
|
|
8659
8674
|
this.authInfo = a;
|
|
@@ -8711,7 +8726,7 @@ class xc {
|
|
|
8711
8726
|
this.authInfo && this.setAuthInfo(J(J({}, this.authInfo), a));
|
|
8712
8727
|
}
|
|
8713
8728
|
}
|
|
8714
|
-
class
|
|
8729
|
+
class Vr {
|
|
8715
8730
|
static checkString(a) {
|
|
8716
8731
|
return typeof a == "string";
|
|
8717
8732
|
}
|
|
@@ -8725,7 +8740,7 @@ class Or {
|
|
|
8725
8740
|
return a && a.nodeName === "AUDIO";
|
|
8726
8741
|
}
|
|
8727
8742
|
static checkAuthInfo(a) {
|
|
8728
|
-
return a ? a.appId ? a.channelId ? a.userId ? a.timestamp ?
|
|
8743
|
+
return a ? a.appId ? a.channelId ? a.userId ? a.timestamp ? Vr.checkNumber(a.timestamp) ? a.token ? null : new V(B.ERR_JOIN_ERR_JOIN_BAD_PARAMBAD, "no token founded") : new V(B.ERR_JOIN_ERR_JOIN_BAD_PARAMBAD, "timestamp is not number") : new V(B.ERR_JOIN_ERR_JOIN_BAD_PARAMBAD, "no timestamp founded") : new V(B.ERR_JOIN_ERR_JOIN_BAD_PARAMBAD, "no userId founded") : new V(B.ERR_JOIN_ERR_JOIN_BAD_PARAMBAD, "no channelId founded") : new V(B.ERR_JOIN_ERR_JOIN_BAD_PARAMBAD, "no appId founded") : new V(B.ERR_JOIN_ERR_JOIN_BAD_PARAMBAD, "no authInfo founded");
|
|
8729
8744
|
}
|
|
8730
8745
|
static checkMediaStreamTrack(a) {
|
|
8731
8746
|
return a instanceof MediaStreamTrack;
|
|
@@ -8734,7 +8749,7 @@ class Or {
|
|
|
8734
8749
|
return a && (a.width || a.height || a.frameRate || a.bitrateMax);
|
|
8735
8750
|
}
|
|
8736
8751
|
}
|
|
8737
|
-
class
|
|
8752
|
+
class Oc {
|
|
8738
8753
|
constructor(a) {
|
|
8739
8754
|
g(this, "taskProfile");
|
|
8740
8755
|
g(this, "encodeParam");
|
|
@@ -8748,7 +8763,7 @@ class Vc {
|
|
|
8748
8763
|
this.taskProfile = a;
|
|
8749
8764
|
}
|
|
8750
8765
|
}
|
|
8751
|
-
class
|
|
8766
|
+
class Vc {
|
|
8752
8767
|
constructor(a, e, t) {
|
|
8753
8768
|
g(this, "userId");
|
|
8754
8769
|
g(this, "streamType");
|
|
@@ -8900,7 +8915,7 @@ const Re = (r, a = 1, e = 6e4, t = 0) => {
|
|
|
8900
8915
|
(!a || a < 0 || a > 1e4) && (i = 1e3);
|
|
8901
8916
|
let s = r;
|
|
8902
8917
|
return s || (s = 0), Math.min(e, Math.max(t, Math.round(s / (i / 1e3))));
|
|
8903
|
-
},
|
|
8918
|
+
}, Vt = (r, a) => {
|
|
8904
8919
|
if (a === 0 || !a)
|
|
8905
8920
|
return "0.00";
|
|
8906
8921
|
let e = r;
|
|
@@ -8963,7 +8978,7 @@ const Re = (r, a = 1, e = 6e4, t = 0) => {
|
|
|
8963
8978
|
d.push(M);
|
|
8964
8979
|
const L = _e(P, "packetsLost"), D = ot(L, z);
|
|
8965
8980
|
b.push(D);
|
|
8966
|
-
const N =
|
|
8981
|
+
const N = Vt(L, ee);
|
|
8967
8982
|
if (u.push(N), n)
|
|
8968
8983
|
(me = P._source) != null && me.audioLevel && f.push(Xa(P._source.audioLevel)), p.push(0);
|
|
8969
8984
|
else {
|
|
@@ -9001,7 +9016,7 @@ const Re = (r, a = 1, e = 6e4, t = 0) => {
|
|
|
9001
9016
|
d.push(Ae);
|
|
9002
9017
|
const ke = _e($, "packetsLost"), se = ot(ke, le);
|
|
9003
9018
|
b.push(se);
|
|
9004
|
-
const re =
|
|
9019
|
+
const re = Vt(ke, te);
|
|
9005
9020
|
u.push(re);
|
|
9006
9021
|
const Z = _e($, "jitterBufferDelay"), ue = _e($, "jitterBufferEmittedCount");
|
|
9007
9022
|
if ($.jitterBufferDelay && $.jitterBufferEmittedCount) {
|
|
@@ -9010,24 +9025,24 @@ const Re = (r, a = 1, e = 6e4, t = 0) => {
|
|
|
9010
9025
|
} else
|
|
9011
9026
|
f.push(0);
|
|
9012
9027
|
const Ie = _e($, "fecPacketsReceived");
|
|
9013
|
-
_.push(
|
|
9028
|
+
_.push(Vt(Ie, te));
|
|
9014
9029
|
const ie = _e($, "retransmittedPacketsReceived"), je = te + ke - ie;
|
|
9015
|
-
if (m.push(
|
|
9030
|
+
if (m.push(Vt(te - ie, je)), S.push(Vt(ke, je)), p.push(Vt(ie, je)), A.push(je), me.push(0), ye.push(""), n) {
|
|
9016
9031
|
v.push(Xa($.audioLevel));
|
|
9017
9032
|
const Je = ((Ge, pt) => {
|
|
9018
9033
|
var qt, nt, wt;
|
|
9019
9034
|
return (((qt = Ge == null ? void 0 : Ge._source) == null ? void 0 : qt[pt]) || 0) - (((wt = (nt = Ge == null ? void 0 : Ge._last) == null ? void 0 : nt._source) == null ? void 0 : wt[pt]) || 0);
|
|
9020
9035
|
})($, "synthesizedSamplesEvents");
|
|
9021
9036
|
w.push(Je);
|
|
9022
|
-
const
|
|
9023
|
-
R.push(
|
|
9024
|
-
const Gt =
|
|
9037
|
+
const Ve = Ya($, "synthesizedSamplesDuration");
|
|
9038
|
+
R.push(Ve);
|
|
9039
|
+
const Gt = Vt(Ve, le);
|
|
9025
9040
|
y.push(Gt), E.push(0);
|
|
9026
9041
|
} else {
|
|
9027
9042
|
const Je = (Ee = $._last) != null && Ee.totalInterFrameDelay ? $.totalInterFrameDelay - $._last.totalInterFrameDelay : 0;
|
|
9028
9043
|
C.push(Re(Je, 1e3 / ($.framesDecoded || 30), 500)), x.push(Re($.framesPerSecond, 1, 100)), P.push(_e($, "framesReceived")), ce.push(_e($, "framesRendered")), z.push(Re($.frameHeight, 1, 4400)), G.push(Re($.frameWidth, 1, 7700));
|
|
9029
|
-
const
|
|
9030
|
-
X.push(Re(
|
|
9044
|
+
const Ve = _e($, "totalProcessingDelay");
|
|
9045
|
+
X.push(Re(Ve, 1e3 / ($.framesDecoded || 30), 12e4));
|
|
9031
9046
|
const Gt = _e($, "nackCount");
|
|
9032
9047
|
H.push(Gt);
|
|
9033
9048
|
const Ge = _e($, "pliCount");
|
|
@@ -9171,7 +9186,7 @@ const Re = (r, a = 1, e = 6e4, t = 0) => {
|
|
|
9171
9186
|
this.log({ evetid: 12001, args: this.data2String(h) });
|
|
9172
9187
|
}
|
|
9173
9188
|
log(a) {
|
|
9174
|
-
a && (a.tm = (/* @__PURE__ */ new Date()).getTime(),
|
|
9189
|
+
a && (a.tm = (/* @__PURE__ */ new Date()).getTime(), O.debug("[ConsoleLogger]", "log", a), this.logClient.sendReport(a));
|
|
9175
9190
|
}
|
|
9176
9191
|
data2String(a) {
|
|
9177
9192
|
let e = "";
|
|
@@ -9207,20 +9222,20 @@ const F = (W = class extends He {
|
|
|
9207
9222
|
g(this, "_proxyAiTid", null);
|
|
9208
9223
|
g(this, "_agentParam", null);
|
|
9209
9224
|
const t = Date.now();
|
|
9210
|
-
|
|
9225
|
+
O.init(), this.slsReporter = new wr(this), this.channelProfile = Ct.AliRtcSdkCommunication, this.clientRole = Bt.AliRtcSdkLive, this.liveTranscoding = new xc(this.slsReporter), this.signalingManager = new Lr(this.channelProfile, this.clientRole, this.slsReporter, (e == null ? void 0 : e.env) === _t.pre ? _t.pre : _t.prod), this.addSignalingManagerListeners(), this.maxSignalingConnectRetryCount = e == null ? void 0 : e.maxSignalingConnectRetryCount, this.bizControl = new $e({ slsReporter: this.slsReporter, signalingManager: this.signalingManager }), this.addBizControlListeners(), this.addPublisherListeners(), this.slsReporter.reportConnectionLatencyEvent(at.CREATE_ENGINE, ht.START, "", "", t), this.slsReporter.reportConnectionLatencyEvent(at.CREATE_ENGINE, ht.END, "", "", Date.now()), this.slsReporter.reportSDKCreated(t);
|
|
9211
9226
|
}
|
|
9212
9227
|
static getSdkVersion() {
|
|
9213
9228
|
return Li;
|
|
9214
9229
|
}
|
|
9215
9230
|
static setLogLevel(e) {
|
|
9216
|
-
|
|
9231
|
+
O.setLogLevel(e);
|
|
9217
9232
|
}
|
|
9218
9233
|
static getInstance(e) {
|
|
9219
9234
|
return W._instance || (W._instance = new W(e)), W._instance;
|
|
9220
9235
|
}
|
|
9221
9236
|
destroy() {
|
|
9222
9237
|
return I(this, null, function* () {
|
|
9223
|
-
W._instance = void 0, yield this.leaveChannel(), yield this.bizControl.clear(),
|
|
9238
|
+
W._instance = void 0, yield this.leaveChannel(), yield this.bizControl.clear(), O.destroy();
|
|
9224
9239
|
});
|
|
9225
9240
|
}
|
|
9226
9241
|
get channel() {
|
|
@@ -9249,13 +9264,13 @@ const F = (W = class extends He {
|
|
|
9249
9264
|
addPublisherListeners() {
|
|
9250
9265
|
var e, t, i, s, n, o, c, h, l, d;
|
|
9251
9266
|
(e = this.publisher) == null || e.on(Ze.Local, (b) => {
|
|
9252
|
-
|
|
9267
|
+
O.event("[Publisher] Device Status Change", b), this.onLocalDeviceStatusChange(b);
|
|
9253
9268
|
}), (t = this.publisher) == null || t.on($t.VideoTrackEnded, () => {
|
|
9254
|
-
|
|
9269
|
+
O.event("[Publisher] VideoTrack Ended"), this.emit("localDeviceException", Rt.AliEngineLocalDeviceTypeCamera, xe.AliEngineLocalDeviceExceptionTypeCameraInterrupt, "");
|
|
9255
9270
|
}), (i = this.publisher) == null || i.on($t.ScreenTrackEnded, () => {
|
|
9256
|
-
|
|
9271
|
+
O.event("[Publisher] ScreenTrack Ended"), this.emit("localDeviceException", Rt.AliEngineLocalDeviceTypeDisplay, xe.AliEngineLocalDeviceExceptionTypeDisplayException, "");
|
|
9257
9272
|
}), (s = this.publisher) == null || s.on($t.AudioTrackEnded, () => {
|
|
9258
|
-
|
|
9273
|
+
O.event("[Publisher] AudioTrack Ended"), this.emit("localDeviceException", Rt.AliEngineLocalDeviceTypeMic, xe.AliEngineLocalDeviceExceptionTypeMicInterrupt, "");
|
|
9259
9274
|
}), (n = this.publisher) == null || n.on("localDeviceException", (b, u, f = "") => {
|
|
9260
9275
|
this.emit("localDeviceException", b, u, f);
|
|
9261
9276
|
}), (o = this.publisher) == null || o.on("audioPublishStateChanged", (b, u, f) => {
|
|
@@ -9276,7 +9291,7 @@ const F = (W = class extends He {
|
|
|
9276
9291
|
});
|
|
9277
9292
|
}
|
|
9278
9293
|
occurError(e, t) {
|
|
9279
|
-
|
|
9294
|
+
O.event(`[${W.logName}]`, "Occur Error", e, t), this.emit("onOccurError", e, t), this.emit("occurError", e, t);
|
|
9280
9295
|
}
|
|
9281
9296
|
addBizControlListeners() {
|
|
9282
9297
|
this.bizControl.rtsManager.on("connected", (e) => {
|
|
@@ -9285,14 +9300,14 @@ const F = (W = class extends He {
|
|
|
9285
9300
|
i.updateSubscribe(fe.Reconnect);
|
|
9286
9301
|
}));
|
|
9287
9302
|
}), this.bizControl.rtsManager.on("disconnected", () => I(this, null, function* () {
|
|
9288
|
-
|
|
9303
|
+
O.event(`[${W.logName}]`, "RTS Disconnected"), (yield it.isNetworkAvailable()) ? this.onNetworkRecovery() : this.onNetworkError();
|
|
9289
9304
|
})), this.bizControl.rtsManager.on("subscribeexceeds", () => I(this, null, function* () {
|
|
9290
9305
|
yield this.resumePublishForNetworkRecovery(), yield this.resumeSubList();
|
|
9291
9306
|
})), this.bizControl.rtsManager.on("seimessage", (e, t, i) => {
|
|
9292
9307
|
const s = this.remoteUsers.find((n) => n.streamUrl === e);
|
|
9293
9308
|
s && this.emit("mediaExtensionMsgReceived", s.userId, i, t);
|
|
9294
9309
|
}), this.bizControl.on(Ze.Remote, (e, t) => {
|
|
9295
|
-
|
|
9310
|
+
O.event(`[${W.logName}]`, "RemoteUser Device Status Change", e, t);
|
|
9296
9311
|
}), this.bizControl.on("remoteUserJoin", (e, t) => {
|
|
9297
9312
|
this.emit("remoteUserOnLineNotify", e, t);
|
|
9298
9313
|
}), this.bizControl.on("remoteTrackAvailableChange", (e, t, i) => {
|
|
@@ -9343,35 +9358,35 @@ const F = (W = class extends He {
|
|
|
9343
9358
|
}
|
|
9344
9359
|
addSignalingManagerListeners() {
|
|
9345
9360
|
this.signalingManager.on("onKeepAliveRsp", () => {
|
|
9346
|
-
this.networkError && (
|
|
9361
|
+
this.networkError && (O.event("[Signaling] Receive KeepAlive Response", `networkError: ${this.networkError}`), this.onNetworkRecovery());
|
|
9347
9362
|
}), this.signalingManager.on("onNotifyJoin", (e) => {
|
|
9348
|
-
|
|
9363
|
+
O.event("[Signaling] Notify Join ", e), this.handleUsersJoin(e), e.forEach((t) => {
|
|
9349
9364
|
this.emit("remoteUserOnLineNotify", t.userid, 0);
|
|
9350
9365
|
});
|
|
9351
9366
|
}), this.signalingManager.on("onNotifyStatus", (e) => {
|
|
9352
|
-
|
|
9367
|
+
O.event("[Signaling] Notify Status ", e), e.forEach((t) => {
|
|
9353
9368
|
this.bizControl.updateRemoteUserDeviceStatus(t);
|
|
9354
9369
|
});
|
|
9355
9370
|
}), this.signalingManager.on("onNotifyLeave", (e) => {
|
|
9356
|
-
|
|
9371
|
+
O.event("[Signaling] Notify Leave ", e), e.forEach((t) => I(this, null, function* () {
|
|
9357
9372
|
yield this.bizControl.removeLeftUser(t), this.emit("remoteUserOffLineNotify", t.userid, t.leavecode);
|
|
9358
9373
|
}));
|
|
9359
9374
|
}), this.signalingManager.on("onBye", (e, t) => {
|
|
9360
|
-
|
|
9375
|
+
O.event("[Signaling] Bye ", e, t), this.slsReporter.reportError({ message: `reason: ${e}, description: ${t}` }), this.emit("bye", e), this.signalingManager.reset(), this.leaveChannel(), this.slsReporter.reportBye(e);
|
|
9361
9376
|
}), this.signalingManager.on("onConnectFail", (e) => {
|
|
9362
|
-
|
|
9377
|
+
O.event("[Signaling] Connect Failed ", e), this.onError(e), this.backToUnpublishStatus(), this.connectState = ne.AliRtcConnectionStatusFailed, this.emit("connectionStatusChange", ne.AliRtcConnectionStatusFailed, yt.AliRtcConnectionChangedNetworkInterrupted);
|
|
9363
9378
|
}), this.signalingManager.on("onNetworkError", (e) => {
|
|
9364
|
-
this.slsReporter.reportWarning("signaling network error"),
|
|
9379
|
+
this.slsReporter.reportWarning("signaling network error"), O.event("[Signaling] Network error ", e), this.onNetworkError();
|
|
9365
9380
|
}), this.signalingManager.on("onAuthInvalid", () => {
|
|
9366
|
-
|
|
9381
|
+
O.event("[Signaling] Auth Invalid");
|
|
9367
9382
|
}), this.signalingManager.on("onReconnectStart", () => {
|
|
9368
|
-
|
|
9383
|
+
O.event("[Signaling] Reconnect Start "), this.connectState = ne.AliRtcConnectionStatusReconnecting, this.emit("connectionStatusChange", ne.AliRtcConnectionStatusReconnecting, yt.AliRtcConnectionSignalingConnecting);
|
|
9369
9384
|
}), this.signalingManager.on("onReconnectSuccess", (e) => {
|
|
9370
|
-
|
|
9385
|
+
O.event("[Signaling] Reconnect Success ", e), this.onNetworkRecovery(e);
|
|
9371
9386
|
}), this.signalingManager.on("onReconnectFail", (e) => {
|
|
9372
|
-
this.slsReporter.reportWarning("signaling reconnect fail: ${err.code}"),
|
|
9387
|
+
this.slsReporter.reportWarning("signaling reconnect fail: ${err.code}"), O.event("[Signaling] Reconnect Failed ", e), e.code === 403 && this.emit("authInfoExpired");
|
|
9373
9388
|
}), this.signalingManager.on("onError", (e) => {
|
|
9374
|
-
this.slsReporter.reportWarning("signaling error: ${err.message}"),
|
|
9389
|
+
this.slsReporter.reportWarning("signaling error: ${err.message}"), O.event("[Signaling] Error ", e), this.onError(e);
|
|
9375
9390
|
}), this.signalingManager.on("onUnknownMessage", (e) => {
|
|
9376
9391
|
if (e.msgtype === "proxyai" && e.tid === this._proxyAiTid) {
|
|
9377
9392
|
let t = e.data.retcode;
|
|
@@ -9386,14 +9401,14 @@ const F = (W = class extends He {
|
|
|
9386
9401
|
handleUsersJoin(e) {
|
|
9387
9402
|
e.forEach((t) => {
|
|
9388
9403
|
const i = t.userid;
|
|
9389
|
-
i && (this.bizControl.addUser(i, t.displayname, fe.Join),
|
|
9404
|
+
i && (this.bizControl.addUser(i, t.displayname, fe.Join), O.event(`[${W.logName}]`, we.UserJoined, i));
|
|
9390
9405
|
});
|
|
9391
9406
|
}
|
|
9392
9407
|
onLocalDeviceStatusChange(e) {
|
|
9393
|
-
|
|
9394
|
-
|
|
9408
|
+
O.event(`[${W.logName}]`, Ze.Local, e), this.signalingManager.reportStatus(e).then(() => {
|
|
9409
|
+
O.debug("[signaling] reportStatus suc");
|
|
9395
9410
|
}).catch((t) => {
|
|
9396
|
-
|
|
9411
|
+
O.error("[signaling] reportStatus failed", t);
|
|
9397
9412
|
});
|
|
9398
9413
|
}
|
|
9399
9414
|
resumePublishForNetworkRecovery() {
|
|
@@ -9428,15 +9443,15 @@ const F = (W = class extends He {
|
|
|
9428
9443
|
onNetworkRecovery(e) {
|
|
9429
9444
|
return I(this, null, function* () {
|
|
9430
9445
|
var t;
|
|
9431
|
-
|
|
9446
|
+
O.event(W.logName, "onNetworkRecovery", `rts isConnected: ${this.bizControl.rtsManager.isConnected}; rts isConnecting: ${this.bizControl.rtsManager.isConnecting}`, { users: e }), this.bizControl.rtsManager.isConnected || this.bizControl.rtsManager.isConnecting ? e && (yield this.resumeSubList(e)) : (this.currentRoleCanPublish && (yield this.resumePublishForNetworkRecovery()), yield this.resumeSubList()), this.networkError && (this.networkError = !1, (t = this.publisher) == null || t.reportSelfDeviceStatus(), this.connectState = ne.AliRtcConnectionStatusConnected, this.emit("connectionStatusChange", ne.AliRtcConnectionStatusConnected, yt.AliRtcConnectionSignalingHeartbeatAlive));
|
|
9432
9447
|
});
|
|
9433
9448
|
}
|
|
9434
9449
|
resumeSubList(e) {
|
|
9435
9450
|
return I(this, null, function* () {
|
|
9436
9451
|
if (e != null && e.length) {
|
|
9437
9452
|
const { joinList: t, leaveList: i, presentList: s } = this.bizControl.updateUsers(e);
|
|
9438
|
-
|
|
9439
|
-
|
|
9453
|
+
O.info(`[${W.logName}]`, "resumeSubList", { joinList: t, leaveList: i, presentList: s }), this.handleUsersJoin(t), i.forEach((n) => {
|
|
9454
|
+
O.event(W.logName, we.UserLeft, n.userid, n.reason), this.emit("remoteUserOffLineNotify", n.userid, Nr.AliRtcUserOfflineQuit);
|
|
9440
9455
|
});
|
|
9441
9456
|
for (let n = 0; n < s.length; n++) {
|
|
9442
9457
|
const o = s[n], c = o.userid, h = this.bizControl.getRemoteUser(c);
|
|
@@ -9456,7 +9471,7 @@ const F = (W = class extends He {
|
|
|
9456
9471
|
return I(this, null, function* () {
|
|
9457
9472
|
const t = this.bizControl.getRemoteUser(e);
|
|
9458
9473
|
if (!t)
|
|
9459
|
-
throw new
|
|
9474
|
+
throw new V(B.ERR_INNER, `no remote user(${e}) founded`);
|
|
9460
9475
|
t.restore(), t.updateSubscribe(fe.Retry);
|
|
9461
9476
|
});
|
|
9462
9477
|
}
|
|
@@ -9464,14 +9479,14 @@ const F = (W = class extends He {
|
|
|
9464
9479
|
this.connectState === ne.AliRtcConnectionStatusConnected && (this.networkError || (this.connectState = ne.AliRtcConnectionStatusDisconnected, this.emit("connectionStatusChange", ne.AliRtcConnectionStatusDisconnected, yt.AliRtcConnectionChangedNetworkInterrupted)), this.networkError = !0);
|
|
9465
9480
|
}
|
|
9466
9481
|
onError(e) {
|
|
9467
|
-
this.slsReporter.reportError(e),
|
|
9482
|
+
this.slsReporter.reportError(e), O.event(W.logName, we.Error, e);
|
|
9468
9483
|
}
|
|
9469
9484
|
setEnableDualVideoStream(e, t) {
|
|
9470
9485
|
this.bizControl.setEnableDualVideoStream(e, t);
|
|
9471
9486
|
}
|
|
9472
9487
|
hadPushStream(e) {
|
|
9473
9488
|
if (!this.publisher || !e)
|
|
9474
|
-
throw new
|
|
9489
|
+
throw new V(B.ERR_INNER, "stream is not publishing");
|
|
9475
9490
|
}
|
|
9476
9491
|
getCurrentMicDeviceId() {
|
|
9477
9492
|
var e;
|
|
@@ -9479,7 +9494,7 @@ const F = (W = class extends He {
|
|
|
9479
9494
|
}
|
|
9480
9495
|
setChannelProfile(e) {
|
|
9481
9496
|
if (![ne.AliRtcConnectionStatusInit, ne.AliRtcConnectionStatusDisconnected, ne.AliRtcConnectionStatusFailed].includes(this.connectState))
|
|
9482
|
-
throw new
|
|
9497
|
+
throw new V(B.ERR_INNER, "cannot set channel profile in call");
|
|
9483
9498
|
this.channelProfile = e, this.channelProfile === Ct.AliRtcSdkCommunication && (this.clientRole = Bt.AliRtcSdkLive), this.signalingManager.setChannelProfile(e);
|
|
9484
9499
|
}
|
|
9485
9500
|
startDefaultDevices() {
|
|
@@ -9492,12 +9507,12 @@ const F = (W = class extends He {
|
|
|
9492
9507
|
try {
|
|
9493
9508
|
yield (s = this.publisher) == null ? void 0 : s.startDefaultCamera(this._audioOnlyMode);
|
|
9494
9509
|
} catch (c) {
|
|
9495
|
-
|
|
9510
|
+
O.warn(`[${W.logName}]`, "startDefaultCamera failed", c.code, c.message), c instanceof V && this.occurError(c), this.occurError(new V(B.ERR_SDK_PUBLISH_VIDEO_STREAM_FAILED, `auto start video failed, ${c.message || ""}`));
|
|
9496
9511
|
}
|
|
9497
9512
|
try {
|
|
9498
9513
|
yield (n = this.publisher) == null ? void 0 : n.startDefaultAudio();
|
|
9499
9514
|
} catch (c) {
|
|
9500
|
-
|
|
9515
|
+
O.warn(`[${W.logName}]`, "startDefaultAUdio failed", c.code, c.message), c instanceof V && this.occurError(c), this.occurError(new V(B.ERR_SDK_PUBLISH_AUDIO_STREAM_FAILED, `auto start audio failed, ${c.message || ""}`));
|
|
9501
9516
|
}
|
|
9502
9517
|
yield (o = this.publisher) == null ? void 0 : o.previewAll();
|
|
9503
9518
|
}
|
|
@@ -9511,7 +9526,7 @@ const F = (W = class extends He {
|
|
|
9511
9526
|
} catch (s) {
|
|
9512
9527
|
const n = ((i = this.publisher) == null ? void 0 : i.publishStreams) || {}, o = [];
|
|
9513
9528
|
n != null && n.audio && o.push(B.ERR_SDK_PUBLISH_AUDIO_STREAM_FAILED), n != null && n.video && o.push(B.ERR_SDK_PUBLISH_VIDEO_STREAM_FAILED), o.forEach((c) => {
|
|
9514
|
-
this.occurError(new
|
|
9529
|
+
this.occurError(new V(c, `auto publish stream failed, ${s.message || ""}`));
|
|
9515
9530
|
});
|
|
9516
9531
|
}
|
|
9517
9532
|
});
|
|
@@ -9523,7 +9538,7 @@ const F = (W = class extends He {
|
|
|
9523
9538
|
if (this.channelProfile === Ct.AliRtcSdkCommunication)
|
|
9524
9539
|
return;
|
|
9525
9540
|
if (!Object.values(Bt).includes(e))
|
|
9526
|
-
throw new
|
|
9541
|
+
throw new V(B.ERR_INVALID_ARGUMENTS, `set client role error, role value(${e}) is invalid`);
|
|
9527
9542
|
if (this.clientRole === e)
|
|
9528
9543
|
return;
|
|
9529
9544
|
this.slsReporter.reportRoleUpdate(this.clientRole, e), this.isInCall() ? this.clientRole === Bt.AliRtcSdkInteractive ? ((t = this.publisher) != null && t.isPublishing ? yield (i = this.publisher) == null ? void 0 : i.unPublish() : yield (s = this.publisher) == null ? void 0 : s.clearStream(), yield this.signalingManager.setClientRole(e)) : (yield this.signalingManager.setClientRole(e), yield this.startDefaultDevices(), yield this.startPublish(St.ROLE_CHANGE)) : yield this.signalingManager.setClientRole(e), this.clientRole = e;
|
|
@@ -9537,12 +9552,12 @@ const F = (W = class extends He {
|
|
|
9537
9552
|
}
|
|
9538
9553
|
setAudioOnlyMode(e) {
|
|
9539
9554
|
if (this.isInCall())
|
|
9540
|
-
throw new
|
|
9555
|
+
throw new V(B.ERR_INNER, "can not change audioOnly mode in call");
|
|
9541
9556
|
this._audioOnlyMode = e;
|
|
9542
9557
|
}
|
|
9543
9558
|
setAudioRedEnabled(e) {
|
|
9544
9559
|
if (this.isInCall())
|
|
9545
|
-
throw new
|
|
9560
|
+
throw new V(B.ERR_INNER, "can not change audioRedEnabled in call");
|
|
9546
9561
|
this.bizControl.setAudioRedEnabled(e);
|
|
9547
9562
|
}
|
|
9548
9563
|
setCheckAuthInfoTimer(e, t) {
|
|
@@ -9566,31 +9581,31 @@ const F = (W = class extends He {
|
|
|
9566
9581
|
const d = JSON.parse(window.atob(e));
|
|
9567
9582
|
n = { appId: d.appid, channelId: d.channelid, userId: d.userid, timestamp: d.timestamp, nonce: d.nonce, token: d.token };
|
|
9568
9583
|
} catch (d) {
|
|
9569
|
-
throw new
|
|
9584
|
+
throw new V(B.ERR_INVALID_ARGUMENTS, `authInfo is invalid: ${d.message || ""}`);
|
|
9570
9585
|
}
|
|
9571
9586
|
else
|
|
9572
9587
|
n = e;
|
|
9573
9588
|
o || (o = n.userId);
|
|
9574
9589
|
const c = { start: Date.now() };
|
|
9575
|
-
let h =
|
|
9590
|
+
let h = Vr.checkAuthInfo(n);
|
|
9576
9591
|
if (ne.AliRtcConnectionStatusInit !== this.connectState && ne.AliRtcConnectionStatusDisconnected !== this.connectState && ne.AliRtcConnectionStatusFailed !== this.connectState) {
|
|
9577
|
-
const d = new
|
|
9592
|
+
const d = new V(B.ERR_JOIN_ALREADY_JOINED, "already joined");
|
|
9578
9593
|
throw this.connectState === ne.AliRtcConnectionStatusConnecting && (d.message = "Repeated operation during login"), this.slsReporter.reportJoin(d.code, c, ""), d;
|
|
9579
9594
|
}
|
|
9580
9595
|
{
|
|
9581
9596
|
if (h)
|
|
9582
9597
|
throw this.connectState = ne.AliRtcConnectionStatusFailed, this.slsReporter.reportJoin(h.code, c, ""), this.slsReporter.reportJoinResult(h), h;
|
|
9583
|
-
n.sessionId = it.createCallid("web"), this.slsReporter.start(n), this.slsReporter.reportConnectionLatencyEvent(at.JOIN, ht.START, "", "", s), this.connectState = ne.AliRtcConnectionStatusConnecting, this.emit("connectionStatusChange", ne.AliRtcConnectionStatusConnecting, yt.AliRtcConnectionSignalingConnecting),
|
|
9598
|
+
n.sessionId = it.createCallid("web"), this.slsReporter.start(n), this.slsReporter.reportConnectionLatencyEvent(at.JOIN, ht.START, "", "", s), this.connectState = ne.AliRtcConnectionStatusConnecting, this.emit("connectionStatusChange", ne.AliRtcConnectionStatusConnecting, yt.AliRtcConnectionSignalingConnecting), O.setSessionID(n.appId, n.sessionId);
|
|
9584
9599
|
const d = () => I(this, null, function* () {
|
|
9585
9600
|
var b;
|
|
9586
9601
|
try {
|
|
9587
9602
|
const u = Date.now(), f = yield this.signalingManager.join(n, o, this.maxSignalingConnectRetryCount, c, i);
|
|
9588
9603
|
f.l1ip && this.publisher && (this.publisher.preferredPubL1Ip = f.l1ip);
|
|
9589
9604
|
const p = Date.now();
|
|
9590
|
-
this.connectState = ne.AliRtcConnectionStatusConnected, this.emit("connectionStatusChange", ne.AliRtcConnectionStatusConnected, yt.AliRtcConnectionSignalingJoinRoomSuccess), this.bizControl.init(n, f, { capabilityProfile: typeof t == "object" ? t.capabilityProfile :
|
|
9605
|
+
this.connectState = ne.AliRtcConnectionStatusConnected, this.emit("connectionStatusChange", ne.AliRtcConnectionStatusConnected, yt.AliRtcConnectionSignalingJoinRoomSuccess), this.bizControl.init(n, f, { capabilityProfile: typeof t == "object" ? t.capabilityProfile : Or.Default }), this.setCheckAuthInfoTimer(n.timestamp, f.timestamp), this.liveTranscoding.setAuthInfo(n), this.slsReporter.reportJoin(0, c, f.tid), this.slsReporter.reportJoinResult(null), this.slsReporter.reportConnectionLatencyEvent(at.JOIN, ht.SEND_SIG, "", "", u), this.slsReporter.reportConnectionLatencyEvent(at.JOIN, ht.RECV_RST, "", "", p), this.slsReporter.reportConnectionLatencyEvent(at.JOIN, ht.END, "", "");
|
|
9591
9606
|
} catch (u) {
|
|
9592
9607
|
const f = (b = u.code) != null ? b : -1, p = u.reason || u.message || "";
|
|
9593
|
-
throw this.connectState = ne.AliRtcConnectionStatusDisconnected, this.emit("connectionStatusChange", ne.AliRtcConnectionStatusDisconnected, yt.AliRtcConnectionSignalingJoinRoomFailure), this.slsReporter.reportJoin(f, c, ""), this.slsReporter.reportJoinResult(u), new
|
|
9608
|
+
throw this.connectState = ne.AliRtcConnectionStatusDisconnected, this.emit("connectionStatusChange", ne.AliRtcConnectionStatusDisconnected, yt.AliRtcConnectionSignalingJoinRoomFailure), this.slsReporter.reportJoin(f, c, ""), this.slsReporter.reportJoinResult(u), new V(f, p);
|
|
9594
9609
|
}
|
|
9595
9610
|
});
|
|
9596
9611
|
this.currentRoleCanPublish ? (yield Promise.all([d(), this.startDefaultDevices()]), yield this.startPublish(St.JOIN_CHANNEL)) : yield d(), (l = this.publisher) == null || l.reportSelfDeviceStatus(), this.remoteUsers.forEach((b) => {
|
|
@@ -9618,7 +9633,7 @@ const F = (W = class extends He {
|
|
|
9618
9633
|
}
|
|
9619
9634
|
else
|
|
9620
9635
|
this.slsReporter.reportLeave(0, 0, "");
|
|
9621
|
-
this.networkError = !1, this.connectState = ne.AliRtcConnectionStatusDisconnected, this.clearCheckAuthInfoTimer(), this.liveTranscoding.clear(), this.slsReporter.stop(), this.signalingManager.reset(),
|
|
9636
|
+
this.networkError = !1, this.connectState = ne.AliRtcConnectionStatusDisconnected, this.clearCheckAuthInfoTimer(), this.liveTranscoding.clear(), this.slsReporter.stop(), this.signalingManager.reset(), O.reportEnd();
|
|
9622
9637
|
});
|
|
9623
9638
|
}
|
|
9624
9639
|
isInCall() {
|
|
@@ -9632,7 +9647,7 @@ const F = (W = class extends He {
|
|
|
9632
9647
|
const l = JSON.parse(window.atob(e));
|
|
9633
9648
|
t = { userId: l.userid, timestamp: l.timestamp, nonce: l.nonce, token: l.token };
|
|
9634
9649
|
} catch (l) {
|
|
9635
|
-
throw new
|
|
9650
|
+
throw new V(B.ERR_INVALID_ARGUMENTS, `authInfo is invalid: ${l.message || ""}`);
|
|
9636
9651
|
}
|
|
9637
9652
|
else
|
|
9638
9653
|
t = e;
|
|
@@ -9665,19 +9680,19 @@ const F = (W = class extends He {
|
|
|
9665
9680
|
}
|
|
9666
9681
|
subscribeRemoteAudioStream(e, t) {
|
|
9667
9682
|
if (t && !this.bizControl.isWantSubAudio)
|
|
9668
|
-
throw new
|
|
9683
|
+
throw new V(B.ERR_INVALID_ARGUMENTS, "subscribeAllRemoteAudioStreams(true) must be called first");
|
|
9669
9684
|
this.bizControl.updateAudioWant(e, t);
|
|
9670
9685
|
}
|
|
9671
9686
|
resumeRemoteAudioStream(e) {
|
|
9672
9687
|
const t = this.bizControl.getRemoteUser(e);
|
|
9673
9688
|
if (!t)
|
|
9674
|
-
throw new
|
|
9689
|
+
throw new V(B.ERR_INNER, `no remote user(${e}) founded`);
|
|
9675
9690
|
t.resumeAudio();
|
|
9676
9691
|
}
|
|
9677
9692
|
stopRemoteAudioPlay(e) {
|
|
9678
9693
|
const t = this.bizControl.getRemoteUser(e);
|
|
9679
9694
|
if (!t)
|
|
9680
|
-
throw new
|
|
9695
|
+
throw new V(B.ERR_INNER, `no remote user(${e}) founded`);
|
|
9681
9696
|
t.stopPlayAudio();
|
|
9682
9697
|
}
|
|
9683
9698
|
publishLocalVideoStream(e) {
|
|
@@ -9705,7 +9720,7 @@ const F = (W = class extends He {
|
|
|
9705
9720
|
subscribeRemoteMediaStream(e, t, i, s) {
|
|
9706
9721
|
const n = this.bizControl.getRemoteUser(e);
|
|
9707
9722
|
if (!n)
|
|
9708
|
-
throw new
|
|
9723
|
+
throw new V(B.ERR_INNER, `no remote user(${e}) founded`);
|
|
9709
9724
|
!i || t !== oe.AliRtcVideoTrackScreen && t !== oe.AliRtcVideoTrackBoth ? n.setWantSubScreen(!1) : n.setWantSubScreen(!0), !i || t !== oe.AliRtcVideoTrackCamera && t !== oe.AliRtcVideoTrackBoth ? n.setWantSubVideo(!1) : n.setWantSubVideo(!0), n.setWantSubAudio(s), n.updateSubscribe(fe.User);
|
|
9710
9725
|
}
|
|
9711
9726
|
resumeRemoteMediaStream(e, t) {
|
|
@@ -9746,7 +9761,7 @@ const F = (W = class extends He {
|
|
|
9746
9761
|
var n;
|
|
9747
9762
|
const t = {}, { width: i, height: s } = e;
|
|
9748
9763
|
if (i && !isNaN(i) && s && !isNaN(s) && i * s > 9437184)
|
|
9749
|
-
throw new
|
|
9764
|
+
throw new V(B.ERR_INVALID_ARGUMENTS, "width * height must be less than 9437184");
|
|
9750
9765
|
Object.keys(e).forEach((o) => {
|
|
9751
9766
|
o !== "width" && o !== "height" || (t[o] = e[o]);
|
|
9752
9767
|
}), yield (n = this.publisher) == null ? void 0 : n.setScreenProfile(t);
|
|
@@ -9770,7 +9785,7 @@ const F = (W = class extends He {
|
|
|
9770
9785
|
}
|
|
9771
9786
|
setAudioShareVolume(e) {
|
|
9772
9787
|
if (typeof e != "number")
|
|
9773
|
-
throw new
|
|
9788
|
+
throw new V(B.ERR_INVALID_ARGUMENTS, "volume must be a number");
|
|
9774
9789
|
this.bizControl.setAudioVolume({ screen: Math.max(0, Math.min(e, 400)) / 100 });
|
|
9775
9790
|
}
|
|
9776
9791
|
enableAudioVolumeIndication(e) {
|
|
@@ -9783,7 +9798,7 @@ const F = (W = class extends He {
|
|
|
9783
9798
|
muteRemoteAudioPlaying(e, t = !1) {
|
|
9784
9799
|
const i = this.bizControl.getRemoteUser(e);
|
|
9785
9800
|
if (!i)
|
|
9786
|
-
throw new
|
|
9801
|
+
throw new V(B.ERR_INNER, `no remote user(${e}) founded`);
|
|
9787
9802
|
i.setAudioMuted(t);
|
|
9788
9803
|
}
|
|
9789
9804
|
muteAllRemoteAudioPlaying(e = !1) {
|
|
@@ -9818,20 +9833,20 @@ const F = (W = class extends He {
|
|
|
9818
9833
|
}
|
|
9819
9834
|
setRecordingVolume(e) {
|
|
9820
9835
|
if (typeof e != "number")
|
|
9821
|
-
throw new
|
|
9836
|
+
throw new V(B.ERR_INVALID_ARGUMENTS, "volume must be a number");
|
|
9822
9837
|
this.bizControl.setAudioVolume({ audio: Math.max(0, Math.min(e, 400)) / 100 });
|
|
9823
9838
|
}
|
|
9824
9839
|
setPlayoutVolume(e) {
|
|
9825
9840
|
if (typeof e != "number")
|
|
9826
|
-
throw new
|
|
9841
|
+
throw new V(B.ERR_INVALID_ARGUMENTS, "volume must be a number");
|
|
9827
9842
|
this.bizControl.setPlayoutVolume(Math.max(0, Math.min(e, 100)) / 100);
|
|
9828
9843
|
}
|
|
9829
9844
|
setRemoteAudioVolume(e, t) {
|
|
9830
9845
|
const i = this.bizControl.getRemoteUser(e);
|
|
9831
9846
|
if (!i)
|
|
9832
|
-
throw new
|
|
9847
|
+
throw new V(B.ERR_INNER, `no remote user(${e}) founded`);
|
|
9833
9848
|
if (typeof t != "number")
|
|
9834
|
-
throw new
|
|
9849
|
+
throw new V(B.ERR_INVALID_ARGUMENTS, "volume must be a number");
|
|
9835
9850
|
i.setPlayoutVolume(Math.max(0, Math.min(t, 100)) / 100);
|
|
9836
9851
|
}
|
|
9837
9852
|
setAudioProfile(e) {
|
|
@@ -9853,7 +9868,7 @@ const F = (W = class extends He {
|
|
|
9853
9868
|
return I(this, null, function* () {
|
|
9854
9869
|
var i, s, n;
|
|
9855
9870
|
if (this._audioOnlyMode)
|
|
9856
|
-
throw new
|
|
9871
|
+
throw new V(B.ERR_INNER, "Cannot set local view in audio only mode");
|
|
9857
9872
|
(i = this.bizControl) == null || i.setLocalViewConfig(e, t), t === oe.AliRtcVideoTrackCamera && ((s = this.publisher) != null && s.hasCamera) ? yield this.startPreview() : t === oe.AliRtcVideoTrackScreen && ((n = this.publisher) != null && n.hasScreenShare) && (yield this.startPreviewScreen());
|
|
9858
9873
|
});
|
|
9859
9874
|
}
|
|
@@ -9874,7 +9889,7 @@ const F = (W = class extends He {
|
|
|
9874
9889
|
return I(this, null, function* () {
|
|
9875
9890
|
var t, i, s, n, o, c, h, l, d, b, u;
|
|
9876
9891
|
if (this._audioOnlyMode)
|
|
9877
|
-
throw new
|
|
9892
|
+
throw new V(B.ERR_INNER, "Cannot enable local video in audio only mode");
|
|
9878
9893
|
e ? ((i = (t = this.publisher) == null ? void 0 : t.publishStreams) != null && i.video && ((o = (n = (s = this.publisher) == null ? void 0 : s.publishStreams) == null ? void 0 : n.video) == null || o.disableVideo(), (d = (l = (h = (c = this.publisher) == null ? void 0 : c.publishStreams) == null ? void 0 : h.video) == null ? void 0 : l.videoTrack) == null || d.stop()), yield (b = this.publisher) == null ? void 0 : b.startCameraCapture()) : yield (u = this.publisher) == null ? void 0 : u.stopCameraCapture();
|
|
9879
9894
|
});
|
|
9880
9895
|
}
|
|
@@ -9901,7 +9916,7 @@ const F = (W = class extends He {
|
|
|
9901
9916
|
return I(this, null, function* () {
|
|
9902
9917
|
var s, n, o, c, h, l;
|
|
9903
9918
|
if (this._audioOnlyMode)
|
|
9904
|
-
throw new
|
|
9919
|
+
throw new V(B.ERR_INNER, "Cannot switch camera in audio only mode");
|
|
9905
9920
|
const i = {};
|
|
9906
9921
|
if (e ? (i.deviceId = e, this.slsReporter.reportSwitchCamera(e)) : t || (i.cameraDirection = ((s = this.publisher) == null ? void 0 : s.cameraDirection) === "environment" ? mi.CAMERA_FRONT : mi.CAMERA_REAR, this.slsReporter.reportSwitchCamera(((n = this.publisher) == null ? void 0 : n.cameraDirection) || "")), yield this.setCameraCapturerConfiguration(i), !((o = this.publisher) != null && o.cameraCaptureDisabled)) {
|
|
9907
9922
|
(h = (c = this.publisher) == null ? void 0 : c.cameraTrack) == null || h.stop();
|
|
@@ -9918,7 +9933,7 @@ const F = (W = class extends He {
|
|
|
9918
9933
|
return I(this, null, function* () {
|
|
9919
9934
|
var e, t;
|
|
9920
9935
|
if (this._audioOnlyMode)
|
|
9921
|
-
throw new
|
|
9936
|
+
throw new V(B.ERR_INNER, "Cannot start preview camera in audio only mode");
|
|
9922
9937
|
(e = this.publisher) != null && e.hasCamera || (yield this.enableLocalVideo(!0)), yield (t = this.publisher) == null ? void 0 : t.previewAll({ screen: !1 });
|
|
9923
9938
|
});
|
|
9924
9939
|
}
|
|
@@ -9926,7 +9941,7 @@ const F = (W = class extends He {
|
|
|
9926
9941
|
return I(this, null, function* () {
|
|
9927
9942
|
var t, i;
|
|
9928
9943
|
if (this._audioOnlyMode)
|
|
9929
|
-
throw new
|
|
9944
|
+
throw new V(B.ERR_INNER, "Cannot start preview screen share in audio only mode");
|
|
9930
9945
|
(t = this.publisher) != null && t.hasScreenShare || (yield this.startScreenShare(e)), yield (i = this.publisher) == null ? void 0 : i.previewAll({ primary: !1 });
|
|
9931
9946
|
});
|
|
9932
9947
|
}
|
|
@@ -9986,7 +10001,7 @@ const F = (W = class extends He {
|
|
|
9986
10001
|
return I(this, null, function* () {
|
|
9987
10002
|
var s;
|
|
9988
10003
|
if (!this.publisher || !this.isPublishing)
|
|
9989
|
-
throw new
|
|
10004
|
+
throw new V(B.ERR_INNER, "you should publish first");
|
|
9990
10005
|
return this.slsReporter.reportSEIMessage(i, e.byteLength, t, 0, !1), (s = this.publisher) == null ? void 0 : s.sendSEI(e, t, i);
|
|
9991
10006
|
});
|
|
9992
10007
|
}
|
|
@@ -10013,26 +10028,26 @@ const F = (W = class extends He {
|
|
|
10013
10028
|
isBeautyEnabled() {
|
|
10014
10029
|
const e = this.bizControl.pluginManager.get("AliRtcBeauty");
|
|
10015
10030
|
if (!e)
|
|
10016
|
-
throw new
|
|
10031
|
+
throw new V(Dt.AliRtcPluginErrorNoFindPlugin, "you should enable beautyPlugin first");
|
|
10017
10032
|
return !!(e != null && e.isEnable);
|
|
10018
10033
|
}
|
|
10019
10034
|
setBeautyEffect(e, t) {
|
|
10020
10035
|
const i = this.bizControl.pluginManager.get("AliRtcBeauty");
|
|
10021
10036
|
if (!i)
|
|
10022
|
-
throw new
|
|
10037
|
+
throw new V(Dt.AliRtcPluginErrorNoFindPlugin, "you should enable beautyPlugin first");
|
|
10023
10038
|
e ? i.enable() : i.disable(), i.setOptions({ basicBeauty: { skinBuffing: Math.max(Math.min(1, +t.smoothnessLevel), 0), whitening: Math.max(Math.min(1, +t.whiteningLevel), 0) } });
|
|
10024
10039
|
}
|
|
10025
10040
|
enableBackgroundExchange(e, t) {
|
|
10026
10041
|
const i = this.bizControl.pluginManager.get("AliRtcBeauty");
|
|
10027
10042
|
if (!i || !i.isEnable)
|
|
10028
|
-
throw new
|
|
10043
|
+
throw new V(Dt.AliRtcPluginErrorNoFindPlugin, "you should enable beautyPlugin first");
|
|
10029
10044
|
const s = { setSegmentBackgroundImage: { backgroundImgUrl: e ? t : "" } };
|
|
10030
10045
|
e && (s.segmentBackgroundProcess = { enable: !1 }), i.setOptions(s);
|
|
10031
10046
|
}
|
|
10032
10047
|
enableBackgroundBlur(e) {
|
|
10033
10048
|
const t = this.bizControl.pluginManager.get("AliRtcBeauty");
|
|
10034
10049
|
if (!t || !t.isEnable)
|
|
10035
|
-
throw new
|
|
10050
|
+
throw new V(Dt.AliRtcPluginErrorNoFindPlugin, "you should enable beautyPlugin first");
|
|
10036
10051
|
const i = { segmentBackgroundProcess: { type: 0, enable: e } };
|
|
10037
10052
|
e && (i.setSegmentBackgroundImage = { type: 0, backgroundImgUrl: "" }), t.setOptions(i);
|
|
10038
10053
|
}
|
|
@@ -10051,7 +10066,7 @@ const F = (W = class extends He {
|
|
|
10051
10066
|
return (yield Se.getMicList()).filter((e) => e.deviceId);
|
|
10052
10067
|
})), g(W, "getSpeakerList", () => I(W, null, function* () {
|
|
10053
10068
|
return (yield Se.getSpeakerList()).filter((e) => e.deviceId);
|
|
10054
|
-
})), g(W, "_instance"), g(W, "AliRtcSdkChannelProfile", Ct), g(W, "AliRtcSdkClientRole", Bt), g(W, "AliRtcVideoStreamType", Ke), g(W, "AliRtcVideoTrack", oe), g(W, "AliRtcAudioTrack", ii), g(W, "AliRtcPublishState", Q), g(W, "AliRtcSubscribeState", pe), g(W, "AliRtcRawDataStreamType", Le), g(W, "AliRtcLogLevel", sn), g(W, "AliRtcEngineLocalDeviceType", Rt), g(W, "AliRtcEngineLocalDeviceExceptionType", xe), g(W, "AliRtcConnectionStatus", ne), g(W, "AliRtcConnectionStatusChangeReason", yt), g(W, "AliRtcPlugin", Jt), g(W, "AliRtcPluginTrackType", fi), g(W, "AliRtcLiveTranscodingParam", mr), g(W, "AliRtcLiveTranscodingEncodeParam", ln), g(W, "AliRtcLiveTranscodingMixParam",
|
|
10069
|
+
})), g(W, "_instance"), g(W, "AliRtcSdkChannelProfile", Ct), g(W, "AliRtcSdkClientRole", Bt), g(W, "AliRtcVideoStreamType", Ke), g(W, "AliRtcVideoTrack", oe), g(W, "AliRtcAudioTrack", ii), g(W, "AliRtcPublishState", Q), g(W, "AliRtcSubscribeState", pe), g(W, "AliRtcRawDataStreamType", Le), g(W, "AliRtcLogLevel", sn), g(W, "AliRtcEngineLocalDeviceType", Rt), g(W, "AliRtcEngineLocalDeviceExceptionType", xe), g(W, "AliRtcConnectionStatus", ne), g(W, "AliRtcConnectionStatusChangeReason", yt), g(W, "AliRtcPlugin", Jt), g(W, "AliRtcPluginTrackType", fi), g(W, "AliRtcLiveTranscodingParam", mr), g(W, "AliRtcLiveTranscodingEncodeParam", ln), g(W, "AliRtcLiveTranscodingMixParam", Oc), g(W, "AliRtcLiveTranscodingSingleParam", Vc), g(W, "AliRtcTranscodingClockWidget", Uc), g(W, "AliRtcTranscodingImage", yn), g(W, "AliRtcTranscodingText", Bc), g(W, "AliRtcTranscodingUser", Hc), g(W, "AliRtcLiveTranscodingMixMode", Pi), g(W, "AliRtcLiveTranscodingStreamType", an), g(W, "AliRtcLiveTranscodingSourceType", pi), g(W, "AliRtcLiveTranscodingTaskProfile", nn), g(W, "AliRtcLiveTranscodingAudioSampleRate", Pr), g(W, "AliRtcLiveTranscodingSegmentType", Di), g(W, "AliRtcLiveTranscodingFontType", xi), g(W, "AliRtcLiveTranscodingCropMode", on), g(W, "AliRtcLiveTranscodingMediaProcessMode", Dr), g(W, "AliRtcLiveTranscodingState", cn), g(W, "AliRtcLiveTranscodingErrorCode", At), g(W, "AliRtcTrascodingPublishTaskStatus", hn), g(W, "AliRtcDataChannelMsg", Kt), g(W, "AliRtcDataMsgType", fn), g(W, "Plugin", Jt), W);
|
|
10055
10070
|
j([T()], F.prototype, "destroy", 1), j([T()], F.prototype, "backToUnpublishStatus", 1), j([T()], F.prototype, "resumePublishForNetworkRecovery", 1), j([T()], F.prototype, "onNetworkRecovery", 1), j([T()], F.prototype, "resumeSubList", 1), j([T(U)], F.prototype, "retrySubscribe", 1), j([T(U)], F.prototype, "setEnableDualVideoStream", 1), j([T(U)], F.prototype, "setChannelProfile", 1), j([T(U)], F.prototype, "setClientRole", 1), j([T(U)], F.prototype, "setAudioOnlyMode", 1), j([T()], F.prototype, "clearCheckAuthInfoTimer", 1), j([T(U)], F.prototype, "joinChannel", 1), j([T(U)], F.prototype, "joinAIChannel", 1), j([T(U)], F.prototype, "leaveChannel", 1), j([T(U)], F.prototype, "refreshAuthInfo", 1), j([T(U)], F.prototype, "publishLocalAudioStream", 1), j([T(U)], F.prototype, "setDefaultSubscribeAllRemoteAudioStreams", 1), j([T(U)], F.prototype, "subscribeAllRemoteAudioStreams", 1), j([T(U)], F.prototype, "subscribeRemoteAudioStream", 1), j([T(U)], F.prototype, "resumeRemoteAudioStream", 1), j([T(U)], F.prototype, "stopRemoteAudioPlay", 1), j([T(U)], F.prototype, "publishLocalVideoStream", 1), j([T(U)], F.prototype, "setRemoteDefaultVideoStreamType", 1), j([T(U)], F.prototype, "setRemoteUserVideoStreamType", 1), j([T(U)], F.prototype, "setDefaultSubscribeAllRemoteVideoStreams", 1), j([T(U)], F.prototype, "subscribeAllRemoteVideoStreams", 1), j([T(U)], F.prototype, "subscribeRemoteMediaStream", 1), j([T(U)], F.prototype, "resumeRemoteMediaStream", 1), j([T(([r]) => [`${r == null ? void 0 : r.audio}`])], F.prototype, "startScreenShare", 1), j([T()], F.prototype, "stopScreenShare", 1), j([T(U)], F.prototype, "setScreenShareConfiguration", 1), j([T(U)], F.prototype, "setScreenShareContentHint", 1), j([T()], F.prototype, "publishLocalScreenShareStream", 1), j([T(U)], F.prototype, "setAudioShareVolume", 1), j([T(U)], F.prototype, "enableAudioVolumeIndication", 1), j([T(U)], F.prototype, "muteLocalMic", 1), j([T(U)], F.prototype, "muteRemoteAudioPlaying", 1), j([T(U)], F.prototype, "muteAllRemoteAudioPlaying", 1), j([T(U)], F.prototype, "startAudioCapture", 1), j([T(U)], F.prototype, "setAudioConstraints", 1), j([T()], F.prototype, "stopAudioCapture", 1), j([T(U)], F.prototype, "switchMicrophone", 1), j([T(U)], F.prototype, "setRecordingVolume", 1), j([T(U)], F.prototype, "setPlayoutVolume", 1), j([T(U)], F.prototype, "setRemoteAudioVolume", 1), j([T(U)], F.prototype, "setAudioProfile", 1), j([T(U)], F.prototype, "getAudioTrack", 1), j([T(U)], F.prototype, "setLocalViewConfig", 1), j([T(U)], F.prototype, "setCameraCapturerConfiguration", 1), j([T(U)], F.prototype, "setCameraCapturerContentHint", 1), j([T(U)], F.prototype, "enableLocalVideo", 1), j([T(U)], F.prototype, "muteLocalCamera", 1), j([T(U)], F.prototype, "muteLocalScreen", 1), j([T(U)], F.prototype, "setRemoteViewConfig", 1), j([T(U)], F.prototype, "switchCamera", 1), j([T()], F.prototype, "startPreview", 1), j([T()], F.prototype, "startPreviewScreen", 1), j([T()], F.prototype, "stopPreview", 1), j([T()], F.prototype, "stopPreviewScreen", 1), j([T()], F.prototype, "startPublishLiveStream", 1), j([T()], F.prototype, "updatePublishLiveStream", 1), j([T()], F.prototype, "updatePublishLiveStreamWithTaskId", 1), j([T()], F.prototype, "stopPublishLiveStream", 1), j([T()], F.prototype, "stopPublishLiveStreamWithTaskId", 1), j([T(U)], F.prototype, "setEnableMediaExtensionMsg", 1), j([T(([r, a, e]) => [r.byteLength, a, e])], F.prototype, "sendMediaExtensionMsgEx", 1), j([T(([r, a]) => [r.name || "", a])], F.prototype, "enablePlugin", 1), j([T(U)], F.prototype, "removePlugin", 1), j([T(U)], F.prototype, "setPluginOption", 1), j([T(U)], F.prototype, "getPluginByName", 1), j([T(U)], F.prototype, "getPluginOption", 1), j([T(U)], F.prototype, "setBeautyEffect", 1), j([T(U)], F.prototype, "enableBackgroundExchange", 1), j([T(U)], F.prototype, "enableBackgroundBlur", 1), j([T(U)], F.prototype, "setParameter", 1), j([T(([r]) => {
|
|
10056
10071
|
var a;
|
|
10057
10072
|
return [(a = r.data) == null ? void 0 : a.byteLength];
|
|
@@ -10063,7 +10078,7 @@ _n.setReady();
|
|
|
10063
10078
|
const $c = _n.wrap(Rn);
|
|
10064
10079
|
export {
|
|
10065
10080
|
ii as AliRtcAudioTrack,
|
|
10066
|
-
|
|
10081
|
+
Or as AliRtcCapabilityProfile,
|
|
10067
10082
|
ne as AliRtcConnectionStatus,
|
|
10068
10083
|
yt as AliRtcConnectionStatusChangeReason,
|
|
10069
10084
|
Kt as AliRtcDataChannelMsg,
|
|
@@ -10078,10 +10093,10 @@ export {
|
|
|
10078
10093
|
xi as AliRtcLiveTranscodingFontType,
|
|
10079
10094
|
Dr as AliRtcLiveTranscodingMediaProcessMode,
|
|
10080
10095
|
Pi as AliRtcLiveTranscodingMixMode,
|
|
10081
|
-
|
|
10096
|
+
Oc as AliRtcLiveTranscodingMixParam,
|
|
10082
10097
|
mr as AliRtcLiveTranscodingParam,
|
|
10083
10098
|
Di as AliRtcLiveTranscodingSegmentType,
|
|
10084
|
-
|
|
10099
|
+
Vc as AliRtcLiveTranscodingSingleParam,
|
|
10085
10100
|
pi as AliRtcLiveTranscodingSourceType,
|
|
10086
10101
|
cn as AliRtcLiveTranscodingState,
|
|
10087
10102
|
an as AliRtcLiveTranscodingStreamType,
|