iss-library-digital-video-v3 0.7.5-hotfix.1 → 0.7.5-hotfix.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,4 +1,4 @@
|
|
|
1
|
-
import { ref as F, reactive as Oe, computed as yA, watch as ve, onMounted as
|
|
1
|
+
import { ref as F, reactive as Oe, computed as yA, watch as ve, onMounted as Te, onBeforeUnmount as Ie, createElementBlock as Ge, openBlock as Ue, createElementVNode as YA, normalizeClass as JA } from "vue";
|
|
2
2
|
var gA, ye = new Uint8Array(16);
|
|
3
3
|
function Ye() {
|
|
4
4
|
if (!gA && (gA = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto < "u" && typeof msCrypto.getRandomValues == "function" && msCrypto.getRandomValues.bind(msCrypto), !gA))
|
|
@@ -145,22 +145,22 @@ function ne(A, e) {
|
|
|
145
145
|
return A.apply(e, arguments);
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
|
-
const { toString: Le } = Object.prototype, { getPrototypeOf:
|
|
148
|
+
const { toString: Le } = Object.prototype, { getPrototypeOf: TA } = Object, { iterator: dA, toStringTag: oe } = Symbol, QA = /* @__PURE__ */ ((A) => (e) => {
|
|
149
149
|
const t = Le.call(e);
|
|
150
150
|
return A[t] || (A[t] = t.slice(8, -1).toLowerCase());
|
|
151
151
|
})(/* @__PURE__ */ Object.create(null)), J = (A) => (A = A.toLowerCase(), (e) => QA(e) === A), DA = (A) => (e) => typeof e === A, { isArray: _ } = Array, K = DA("undefined");
|
|
152
152
|
function rA(A) {
|
|
153
|
-
return A !== null && !K(A) && A.constructor !== null && !K(A.constructor) &&
|
|
153
|
+
return A !== null && !K(A) && A.constructor !== null && !K(A.constructor) && I(A.constructor.isBuffer) && A.constructor.isBuffer(A);
|
|
154
154
|
}
|
|
155
155
|
const re = J("ArrayBuffer");
|
|
156
156
|
function xe(A) {
|
|
157
157
|
let e;
|
|
158
158
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(A) : e = A && A.buffer && re(A.buffer), e;
|
|
159
159
|
}
|
|
160
|
-
const qe = DA("string"),
|
|
160
|
+
const qe = DA("string"), I = DA("function"), se = DA("number"), sA = (A) => A !== null && typeof A == "object", je = (A) => A === !0 || A === !1, wA = (A) => {
|
|
161
161
|
if (QA(A) !== "object")
|
|
162
162
|
return !1;
|
|
163
|
-
const e =
|
|
163
|
+
const e = TA(A);
|
|
164
164
|
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(oe in A) && !(dA in A);
|
|
165
165
|
}, Ke = (A) => {
|
|
166
166
|
if (!sA(A) || rA(A))
|
|
@@ -170,10 +170,10 @@ const qe = DA("string"), T = DA("function"), se = DA("number"), sA = (A) => A !=
|
|
|
170
170
|
} catch {
|
|
171
171
|
return !1;
|
|
172
172
|
}
|
|
173
|
-
}, _e = J("Date"), $e = J("File"), At = J("Blob"), et = J("FileList"), tt = (A) => sA(A) &&
|
|
173
|
+
}, _e = J("Date"), $e = J("File"), At = J("Blob"), et = J("FileList"), tt = (A) => sA(A) && I(A.pipe), nt = (A) => {
|
|
174
174
|
let e;
|
|
175
|
-
return A && (typeof FormData == "function" && A instanceof FormData ||
|
|
176
|
-
e === "object" &&
|
|
175
|
+
return A && (typeof FormData == "function" && A instanceof FormData || I(A.append) && ((e = QA(A)) === "formdata" || // detect form-data instance
|
|
176
|
+
e === "object" && I(A.toString) && A.toString() === "[object FormData]"));
|
|
177
177
|
}, ot = J("URLSearchParams"), [rt, st, Bt, at] = ["ReadableStream", "Request", "Response", "Headers"].map(J), it = (A) => A.trim ? A.trim() : A.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
178
178
|
function BA(A, e, { allOwnKeys: t = !1 } = {}) {
|
|
179
179
|
if (A === null || typeof A > "u")
|
|
@@ -213,7 +213,7 @@ function FA() {
|
|
|
213
213
|
return t;
|
|
214
214
|
}
|
|
215
215
|
const Et = (A, e, t, { allOwnKeys: n } = {}) => (BA(e, (o, s) => {
|
|
216
|
-
t &&
|
|
216
|
+
t && I(o) ? A[s] = ne(o, t) : A[s] = o;
|
|
217
217
|
}, { allOwnKeys: n }), A), ct = (A) => (A.charCodeAt(0) === 65279 && (A = A.slice(1)), A), gt = (A, e, t, n) => {
|
|
218
218
|
A.prototype = Object.create(e.prototype, n), A.prototype.constructor = A, Object.defineProperty(A, "super", {
|
|
219
219
|
value: e.prototype
|
|
@@ -225,7 +225,7 @@ const Et = (A, e, t, { allOwnKeys: n } = {}) => (BA(e, (o, s) => {
|
|
|
225
225
|
do {
|
|
226
226
|
for (o = Object.getOwnPropertyNames(A), s = o.length; s-- > 0; )
|
|
227
227
|
r = o[s], (!n || n(r, A, e)) && !a[r] && (e[r] = A[r], a[r] = !0);
|
|
228
|
-
A = t !== !1 &&
|
|
228
|
+
A = t !== !1 && TA(A);
|
|
229
229
|
} while (A && (!t || t(A, e)) && A !== Object.prototype);
|
|
230
230
|
return e;
|
|
231
231
|
}, wt = (A, e, t) => {
|
|
@@ -241,7 +241,7 @@ const Et = (A, e, t, { allOwnKeys: n } = {}) => (BA(e, (o, s) => {
|
|
|
241
241
|
for (; e-- > 0; )
|
|
242
242
|
t[e] = A[e];
|
|
243
243
|
return t;
|
|
244
|
-
}, Ct = /* @__PURE__ */ ((A) => (e) => A && e instanceof A)(typeof Uint8Array < "u" &&
|
|
244
|
+
}, Ct = /* @__PURE__ */ ((A) => (e) => A && e instanceof A)(typeof Uint8Array < "u" && TA(Uint8Array)), ft = (A, e) => {
|
|
245
245
|
const n = (A && A[dA]).call(A);
|
|
246
246
|
let o;
|
|
247
247
|
for (; (o = n.next()) && !o.done; ) {
|
|
@@ -267,10 +267,10 @@ const Et = (A, e, t, { allOwnKeys: n } = {}) => (BA(e, (o, s) => {
|
|
|
267
267
|
}), Object.defineProperties(A, n);
|
|
268
268
|
}, mt = (A) => {
|
|
269
269
|
ie(A, (e, t) => {
|
|
270
|
-
if (
|
|
270
|
+
if (I(A) && ["arguments", "caller", "callee"].indexOf(t) !== -1)
|
|
271
271
|
return !1;
|
|
272
272
|
const n = A[t];
|
|
273
|
-
if (
|
|
273
|
+
if (I(n)) {
|
|
274
274
|
if (e.enumerable = !1, "writable" in e) {
|
|
275
275
|
e.writable = !1;
|
|
276
276
|
return;
|
|
@@ -290,7 +290,7 @@ const Et = (A, e, t, { allOwnKeys: n } = {}) => (BA(e, (o, s) => {
|
|
|
290
290
|
}, pt = () => {
|
|
291
291
|
}, Rt = (A, e) => A != null && Number.isFinite(A = +A) ? A : e;
|
|
292
292
|
function St(A) {
|
|
293
|
-
return !!(A &&
|
|
293
|
+
return !!(A && I(A.append) && A[oe] === "FormData" && A[dA]);
|
|
294
294
|
}
|
|
295
295
|
const bt = (A) => {
|
|
296
296
|
const e = new Array(10), t = (n, o) => {
|
|
@@ -311,14 +311,14 @@ const bt = (A) => {
|
|
|
311
311
|
return n;
|
|
312
312
|
};
|
|
313
313
|
return t(A, 0);
|
|
314
|
-
}, Ft = J("AsyncFunction"), Zt = (A) => A && (sA(A) ||
|
|
314
|
+
}, Ft = J("AsyncFunction"), Zt = (A) => A && (sA(A) || I(A)) && I(A.then) && I(A.catch), Ee = ((A, e) => A ? setImmediate : e ? ((t, n) => (H.addEventListener("message", ({ source: o, data: s }) => {
|
|
315
315
|
o === H && s === t && n.length && n.shift()();
|
|
316
316
|
}, !1), (o) => {
|
|
317
317
|
n.push(o), H.postMessage(t, "*");
|
|
318
318
|
}))(`axios@${Math.random()}`, []) : (t) => setTimeout(t))(
|
|
319
319
|
typeof setImmediate == "function",
|
|
320
|
-
|
|
321
|
-
), kt = typeof queueMicrotask < "u" ? queueMicrotask.bind(H) : typeof process < "u" && process.nextTick || Ee, Ot = (A) => A != null &&
|
|
320
|
+
I(H.postMessage)
|
|
321
|
+
), kt = typeof queueMicrotask < "u" ? queueMicrotask.bind(H) : typeof process < "u" && process.nextTick || Ee, Ot = (A) => A != null && I(A[dA]), B = {
|
|
322
322
|
isArray: _,
|
|
323
323
|
isArrayBuffer: re,
|
|
324
324
|
isBuffer: rA,
|
|
@@ -339,7 +339,7 @@ const bt = (A) => {
|
|
|
339
339
|
isFile: $e,
|
|
340
340
|
isBlob: At,
|
|
341
341
|
isRegExp: ht,
|
|
342
|
-
isFunction:
|
|
342
|
+
isFunction: I,
|
|
343
343
|
isStream: tt,
|
|
344
344
|
isURLSearchParams: ot,
|
|
345
345
|
isTypedArray: Ct,
|
|
@@ -442,10 +442,10 @@ function PA(A, e, t) {
|
|
|
442
442
|
return o = le(o), !t && s ? "[" + o + "]" : o;
|
|
443
443
|
}).join(t ? "." : "") : e;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function Tt(A) {
|
|
446
446
|
return B.isArray(A) && !A.some(ZA);
|
|
447
447
|
}
|
|
448
|
-
const
|
|
448
|
+
const It = B.toFlatObject(B, {}, null, function(e) {
|
|
449
449
|
return /^is[A-Z]/.test(e);
|
|
450
450
|
});
|
|
451
451
|
function hA(A, e, t) {
|
|
@@ -476,7 +476,7 @@ function hA(A, e, t) {
|
|
|
476
476
|
if (c && !l && typeof c == "object") {
|
|
477
477
|
if (B.endsWith(u, "{}"))
|
|
478
478
|
u = n ? u : u.slice(0, -2), c = JSON.stringify(c);
|
|
479
|
-
else if (B.isArray(c) &&
|
|
479
|
+
else if (B.isArray(c) && Tt(c) || (B.isFileList(c) || B.endsWith(u, "[]")) && (h = B.toArray(c)))
|
|
480
480
|
return u = le(u), h.forEach(function(m, p) {
|
|
481
481
|
!(B.isUndefined(m) || m === null) && e.append(
|
|
482
482
|
// eslint-disable-next-line no-nested-ternary
|
|
@@ -487,7 +487,7 @@ function hA(A, e, t) {
|
|
|
487
487
|
}
|
|
488
488
|
return ZA(c) ? !0 : (e.append(PA(l, u, s), E(c)), !1);
|
|
489
489
|
}
|
|
490
|
-
const w = [], C = Object.assign(
|
|
490
|
+
const w = [], C = Object.assign(It, {
|
|
491
491
|
defaultVisitor: i,
|
|
492
492
|
convertValue: E,
|
|
493
493
|
isVisitable: ZA
|
|
@@ -525,10 +525,10 @@ function NA(A) {
|
|
|
525
525
|
return e[n];
|
|
526
526
|
});
|
|
527
527
|
}
|
|
528
|
-
function
|
|
528
|
+
function IA(A, e) {
|
|
529
529
|
this._pairs = [], A && hA(A, this, e);
|
|
530
530
|
}
|
|
531
|
-
const we =
|
|
531
|
+
const we = IA.prototype;
|
|
532
532
|
we.append = function(e, t) {
|
|
533
533
|
this._pairs.push([e, t]);
|
|
534
534
|
};
|
|
@@ -552,7 +552,7 @@ function ue(A, e, t) {
|
|
|
552
552
|
});
|
|
553
553
|
const o = t && t.serialize;
|
|
554
554
|
let s;
|
|
555
|
-
if (o ? s = o(e, t) : s = B.isURLSearchParams(e) ? e.toString() : new
|
|
555
|
+
if (o ? s = o(e, t) : s = B.isURLSearchParams(e) ? e.toString() : new IA(e, t).toString(n), s) {
|
|
556
556
|
const r = A.indexOf("#");
|
|
557
557
|
r !== -1 && (A = A.slice(0, r)), A += (A.indexOf("?") === -1 ? "?" : "&") + s;
|
|
558
558
|
}
|
|
@@ -616,7 +616,7 @@ const Ce = {
|
|
|
616
616
|
silentJSONParsing: !0,
|
|
617
617
|
forcedJSONParsing: !0,
|
|
618
618
|
clarifyTimeoutError: !1
|
|
619
|
-
}, Ut = typeof URLSearchParams < "u" ? URLSearchParams :
|
|
619
|
+
}, Ut = typeof URLSearchParams < "u" ? URLSearchParams : IA, yt = typeof FormData < "u" ? FormData : null, Yt = typeof Blob < "u" ? Blob : null, Jt = {
|
|
620
620
|
isBrowser: !0,
|
|
621
621
|
classes: {
|
|
622
622
|
URLSearchParams: Ut,
|
|
@@ -1394,14 +1394,14 @@ const he = (A) => {
|
|
|
1394
1394
|
}
|
|
1395
1395
|
}
|
|
1396
1396
|
B.isString(N) || (N = N ? "include" : "omit");
|
|
1397
|
-
const
|
|
1397
|
+
const T = s && "credentials" in t.prototype, EA = {
|
|
1398
1398
|
...eA,
|
|
1399
1399
|
signal: X,
|
|
1400
1400
|
method: l.toUpperCase(),
|
|
1401
1401
|
headers: AA.normalize().toJSON(),
|
|
1402
1402
|
body: h,
|
|
1403
1403
|
duplex: "half",
|
|
1404
|
-
credentials:
|
|
1404
|
+
credentials: T ? N : void 0
|
|
1405
1405
|
};
|
|
1406
1406
|
W = s && new t(u, EA);
|
|
1407
1407
|
let z = await (s ? iA(W, eA) : iA(u, EA));
|
|
@@ -1434,13 +1434,13 @@ const he = (A) => {
|
|
|
1434
1434
|
request: W
|
|
1435
1435
|
});
|
|
1436
1436
|
});
|
|
1437
|
-
} catch (
|
|
1438
|
-
throw Y && Y(),
|
|
1437
|
+
} catch (T) {
|
|
1438
|
+
throw Y && Y(), T && T.name === "TypeError" && /Load failed|fetch/i.test(T.message) ? Object.assign(
|
|
1439
1439
|
new f("Network Error", f.ERR_NETWORK, c, W),
|
|
1440
1440
|
{
|
|
1441
|
-
cause:
|
|
1441
|
+
cause: T.cause || T
|
|
1442
1442
|
}
|
|
1443
|
-
) : f.from(
|
|
1443
|
+
) : f.from(T, T && T.code, c, W);
|
|
1444
1444
|
}
|
|
1445
1445
|
};
|
|
1446
1446
|
}, Cn = /* @__PURE__ */ new Map(), me = (A) => {
|
|
@@ -1931,7 +1931,7 @@ const Mn = "data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAA
|
|
|
1931
1931
|
default: "ws://10.110.145.131:8191/meta-human/stream-tts"
|
|
1932
1932
|
}
|
|
1933
1933
|
},
|
|
1934
|
-
emits: ["error", "voice-stop-event"],
|
|
1934
|
+
emits: ["error", "voice-stop-event", "start-end-pointer"],
|
|
1935
1935
|
setup(A, { expose: e, emit: t }) {
|
|
1936
1936
|
const n = t, o = A, s = F(!0), r = F(!1), a = F(null), g = F(""), E = F(""), i = F(!1), w = F(!1), C = F(!1), D = F(0), c = F(0);
|
|
1937
1937
|
F(!1);
|
|
@@ -2010,7 +2010,7 @@ const Mn = "data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAA
|
|
|
2010
2010
|
const d = { task: "tts", signal: "end" };
|
|
2011
2011
|
Q.value.send(JSON.stringify(d));
|
|
2012
2012
|
}
|
|
2013
|
-
},
|
|
2013
|
+
}, T = (d = "init", b) => {
|
|
2014
2014
|
try {
|
|
2015
2015
|
return u.value = new He({
|
|
2016
2016
|
encoding: "16bitInt",
|
|
@@ -2024,7 +2024,10 @@ const Mn = "data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAA
|
|
|
2024
2024
|
console.log("开始播放onstart"), s.value && !w.value && iA(), D.value++;
|
|
2025
2025
|
},
|
|
2026
2026
|
onended: (R, q) => {
|
|
2027
|
-
console.log("播放结束onended", R), c.value++,
|
|
2027
|
+
console.log("播放结束onended", R), c.value++, n("start-end-pointer", {
|
|
2028
|
+
startTimes: D.value,
|
|
2029
|
+
endTimes: c.value
|
|
2030
|
+
}), D.value === c.value && (console.log("停止说话了~~~"), setTimeout(() => {
|
|
2028
2031
|
X();
|
|
2029
2032
|
}, 200), setTimeout(() => {
|
|
2030
2033
|
console.log("停止说话了~~~2::", D.value === c.value), D.value === c.value && n("voice-stop-event", !0);
|
|
@@ -2057,7 +2060,7 @@ const Mn = "data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAA
|
|
|
2057
2060
|
startTimes: D.value,
|
|
2058
2061
|
endTimes: c.value
|
|
2059
2062
|
}), y = (d) => {
|
|
2060
|
-
d && ((!u.value || !u.value.audioCtx) && (console.log("正在初始化播放器"),
|
|
2063
|
+
d && ((!u.value || !u.value.audioCtx) && (console.log("正在初始化播放器"), T("data", d)), w.value = !1, D.value = 0, c.value = 0, i.value ? (E.value = "", Y(d)) : (console.log("wss未连接,开始连接"), eA(null, d)));
|
|
2061
2064
|
}, V = (d) => {
|
|
2062
2065
|
h.value = 0, S.value && clearInterval(S.value), C.value ? S.value = setInterval(() => {
|
|
2063
2066
|
N("startReading 开启本地轮训,等待ws链接断开"), h.value++, C.value || (S.value && clearInterval(S.value), y(d)), h.value > l.value && (N("startReading 已停止轮训 ws 断开无响应 链接异常"), clearInterval(S.value), C.value && (C.value = !1, y(d)));
|
|
@@ -2069,12 +2072,12 @@ const Mn = "data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAA
|
|
|
2069
2072
|
V(d);
|
|
2070
2073
|
},
|
|
2071
2074
|
{ immediate: !1 }
|
|
2072
|
-
),
|
|
2073
|
-
g.value = Ne(),
|
|
2074
|
-
}),
|
|
2075
|
+
), Te(async () => {
|
|
2076
|
+
g.value = Ne(), T("init");
|
|
2077
|
+
}), Ie(() => {
|
|
2075
2078
|
Q.value && (tA(), u.value && u.value.destroy(), Q.value.close());
|
|
2076
2079
|
}), e({
|
|
2077
|
-
initAudioPlayer:
|
|
2080
|
+
initAudioPlayer: T,
|
|
2078
2081
|
getWssConnectStatus: cA,
|
|
2079
2082
|
getStartEndPointer: MA,
|
|
2080
2083
|
stopAudioPlay: EA,
|
|
@@ -2100,7 +2103,7 @@ const Mn = "data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAA
|
|
|
2100
2103
|
}, null, 10, Fn)
|
|
2101
2104
|
]));
|
|
2102
2105
|
}
|
|
2103
|
-
}), oA = /* @__PURE__ */ Rn(Zn, [["__scopeId", "data-v-
|
|
2106
|
+
}), oA = /* @__PURE__ */ Rn(Zn, [["__scopeId", "data-v-3e8bdda0"]]), Fe = "0.7.5-hotfix.2", Ze = () => {
|
|
2104
2107
|
Function(`
|
|
2105
2108
|
window.console && console.log('%c灵犀数字人直播组件 iss-library-digital-video %cV${Fe}', 'color: #3164F6;font-weight: 500;font-size: 12px;', 'color: #999;');
|
|
2106
2109
|
`)();
|