media-av 0.0.13 → 0.0.15
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/LICENSE +20 -20
- package/README.md +14 -14
- package/dist/mediaAV.js +115 -112
- package/dist/mediaAV.umd.cjs +1 -1
- package/index.d.ts +357 -353
- package/package.json +1 -1
package/dist/mediaAV.js
CHANGED
|
@@ -17,7 +17,7 @@ function ti(t, e) {
|
|
|
17
17
|
}
|
|
18
18
|
return Object.freeze(Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }));
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function Lr(t, e) {
|
|
21
21
|
return function() {
|
|
22
22
|
return t.apply(e, arguments);
|
|
23
23
|
};
|
|
@@ -29,12 +29,12 @@ const { toString: ri } = Object.prototype, { getPrototypeOf: kt } = Object, qe =
|
|
|
29
29
|
function ni(t) {
|
|
30
30
|
return t !== null && !Te(t) && t.constructor !== null && !Te(t.constructor) && k(t.constructor.isBuffer) && t.constructor.isBuffer(t);
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const xr = j("ArrayBuffer");
|
|
33
33
|
function ii(t) {
|
|
34
34
|
let e;
|
|
35
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer &&
|
|
35
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && xr(t.buffer), e;
|
|
36
36
|
}
|
|
37
|
-
const oi = Ke("string"), k = Ke("function"), kr = Ke("number"), Qe = (t) => t !== null && typeof t == "object", si = (t) => t === !0 || t === !1,
|
|
37
|
+
const oi = Ke("string"), k = Ke("function"), kr = Ke("number"), Qe = (t) => t !== null && typeof t == "object", si = (t) => t === !0 || t === !1, xe = (t) => {
|
|
38
38
|
if (qe(t) !== "object")
|
|
39
39
|
return !1;
|
|
40
40
|
const e = kt(t);
|
|
@@ -71,14 +71,14 @@ const Fr = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? sel
|
|
|
71
71
|
function ht() {
|
|
72
72
|
const { caseless: t } = Nr(this) && this || {}, e = {}, r = (n, i) => {
|
|
73
73
|
const o = t && Mr(e, i) || i;
|
|
74
|
-
|
|
74
|
+
xe(e[o]) && xe(n) ? e[o] = ht(e[o], n) : xe(n) ? e[o] = ht({}, n) : he(n) ? e[o] = n.slice() : e[o] = n;
|
|
75
75
|
};
|
|
76
76
|
for (let n = 0, i = arguments.length; n < i; n++)
|
|
77
77
|
arguments[n] && Ee(arguments[n], r);
|
|
78
78
|
return e;
|
|
79
79
|
}
|
|
80
80
|
const mi = (t, e, r, { allOwnKeys: n } = {}) => (Ee(e, (i, o) => {
|
|
81
|
-
r && k(i) ? t[o] =
|
|
81
|
+
r && k(i) ? t[o] = Lr(i, r) : t[o] = i;
|
|
82
82
|
}, { allOwnKeys: n }), t), yi = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), gi = (t, e, r, n) => {
|
|
83
83
|
t.prototype = Object.create(e.prototype, n), t.prototype.constructor = t, Object.defineProperty(t, "super", {
|
|
84
84
|
value: e.prototype
|
|
@@ -160,14 +160,14 @@ const mi = (t, e, r, { allOwnKeys: n } = {}) => (Ee(e, (i, o) => {
|
|
|
160
160
|
DIGIT: Qt,
|
|
161
161
|
ALPHA: et,
|
|
162
162
|
ALPHA_DIGIT: et + et.toUpperCase() + Qt
|
|
163
|
-
},
|
|
163
|
+
}, Li = (t = 16, e = Br.ALPHA_DIGIT) => {
|
|
164
164
|
let r = "";
|
|
165
165
|
const { length: n } = e;
|
|
166
166
|
for (; t--; )
|
|
167
167
|
r += e[Math.random() * n | 0];
|
|
168
168
|
return r;
|
|
169
169
|
};
|
|
170
|
-
function
|
|
170
|
+
function xi(t) {
|
|
171
171
|
return !!(t && k(t.append) && t[Symbol.toStringTag] === "FormData" && t[Symbol.iterator]);
|
|
172
172
|
}
|
|
173
173
|
const ki = (t) => {
|
|
@@ -189,7 +189,7 @@ const ki = (t) => {
|
|
|
189
189
|
return r(t, 0);
|
|
190
190
|
}, Mi = j("AsyncFunction"), Fi = (t) => t && (Qe(t) || k(t)) && k(t.then) && k(t.catch), d = {
|
|
191
191
|
isArray: he,
|
|
192
|
-
isArrayBuffer:
|
|
192
|
+
isArrayBuffer: xr,
|
|
193
193
|
isBuffer: ni,
|
|
194
194
|
isFormData: pi,
|
|
195
195
|
isArrayBufferView: ii,
|
|
@@ -197,7 +197,7 @@ const ki = (t) => {
|
|
|
197
197
|
isNumber: kr,
|
|
198
198
|
isBoolean: si,
|
|
199
199
|
isObject: Qe,
|
|
200
|
-
isPlainObject:
|
|
200
|
+
isPlainObject: xe,
|
|
201
201
|
isUndefined: Te,
|
|
202
202
|
isDate: ai,
|
|
203
203
|
isFile: ci,
|
|
@@ -235,8 +235,8 @@ const ki = (t) => {
|
|
|
235
235
|
global: Fr,
|
|
236
236
|
isContextDefined: Nr,
|
|
237
237
|
ALPHABET: Br,
|
|
238
|
-
generateString:
|
|
239
|
-
isSpecCompliantForm:
|
|
238
|
+
generateString: Li,
|
|
239
|
+
isSpecCompliantForm: xi,
|
|
240
240
|
toJSONObject: ki,
|
|
241
241
|
isAsyncFn: Mi,
|
|
242
242
|
isThenable: Fi
|
|
@@ -332,16 +332,16 @@ function Ye(t, e, r) {
|
|
|
332
332
|
return d.isArrayBuffer(h) || d.isTypedArray(h) ? l && typeof Blob == "function" ? new Blob([h]) : Buffer.from(h) : h;
|
|
333
333
|
}
|
|
334
334
|
function u(h, y, T) {
|
|
335
|
-
let
|
|
335
|
+
let v = h;
|
|
336
336
|
if (h && !T && typeof h == "object") {
|
|
337
337
|
if (d.endsWith(y, "{}"))
|
|
338
338
|
y = n ? y : y.slice(0, -2), h = JSON.stringify(h);
|
|
339
|
-
else if (d.isArray(h) && Ui(h) || (d.isFileList(h) || d.endsWith(y, "[]")) && (
|
|
340
|
-
return y = Hr(y),
|
|
341
|
-
!(d.isUndefined(
|
|
339
|
+
else if (d.isArray(h) && Ui(h) || (d.isFileList(h) || d.endsWith(y, "[]")) && (v = d.toArray(h)))
|
|
340
|
+
return y = Hr(y), v.forEach(function(L, G) {
|
|
341
|
+
!(d.isUndefined(L) || L === null) && e.append(
|
|
342
342
|
// eslint-disable-next-line no-nested-ternary
|
|
343
343
|
s === !0 ? Yt([y], G, o) : s === null ? y : y + "[]",
|
|
344
|
-
c(
|
|
344
|
+
c(L)
|
|
345
345
|
);
|
|
346
346
|
}), !1;
|
|
347
347
|
}
|
|
@@ -356,14 +356,14 @@ function Ye(t, e, r) {
|
|
|
356
356
|
if (!d.isUndefined(h)) {
|
|
357
357
|
if (f.indexOf(h) !== -1)
|
|
358
358
|
throw Error("Circular reference detected in " + y.join("."));
|
|
359
|
-
f.push(h), d.forEach(h, function(
|
|
360
|
-
(!(d.isUndefined(
|
|
359
|
+
f.push(h), d.forEach(h, function(v, A) {
|
|
360
|
+
(!(d.isUndefined(v) || v === null) && i.call(
|
|
361
361
|
e,
|
|
362
|
-
|
|
362
|
+
v,
|
|
363
363
|
d.isString(A) ? A.trim() : A,
|
|
364
364
|
y,
|
|
365
365
|
p
|
|
366
|
-
)) === !0 && m(
|
|
366
|
+
)) === !0 && m(v, y ? y.concat(A) : [A]);
|
|
367
367
|
}), f.pop();
|
|
368
368
|
}
|
|
369
369
|
}
|
|
@@ -944,10 +944,10 @@ const uo = typeof XMLHttpRequest < "u", fo = uo && function(t) {
|
|
|
944
944
|
config: t,
|
|
945
945
|
request: c
|
|
946
946
|
};
|
|
947
|
-
no(function(
|
|
948
|
-
r(
|
|
949
|
-
}, function(
|
|
950
|
-
n(
|
|
947
|
+
no(function(v) {
|
|
948
|
+
r(v), l();
|
|
949
|
+
}, function(v) {
|
|
950
|
+
n(v), l();
|
|
951
951
|
}, y), c = null;
|
|
952
952
|
}
|
|
953
953
|
if ("onloadend" in c ? c.onloadend = f : c.onreadystatechange = function() {
|
|
@@ -1400,7 +1400,7 @@ Object.entries(gt).forEach(([t, e]) => {
|
|
|
1400
1400
|
});
|
|
1401
1401
|
const So = gt;
|
|
1402
1402
|
function Kr(t) {
|
|
1403
|
-
const e = new Fe(t), r =
|
|
1403
|
+
const e = new Fe(t), r = Lr(Fe.prototype.request, e);
|
|
1404
1404
|
return d.extend(r, Fe.prototype, e, { allOwnKeys: !0 }), d.extend(r, e, null, { allOwnKeys: !0 }), r.create = function(i) {
|
|
1405
1405
|
return Kr(ue(t, i));
|
|
1406
1406
|
}, r;
|
|
@@ -1502,7 +1502,7 @@ var bo = function() {
|
|
|
1502
1502
|
c.prototype = r.prototype, i.prototype = new c(), c.prototype = null;
|
|
1503
1503
|
}
|
|
1504
1504
|
return i;
|
|
1505
|
-
}, Do = Io, Bt = Function.prototype.bind || Do,
|
|
1505
|
+
}, Do = Io, Bt = Function.prototype.bind || Do, Lo = Bt, xo = Lo.call(Function.call, Object.prototype.hasOwnProperty), C, fe = SyntaxError, Yr = Function, ce = TypeError, ot = function(t) {
|
|
1506
1506
|
try {
|
|
1507
1507
|
return Yr('"use strict"; return (' + t + ").constructor;")();
|
|
1508
1508
|
} catch {
|
|
@@ -1672,7 +1672,7 @@ var Uo = function t(e) {
|
|
|
1672
1672
|
"%URIErrorPrototype%": ["URIError", "prototype"],
|
|
1673
1673
|
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
1674
1674
|
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
1675
|
-
}, Oe = Bt, Ve =
|
|
1675
|
+
}, Oe = Bt, Ve = xo, Bo = Oe.call(Function.call, Array.prototype.concat), jo = Oe.call(Function.apply, Array.prototype.splice), cr = Oe.call(Function.call, String.prototype.replace), ze = Oe.call(Function.call, String.prototype.slice), $o = Oe.call(Function.call, RegExp.prototype.exec), Ho = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, wo = /\\(\\)?/g, Go = function(e) {
|
|
1676
1676
|
var r = ze(e, 0, 1), n = ze(e, -1);
|
|
1677
1677
|
if (r === "%" && n !== "%")
|
|
1678
1678
|
throw new fe("invalid intrinsic syntax, expected closing `%`");
|
|
@@ -1833,15 +1833,15 @@ var Ct = Qo, gr = Ct.custom, Sr = on(gr) ? gr : null, ss = function t(e, r, n, i
|
|
|
1833
1833
|
return typeof e == "object" && !pe ? ve(y) : y;
|
|
1834
1834
|
}
|
|
1835
1835
|
if (bs(e)) {
|
|
1836
|
-
for (var T = "<" + pr.call(String(e.nodeName)),
|
|
1837
|
-
T += " " +
|
|
1836
|
+
for (var T = "<" + pr.call(String(e.nodeName)), v = e.attributes || [], A = 0; A < v.length; A++)
|
|
1837
|
+
T += " " + v[A].name + "=" + nn(as(v[A].value), "double", o);
|
|
1838
1838
|
return T += ">", e.childNodes && e.childNodes.length && (T += "..."), T += "</" + pr.call(String(e.nodeName)) + ">", T;
|
|
1839
1839
|
}
|
|
1840
1840
|
if (bt(e)) {
|
|
1841
1841
|
if (e.length === 0)
|
|
1842
1842
|
return "[]";
|
|
1843
|
-
var
|
|
1844
|
-
return f && !Ts(
|
|
1843
|
+
var L = Ie(e, p);
|
|
1844
|
+
return f && !Ts(L) ? "[" + Rt(L, f) + "]" : "[ " + N.call(L, ", ") + " ]";
|
|
1845
1845
|
}
|
|
1846
1846
|
if (ls(e)) {
|
|
1847
1847
|
var G = Ie(e, p);
|
|
@@ -2106,7 +2106,7 @@ function Ie(t, e) {
|
|
|
2106
2106
|
rn.call(t, o[c]) && n.push("[" + e(o[c]) + "]: " + e(t[o[c]], t));
|
|
2107
2107
|
return n;
|
|
2108
2108
|
}
|
|
2109
|
-
var Gt = jt, me = Wo, Ps = ss, Os = Gt("%TypeError%"), De = Gt("%WeakMap%", !0),
|
|
2109
|
+
var Gt = jt, me = Wo, Ps = ss, Os = Gt("%TypeError%"), De = Gt("%WeakMap%", !0), Le = Gt("%Map%", !0), As = me("WeakMap.prototype.get", !0), _s = me("WeakMap.prototype.set", !0), Is = me("WeakMap.prototype.has", !0), Ds = me("Map.prototype.get", !0), Ls = me("Map.prototype.set", !0), xs = me("Map.prototype.has", !0), Vt = function(t, e) {
|
|
2110
2110
|
for (var r = t, n; (n = r.next) !== null; r = n)
|
|
2111
2111
|
if (n.key === e)
|
|
2112
2112
|
return r.next = n.next, n.next = t.next, t.next = n, n;
|
|
@@ -2133,7 +2133,7 @@ var Gt = jt, me = Wo, Ps = ss, Os = Gt("%TypeError%"), De = Gt("%WeakMap%", !0),
|
|
|
2133
2133
|
if (De && o && (typeof o == "object" || typeof o == "function")) {
|
|
2134
2134
|
if (e)
|
|
2135
2135
|
return As(e, o);
|
|
2136
|
-
} else if (
|
|
2136
|
+
} else if (Le) {
|
|
2137
2137
|
if (r)
|
|
2138
2138
|
return Ds(r, o);
|
|
2139
2139
|
} else if (n)
|
|
@@ -2143,15 +2143,15 @@ var Gt = jt, me = Wo, Ps = ss, Os = Gt("%TypeError%"), De = Gt("%WeakMap%", !0),
|
|
|
2143
2143
|
if (De && o && (typeof o == "object" || typeof o == "function")) {
|
|
2144
2144
|
if (e)
|
|
2145
2145
|
return Is(e, o);
|
|
2146
|
-
} else if (
|
|
2146
|
+
} else if (Le) {
|
|
2147
2147
|
if (r)
|
|
2148
|
-
return
|
|
2148
|
+
return xs(r, o);
|
|
2149
2149
|
} else if (n)
|
|
2150
2150
|
return Fs(n, o);
|
|
2151
2151
|
return !1;
|
|
2152
2152
|
},
|
|
2153
2153
|
set: function(o, s) {
|
|
2154
|
-
De && o && (typeof o == "object" || typeof o == "function") ? (e || (e = new De()), _s(e, o, s)) :
|
|
2154
|
+
De && o && (typeof o == "object" || typeof o == "function") ? (e || (e = new De()), _s(e, o, s)) : Le ? (r || (r = new Le()), Ls(r, o, s)) : (n || (n = { key: {}, next: null }), Ms(n, o, s));
|
|
2155
2155
|
}
|
|
2156
2156
|
};
|
|
2157
2157
|
return i;
|
|
@@ -2319,46 +2319,46 @@ var Gt = jt, me = Wo, Ps = ss, Os = Gt("%TypeError%"), De = Gt("%WeakMap%", !0),
|
|
|
2319
2319
|
}, Zs = function(e) {
|
|
2320
2320
|
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" || typeof e == "bigint";
|
|
2321
2321
|
}, dt = {}, ea = function t(e, r, n, i, o, s, a, l, c, u, f, p, m, h, y, T) {
|
|
2322
|
-
for (var
|
|
2322
|
+
for (var v = e, A = T, L = 0, G = !1; (A = A.get(dt)) !== void 0 && !G; ) {
|
|
2323
2323
|
var ye = A.get(e);
|
|
2324
|
-
if (
|
|
2325
|
-
if (ye ===
|
|
2324
|
+
if (L += 1, typeof ye < "u") {
|
|
2325
|
+
if (ye === L)
|
|
2326
2326
|
throw new RangeError("Cyclic object value");
|
|
2327
2327
|
G = !0;
|
|
2328
2328
|
}
|
|
2329
|
-
typeof A.get(dt) > "u" && (
|
|
2329
|
+
typeof A.get(dt) > "u" && (L = 0);
|
|
2330
2330
|
}
|
|
2331
|
-
if (typeof l == "function" ?
|
|
2331
|
+
if (typeof l == "function" ? v = l(r, v) : v instanceof Date ? v = f(v) : n === "comma" && H(v) && (v = Ne.maybeMap(v, function(oe) {
|
|
2332
2332
|
return oe instanceof Date ? f(oe) : oe;
|
|
2333
|
-
})),
|
|
2333
|
+
})), v === null) {
|
|
2334
2334
|
if (o)
|
|
2335
2335
|
return a && !h ? a(r, _.encoder, y, "key", p) : r;
|
|
2336
|
-
|
|
2336
|
+
v = "";
|
|
2337
2337
|
}
|
|
2338
|
-
if (Zs(
|
|
2338
|
+
if (Zs(v) || Ne.isBuffer(v)) {
|
|
2339
2339
|
if (a) {
|
|
2340
2340
|
var Ae = h ? r : a(r, _.encoder, y, "key", p);
|
|
2341
|
-
return [m(Ae) + "=" + m(a(
|
|
2341
|
+
return [m(Ae) + "=" + m(a(v, _.encoder, y, "value", p))];
|
|
2342
2342
|
}
|
|
2343
|
-
return [m(r) + "=" + m(String(
|
|
2343
|
+
return [m(r) + "=" + m(String(v))];
|
|
2344
2344
|
}
|
|
2345
2345
|
var K = [];
|
|
2346
|
-
if (typeof
|
|
2346
|
+
if (typeof v > "u")
|
|
2347
2347
|
return K;
|
|
2348
2348
|
var V;
|
|
2349
|
-
if (n === "comma" && H(
|
|
2350
|
-
h && a && (
|
|
2349
|
+
if (n === "comma" && H(v))
|
|
2350
|
+
h && a && (v = Ne.maybeMap(v, a)), V = [{ value: v.length > 0 ? v.join(",") || null : void 0 }];
|
|
2351
2351
|
else if (H(l))
|
|
2352
2352
|
V = l;
|
|
2353
2353
|
else {
|
|
2354
|
-
var re = Object.keys(
|
|
2354
|
+
var re = Object.keys(v);
|
|
2355
2355
|
V = c ? re.sort(c) : re;
|
|
2356
2356
|
}
|
|
2357
|
-
for (var ne = i && H(
|
|
2358
|
-
var M = V[ge], $ = typeof M == "object" && typeof M.value < "u" ? M.value :
|
|
2357
|
+
for (var ne = i && H(v) && v.length === 1 ? r + "[]" : r, ge = 0; ge < V.length; ++ge) {
|
|
2358
|
+
var M = V[ge], $ = typeof M == "object" && typeof M.value < "u" ? M.value : v[M];
|
|
2359
2359
|
if (!(s && $ === null)) {
|
|
2360
|
-
var ie = H(
|
|
2361
|
-
T.set(e,
|
|
2360
|
+
var ie = H(v) ? typeof n == "function" ? n(ne, M) : ne : ne + (u ? "." + M : "[" + M + "]");
|
|
2361
|
+
T.set(e, L);
|
|
2362
2362
|
var _e = un();
|
|
2363
2363
|
_e.set(dt, T), fn(K, t(
|
|
2364
2364
|
$,
|
|
@@ -2367,7 +2367,7 @@ var Gt = jt, me = Wo, Ps = ss, Os = Gt("%TypeError%"), De = Gt("%WeakMap%", !0),
|
|
|
2367
2367
|
i,
|
|
2368
2368
|
o,
|
|
2369
2369
|
s,
|
|
2370
|
-
n === "comma" && h && H(
|
|
2370
|
+
n === "comma" && h && H(v) ? null : a,
|
|
2371
2371
|
l,
|
|
2372
2372
|
c,
|
|
2373
2373
|
u,
|
|
@@ -2613,7 +2613,7 @@ class ga {
|
|
|
2613
2613
|
console.debug("onDataChannelMessage:", e);
|
|
2614
2614
|
}
|
|
2615
2615
|
}
|
|
2616
|
-
var
|
|
2616
|
+
var S = /* @__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))(S || {}), Q = /* @__PURE__ */ ((t) => (t.FRONT_FACING = "user", t.BACK_FACING = "environment", t))(Q || {});
|
|
2617
2617
|
let hn = !0, mn = !0;
|
|
2618
2618
|
function Ue(t, e, r) {
|
|
2619
2619
|
const n = t.match(e);
|
|
@@ -3349,14 +3349,14 @@ function Dn(t) {
|
|
|
3349
3349
|
return this._pc.getStats(this.track);
|
|
3350
3350
|
};
|
|
3351
3351
|
}
|
|
3352
|
-
function
|
|
3352
|
+
function Ln(t) {
|
|
3353
3353
|
!t.RTCPeerConnection || "removeStream" in t.RTCPeerConnection.prototype || (t.RTCPeerConnection.prototype.removeStream = function(r) {
|
|
3354
3354
|
Jt("removeStream", "removeTrack"), this.getSenders().forEach((n) => {
|
|
3355
3355
|
n.track && r.getTracks().includes(n.track) && this.removeTrack(n);
|
|
3356
3356
|
});
|
|
3357
3357
|
});
|
|
3358
3358
|
}
|
|
3359
|
-
function
|
|
3359
|
+
function xn(t) {
|
|
3360
3360
|
t.DataChannel && !t.RTCDataChannel && (t.RTCDataChannel = t.DataChannel);
|
|
3361
3361
|
}
|
|
3362
3362
|
function kn(t) {
|
|
@@ -3430,9 +3430,9 @@ const Ar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3430
3430
|
shimGetUserMedia: An,
|
|
3431
3431
|
shimOnTrack: _n,
|
|
3432
3432
|
shimPeerConnection: Ot,
|
|
3433
|
-
shimRTCDataChannel:
|
|
3433
|
+
shimRTCDataChannel: xn,
|
|
3434
3434
|
shimReceiverGetStats: Dn,
|
|
3435
|
-
shimRemoveStream:
|
|
3435
|
+
shimRemoveStream: Ln,
|
|
3436
3436
|
shimSenderGetStats: In
|
|
3437
3437
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3438
3438
|
function Un(t) {
|
|
@@ -4241,7 +4241,7 @@ function Pa({ window: t } = {}, e = {
|
|
|
4241
4241
|
case "firefox":
|
|
4242
4242
|
if (!Ar || !Ot || !e.shimFirefox)
|
|
4243
4243
|
return r("Firefox shim is not included in this adapter release."), i;
|
|
4244
|
-
r("adapter.js shimming firefox."), i.browserShim = Ar, He(t, n), we(t), An(t, n), Ot(t, n), _n(t),
|
|
4244
|
+
r("adapter.js shimming firefox."), i.browserShim = Ar, He(t, n), we(t), An(t, n), Ot(t, n), _n(t), Ln(t), In(t), Dn(t), xn(t), kn(t), Mn(t), Fn(t), Nn(t), Be(t), _t(t), je(t, n), $e(t);
|
|
4245
4245
|
break;
|
|
4246
4246
|
case "safari":
|
|
4247
4247
|
if (!_r || !e.shimSafari)
|
|
@@ -4265,7 +4265,7 @@ class Wt {
|
|
|
4265
4265
|
// 呼叫方向
|
|
4266
4266
|
g(this, "isCallOut", !1);
|
|
4267
4267
|
// 会话类型
|
|
4268
|
-
g(this, "sessionType",
|
|
4268
|
+
g(this, "sessionType", S.UNKNOWN);
|
|
4269
4269
|
// 本地媒体流
|
|
4270
4270
|
g(this, "localStream");
|
|
4271
4271
|
// 对端媒体流
|
|
@@ -4304,10 +4304,10 @@ class Wt {
|
|
|
4304
4304
|
}
|
|
4305
4305
|
switch (this.isCallOut = e, this.hasSetRemoteSdp = !1, this.facingMode = Q.FRONT_FACING, this.facingChanging = !1, this.muted = !1, this.peerConnection = new RTCPeerConnection({ iceServers: [] }), this.peerConnection.onnegotiationneeded = () => {
|
|
4306
4306
|
switch (this.sessionType) {
|
|
4307
|
-
case
|
|
4308
|
-
case
|
|
4309
|
-
case
|
|
4310
|
-
case
|
|
4307
|
+
case S.AUDIO_PUSH:
|
|
4308
|
+
case S.VIDEO_PUSH:
|
|
4309
|
+
case S.AUDIO_HALF:
|
|
4310
|
+
case S.VIDEO_HALF:
|
|
4311
4311
|
this.createDataChannel();
|
|
4312
4312
|
}
|
|
4313
4313
|
e ? (console.debug("webrtc call out"), this.peerConnection.createOffer().then((n) => {
|
|
@@ -4348,15 +4348,15 @@ class Wt {
|
|
|
4348
4348
|
var i, o, s, a, l;
|
|
4349
4349
|
console.debug("oniceconnectionstatechange", (i = this.peerConnection) == null ? void 0 : i.iceConnectionState), (((o = this.peerConnection) == null ? void 0 : o.iceConnectionState) == "completed" || ((s = this.peerConnection) == null ? void 0 : s.iceConnectionState) == "disconnected" || ((a = this.peerConnection) == null ? void 0 : a.iceConnectionState) == "failed" || ((l = this.peerConnection) == null ? void 0 : l.iceConnectionState) == "closed") && (this.stop(), this.sessionListener.onError(new Error("session closed.")));
|
|
4350
4350
|
}, this.sessionType) {
|
|
4351
|
-
case
|
|
4351
|
+
case S.RTSP_PULL:
|
|
4352
4352
|
this.addTransceivers(), this.createDataChannel();
|
|
4353
4353
|
break;
|
|
4354
|
-
case
|
|
4355
|
-
case
|
|
4356
|
-
case
|
|
4357
|
-
case
|
|
4358
|
-
case
|
|
4359
|
-
case
|
|
4354
|
+
case S.AUDIO_PUSH:
|
|
4355
|
+
case S.VIDEO_PUSH:
|
|
4356
|
+
case S.AUDIO_HALF:
|
|
4357
|
+
case S.VIDEO_HALF:
|
|
4358
|
+
case S.VIDEO:
|
|
4359
|
+
case S.AUDIO:
|
|
4360
4360
|
this.gotLocalMedia();
|
|
4361
4361
|
break;
|
|
4362
4362
|
default:
|
|
@@ -4394,7 +4394,7 @@ class Wt {
|
|
|
4394
4394
|
*/
|
|
4395
4395
|
stop() {
|
|
4396
4396
|
var e;
|
|
4397
|
-
console.debug("webrtc stop"), (this.sessionType ==
|
|
4397
|
+
console.debug("webrtc stop"), (this.sessionType == S.VIDEO_PUSH || this.sessionType == S.AUDIO_PUSH || this.sessionType == S.RTSP_PULL) && this.sendStringData("close"), (e = this.peerConnection) == null || e.close(), this.peerConnection = void 0, this.localStream && (this.localStream.getTracks().forEach((r) => {
|
|
4398
4398
|
this.localStream.removeTrack(r), r.stop();
|
|
4399
4399
|
}), this.localStream = void 0), this.remoteStream = void 0;
|
|
4400
4400
|
}
|
|
@@ -4405,7 +4405,7 @@ class Wt {
|
|
|
4405
4405
|
*/
|
|
4406
4406
|
changeFacing() {
|
|
4407
4407
|
return new Promise((e, r) => {
|
|
4408
|
-
if (this.sessionType !==
|
|
4408
|
+
if (this.sessionType !== S.VIDEO && this.sessionType !== S.VIDEO_PUSH) {
|
|
4409
4409
|
r(new Error("not video call"));
|
|
4410
4410
|
return;
|
|
4411
4411
|
}
|
|
@@ -4463,9 +4463,9 @@ class Wt {
|
|
|
4463
4463
|
audio: { echoCancellation: !0, noiseSuppression: !0 }
|
|
4464
4464
|
};
|
|
4465
4465
|
switch (this.sessionType) {
|
|
4466
|
-
case
|
|
4467
|
-
case
|
|
4468
|
-
case
|
|
4466
|
+
case S.VIDEO:
|
|
4467
|
+
case S.VIDEO_PUSH:
|
|
4468
|
+
case S.VIDEO_HALF:
|
|
4469
4469
|
e.video = { height: { exact: 720 }, width: { exact: 1280 } };
|
|
4470
4470
|
break;
|
|
4471
4471
|
}
|
|
@@ -4476,10 +4476,10 @@ class Wt {
|
|
|
4476
4476
|
}) : this.error(new Error("Browser does not support WebRTC"));
|
|
4477
4477
|
}
|
|
4478
4478
|
getMediaSuccess(e) {
|
|
4479
|
-
console.debug("webrtc getMediaSuccess"), this.localStream = e, (this.sessionType ===
|
|
4479
|
+
console.debug("webrtc getMediaSuccess"), this.localStream = e, (this.sessionType === S.VIDEO || this.sessionType === S.VIDEO_PUSH || this.sessionType === S.VIDEO_HALF) && this.sessionListener.onAddLocalStream(e), e.getTracks().forEach((r) => {
|
|
4480
4480
|
switch (this.sessionType) {
|
|
4481
|
-
case
|
|
4482
|
-
case
|
|
4481
|
+
case S.AUDIO_PUSH:
|
|
4482
|
+
case S.VIDEO_PUSH:
|
|
4483
4483
|
this.peerConnection.addTransceiver(r, { direction: "sendonly", streams: [e] });
|
|
4484
4484
|
break;
|
|
4485
4485
|
default:
|
|
@@ -4488,11 +4488,14 @@ class Wt {
|
|
|
4488
4488
|
}), this.muted = !1;
|
|
4489
4489
|
}
|
|
4490
4490
|
getMediaFailed(e) {
|
|
4491
|
-
if (console.debug("webrtc getMediaFailed failed"), this.sessionType ===
|
|
4492
|
-
console.error("get video media failed. maybe not found camera.", e), this.sessionType =
|
|
4491
|
+
if (console.debug("webrtc getMediaFailed failed"), this.sessionType === S.VIDEO) {
|
|
4492
|
+
console.error("get video media failed. maybe not found camera.", e), this.sessionType = S.AUDIO, this.gotLocalMedia();
|
|
4493
|
+
return;
|
|
4494
|
+
} else if (this.sessionType === S.VIDEO_PUSH) {
|
|
4495
|
+
console.error("get video media failed. maybe not found camera.", e), this.sessionType = S.AUDIO_PUSH, this.gotLocalMedia();
|
|
4493
4496
|
return;
|
|
4494
|
-
} else if (this.sessionType ===
|
|
4495
|
-
console.error("get video media failed. maybe not found camera.", e), this.sessionType =
|
|
4497
|
+
} else if (this.sessionType === S.VIDEO_HALF) {
|
|
4498
|
+
console.error("get video media failed. maybe not found camera.", e), this.sessionType = S.AUDIO_HALF, this.gotLocalMedia();
|
|
4496
4499
|
return;
|
|
4497
4500
|
}
|
|
4498
4501
|
this.error(e);
|
|
@@ -4511,7 +4514,7 @@ class Wt {
|
|
|
4511
4514
|
console.debug("data channel receive from server: close"), this.dataChannel = void 0, this.stop();
|
|
4512
4515
|
return;
|
|
4513
4516
|
}
|
|
4514
|
-
(this.sessionType ==
|
|
4517
|
+
(this.sessionType == S.VIDEO_HALF || this.sessionType == S.AUDIO_HALF) && this.sessionListener.onDataChannelMessage(e);
|
|
4515
4518
|
}
|
|
4516
4519
|
changeCameraLocalMedia() {
|
|
4517
4520
|
return new Promise((e, r) => {
|
|
@@ -4580,7 +4583,7 @@ class _a {
|
|
|
4580
4583
|
*/
|
|
4581
4584
|
constructor(e, r) {
|
|
4582
4585
|
g(this, "rtspUrl");
|
|
4583
|
-
g(this, "webrtcSession", new Wt(
|
|
4586
|
+
g(this, "webrtcSession", new Wt(S.RTSP_PULL));
|
|
4584
4587
|
g(this, "sessionListener", new Oa());
|
|
4585
4588
|
g(this, "httpClient");
|
|
4586
4589
|
this.rtspUrl = e, this.httpClient = r, this.webrtcSession.setListener(this);
|
|
@@ -4618,7 +4621,7 @@ class _a {
|
|
|
4618
4621
|
onDataChannelMessage(e) {
|
|
4619
4622
|
}
|
|
4620
4623
|
}
|
|
4621
|
-
var R = /* @__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))(R || {}), D = /* @__PURE__ */ ((t) => (t.VIDEO = "video", t.AUDIO = "audio", t))(D || {}), U = /* @__PURE__ */ ((t) => (t.FULL = "full-duplex", t.HALF = "half-duplex", t))(U || {}), Y = /* @__PURE__ */ ((t) => (t.IN = "in", t.OUT = "out", t))(Y || {}),
|
|
4624
|
+
var R = /* @__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))(R || {}), D = /* @__PURE__ */ ((t) => (t.VIDEO = "video", t.AUDIO = "audio", t))(D || {}), U = /* @__PURE__ */ ((t) => (t.FULL = "full-duplex", t.HALF = "half-duplex", t))(U || {}), Y = /* @__PURE__ */ ((t) => (t.IN = "in", t.OUT = "out", t))(Y || {}), x = /* @__PURE__ */ ((t) => (t.LOGIN = "login", t.LOGOUT = "logout", t.Invite = "invite", t.RING = "ring", t.ANSWER = "answer", t.HANGUP = "hangup", t.DTMF = "dtmf", t))(x || {});
|
|
4622
4625
|
function Dr() {
|
|
4623
4626
|
try {
|
|
4624
4627
|
return !!(navigator.mediaDevices && navigator.mediaDevices.getUserMedia);
|
|
@@ -4627,13 +4630,13 @@ function Dr() {
|
|
|
4627
4630
|
}
|
|
4628
4631
|
}
|
|
4629
4632
|
function Ia() {
|
|
4630
|
-
return "browser-" + Da() +
|
|
4633
|
+
return "browser-" + Da() + La(6);
|
|
4631
4634
|
}
|
|
4632
4635
|
function Da() {
|
|
4633
4636
|
let t = /* @__PURE__ */ new Date();
|
|
4634
4637
|
return `${t.getFullYear()}${t.getMonth()}${t.getDate()}${t.getHours()}${t.getMinutes()}${t.getSeconds()}`;
|
|
4635
4638
|
}
|
|
4636
|
-
function
|
|
4639
|
+
function La(t) {
|
|
4637
4640
|
let e = "", r = [
|
|
4638
4641
|
"0",
|
|
4639
4642
|
"1",
|
|
@@ -4677,7 +4680,7 @@ function xa(t) {
|
|
|
4677
4680
|
e += r[Math.floor(Math.random() * (r.length - 1))];
|
|
4678
4681
|
return e;
|
|
4679
4682
|
}
|
|
4680
|
-
class
|
|
4683
|
+
class xa {
|
|
4681
4684
|
constructor(e, r, n) {
|
|
4682
4685
|
g(this, "tel");
|
|
4683
4686
|
g(this, "mediaType");
|
|
@@ -4760,7 +4763,7 @@ class Qn {
|
|
|
4760
4763
|
return;
|
|
4761
4764
|
}
|
|
4762
4765
|
let e;
|
|
4763
|
-
this.callMode == U.HALF ? e = D.VIDEO == this.mediaType ?
|
|
4766
|
+
this.callMode == U.HALF ? e = D.VIDEO == this.mediaType ? S.VIDEO_HALF : S.AUDIO_HALF : e = D.VIDEO == this.mediaType ? S.VIDEO : S.AUDIO, this.webrtcCreate(e), (r = this.webrtcSession) == null || r.start(!1, this.remoteSdp);
|
|
4764
4767
|
}
|
|
4765
4768
|
hangup() {
|
|
4766
4769
|
this.status <= R.IDLE || (this.status == R.TALK ? this.sendHangup(this.callId ?? "") : this.callDirect == Y.IN ? this.sendHangup(this.callId ?? "", 488) : this.sendHangup(this.callId ?? "", 801), this.close());
|
|
@@ -4816,7 +4819,7 @@ class Qn {
|
|
|
4816
4819
|
}
|
|
4817
4820
|
this.status > R.IDLE && (console.debug("Another call is currently in progress, hangup it"), this.hangup()), this.mediaType = r, this.callMode = n, this.called = e, this.callDirect = Y.OUT, this.callId = Ia();
|
|
4818
4821
|
let o;
|
|
4819
|
-
this.callMode == U.HALF ? o = D.VIDEO == r ?
|
|
4822
|
+
this.callMode == U.HALF ? o = D.VIDEO == r ? S.VIDEO_HALF : S.AUDIO_HALF : o = D.VIDEO == r ? S.VIDEO : S.AUDIO, this.webrtcCreate(o), (i = this.webrtcSession) == null || i.start(!0), this.status = R.TRY;
|
|
4820
4823
|
} catch (o) {
|
|
4821
4824
|
this.status = R.IDLE, this.sessionListener.onError(new Error("" + o));
|
|
4822
4825
|
}
|
|
@@ -4840,19 +4843,19 @@ class Qn {
|
|
|
4840
4843
|
try {
|
|
4841
4844
|
let n = JSON.parse(r.data);
|
|
4842
4845
|
switch (console.debug("receive msg from server <<<<<<<<<<<<<<<", n), n.type) {
|
|
4843
|
-
case
|
|
4846
|
+
case x.Invite:
|
|
4844
4847
|
this.inviteHandler(n);
|
|
4845
4848
|
break;
|
|
4846
|
-
case
|
|
4849
|
+
case x.ANSWER:
|
|
4847
4850
|
this.answerHandler(n);
|
|
4848
4851
|
break;
|
|
4849
|
-
case
|
|
4852
|
+
case x.RING:
|
|
4850
4853
|
this.ringHandler(n);
|
|
4851
4854
|
break;
|
|
4852
|
-
case
|
|
4855
|
+
case x.HANGUP:
|
|
4853
4856
|
this.hangupHandler(n);
|
|
4854
4857
|
break;
|
|
4855
|
-
case
|
|
4858
|
+
case x.LOGIN:
|
|
4856
4859
|
this.loginHandler(n);
|
|
4857
4860
|
break;
|
|
4858
4861
|
}
|
|
@@ -4873,7 +4876,7 @@ class Qn {
|
|
|
4873
4876
|
}
|
|
4874
4877
|
sendLogin() {
|
|
4875
4878
|
this.sendTo({
|
|
4876
|
-
type:
|
|
4879
|
+
type: x.LOGIN,
|
|
4877
4880
|
username: this.tel,
|
|
4878
4881
|
userAgent: this.getUserAgent(),
|
|
4879
4882
|
accountId: this.accountId
|
|
@@ -4881,14 +4884,14 @@ class Qn {
|
|
|
4881
4884
|
}
|
|
4882
4885
|
sendLogout() {
|
|
4883
4886
|
this.sendTo({
|
|
4884
|
-
type:
|
|
4887
|
+
type: x.LOGOUT,
|
|
4885
4888
|
username: this.tel
|
|
4886
4889
|
}), this.status = R.OFFLINE;
|
|
4887
4890
|
}
|
|
4888
4891
|
sendInvite(e) {
|
|
4889
4892
|
this.sendTo({
|
|
4890
4893
|
callId: this.callId,
|
|
4891
|
-
type:
|
|
4894
|
+
type: x.Invite,
|
|
4892
4895
|
from: this.tel,
|
|
4893
4896
|
to: this.called,
|
|
4894
4897
|
callMode: this.callMode,
|
|
@@ -4898,14 +4901,14 @@ class Qn {
|
|
|
4898
4901
|
}
|
|
4899
4902
|
sendRing() {
|
|
4900
4903
|
this.sendTo({
|
|
4901
|
-
type:
|
|
4904
|
+
type: x.RING,
|
|
4902
4905
|
callId: this.callId,
|
|
4903
4906
|
code: 180
|
|
4904
4907
|
}), this.status = R.RING;
|
|
4905
4908
|
}
|
|
4906
4909
|
sendAnswer(e) {
|
|
4907
4910
|
this.sendTo({
|
|
4908
|
-
type:
|
|
4911
|
+
type: x.ANSWER,
|
|
4909
4912
|
callId: this.callId,
|
|
4910
4913
|
mediaType: this.mediaType,
|
|
4911
4914
|
sdp: e
|
|
@@ -4913,7 +4916,7 @@ class Qn {
|
|
|
4913
4916
|
}
|
|
4914
4917
|
sendDtmf(e) {
|
|
4915
4918
|
this.sendTo({
|
|
4916
|
-
type:
|
|
4919
|
+
type: x.DTMF,
|
|
4917
4920
|
callId: this.callId,
|
|
4918
4921
|
callInfo: "dtmf=" + e
|
|
4919
4922
|
}), this.dtmfAudio.play().then(() => {
|
|
@@ -4921,7 +4924,7 @@ class Qn {
|
|
|
4921
4924
|
}
|
|
4922
4925
|
sendHangup(e, r = 800) {
|
|
4923
4926
|
this.sendTo({
|
|
4924
|
-
type:
|
|
4927
|
+
type: x.HANGUP,
|
|
4925
4928
|
callId: e,
|
|
4926
4929
|
code: r
|
|
4927
4930
|
}), e == this.callId && (this.status = R.IDLE, this.callId = void 0);
|
|
@@ -4949,7 +4952,7 @@ class Qn {
|
|
|
4949
4952
|
}
|
|
4950
4953
|
this.callId = e.callId, this.mediaType = e.mediaType ?? D.AUDIO, this.callMode = e.callMode ?? U.FULL, this.called = e.from ?? "", this.callDirect = Y.IN, this.remoteSdp = e.sdp, this.candidate = e.candidate, this.sendRing(), this.ringtone.currentTime = 0, this.ringtone.play().then(() => {
|
|
4951
4954
|
}).catch(() => {
|
|
4952
|
-
}), this.sessionListener.onNewCall(new
|
|
4955
|
+
}), this.sessionListener.onNewCall(new xa(this.called, this.mediaType, this.callMode));
|
|
4953
4956
|
}
|
|
4954
4957
|
ringHandler(e) {
|
|
4955
4958
|
var r, n;
|
|
@@ -5014,7 +5017,7 @@ class Fa {
|
|
|
5014
5017
|
g(this, "webrtcSession");
|
|
5015
5018
|
g(this, "sessionListener", new ka());
|
|
5016
5019
|
g(this, "httpClient");
|
|
5017
|
-
this.tel = e, this.httpClient = r, this.mediaType = n === D.VIDEO ? D.VIDEO : D.AUDIO, this.webrtcSession = new Wt(n == D.VIDEO ?
|
|
5020
|
+
this.tel = e, this.httpClient = r, this.mediaType = n === D.VIDEO ? D.VIDEO : D.AUDIO, this.webrtcSession = new Wt(n == D.VIDEO ? S.VIDEO_PUSH : S.AUDIO_PUSH), this.webrtcSession.setListener(this);
|
|
5018
5021
|
}
|
|
5019
5022
|
setBroadcastSessionListener(e) {
|
|
5020
5023
|
this.sessionListener = e;
|
|
@@ -5089,7 +5092,7 @@ class Ua extends Qn {
|
|
|
5089
5092
|
}
|
|
5090
5093
|
}
|
|
5091
5094
|
}
|
|
5092
|
-
let qt = new dn("/"), Yn = "/media-server/ws/voip", Xn = "/media-server/ws/b-trun-c",
|
|
5095
|
+
let qt = new dn("/"), Yn = "/media-server/ws/voip", Xn = "/media-server/ws/b-trun-c", Lt = new URL((location.protocol == "https:" ? "wss://" : "ws://") + location.host + Yn), xt = new URL((location.protocol == "https:" ? "wss://" : "ws://") + location.host + Xn);
|
|
5093
5096
|
function ja(t) {
|
|
5094
5097
|
qt = new dn(t);
|
|
5095
5098
|
}
|
|
@@ -5100,13 +5103,13 @@ function Ha(t, e) {
|
|
|
5100
5103
|
return new Fa(t, qt, e);
|
|
5101
5104
|
}
|
|
5102
5105
|
function wa(t) {
|
|
5103
|
-
|
|
5106
|
+
Lt = new URL(t), Lt.pathname = Yn, xt = new URL(t), xt.pathname = Xn;
|
|
5104
5107
|
}
|
|
5105
5108
|
function Ga(t) {
|
|
5106
|
-
return new Qn(
|
|
5109
|
+
return new Qn(Lt.toString(), t);
|
|
5107
5110
|
}
|
|
5108
5111
|
function Va(t, e) {
|
|
5109
|
-
return new Ua(
|
|
5112
|
+
return new Ua(xt.toString(), t, e);
|
|
5110
5113
|
}
|
|
5111
5114
|
export {
|
|
5112
5115
|
Va as createAppCallSession,
|