media-av 0.0.21 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -7
- package/dist/mediaAV.js +161 -146
- package/dist/mediaAV.umd.cjs +8 -8
- package/package.json +1 -1
package/dist/mediaAV.js
CHANGED
|
@@ -9,25 +9,25 @@ function ur(t, e) {
|
|
|
9
9
|
const { toString: en } = Object.prototype, { getPrototypeOf: St } = Object, Me = /* @__PURE__ */ ((t) => (e) => {
|
|
10
10
|
const r = en.call(e);
|
|
11
11
|
return t[r] || (t[r] = r.slice(8, -1).toLowerCase());
|
|
12
|
-
})(/* @__PURE__ */ Object.create(null)),
|
|
12
|
+
})(/* @__PURE__ */ Object.create(null)), H = (t) => (t = t.toLowerCase(), (e) => Me(e) === t), He = (t) => (e) => typeof e === t, { isArray: de } = Array, ve = He("undefined");
|
|
13
13
|
function tn(t) {
|
|
14
|
-
return t !== null && !ve(t) && t.constructor !== null && !ve(t.constructor) &&
|
|
14
|
+
return t !== null && !ve(t) && t.constructor !== null && !ve(t.constructor) && _(t.constructor.isBuffer) && t.constructor.isBuffer(t);
|
|
15
15
|
}
|
|
16
|
-
const fr =
|
|
16
|
+
const fr = H("ArrayBuffer");
|
|
17
17
|
function rn(t) {
|
|
18
18
|
let e;
|
|
19
19
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && fr(t.buffer), e;
|
|
20
20
|
}
|
|
21
|
-
const nn = He("string"),
|
|
21
|
+
const nn = He("string"), _ = He("function"), dr = He("number"), $e = (t) => t !== null && typeof t == "object", on = (t) => t === !0 || t === !1, Pe = (t) => {
|
|
22
22
|
if (Me(t) !== "object")
|
|
23
23
|
return !1;
|
|
24
24
|
const e = St(t);
|
|
25
25
|
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(Symbol.toStringTag in t) && !(Symbol.iterator in t);
|
|
26
|
-
}, sn =
|
|
26
|
+
}, sn = H("Date"), an = H("File"), cn = H("Blob"), ln = H("FileList"), un = (t) => $e(t) && _(t.pipe), fn = (t) => {
|
|
27
27
|
let e;
|
|
28
|
-
return t && (typeof FormData == "function" && t instanceof FormData ||
|
|
29
|
-
e === "object" &&
|
|
30
|
-
}, dn =
|
|
28
|
+
return t && (typeof FormData == "function" && t instanceof FormData || _(t.append) && ((e = Me(t)) === "formdata" || // detect form-data instance
|
|
29
|
+
e === "object" && _(t.toString) && t.toString() === "[object FormData]"));
|
|
30
|
+
}, dn = H("URLSearchParams"), pn = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
31
31
|
function Ee(t, e, { allOwnKeys: r = !1 } = {}) {
|
|
32
32
|
if (t === null || typeof t > "u")
|
|
33
33
|
return;
|
|
@@ -62,7 +62,7 @@ function ot() {
|
|
|
62
62
|
return e;
|
|
63
63
|
}
|
|
64
64
|
const hn = (t, e, r, { allOwnKeys: n } = {}) => (Ee(e, (o, i) => {
|
|
65
|
-
r &&
|
|
65
|
+
r && _(o) ? t[i] = ur(o, r) : t[i] = o;
|
|
66
66
|
}, { allOwnKeys: n }), t), yn = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), mn = (t, e, r, n) => {
|
|
67
67
|
t.prototype = Object.create(e.prototype, n), t.prototype.constructor = t, Object.defineProperty(t, "super", {
|
|
68
68
|
value: e.prototype
|
|
@@ -107,12 +107,12 @@ const hn = (t, e, r, { allOwnKeys: n } = {}) => (Ee(e, (o, i) => {
|
|
|
107
107
|
for (; (r = t.exec(e)) !== null; )
|
|
108
108
|
n.push(r);
|
|
109
109
|
return n;
|
|
110
|
-
}, An =
|
|
110
|
+
}, An = H("HTMLFormElement"), On = (t) => t.toLowerCase().replace(
|
|
111
111
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
112
112
|
function(r, n, o) {
|
|
113
113
|
return n.toUpperCase() + o;
|
|
114
114
|
}
|
|
115
|
-
), _t = (({ hasOwnProperty: t }) => (e, r) => t.call(e, r))(Object.prototype), Rn =
|
|
115
|
+
), _t = (({ hasOwnProperty: t }) => (e, r) => t.call(e, r))(Object.prototype), Rn = H("RegExp"), mr = (t, e) => {
|
|
116
116
|
const r = Object.getOwnPropertyDescriptors(t), n = {};
|
|
117
117
|
Ee(r, (o, i) => {
|
|
118
118
|
let s;
|
|
@@ -120,10 +120,10 @@ const hn = (t, e, r, { allOwnKeys: n } = {}) => (Ee(e, (o, i) => {
|
|
|
120
120
|
}), Object.defineProperties(t, n);
|
|
121
121
|
}, Cn = (t) => {
|
|
122
122
|
mr(t, (e, r) => {
|
|
123
|
-
if (
|
|
123
|
+
if (_(t) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
|
|
124
124
|
return !1;
|
|
125
125
|
const n = t[r];
|
|
126
|
-
if (
|
|
126
|
+
if (_(n)) {
|
|
127
127
|
if (e.enumerable = !1, "writable" in e) {
|
|
128
128
|
e.writable = !1;
|
|
129
129
|
return;
|
|
@@ -153,7 +153,7 @@ const hn = (t, e, r, { allOwnKeys: n } = {}) => (Ee(e, (o, i) => {
|
|
|
153
153
|
return r;
|
|
154
154
|
};
|
|
155
155
|
function Ln(t) {
|
|
156
|
-
return !!(t &&
|
|
156
|
+
return !!(t && _(t.append) && t[Symbol.toStringTag] === "FormData" && t[Symbol.iterator]);
|
|
157
157
|
}
|
|
158
158
|
const Fn = (t) => {
|
|
159
159
|
const e = new Array(10), r = (n, o) => {
|
|
@@ -172,7 +172,7 @@ const Fn = (t) => {
|
|
|
172
172
|
return n;
|
|
173
173
|
};
|
|
174
174
|
return r(t, 0);
|
|
175
|
-
}, Nn =
|
|
175
|
+
}, Nn = H("AsyncFunction"), _n = (t) => t && ($e(t) || _(t)) && _(t.then) && _(t.catch), u = {
|
|
176
176
|
isArray: de,
|
|
177
177
|
isArrayBuffer: fr,
|
|
178
178
|
isBuffer: tn,
|
|
@@ -188,7 +188,7 @@ const Fn = (t) => {
|
|
|
188
188
|
isFile: an,
|
|
189
189
|
isBlob: cn,
|
|
190
190
|
isRegExp: Rn,
|
|
191
|
-
isFunction:
|
|
191
|
+
isFunction: _,
|
|
192
192
|
isStream: un,
|
|
193
193
|
isURLSearchParams: dn,
|
|
194
194
|
isTypedArray: bn,
|
|
@@ -201,7 +201,7 @@ const Fn = (t) => {
|
|
|
201
201
|
inherits: mn,
|
|
202
202
|
toFlatObject: gn,
|
|
203
203
|
kindOf: Me,
|
|
204
|
-
kindOfTest:
|
|
204
|
+
kindOfTest: H,
|
|
205
205
|
endsWith: Sn,
|
|
206
206
|
toArray: wn,
|
|
207
207
|
forEachEntry: vn,
|
|
@@ -322,10 +322,10 @@ function Ve(t, e, r) {
|
|
|
322
322
|
if (u.endsWith(h, "{}"))
|
|
323
323
|
h = n ? h : h.slice(0, -2), p = JSON.stringify(p);
|
|
324
324
|
else if (u.isArray(p) && Un(p) || (u.isFileList(p) || u.endsWith(h, "[]")) && (S = u.toArray(p)))
|
|
325
|
-
return h = br(h), S.forEach(function(T,
|
|
325
|
+
return h = br(h), S.forEach(function(T, W) {
|
|
326
326
|
!(u.isUndefined(T) || T === null) && e.append(
|
|
327
327
|
// eslint-disable-next-line no-nested-ternary
|
|
328
|
-
s === !0 ? Ut([h],
|
|
328
|
+
s === !0 ? Ut([h], W, i) : s === null ? h : h + "[]",
|
|
329
329
|
l(T)
|
|
330
330
|
);
|
|
331
331
|
}), !1;
|
|
@@ -471,14 +471,14 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", qn
|
|
|
471
471
|
hasBrowserEnv: Or,
|
|
472
472
|
hasStandardBrowserEnv: Gn,
|
|
473
473
|
hasStandardBrowserWebWorkerEnv: Wn
|
|
474
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
474
|
+
}, Symbol.toStringTag, { value: "Module" })), M = {
|
|
475
475
|
...qn,
|
|
476
476
|
...Vn
|
|
477
477
|
};
|
|
478
478
|
function zn(t, e) {
|
|
479
|
-
return Ve(t, new
|
|
479
|
+
return Ve(t, new M.classes.URLSearchParams(), Object.assign({
|
|
480
480
|
visitor: function(r, n, o, i) {
|
|
481
|
-
return
|
|
481
|
+
return M.isNode && u.isBuffer(r) ? (this.append(n, r.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
|
|
482
482
|
}
|
|
483
483
|
}, e));
|
|
484
484
|
}
|
|
@@ -571,8 +571,8 @@ const bt = {
|
|
|
571
571
|
maxContentLength: -1,
|
|
572
572
|
maxBodyLength: -1,
|
|
573
573
|
env: {
|
|
574
|
-
FormData:
|
|
575
|
-
Blob:
|
|
574
|
+
FormData: M.classes.FormData,
|
|
575
|
+
Blob: M.classes.Blob
|
|
576
576
|
},
|
|
577
577
|
validateStatus: function(e) {
|
|
578
578
|
return e >= 200 && e < 300;
|
|
@@ -771,9 +771,9 @@ u.reduceDescriptors(Ge.prototype, ({ value: t }, e) => {
|
|
|
771
771
|
};
|
|
772
772
|
});
|
|
773
773
|
u.freezeMethods(Ge);
|
|
774
|
-
const
|
|
774
|
+
const G = Ge;
|
|
775
775
|
function ze(t, e) {
|
|
776
|
-
const r = this || vt, n = e || r, o =
|
|
776
|
+
const r = this || vt, n = e || r, o = G.from(n.headers);
|
|
777
777
|
let i = n.data;
|
|
778
778
|
return u.forEach(t, function(a) {
|
|
779
779
|
i = a.call(r, i, o.normalize(), e ? e.status : void 0);
|
|
@@ -798,7 +798,7 @@ function ro(t, e, r) {
|
|
|
798
798
|
r
|
|
799
799
|
));
|
|
800
800
|
}
|
|
801
|
-
const no =
|
|
801
|
+
const no = M.hasStandardBrowserEnv ? (
|
|
802
802
|
// Standard browser envs support document.cookie
|
|
803
803
|
{
|
|
804
804
|
write(t, e, r, n, o, i) {
|
|
@@ -834,7 +834,7 @@ function io(t, e) {
|
|
|
834
834
|
function Ir(t, e) {
|
|
835
835
|
return t && !oo(e) ? io(t, e) : e;
|
|
836
836
|
}
|
|
837
|
-
const so =
|
|
837
|
+
const so = M.hasStandardBrowserEnv ? (
|
|
838
838
|
// Standard browser envs have full support of the APIs needed to test
|
|
839
839
|
// whether the request URL is of the same origin as current location.
|
|
840
840
|
function() {
|
|
@@ -907,14 +907,14 @@ function Ht(t, e) {
|
|
|
907
907
|
const lo = typeof XMLHttpRequest < "u", uo = lo && function(t) {
|
|
908
908
|
return new Promise(function(r, n) {
|
|
909
909
|
let o = t.data;
|
|
910
|
-
const i =
|
|
910
|
+
const i = G.from(t.headers).normalize();
|
|
911
911
|
let { responseType: s, withXSRFToken: a } = t, c;
|
|
912
912
|
function l() {
|
|
913
913
|
t.cancelToken && t.cancelToken.unsubscribe(c), t.signal && t.signal.removeEventListener("abort", c);
|
|
914
914
|
}
|
|
915
915
|
let d;
|
|
916
916
|
if (u.isFormData(o)) {
|
|
917
|
-
if (
|
|
917
|
+
if (M.hasStandardBrowserEnv || M.hasStandardBrowserWebWorkerEnv)
|
|
918
918
|
i.setContentType(!1);
|
|
919
919
|
else if ((d = i.getContentType()) !== !1) {
|
|
920
920
|
const [h, ...E] = d ? d.split(";").map((S) => S.trim()).filter(Boolean) : [];
|
|
@@ -931,7 +931,7 @@ const lo = typeof XMLHttpRequest < "u", uo = lo && function(t) {
|
|
|
931
931
|
function w() {
|
|
932
932
|
if (!f)
|
|
933
933
|
return;
|
|
934
|
-
const h =
|
|
934
|
+
const h = G.from(
|
|
935
935
|
"getAllResponseHeaders" in f && f.getAllResponseHeaders()
|
|
936
936
|
), S = {
|
|
937
937
|
data: !s || s === "text" || s === "json" ? f.responseText : f.response,
|
|
@@ -962,7 +962,7 @@ const lo = typeof XMLHttpRequest < "u", uo = lo && function(t) {
|
|
|
962
962
|
t,
|
|
963
963
|
f
|
|
964
964
|
)), f = null;
|
|
965
|
-
},
|
|
965
|
+
}, M.hasStandardBrowserEnv && (a && u.isFunction(a) && (a = a(t)), a || a !== !1 && so(y))) {
|
|
966
966
|
const h = t.xsrfHeaderName && t.xsrfCookieName && no.read(t.xsrfCookieName);
|
|
967
967
|
h && i.set(t.xsrfHeaderName, h);
|
|
968
968
|
}
|
|
@@ -972,7 +972,7 @@ const lo = typeof XMLHttpRequest < "u", uo = lo && function(t) {
|
|
|
972
972
|
f && (n(!h || h.type ? new Ae(null, t, f) : h), f.abort(), f = null);
|
|
973
973
|
}, t.cancelToken && t.cancelToken.subscribe(c), t.signal && (t.signal.aborted ? c() : t.signal.addEventListener("abort", c)));
|
|
974
974
|
const p = ao(y);
|
|
975
|
-
if (p &&
|
|
975
|
+
if (p && M.protocols.indexOf(p) === -1) {
|
|
976
976
|
n(new v("Unsupported protocol " + p + ":", v.ERR_BAD_REQUEST, t));
|
|
977
977
|
return;
|
|
978
978
|
}
|
|
@@ -1027,7 +1027,7 @@ function je(t) {
|
|
|
1027
1027
|
throw new Ae(null, t);
|
|
1028
1028
|
}
|
|
1029
1029
|
function Vt(t) {
|
|
1030
|
-
return je(t), t.headers =
|
|
1030
|
+
return je(t), t.headers = G.from(t.headers), t.data = ze.call(
|
|
1031
1031
|
t,
|
|
1032
1032
|
t.transformRequest
|
|
1033
1033
|
), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), Tr.getAdapter(t.adapter || vt.adapter)(t).then(function(n) {
|
|
@@ -1035,16 +1035,16 @@ function Vt(t) {
|
|
|
1035
1035
|
t,
|
|
1036
1036
|
t.transformResponse,
|
|
1037
1037
|
n
|
|
1038
|
-
), n.headers =
|
|
1038
|
+
), n.headers = G.from(n.headers), n;
|
|
1039
1039
|
}, function(n) {
|
|
1040
1040
|
return Cr(n) || (je(t), n && n.response && (n.response.data = ze.call(
|
|
1041
1041
|
t,
|
|
1042
1042
|
t.transformResponse,
|
|
1043
1043
|
n.response
|
|
1044
|
-
), n.response.headers =
|
|
1044
|
+
), n.response.headers = G.from(n.response.headers))), Promise.reject(n);
|
|
1045
1045
|
});
|
|
1046
1046
|
}
|
|
1047
|
-
const Gt = (t) => t instanceof
|
|
1047
|
+
const Gt = (t) => t instanceof G ? t.toJSON() : t;
|
|
1048
1048
|
function ce(t, e) {
|
|
1049
1049
|
e = e || {};
|
|
1050
1050
|
const r = {};
|
|
@@ -1156,7 +1156,7 @@ function po(t, e, r) {
|
|
|
1156
1156
|
const at = {
|
|
1157
1157
|
assertOptions: po,
|
|
1158
1158
|
validators: Et
|
|
1159
|
-
},
|
|
1159
|
+
}, z = at.validators;
|
|
1160
1160
|
class _e {
|
|
1161
1161
|
constructor(e) {
|
|
1162
1162
|
this.defaults = e, this.interceptors = {
|
|
@@ -1190,14 +1190,14 @@ class _e {
|
|
|
1190
1190
|
typeof e == "string" ? (r = r || {}, r.url = e) : r = e || {}, r = ce(this.defaults, r);
|
|
1191
1191
|
const { transitional: n, paramsSerializer: o, headers: i } = r;
|
|
1192
1192
|
n !== void 0 && at.assertOptions(n, {
|
|
1193
|
-
silentJSONParsing:
|
|
1194
|
-
forcedJSONParsing:
|
|
1195
|
-
clarifyTimeoutError:
|
|
1193
|
+
silentJSONParsing: z.transitional(z.boolean),
|
|
1194
|
+
forcedJSONParsing: z.transitional(z.boolean),
|
|
1195
|
+
clarifyTimeoutError: z.transitional(z.boolean)
|
|
1196
1196
|
}, !1), o != null && (u.isFunction(o) ? r.paramsSerializer = {
|
|
1197
1197
|
serialize: o
|
|
1198
1198
|
} : at.assertOptions(o, {
|
|
1199
|
-
encode:
|
|
1200
|
-
serialize:
|
|
1199
|
+
encode: z.function,
|
|
1200
|
+
serialize: z.function
|
|
1201
1201
|
}, !0)), r.method = (r.method || this.defaults.method || "get").toLowerCase();
|
|
1202
1202
|
let s = i && u.merge(
|
|
1203
1203
|
i.common,
|
|
@@ -1208,7 +1208,7 @@ class _e {
|
|
|
1208
1208
|
(p) => {
|
|
1209
1209
|
delete i[p];
|
|
1210
1210
|
}
|
|
1211
|
-
), r.headers =
|
|
1211
|
+
), r.headers = G.concat(s, i);
|
|
1212
1212
|
const a = [];
|
|
1213
1213
|
let c = !0;
|
|
1214
1214
|
this.interceptors.request.forEach(function(h) {
|
|
@@ -1443,7 +1443,7 @@ O.all = function(e) {
|
|
|
1443
1443
|
O.spread = yo;
|
|
1444
1444
|
O.isAxiosError = mo;
|
|
1445
1445
|
O.mergeConfig = ce;
|
|
1446
|
-
O.AxiosHeaders =
|
|
1446
|
+
O.AxiosHeaders = G;
|
|
1447
1447
|
O.formToJSON = (t) => Rr(u.isHTMLForm(t) ? new FormData(t) : t);
|
|
1448
1448
|
O.getAdapter = Tr.getAdapter;
|
|
1449
1449
|
O.HttpStatusCode = go;
|
|
@@ -1782,7 +1782,7 @@ const jo = {}, Jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
1782
1782
|
__proto__: null,
|
|
1783
1783
|
default: jo
|
|
1784
1784
|
}, Symbol.toStringTag, { value: "Module" })), Ko = /* @__PURE__ */ wo(Jo);
|
|
1785
|
-
var Ct = typeof Map == "function" && Map.prototype, Xe = Object.getOwnPropertyDescriptor && Ct ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, ke = Ct && Xe && typeof Xe.get == "function" ? Xe.get : null, Kt = Ct && Map.prototype.forEach, It = typeof Set == "function" && Set.prototype, Ye = Object.getOwnPropertyDescriptor && It ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, Be = It && Ye && typeof Ye.get == "function" ? Ye.get : null, Qt = It && Set.prototype.forEach, Qo = typeof WeakMap == "function" && WeakMap.prototype, Se = Qo ? WeakMap.prototype.has : null, Xo = typeof WeakSet == "function" && WeakSet.prototype, we = Xo ? WeakSet.prototype.has : null, Yo = typeof WeakRef == "function" && WeakRef.prototype, Xt = Yo ? WeakRef.prototype.deref : null, Zo = Boolean.prototype.valueOf, ei = Object.prototype.toString, ti = Function.prototype.toString, ri = String.prototype.match, Tt = String.prototype.slice, J = String.prototype.replace, ni = String.prototype.toUpperCase, Yt = String.prototype.toLowerCase, xr = RegExp.prototype.test, Zt = Array.prototype.concat,
|
|
1785
|
+
var Ct = typeof Map == "function" && Map.prototype, Xe = Object.getOwnPropertyDescriptor && Ct ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, ke = Ct && Xe && typeof Xe.get == "function" ? Xe.get : null, Kt = Ct && Map.prototype.forEach, It = typeof Set == "function" && Set.prototype, Ye = Object.getOwnPropertyDescriptor && It ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, Be = It && Ye && typeof Ye.get == "function" ? Ye.get : null, Qt = It && Set.prototype.forEach, Qo = typeof WeakMap == "function" && WeakMap.prototype, Se = Qo ? WeakMap.prototype.has : null, Xo = typeof WeakSet == "function" && WeakSet.prototype, we = Xo ? WeakSet.prototype.has : null, Yo = typeof WeakRef == "function" && WeakRef.prototype, Xt = Yo ? WeakRef.prototype.deref : null, Zo = Boolean.prototype.valueOf, ei = Object.prototype.toString, ti = Function.prototype.toString, ri = String.prototype.match, Tt = String.prototype.slice, J = String.prototype.replace, ni = String.prototype.toUpperCase, Yt = String.prototype.toLowerCase, xr = RegExp.prototype.test, Zt = Array.prototype.concat, k = Array.prototype.join, oi = Array.prototype.slice, er = Math.floor, lt = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, Ze = Object.getOwnPropertySymbols, ut = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, ue = typeof Symbol == "function" && typeof Symbol.iterator == "object", P = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === ue || !0) ? Symbol.toStringTag : null, Ur = Object.prototype.propertyIsEnumerable, tr = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(t) {
|
|
1786
1786
|
return t.__proto__;
|
|
1787
1787
|
} : null);
|
|
1788
1788
|
function rr(t, e) {
|
|
@@ -1838,18 +1838,18 @@ var ft = Ko, nr = ft.custom, or = Br(nr) ? nr : null, ii = function t(e, r, n, o
|
|
|
1838
1838
|
o = [];
|
|
1839
1839
|
else if (Mr(o, e) >= 0)
|
|
1840
1840
|
return "[Circular]";
|
|
1841
|
-
function y(
|
|
1841
|
+
function y($, ne, Ce) {
|
|
1842
1842
|
if (ne && (o = oi.call(o), o.push(ne)), Ce) {
|
|
1843
1843
|
var oe = {
|
|
1844
1844
|
depth: i.depth
|
|
1845
1845
|
};
|
|
1846
|
-
return j(i, "quoteStyle") && (oe.quoteStyle = i.quoteStyle), t(
|
|
1846
|
+
return j(i, "quoteStyle") && (oe.quoteStyle = i.quoteStyle), t($, oe, n + 1, o);
|
|
1847
1847
|
}
|
|
1848
|
-
return t(
|
|
1848
|
+
return t($, i, n + 1, o);
|
|
1849
1849
|
}
|
|
1850
1850
|
if (typeof e == "function" && !ir(e)) {
|
|
1851
1851
|
var w = hi(e), p = Ie(e, y);
|
|
1852
|
-
return "[Function" + (w ? ": " + w : " (anonymous)") + "]" + (p.length > 0 ? " { " +
|
|
1852
|
+
return "[Function" + (w ? ": " + w : " (anonymous)") + "]" + (p.length > 0 ? " { " + k.call(p, ", ") + " }" : "");
|
|
1853
1853
|
}
|
|
1854
1854
|
if (Br(e)) {
|
|
1855
1855
|
var h = ue ? J.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : ut.call(e);
|
|
@@ -1864,11 +1864,11 @@ var ft = Ko, nr = ft.custom, or = Br(nr) ? nr : null, ii = function t(e, r, n, o
|
|
|
1864
1864
|
if (e.length === 0)
|
|
1865
1865
|
return "[]";
|
|
1866
1866
|
var T = Ie(e, y);
|
|
1867
|
-
return f && !Ei(T) ? "[" + pt(T, f) + "]" : "[ " +
|
|
1867
|
+
return f && !Ei(T) ? "[" + pt(T, f) + "]" : "[ " + k.call(T, ", ") + " ]";
|
|
1868
1868
|
}
|
|
1869
1869
|
if (ci(e)) {
|
|
1870
|
-
var
|
|
1871
|
-
return !("cause" in Error.prototype) && "cause" in e && !Ur.call(e, "cause") ? "{ [" + String(e) + "] " +
|
|
1870
|
+
var W = Ie(e, y);
|
|
1871
|
+
return !("cause" in Error.prototype) && "cause" in e && !Ur.call(e, "cause") ? "{ [" + String(e) + "] " + k.call(Zt.call("[cause]: " + y(e.cause), W), ", ") + " }" : W.length === 0 ? "[" + String(e) + "]" : "{ [" + String(e) + "] " + k.call(W, ", ") + " }";
|
|
1872
1872
|
}
|
|
1873
1873
|
if (typeof e == "object" && s) {
|
|
1874
1874
|
if (or && typeof e[or] == "function" && ft)
|
|
@@ -1878,14 +1878,14 @@ var ft = Ko, nr = ft.custom, or = Br(nr) ? nr : null, ii = function t(e, r, n, o
|
|
|
1878
1878
|
}
|
|
1879
1879
|
if (yi(e)) {
|
|
1880
1880
|
var he = [];
|
|
1881
|
-
return Kt && Kt.call(e, function(
|
|
1882
|
-
he.push(y(ne, e, !0) + " => " + y(
|
|
1881
|
+
return Kt && Kt.call(e, function($, ne) {
|
|
1882
|
+
he.push(y(ne, e, !0) + " => " + y($, e));
|
|
1883
1883
|
}), sr("Map", ke.call(e), he, f);
|
|
1884
1884
|
}
|
|
1885
1885
|
if (Si(e)) {
|
|
1886
1886
|
var Re = [];
|
|
1887
|
-
return Qt && Qt.call(e, function(
|
|
1888
|
-
Re.push(y(
|
|
1887
|
+
return Qt && Qt.call(e, function($) {
|
|
1888
|
+
Re.push(y($, e));
|
|
1889
1889
|
}), sr("Set", Be.call(e), Re, f);
|
|
1890
1890
|
}
|
|
1891
1891
|
if (mi(e))
|
|
@@ -1903,8 +1903,8 @@ var ft = Ko, nr = ft.custom, or = Br(nr) ? nr : null, ii = function t(e, r, n, o
|
|
|
1903
1903
|
if (li(e))
|
|
1904
1904
|
return ge(y(String(e)));
|
|
1905
1905
|
if (!ai(e) && !ir(e)) {
|
|
1906
|
-
var Q = Ie(e, y),
|
|
1907
|
-
return Q.length === 0 ?
|
|
1906
|
+
var Q = Ie(e, y), q = tr ? tr(e) === Object.prototype : e instanceof Object || e.constructor === Object, te = e instanceof Object ? "" : "null prototype", re = !q && P && Object(e) === e && P in e ? Tt.call(K(e), 8, -1) : te ? "Object" : "", ye = q || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : "", x = ye + (re || te ? "[" + k.call(Zt.call([], re || [], te || []), ": ") + "] " : "");
|
|
1907
|
+
return Q.length === 0 ? x + "{}" : f ? x + "{" + pt(Q, f) + "}" : x + "{ " + k.call(Q, ", ") + " }";
|
|
1908
1908
|
}
|
|
1909
1909
|
return String(e);
|
|
1910
1910
|
};
|
|
@@ -2078,7 +2078,7 @@ function et(t) {
|
|
|
2078
2078
|
return t + " { ? }";
|
|
2079
2079
|
}
|
|
2080
2080
|
function sr(t, e, r, n) {
|
|
2081
|
-
var o = n ? pt(r, n) :
|
|
2081
|
+
var o = n ? pt(r, n) : k.call(r, ", ");
|
|
2082
2082
|
return t + " (" + e + ") {" + o + "}";
|
|
2083
2083
|
}
|
|
2084
2084
|
function Ei(t) {
|
|
@@ -2093,12 +2093,12 @@ function Ai(t, e) {
|
|
|
2093
2093
|
if (t.indent === " ")
|
|
2094
2094
|
r = " ";
|
|
2095
2095
|
else if (typeof t.indent == "number" && t.indent > 0)
|
|
2096
|
-
r =
|
|
2096
|
+
r = k.call(Array(t.indent + 1), " ");
|
|
2097
2097
|
else
|
|
2098
2098
|
return null;
|
|
2099
2099
|
return {
|
|
2100
2100
|
base: r,
|
|
2101
|
-
prev:
|
|
2101
|
+
prev: k.call(Array(e + 1), r)
|
|
2102
2102
|
};
|
|
2103
2103
|
}
|
|
2104
2104
|
function pt(t, e) {
|
|
@@ -2106,7 +2106,7 @@ function pt(t, e) {
|
|
|
2106
2106
|
return "";
|
|
2107
2107
|
var r = `
|
|
2108
2108
|
` + e.prev + e.base;
|
|
2109
|
-
return r +
|
|
2109
|
+
return r + k.call(t, "," + r) + `
|
|
2110
2110
|
` + e.prev;
|
|
2111
2111
|
}
|
|
2112
2112
|
function Ie(t, e) {
|
|
@@ -2193,7 +2193,7 @@ var Dt = Rt, pe = zo, Oi = ii, Ri = Dt("%TypeError%"), Te = Dt("%WeakMap%", !0),
|
|
|
2193
2193
|
},
|
|
2194
2194
|
RFC1738: tt.RFC1738,
|
|
2195
2195
|
RFC3986: tt.RFC3986
|
|
2196
|
-
}, Bi = Lt, rt = Object.prototype.hasOwnProperty, Y = Array.isArray,
|
|
2196
|
+
}, Bi = Lt, rt = Object.prototype.hasOwnProperty, Y = Array.isArray, U = function() {
|
|
2197
2197
|
for (var t = [], e = 0; e < 256; ++e)
|
|
2198
2198
|
t.push("%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase());
|
|
2199
2199
|
return t;
|
|
@@ -2263,18 +2263,18 @@ var Dt = Rt, pe = zo, Oi = ii, Ri = Dt("%TypeError%"), Te = Dt("%WeakMap%", !0),
|
|
|
2263
2263
|
continue;
|
|
2264
2264
|
}
|
|
2265
2265
|
if (l < 128) {
|
|
2266
|
-
a = a +
|
|
2266
|
+
a = a + U[l];
|
|
2267
2267
|
continue;
|
|
2268
2268
|
}
|
|
2269
2269
|
if (l < 2048) {
|
|
2270
|
-
a = a + (
|
|
2270
|
+
a = a + (U[192 | l >> 6] + U[128 | l & 63]);
|
|
2271
2271
|
continue;
|
|
2272
2272
|
}
|
|
2273
2273
|
if (l < 55296 || l >= 57344) {
|
|
2274
|
-
a = a + (
|
|
2274
|
+
a = a + (U[224 | l >> 12] + U[128 | l >> 6 & 63] + U[128 | l & 63]);
|
|
2275
2275
|
continue;
|
|
2276
2276
|
}
|
|
2277
|
-
c += 1, l = 65536 + ((l & 1023) << 10 | s.charCodeAt(c) & 1023), a +=
|
|
2277
|
+
c += 1, l = 65536 + ((l & 1023) << 10 | s.charCodeAt(c) & 1023), a += U[240 | l >> 18] + U[128 | l >> 12 & 63] + U[128 | l >> 6 & 63] + U[128 | l & 63];
|
|
2278
2278
|
}
|
|
2279
2279
|
return a;
|
|
2280
2280
|
}, Wi = function(e) {
|
|
@@ -2319,8 +2319,8 @@ var Dt = Rt, pe = zo, Oi = ii, Ri = Dt("%TypeError%"), Te = Dt("%WeakMap%", !0),
|
|
|
2319
2319
|
repeat: function(e) {
|
|
2320
2320
|
return e;
|
|
2321
2321
|
}
|
|
2322
|
-
},
|
|
2323
|
-
Qi.apply(t,
|
|
2322
|
+
}, V = Array.isArray, Qi = Array.prototype.push, Wr = function(t, e) {
|
|
2323
|
+
Qi.apply(t, V(e) ? e : [e]);
|
|
2324
2324
|
}, Xi = Date.prototype.toISOString, cr = be.default, D = {
|
|
2325
2325
|
addQueryPrefix: !1,
|
|
2326
2326
|
allowDots: !1,
|
|
@@ -2342,16 +2342,16 @@ var Dt = Rt, pe = zo, Oi = ii, Ri = Dt("%TypeError%"), Te = Dt("%WeakMap%", !0),
|
|
|
2342
2342
|
}, Yi = function(e) {
|
|
2343
2343
|
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" || typeof e == "bigint";
|
|
2344
2344
|
}, nt = {}, Zi = function t(e, r, n, o, i, s, a, c, l, d, f, y, w, p, h, E) {
|
|
2345
|
-
for (var S = e, R = E, T = 0,
|
|
2345
|
+
for (var S = e, R = E, T = 0, W = !1; (R = R.get(nt)) !== void 0 && !W; ) {
|
|
2346
2346
|
var he = R.get(e);
|
|
2347
2347
|
if (T += 1, typeof he < "u") {
|
|
2348
2348
|
if (he === T)
|
|
2349
2349
|
throw new RangeError("Cyclic object value");
|
|
2350
|
-
|
|
2350
|
+
W = !0;
|
|
2351
2351
|
}
|
|
2352
2352
|
typeof R.get(nt) > "u" && (T = 0);
|
|
2353
2353
|
}
|
|
2354
|
-
if (typeof c == "function" ? S = c(r, S) : S instanceof Date ? S = f(S) : n === "comma" &&
|
|
2354
|
+
if (typeof c == "function" ? S = c(r, S) : S instanceof Date ? S = f(S) : n === "comma" && V(S) && (S = Ne.maybeMap(S, function(oe) {
|
|
2355
2355
|
return oe instanceof Date ? f(oe) : oe;
|
|
2356
2356
|
})), S === null) {
|
|
2357
2357
|
if (i)
|
|
@@ -2368,29 +2368,29 @@ var Dt = Rt, pe = zo, Oi = ii, Ri = Dt("%TypeError%"), Te = Dt("%WeakMap%", !0),
|
|
|
2368
2368
|
var Q = [];
|
|
2369
2369
|
if (typeof S > "u")
|
|
2370
2370
|
return Q;
|
|
2371
|
-
var
|
|
2372
|
-
if (n === "comma" &&
|
|
2373
|
-
p && a && (S = Ne.maybeMap(S, a)),
|
|
2374
|
-
else if (
|
|
2375
|
-
|
|
2371
|
+
var q;
|
|
2372
|
+
if (n === "comma" && V(S))
|
|
2373
|
+
p && a && (S = Ne.maybeMap(S, a)), q = [{ value: S.length > 0 ? S.join(",") || null : void 0 }];
|
|
2374
|
+
else if (V(c))
|
|
2375
|
+
q = c;
|
|
2376
2376
|
else {
|
|
2377
2377
|
var te = Object.keys(S);
|
|
2378
|
-
|
|
2378
|
+
q = l ? te.sort(l) : te;
|
|
2379
2379
|
}
|
|
2380
|
-
for (var re = o &&
|
|
2381
|
-
var
|
|
2382
|
-
if (!(s &&
|
|
2383
|
-
var ne =
|
|
2380
|
+
for (var re = o && V(S) && S.length === 1 ? r + "[]" : r, ye = 0; ye < q.length; ++ye) {
|
|
2381
|
+
var x = q[ye], $ = typeof x == "object" && typeof x.value < "u" ? x.value : S[x];
|
|
2382
|
+
if (!(s && $ === null)) {
|
|
2383
|
+
var ne = V(S) ? typeof n == "function" ? n(re, x) : re : re + (d ? "." + x : "[" + x + "]");
|
|
2384
2384
|
E.set(e, T);
|
|
2385
2385
|
var Ce = Gr();
|
|
2386
2386
|
Ce.set(nt, E), Wr(Q, t(
|
|
2387
|
-
|
|
2387
|
+
$,
|
|
2388
2388
|
ne,
|
|
2389
2389
|
n,
|
|
2390
2390
|
o,
|
|
2391
2391
|
i,
|
|
2392
2392
|
s,
|
|
2393
|
-
n === "comma" && p &&
|
|
2393
|
+
n === "comma" && p && V(S) ? null : a,
|
|
2394
2394
|
c,
|
|
2395
2395
|
l,
|
|
2396
2396
|
d,
|
|
@@ -2419,7 +2419,7 @@ var Dt = Rt, pe = zo, Oi = ii, Ri = Dt("%TypeError%"), Te = Dt("%WeakMap%", !0),
|
|
|
2419
2419
|
n = e.format;
|
|
2420
2420
|
}
|
|
2421
2421
|
var o = be.formatters[n], i = D.filter;
|
|
2422
|
-
return (typeof e.filter == "function" ||
|
|
2422
|
+
return (typeof e.filter == "function" || V(e.filter)) && (i = e.filter), {
|
|
2423
2423
|
addQueryPrefix: typeof e.addQueryPrefix == "boolean" ? e.addQueryPrefix : D.addQueryPrefix,
|
|
2424
2424
|
allowDots: typeof e.allowDots > "u" ? D.allowDots : !!e.allowDots,
|
|
2425
2425
|
charset: r,
|
|
@@ -2438,7 +2438,7 @@ var Dt = Rt, pe = zo, Oi = ii, Ri = Dt("%TypeError%"), Te = Dt("%WeakMap%", !0),
|
|
|
2438
2438
|
};
|
|
2439
2439
|
}, ts = function(t, e) {
|
|
2440
2440
|
var r = t, n = es(e), o, i;
|
|
2441
|
-
typeof n.filter == "function" ? (i = n.filter, r = i("", r)) :
|
|
2441
|
+
typeof n.filter == "function" ? (i = n.filter, r = i("", r)) : V(n.filter) && (i = n.filter, o = i);
|
|
2442
2442
|
var s = [];
|
|
2443
2443
|
if (typeof r != "object" || r === null)
|
|
2444
2444
|
return "";
|
|
@@ -2639,7 +2639,7 @@ class ms {
|
|
|
2639
2639
|
console.debug("onStopDesktopShare");
|
|
2640
2640
|
}
|
|
2641
2641
|
}
|
|
2642
|
-
var g = /* @__PURE__ */ ((t) => (t[t.UNKNOWN = 0] = "UNKNOWN", t[t.AUDIO = 1] = "AUDIO", t[t.VIDEO = 2] = "VIDEO", t[t.RTSP_PULL = 3] = "RTSP_PULL", t[t.AUDIO_PUSH = 4] = "AUDIO_PUSH", t[t.VIDEO_PUSH = 5] = "VIDEO_PUSH", t[t.AUDIO_HALF = 6] = "AUDIO_HALF", t[t.VIDEO_HALF = 7] = "VIDEO_HALF", t))(g || {}),
|
|
2642
|
+
var g = /* @__PURE__ */ ((t) => (t[t.UNKNOWN = 0] = "UNKNOWN", t[t.AUDIO = 1] = "AUDIO", t[t.VIDEO = 2] = "VIDEO", t[t.RTSP_PULL = 3] = "RTSP_PULL", t[t.AUDIO_PUSH = 4] = "AUDIO_PUSH", t[t.VIDEO_PUSH = 5] = "VIDEO_PUSH", t[t.AUDIO_HALF = 6] = "AUDIO_HALF", t[t.VIDEO_HALF = 7] = "VIDEO_HALF", t))(g || {}), L = /* @__PURE__ */ ((t) => (t.FRONT_FACING = "user", t.BACK_FACING = "environment", t))(L || {});
|
|
2643
2643
|
class Ft {
|
|
2644
2644
|
constructor(e) {
|
|
2645
2645
|
// private config: RTCConfiguration = { iceServers: [] }
|
|
@@ -2660,7 +2660,7 @@ class Ft {
|
|
|
2660
2660
|
// 是否设置了对端sdp
|
|
2661
2661
|
m(this, "hasSetRemoteSdp", !1);
|
|
2662
2662
|
// 前置摄像头 "user", 后置摄像头 "environment"
|
|
2663
|
-
m(this, "facingMode",
|
|
2663
|
+
m(this, "facingMode", L.FRONT_FACING);
|
|
2664
2664
|
// 摄像头切换中
|
|
2665
2665
|
m(this, "facingChanging", !1);
|
|
2666
2666
|
// 是否闭麦
|
|
@@ -2689,7 +2689,7 @@ class Ft {
|
|
|
2689
2689
|
this.error(new Error("start failed, remoteSdp is null."));
|
|
2690
2690
|
return;
|
|
2691
2691
|
}
|
|
2692
|
-
switch (this.isCallOut = e, this.hasSetRemoteSdp = !1, this.facingMode =
|
|
2692
|
+
switch (this.isCallOut = e, this.hasSetRemoteSdp = !1, this.facingMode = L.FRONT_FACING, this.facingChanging = !1, this.muted = !1, this.desktopSharing = !1, this.peerConnection = new RTCPeerConnection({ iceServers: [] }), this.peerConnection.onnegotiationneeded = () => {
|
|
2693
2693
|
switch (this.sessionType) {
|
|
2694
2694
|
case g.AUDIO_PUSH:
|
|
2695
2695
|
case g.VIDEO_PUSH:
|
|
@@ -2788,7 +2788,7 @@ class Ft {
|
|
|
2788
2788
|
if (console.debug("webrtc stop"), (this.sessionType == g.VIDEO_PUSH || this.sessionType == g.AUDIO_PUSH || this.sessionType == g.RTSP_PULL) && this.sendStringData("close"), (e = this.peerConnection) == null || e.close(), this.localStream)
|
|
2789
2789
|
for (let r of this.localStream.getTracks())
|
|
2790
2790
|
this.localStream.removeTrack(r), r.stop();
|
|
2791
|
-
this.desktopSharing && (this.desktopSharing = !1, this.sessionListener.onStopDesktopShare()), this.peerConnection = void 0, this.dataChannel = void 0, this.localStream = void 0, this.remoteStream = void 0, this.isCallOut = !1, this.sessionType = g.UNKNOWN, this.hasSetRemoteSdp = !1, this.facingMode =
|
|
2791
|
+
this.desktopSharing && (this.desktopSharing = !1, this.sessionListener.onStopDesktopShare()), this.peerConnection = void 0, this.dataChannel = void 0, this.localStream = void 0, this.remoteStream = void 0, this.isCallOut = !1, this.sessionType = g.UNKNOWN, this.hasSetRemoteSdp = !1, this.facingMode = L.FRONT_FACING, this.facingChanging = !1, this.muted = !1, this.openCamera = !1, this.desktopSharing = !1;
|
|
2792
2792
|
}
|
|
2793
2793
|
/**
|
|
2794
2794
|
* 移动端切换前后置摄像头
|
|
@@ -2809,11 +2809,7 @@ class Ft {
|
|
|
2809
2809
|
r(new Error("camera switching in progress"));
|
|
2810
2810
|
return;
|
|
2811
2811
|
}
|
|
2812
|
-
|
|
2813
|
-
r(new Error("not mobile device"));
|
|
2814
|
-
return;
|
|
2815
|
-
}
|
|
2816
|
-
this.facingChanging = !0, this.changeCameraLocalMedia().then(() => e(this.facingMode)).catch((n) => r(n));
|
|
2812
|
+
this.changeCameraLocalMedia().then(() => e(this.facingMode)).catch((n) => r(n));
|
|
2817
2813
|
});
|
|
2818
2814
|
}
|
|
2819
2815
|
/**
|
|
@@ -2917,7 +2913,7 @@ class Ft {
|
|
|
2917
2913
|
case g.VIDEO:
|
|
2918
2914
|
case g.VIDEO_PUSH:
|
|
2919
2915
|
case g.VIDEO_HALF:
|
|
2920
|
-
e.video = { height: { exact: 720 }, width: { exact: 1280 } };
|
|
2916
|
+
e.video = { height: { exact: 720 }, width: { exact: 1280 }, facingMode: L.FRONT_FACING };
|
|
2921
2917
|
break;
|
|
2922
2918
|
}
|
|
2923
2919
|
navigator.mediaDevices && navigator.mediaDevices.getUserMedia ? navigator.mediaDevices.getUserMedia(e).then((r) => {
|
|
@@ -2969,42 +2965,61 @@ class Ft {
|
|
|
2969
2965
|
}
|
|
2970
2966
|
changeCameraLocalMedia() {
|
|
2971
2967
|
return new Promise((e, r) => {
|
|
2972
|
-
|
|
2973
|
-
|
|
2968
|
+
if (!this.localStream) {
|
|
2969
|
+
r(new Error("local stream not found"));
|
|
2970
|
+
return;
|
|
2971
|
+
}
|
|
2972
|
+
if (this.localStream.getVideoTracks().length == 0) {
|
|
2973
|
+
r(new Error("local stream not video track"));
|
|
2974
|
+
return;
|
|
2975
|
+
}
|
|
2976
|
+
this.facingChanging = !0, this.localStream.getVideoTracks().forEach((i) => {
|
|
2977
|
+
this.localStream.removeTrack(i), i.stop();
|
|
2978
|
+
});
|
|
2979
|
+
let n, o = this.facingMode;
|
|
2980
|
+
if (this.facingMode === L.FRONT_FACING ? (o = L.BACK_FACING, n = {
|
|
2974
2981
|
audio: { echoCancellation: !0, noiseSuppression: !0 },
|
|
2975
|
-
video: { height: { exact: 1280 }, width: { exact: 720 }, facingMode:
|
|
2976
|
-
} : n = {
|
|
2982
|
+
video: { height: { exact: 1280 }, width: { exact: 720 }, facingMode: L.BACK_FACING }
|
|
2983
|
+
}) : (o = L.FRONT_FACING, n = {
|
|
2977
2984
|
audio: { echoCancellation: !0, noiseSuppression: !0 },
|
|
2978
|
-
video: { height: { exact: 720 }, width: { exact: 1280 }, facingMode:
|
|
2979
|
-
}, navigator.mediaDevices && navigator.mediaDevices.getUserMedia)
|
|
2980
|
-
navigator.mediaDevices.getUserMedia(n).then((
|
|
2981
|
-
this.changeCameraSuccess(o), e();
|
|
2982
|
-
}).catch((
|
|
2983
|
-
|
|
2985
|
+
video: { height: { exact: 720 }, width: { exact: 1280 }, facingMode: L.FRONT_FACING }
|
|
2986
|
+
}), navigator.mediaDevices && navigator.mediaDevices.getUserMedia)
|
|
2987
|
+
navigator.mediaDevices.getUserMedia(n).then((i) => {
|
|
2988
|
+
this.changeCameraSuccess(i, o), e();
|
|
2989
|
+
}).catch((i) => {
|
|
2990
|
+
console.error("change camera failed, use last camera: " + i, i), o = this.facingMode, this.facingMode === L.FRONT_FACING ? (o = L.FRONT_FACING, n = {
|
|
2991
|
+
audio: { echoCancellation: !0, noiseSuppression: !0 },
|
|
2992
|
+
video: { height: { exact: 720 }, width: { exact: 1280 }, facingMode: L.FRONT_FACING }
|
|
2993
|
+
}) : (o = L.BACK_FACING, n = {
|
|
2994
|
+
audio: { echoCancellation: !0, noiseSuppression: !0 },
|
|
2995
|
+
video: { height: { exact: 1280 }, width: { exact: 720 }, facingMode: L.BACK_FACING }
|
|
2996
|
+
}), navigator.mediaDevices.getUserMedia(n).then((s) => {
|
|
2997
|
+
this.changeCameraSuccess(s, o), e();
|
|
2998
|
+
}).catch((s) => {
|
|
2999
|
+
this.changeCameraFailed(s), r(s);
|
|
3000
|
+
});
|
|
2984
3001
|
});
|
|
2985
3002
|
else {
|
|
2986
|
-
let
|
|
2987
|
-
this.changeCameraFailed(
|
|
3003
|
+
let i = new Error("Browser does not support WebRTC");
|
|
3004
|
+
this.changeCameraFailed(i), r(new Error("Browser does not support WebRTC"));
|
|
2988
3005
|
}
|
|
2989
3006
|
});
|
|
2990
3007
|
}
|
|
2991
|
-
changeCameraSuccess(e) {
|
|
3008
|
+
changeCameraSuccess(e, r) {
|
|
2992
3009
|
if (!this.localStream) {
|
|
2993
|
-
e.getTracks().forEach((
|
|
2994
|
-
|
|
3010
|
+
e.getTracks().forEach((n) => {
|
|
3011
|
+
n.stop();
|
|
2995
3012
|
}), this.facingChanging = !1;
|
|
2996
3013
|
return;
|
|
2997
3014
|
}
|
|
2998
|
-
|
|
2999
|
-
this.localStream.
|
|
3000
|
-
}),
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
}).catch((n) => {
|
|
3005
|
-
console.log(n);
|
|
3015
|
+
e.getVideoTracks().forEach((n) => {
|
|
3016
|
+
this.localStream.addTrack(n);
|
|
3017
|
+
}), this.peerConnection.getSenders().forEach((n) => {
|
|
3018
|
+
n.track && n.track.kind === "video" && n.replaceTrack(e.getVideoTracks()[0]).then(() => {
|
|
3019
|
+
}).catch((o) => {
|
|
3020
|
+
console.log(o);
|
|
3006
3021
|
});
|
|
3007
|
-
}), this.facingMode
|
|
3022
|
+
}), this.facingMode = r, this.facingChanging = !1;
|
|
3008
3023
|
}
|
|
3009
3024
|
changeCameraFailed(e) {
|
|
3010
3025
|
console.log(e), this.facingChanging = !1;
|
|
@@ -3074,7 +3089,7 @@ class ws {
|
|
|
3074
3089
|
onStopDesktopShare() {
|
|
3075
3090
|
}
|
|
3076
3091
|
}
|
|
3077
|
-
var A = /* @__PURE__ */ ((t) => (t[t.OFFLINE = -1] = "OFFLINE", t[t.IDLE = 0] = "IDLE", t[t.TRY = 1] = "TRY", t[t.RING = 2] = "RING", t[t.TALK = 3] = "TALK", t))(A || {}),
|
|
3092
|
+
var A = /* @__PURE__ */ ((t) => (t[t.OFFLINE = -1] = "OFFLINE", t[t.IDLE = 0] = "IDLE", t[t.TRY = 1] = "TRY", t[t.RING = 2] = "RING", t[t.TALK = 3] = "TALK", t))(A || {}), F = /* @__PURE__ */ ((t) => (t.VIDEO = "video", t.AUDIO = "audio", t))(F || {}), B = /* @__PURE__ */ ((t) => (t.FULL = "full-duplex", t.HALF = "half-duplex", t))(B || {}), X = /* @__PURE__ */ ((t) => (t.IN = "in", t.OUT = "out", t))(X || {}), N = /* @__PURE__ */ ((t) => (t.LOGIN = "login", t.LOGOUT = "logout", t.Invite = "invite", t.RING = "ring", t.ANSWER = "answer", t.HANGUP = "hangup", t.DTMF = "dtmf", t))(N || {});
|
|
3078
3093
|
function lr() {
|
|
3079
3094
|
try {
|
|
3080
3095
|
return !!(navigator.mediaDevices && navigator.mediaDevices.getUserMedia);
|
|
@@ -3177,8 +3192,8 @@ class Kr {
|
|
|
3177
3192
|
constructor(e, r, n) {
|
|
3178
3193
|
m(this, "tel", "");
|
|
3179
3194
|
m(this, "status", A.OFFLINE);
|
|
3180
|
-
m(this, "mediaType",
|
|
3181
|
-
m(this, "callMode",
|
|
3195
|
+
m(this, "mediaType", F.AUDIO);
|
|
3196
|
+
m(this, "callMode", B.FULL);
|
|
3182
3197
|
m(this, "callDirect", X.OUT);
|
|
3183
3198
|
m(this, "called", "");
|
|
3184
3199
|
m(this, "callId");
|
|
@@ -3206,7 +3221,7 @@ class Kr {
|
|
|
3206
3221
|
this.makeCall(e);
|
|
3207
3222
|
}
|
|
3208
3223
|
videoCall(e) {
|
|
3209
|
-
this.makeCall(e,
|
|
3224
|
+
this.makeCall(e, F.VIDEO);
|
|
3210
3225
|
}
|
|
3211
3226
|
answer() {
|
|
3212
3227
|
var r;
|
|
@@ -3219,7 +3234,7 @@ class Kr {
|
|
|
3219
3234
|
return;
|
|
3220
3235
|
}
|
|
3221
3236
|
let e;
|
|
3222
|
-
this.callMode ==
|
|
3237
|
+
this.callMode == B.HALF ? e = F.VIDEO == this.mediaType ? g.VIDEO_HALF : g.AUDIO_HALF : e = F.VIDEO == this.mediaType ? g.VIDEO : g.AUDIO, this.webrtcCreate(e), (r = this.webrtcSession) == null || r.start(!1, this.remoteSdp);
|
|
3223
3238
|
}
|
|
3224
3239
|
hangup() {
|
|
3225
3240
|
this.status <= A.IDLE || (this.status == A.TALK ? this.sendHangup(this.callId ?? "") : this.callDirect == X.IN ? this.sendHangup(this.callId ?? "", 488) : this.sendHangup(this.callId ?? "", 801), this.close());
|
|
@@ -3270,7 +3285,7 @@ class Kr {
|
|
|
3270
3285
|
var e;
|
|
3271
3286
|
this.closeBySelf = !0, this.hangup(), this.close(), (e = this.ws) == null || e.close();
|
|
3272
3287
|
}
|
|
3273
|
-
makeCall(e, r =
|
|
3288
|
+
makeCall(e, r = F.AUDIO, n = B.FULL) {
|
|
3274
3289
|
var o;
|
|
3275
3290
|
try {
|
|
3276
3291
|
if (!lr()) {
|
|
@@ -3283,7 +3298,7 @@ class Kr {
|
|
|
3283
3298
|
}
|
|
3284
3299
|
this.status > A.IDLE && (console.debug("Another call is currently in progress, hangup it"), this.hangup()), this.mediaType = r, this.callMode = n, this.called = e, this.callDirect = X.OUT, this.callId = bs();
|
|
3285
3300
|
let i;
|
|
3286
|
-
this.callMode ==
|
|
3301
|
+
this.callMode == B.HALF ? i = F.VIDEO == r ? g.VIDEO_HALF : g.AUDIO_HALF : i = F.VIDEO == r ? g.VIDEO : g.AUDIO, this.webrtcCreate(i), (o = this.webrtcSession) == null || o.start(!0), this.status = A.TRY;
|
|
3287
3302
|
} catch (i) {
|
|
3288
3303
|
this.status = A.IDLE, this.sessionListener.onError(new Error("" + i));
|
|
3289
3304
|
}
|
|
@@ -3307,19 +3322,19 @@ class Kr {
|
|
|
3307
3322
|
try {
|
|
3308
3323
|
let n = JSON.parse(r.data);
|
|
3309
3324
|
switch (console.debug("receive msg from server <<<<<<<<<<<<<<<", n), n.type) {
|
|
3310
|
-
case
|
|
3325
|
+
case N.Invite:
|
|
3311
3326
|
this.inviteHandler(n);
|
|
3312
3327
|
break;
|
|
3313
|
-
case
|
|
3328
|
+
case N.ANSWER:
|
|
3314
3329
|
this.answerHandler(n);
|
|
3315
3330
|
break;
|
|
3316
|
-
case
|
|
3331
|
+
case N.RING:
|
|
3317
3332
|
this.ringHandler(n);
|
|
3318
3333
|
break;
|
|
3319
|
-
case
|
|
3334
|
+
case N.HANGUP:
|
|
3320
3335
|
this.hangupHandler(n);
|
|
3321
3336
|
break;
|
|
3322
|
-
case
|
|
3337
|
+
case N.LOGIN:
|
|
3323
3338
|
this.loginHandler(n);
|
|
3324
3339
|
break;
|
|
3325
3340
|
}
|
|
@@ -3340,7 +3355,7 @@ class Kr {
|
|
|
3340
3355
|
}
|
|
3341
3356
|
sendLogin() {
|
|
3342
3357
|
this.sendTo({
|
|
3343
|
-
type:
|
|
3358
|
+
type: N.LOGIN,
|
|
3344
3359
|
username: this.tel,
|
|
3345
3360
|
userAgent: this.getUserAgent(),
|
|
3346
3361
|
accountId: this.accountId
|
|
@@ -3348,14 +3363,14 @@ class Kr {
|
|
|
3348
3363
|
}
|
|
3349
3364
|
sendLogout() {
|
|
3350
3365
|
this.sendTo({
|
|
3351
|
-
type:
|
|
3366
|
+
type: N.LOGOUT,
|
|
3352
3367
|
username: this.tel
|
|
3353
3368
|
}), this.status = A.OFFLINE;
|
|
3354
3369
|
}
|
|
3355
3370
|
sendInvite(e) {
|
|
3356
3371
|
this.sendTo({
|
|
3357
3372
|
callId: this.callId,
|
|
3358
|
-
type:
|
|
3373
|
+
type: N.Invite,
|
|
3359
3374
|
from: this.tel,
|
|
3360
3375
|
to: this.called,
|
|
3361
3376
|
callMode: this.callMode,
|
|
@@ -3365,14 +3380,14 @@ class Kr {
|
|
|
3365
3380
|
}
|
|
3366
3381
|
sendRing() {
|
|
3367
3382
|
this.sendTo({
|
|
3368
|
-
type:
|
|
3383
|
+
type: N.RING,
|
|
3369
3384
|
callId: this.callId,
|
|
3370
3385
|
code: 180
|
|
3371
3386
|
}), this.status = A.RING;
|
|
3372
3387
|
}
|
|
3373
3388
|
sendAnswer(e) {
|
|
3374
3389
|
this.sendTo({
|
|
3375
|
-
type:
|
|
3390
|
+
type: N.ANSWER,
|
|
3376
3391
|
callId: this.callId,
|
|
3377
3392
|
mediaType: this.mediaType,
|
|
3378
3393
|
sdp: e
|
|
@@ -3380,7 +3395,7 @@ class Kr {
|
|
|
3380
3395
|
}
|
|
3381
3396
|
sendDtmf(e) {
|
|
3382
3397
|
this.sendTo({
|
|
3383
|
-
type:
|
|
3398
|
+
type: N.DTMF,
|
|
3384
3399
|
callId: this.callId,
|
|
3385
3400
|
callInfo: "dtmf=" + e
|
|
3386
3401
|
}), this.dtmfAudio.play().then(() => {
|
|
@@ -3388,7 +3403,7 @@ class Kr {
|
|
|
3388
3403
|
}
|
|
3389
3404
|
sendHangup(e, r = 800) {
|
|
3390
3405
|
this.sendTo({
|
|
3391
|
-
type:
|
|
3406
|
+
type: N.HANGUP,
|
|
3392
3407
|
callId: e,
|
|
3393
3408
|
code: r
|
|
3394
3409
|
}), e == this.callId && (this.status = A.IDLE, this.callId = void 0);
|
|
@@ -3414,7 +3429,7 @@ class Kr {
|
|
|
3414
3429
|
e.callId != this.callId ? (console.debug("receive invite, but busy."), this.sendHangup(e.callId, 486)) : console.debug("receive re invite. not process");
|
|
3415
3430
|
return;
|
|
3416
3431
|
}
|
|
3417
|
-
this.callId = e.callId, this.mediaType = e.mediaType ??
|
|
3432
|
+
this.callId = e.callId, this.mediaType = e.mediaType ?? F.AUDIO, this.callMode = e.callMode ?? B.FULL, this.called = e.from ?? "", this.callDirect = X.IN, this.remoteSdp = e.sdp, this.candidate = e.candidate, this.sendRing(), this.ringtone.currentTime = 0, this.ringtone.play().then(() => {
|
|
3418
3433
|
}).catch(() => {
|
|
3419
3434
|
}), this.sessionListener.onNewCall(new As(this.called, this.mediaType, this.callMode));
|
|
3420
3435
|
}
|
|
@@ -3487,7 +3502,7 @@ class Cs {
|
|
|
3487
3502
|
m(this, "webrtcSession");
|
|
3488
3503
|
m(this, "sessionListener", new Os());
|
|
3489
3504
|
m(this, "httpClient");
|
|
3490
|
-
this.tel = e, this.httpClient = r, this.mediaType = n ===
|
|
3505
|
+
this.tel = e, this.httpClient = r, this.mediaType = n === F.VIDEO ? F.VIDEO : F.AUDIO, this.webrtcSession = new Ft(n == F.VIDEO ? g.VIDEO_PUSH : g.AUDIO_PUSH), this.webrtcSession.setListener(this);
|
|
3491
3506
|
}
|
|
3492
3507
|
setBroadcastSessionListener(e) {
|
|
3493
3508
|
this.sessionListener = e;
|
|
@@ -3548,20 +3563,20 @@ class Ts extends Kr {
|
|
|
3548
3563
|
this.sessionListener = r;
|
|
3549
3564
|
}
|
|
3550
3565
|
audioHalfCall(r) {
|
|
3551
|
-
this.makeCall(r,
|
|
3566
|
+
this.makeCall(r, F.AUDIO, B.HALF);
|
|
3552
3567
|
}
|
|
3553
3568
|
videoHalfCall(r) {
|
|
3554
|
-
this.makeCall(r,
|
|
3569
|
+
this.makeCall(r, F.VIDEO, B.HALF);
|
|
3555
3570
|
}
|
|
3556
3571
|
tbcpRequest() {
|
|
3557
3572
|
var r;
|
|
3558
|
-
this.callMode ==
|
|
3573
|
+
this.callMode == B.HALF && this.status == A.TALK && ((r = this.webrtcSession) == null || r.sendStringData(JSON.stringify({
|
|
3559
3574
|
type: yt.TB_REQUEST
|
|
3560
3575
|
})));
|
|
3561
3576
|
}
|
|
3562
3577
|
tbcpRelease() {
|
|
3563
3578
|
var r;
|
|
3564
|
-
this.callMode ==
|
|
3579
|
+
this.callMode == B.HALF && this.status == A.TALK && ((r = this.webrtcSession) == null || r.sendStringData(JSON.stringify({
|
|
3565
3580
|
type: yt.TB_RELEASE
|
|
3566
3581
|
})));
|
|
3567
3582
|
}
|