zhihao-ui 1.3.70-alpha.3 → 1.3.71
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/dist/es/{VideoPlayer-bzT-G97L.js → VideoPlayer-BxefzrEj.js} +149 -145
- package/dist/es/index.js +1 -1
- package/dist/es/{videoPlayerEasyPlayer-DNxlqu99.js → videoPlayerEasyPlayer-HOFMYxEB.js} +1 -1
- package/dist/es/{videoPlayerLibde265-BGKki7_9.js → videoPlayerLibde265-sfC5j0Ie.js} +1 -1
- package/dist/index.css +1 -1
- package/dist/types/components/VideoPlayer/components/timeLine.vue.d.ts +1 -0
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.umd.cjs +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var s = (a, A, I) =>
|
|
4
|
-
import { defineComponent as QA, ref as G, computed as u, onMounted as sA, onUnmounted as
|
|
5
|
-
import { ax as X, ay as
|
|
6
|
-
import { Z as
|
|
1
|
+
var XA = Object.defineProperty;
|
|
2
|
+
var jA = (a, A, I) => A in a ? XA(a, A, { enumerable: !0, configurable: !0, writable: !0, value: I }) : a[A] = I;
|
|
3
|
+
var s = (a, A, I) => jA(a, typeof A != "symbol" ? A + "" : A, I);
|
|
4
|
+
import { defineComponent as QA, ref as G, computed as u, onMounted as sA, onUnmounted as lA, openBlock as W, createElementBlock as Z, withModifiers as zA, normalizeClass as _A, createElementVNode as AA, createBlock as qA, unref as eA, createCommentVNode as fA, watch as tA, normalizeStyle as $A, resolveComponent as AI, withDirectives as II, createVNode as BA, vShow as gI, nextTick as SA, mergeProps as nA } from "vue";
|
|
5
|
+
import { ax as X, ay as LA, J as V, az as L, h as j } from "./vendor-Cpx5CWBZ.js";
|
|
6
|
+
import { Z as HA } from "./Loading-Chcac1F0.js";
|
|
7
7
|
import { _ as CA } from "./Button-jyzZM0Az.js";
|
|
8
|
-
import { a as H, L as IA, b as z, c as
|
|
8
|
+
import { a as H, L as IA, b as z, c as yA, e as RA } from "./DatePicker-C9Mbrb-D.js";
|
|
9
9
|
import { w as BI } from "./utils-CGROVgQL.js";
|
|
10
10
|
class v {
|
|
11
11
|
constructor(A) {
|
|
@@ -120,8 +120,8 @@ class v {
|
|
|
120
120
|
return this.paused || !!((I = (A = this.player) == null ? void 0 : A.isPause) != null && I.call(A));
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
const
|
|
124
|
-
function
|
|
123
|
+
const pA = new Uint8Array([0, 0, 0, 1]);
|
|
124
|
+
function kA(a, A) {
|
|
125
125
|
return a[A] << 16 | a[A + 1] << 8 | a[A + 2];
|
|
126
126
|
}
|
|
127
127
|
function aA(a, A) {
|
|
@@ -136,7 +136,7 @@ function gA(a) {
|
|
|
136
136
|
I.set(i, g), g += i.byteLength;
|
|
137
137
|
return I;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function UA(a) {
|
|
140
140
|
if (!a || a.byteLength < 23) return null;
|
|
141
141
|
const A = a, g = (A[21] & 3) + 1, i = A[22];
|
|
142
142
|
let C = 23;
|
|
@@ -147,8 +147,8 @@ function kA(a) {
|
|
|
147
147
|
for (let r = 0; r < o && !(C + 2 > A.byteLength); r++) {
|
|
148
148
|
const S = A[C] << 8 | A[C + 1];
|
|
149
149
|
if (C += 2, C + S > A.byteLength) break;
|
|
150
|
-
const
|
|
151
|
-
C += S, (D === 32 || D === 33 || D === 34) && e.push(gA([
|
|
150
|
+
const n = A.subarray(C, C + S);
|
|
151
|
+
C += S, (D === 32 || D === 33 || D === 34) && e.push(gA([pA, n]));
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
return { lengthSize: g, paramSetsAnnexB: e };
|
|
@@ -214,7 +214,7 @@ class QI {
|
|
|
214
214
|
A = g + 4, this.headerParsed = !0, this.stats.flvHeader = !0;
|
|
215
215
|
}
|
|
216
216
|
for (; !(A + 11 > I.byteLength); ) {
|
|
217
|
-
const g = I[A], i =
|
|
217
|
+
const g = I[A], i = kA(I, A + 1), C = kA(I, A + 4) + (I[A + 7] << 24), e = 11 + i + 4;
|
|
218
218
|
if (A + e > I.byteLength) break;
|
|
219
219
|
if (this.stats.tagsTotal++, this.stats.lastTagType = g, g === 9 && i > 1) {
|
|
220
220
|
this.stats.tagsVideo++;
|
|
@@ -241,7 +241,7 @@ class QI {
|
|
|
241
241
|
this.stats.hevcVideoTags++, this.stats.lastTimestamp = I;
|
|
242
242
|
const C = A.subarray(5);
|
|
243
243
|
if (i === 0) {
|
|
244
|
-
const E =
|
|
244
|
+
const E = UA(C);
|
|
245
245
|
E && (this.lengthSize = E.lengthSize, this.paramSetsAnnexB = E.paramSetsAnnexB, this.stats.seqHeaders++), (e = this.onStats) == null || e.call(this, { ...this.stats, bufBytes: this.buf.byteLength });
|
|
246
246
|
return;
|
|
247
247
|
}
|
|
@@ -257,7 +257,7 @@ class QI {
|
|
|
257
257
|
this.stats.lastVideoPacketType = i, this.stats.hevcVideoTags++, this.stats.lastTimestamp = I;
|
|
258
258
|
const C = A.subarray(5);
|
|
259
259
|
if (i === 0) {
|
|
260
|
-
const E =
|
|
260
|
+
const E = UA(C);
|
|
261
261
|
E && (this.lengthSize = E.lengthSize, this.paramSetsAnnexB = E.paramSetsAnnexB, this.stats.seqHeaders++), (e = this.onStats) == null || e.call(this, { ...this.stats, bufBytes: this.buf.byteLength });
|
|
262
262
|
return;
|
|
263
263
|
}
|
|
@@ -285,7 +285,7 @@ class QI {
|
|
|
285
285
|
let o = 0;
|
|
286
286
|
if (e === 1 ? o = A[C] : e === 2 ? o = A[C] << 8 | A[C + 1] : e === 3 ? o = A[C] << 16 | A[C + 1] << 8 | A[C + 2] : o = aA(A, C), C += e, o <= 0 || C + o > A.byteLength) break;
|
|
287
287
|
const r = A.subarray(C, C + o);
|
|
288
|
-
C += o, i.push(
|
|
288
|
+
C += o, i.push(pA, r);
|
|
289
289
|
}
|
|
290
290
|
if (i.length) {
|
|
291
291
|
this.stats.hevcFrames++, this.stats.pushedToDecoder++, (D = this.onStats) == null || D.call(this, { ...this.stats, bufBytes: this.buf.byteLength });
|
|
@@ -473,19 +473,19 @@ class b {
|
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
475
|
let _ = null, $ = null;
|
|
476
|
-
function
|
|
476
|
+
function MA() {
|
|
477
477
|
return v.isAvailable() ? Promise.resolve() : _ || (_ = (async () => {
|
|
478
|
-
if (await (await import("./videoPlayerEasyPlayer-
|
|
478
|
+
if (await (await import("./videoPlayerEasyPlayer-HOFMYxEB.js")).injectEasyPlayer(), !v.isAvailable())
|
|
479
479
|
throw new Error("EasyPlayer 注入后仍不可用");
|
|
480
480
|
})(), _);
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function NA() {
|
|
483
483
|
return b.isAvailable() ? Promise.resolve() : $ || ($ = (async () => {
|
|
484
|
-
if ((await import("./videoPlayerLibde265-
|
|
484
|
+
if ((await import("./videoPlayerLibde265-sfC5j0Ie.js")).injectLibde265(), !b.isAvailable())
|
|
485
485
|
throw new Error("libde265 注入后仍不可用");
|
|
486
486
|
})(), $);
|
|
487
487
|
}
|
|
488
|
-
var
|
|
488
|
+
var KA = /* @__PURE__ */ ((a) => (a.ERROR = "error", a.LOADING_COMPLETE = "loading_complete", a.RECOVERED_EARLY_EOF = "recovered_early_eof", a.MEDIA_INFO = "media_info", a.METADATA_ARRIVED = "metadata_arrived", a.SCRIPTDATA_ARRIVED = "scriptdata_arrived", a.STATISTICS_INFO = "statistics_info", a))(KA || {}), JA = /* @__PURE__ */ ((a) => (a.NETWORK_ERROR = "NetworkError", a.MEDIA_ERROR = "MediaError", a.OTHER_ERROR = "OtherError", a))(JA || {});
|
|
489
489
|
class CI {
|
|
490
490
|
constructor(A, I = {}) {
|
|
491
491
|
s(this, "config");
|
|
@@ -596,7 +596,7 @@ class CI {
|
|
|
596
596
|
*/
|
|
597
597
|
async switchToSoftDecode() {
|
|
598
598
|
if (!this.useSoftDecode) {
|
|
599
|
-
if (this.config.isLive ? await
|
|
599
|
+
if (this.config.isLive ? await MA() : await NA(), !this.config.isLive && !b.isAvailable()) {
|
|
600
600
|
this.emit("error", "OtherError", new Error("libde265 软解库加载失败"));
|
|
601
601
|
return;
|
|
602
602
|
}
|
|
@@ -618,11 +618,11 @@ class CI {
|
|
|
618
618
|
async load() {
|
|
619
619
|
if (!this.useSoftDecode) {
|
|
620
620
|
if (!this.checkHardwareSupport()) {
|
|
621
|
-
this.config.isLive ? (await
|
|
621
|
+
this.config.isLive ? (await MA(), v.isAvailable() ? (this.useSoftDecode = !0, this.initSoftwareDecoder()) : this.emit(
|
|
622
622
|
"error",
|
|
623
623
|
"OtherError",
|
|
624
624
|
new Error("浏览器不支持硬解码,且 EasyPlayer 软解库未加载")
|
|
625
|
-
)) : (await
|
|
625
|
+
)) : (await NA(), b.isAvailable() ? (this.useSoftDecode = !0, this.initSoftwareDecoder()) : this.emit(
|
|
626
626
|
"error",
|
|
627
627
|
"OtherError",
|
|
628
628
|
new Error("浏览器不支持硬解码,且 libde265 软解库未加载")
|
|
@@ -668,10 +668,10 @@ class CI {
|
|
|
668
668
|
return this.useSoftDecode;
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
|
-
function
|
|
671
|
+
function YA(a, A) {
|
|
672
672
|
return new CI(a, A);
|
|
673
673
|
}
|
|
674
|
-
const
|
|
674
|
+
const mA = KA, O = JA, EI = /* @__PURE__ */ QA({
|
|
675
675
|
__name: "live",
|
|
676
676
|
props: {
|
|
677
677
|
getLiveUrl: { type: Function },
|
|
@@ -685,13 +685,13 @@ const YA = pA, O = KA, EI = /* @__PURE__ */ QA({
|
|
|
685
685
|
return !1;
|
|
686
686
|
const U = new URL(D.value).searchParams;
|
|
687
687
|
return U.get("audio") ? !!Number(U.get("audio")) : !0;
|
|
688
|
-
}),
|
|
688
|
+
}), n = async (U) => {
|
|
689
689
|
{
|
|
690
690
|
const w = await e.getLiveUrl();
|
|
691
691
|
D.value = w.playUrl, o.value = w.streamId;
|
|
692
692
|
}
|
|
693
693
|
const M = document.getElementById("live-player");
|
|
694
|
-
I =
|
|
694
|
+
I = YA(
|
|
695
695
|
{
|
|
696
696
|
type: "flv",
|
|
697
697
|
isLive: !0,
|
|
@@ -710,8 +710,8 @@ const YA = pA, O = KA, EI = /* @__PURE__ */ QA({
|
|
|
710
710
|
const t = () => {
|
|
711
711
|
try {
|
|
712
712
|
const w = I == null ? void 0 : I.play();
|
|
713
|
-
w !== void 0 && w instanceof Promise && w.catch((
|
|
714
|
-
console.warn("自动播放失败:",
|
|
713
|
+
w !== void 0 && w instanceof Promise && w.catch((y) => {
|
|
714
|
+
console.warn("自动播放失败:", y);
|
|
715
715
|
}).finally(() => {
|
|
716
716
|
r.value = !1;
|
|
717
717
|
});
|
|
@@ -721,9 +721,9 @@ const YA = pA, O = KA, EI = /* @__PURE__ */ QA({
|
|
|
721
721
|
};
|
|
722
722
|
setTimeout(() => {
|
|
723
723
|
t();
|
|
724
|
-
}), I.on(
|
|
724
|
+
}), I.on(mA.ERROR, p);
|
|
725
725
|
}, N = () => {
|
|
726
|
-
g = new
|
|
726
|
+
g = new LA("#live-player", {
|
|
727
727
|
autoplay: !0,
|
|
728
728
|
muted: !0,
|
|
729
729
|
controls: ["play-large", "play", "fullscreen", "mute"],
|
|
@@ -733,7 +733,7 @@ const YA = pA, O = KA, EI = /* @__PURE__ */ QA({
|
|
|
733
733
|
}), g.on("exitfullscreen", () => {
|
|
734
734
|
E.value = void 0, C("fullscreenChange", !1, E.value);
|
|
735
735
|
});
|
|
736
|
-
},
|
|
736
|
+
}, k = () => {
|
|
737
737
|
I == null || I.unload(), I == null || I.destroy(), I = null, o.value && (e.stopLivePlay(o.value), o.value = "");
|
|
738
738
|
}, p = (U) => {
|
|
739
739
|
switch (String(U)) {
|
|
@@ -745,7 +745,7 @@ const YA = pA, O = KA, EI = /* @__PURE__ */ QA({
|
|
|
745
745
|
break;
|
|
746
746
|
case O.MEDIA_ERROR:
|
|
747
747
|
I && !i && (i = !0, setTimeout(async () => {
|
|
748
|
-
I == null || I.unload(), I == null || I.destroy(), I = null, await
|
|
748
|
+
I == null || I.unload(), I == null || I.destroy(), I = null, await n(), console.error("播放错误,重新播放"), i = !1;
|
|
749
749
|
}, 2e3));
|
|
750
750
|
break;
|
|
751
751
|
case O.OTHER_ERROR:
|
|
@@ -757,24 +757,24 @@ const YA = pA, O = KA, EI = /* @__PURE__ */ QA({
|
|
|
757
757
|
}
|
|
758
758
|
};
|
|
759
759
|
return sA(() => {
|
|
760
|
-
|
|
761
|
-
}),
|
|
762
|
-
|
|
760
|
+
n(), N();
|
|
761
|
+
}), lA(() => {
|
|
762
|
+
k(), g == null || g.destroy();
|
|
763
763
|
}), (U, M) => (W(), Z("div", {
|
|
764
|
-
class:
|
|
764
|
+
class: _A(["live-player-container", { "live-player-container__loading": r.value }]),
|
|
765
765
|
id: "live-player-container",
|
|
766
766
|
ref: "playerContainerRef",
|
|
767
|
-
onDblclickCapture:
|
|
767
|
+
onDblclickCapture: zA(() => {
|
|
768
768
|
}, ["stop", "prevent"])
|
|
769
769
|
}, [
|
|
770
770
|
M[0] || (M[0] = AA("video", {
|
|
771
771
|
id: "live-player",
|
|
772
772
|
class: "live-player"
|
|
773
773
|
}, null, -1)),
|
|
774
|
-
r.value ? (W(),
|
|
774
|
+
r.value ? (W(), qA(eA(HA), {
|
|
775
775
|
key: 0,
|
|
776
776
|
class: "zh-loading"
|
|
777
|
-
})) :
|
|
777
|
+
})) : fA("", !0)
|
|
778
778
|
], 34));
|
|
779
779
|
}
|
|
780
780
|
}), iI = /* @__PURE__ */ CA(EI, [["__scopeId", "data-v-bdbeab14"]]), oI = ["height"], aI = /* @__PURE__ */ QA({
|
|
@@ -826,8 +826,8 @@ const YA = pA, O = KA, EI = /* @__PURE__ */ QA({
|
|
|
826
826
|
},
|
|
827
827
|
emits: ["click", "change"],
|
|
828
828
|
setup(a, { expose: A, emit: I }) {
|
|
829
|
-
const g = a, i = I, C = G(null), e = G(1), E = G(24), D = G(1e3), o = G(""), r = G(!1), S = G(""),
|
|
830
|
-
let t = null, w = null,
|
|
829
|
+
const g = a, i = I, C = G(null), e = G(1), E = G(24), D = G(1e3), o = G(""), r = G(!1), S = G(""), n = G(""), N = G(!1), k = G(!1), p = G(0), U = G(!1), M = G(0);
|
|
830
|
+
let t = null, w = null, y = null;
|
|
831
831
|
const J = u(() => new Date(o.value).getTime() - l.value * D.value / 2 * 1e3), l = u(() => {
|
|
832
832
|
let B = E.value * 60 * 60 / D.value;
|
|
833
833
|
return B > g.minPxSecond && (B = g.minPxSecond), B;
|
|
@@ -841,35 +841,35 @@ const YA = pA, O = KA, EI = /* @__PURE__ */ QA({
|
|
|
841
841
|
startMeddleTime: g.startMeddleTime,
|
|
842
842
|
markTime: g.markTime,
|
|
843
843
|
timeRange: g.timeRange
|
|
844
|
-
})),
|
|
845
|
-
var
|
|
844
|
+
})), h = () => {
|
|
845
|
+
var c;
|
|
846
846
|
if (!C.value || (w = C.value, t = w.getContext("2d"), !t)) return;
|
|
847
|
-
let B = g.width, Q = ((
|
|
847
|
+
let B = g.width, Q = ((c = w.parentElement) == null ? void 0 : c.clientWidth) || 0;
|
|
848
848
|
/^(\d|[1-9]\d|100)%$/.test(String(g.width)) && (B = Math.floor(Number(String(g.width).replace("%", "")) / 100 * Q)), e.value = window.devicePixelRatio, w.style.width = `${B}px`, w.style.height = `${g.height}px`, w.width = Math.round(Number(B) * e.value), w.height = Math.round(Number(g.height) * e.value), t.scale(e.value, e.value), D.value = w.width / e.value, m();
|
|
849
|
-
},
|
|
849
|
+
}, R = () => {
|
|
850
850
|
var B;
|
|
851
851
|
w && w.style.width === ((B = w.parentElement) == null ? void 0 : B.clientWidth) + "px" ? setTimeout(() => {
|
|
852
|
-
|
|
853
|
-
}, 10) :
|
|
852
|
+
R();
|
|
853
|
+
}, 10) : h();
|
|
854
854
|
}, K = () => {
|
|
855
|
-
U.value && (U.value = !1, i("change", o.value, "stop")),
|
|
855
|
+
U.value && (U.value = !1, i("change", o.value, "stop")), y && clearInterval(y);
|
|
856
856
|
}, f = (B) => {
|
|
857
|
-
U.value = !0,
|
|
857
|
+
U.value = !0, y && clearInterval(y), B && (o.value = B), y = window.setInterval(() => {
|
|
858
858
|
o.value = L(o.value).add(1, "s").format("YYYY-MM-DD HH:mm:ss");
|
|
859
859
|
const Q = q.value;
|
|
860
|
-
let
|
|
861
|
-
i("change", o.value,
|
|
860
|
+
let c = Q[1] && new Date(o.value).getTime() >= new Date(Q[1]).getTime() ? "end" : "play";
|
|
861
|
+
i("change", o.value, c);
|
|
862
862
|
try {
|
|
863
863
|
m();
|
|
864
864
|
} catch (F) {
|
|
865
|
-
console.log(F),
|
|
865
|
+
console.log(F), y && clearInterval(y);
|
|
866
866
|
}
|
|
867
|
-
(!U.value ||
|
|
867
|
+
(!U.value || c == "end") && y && clearInterval(y);
|
|
868
868
|
}, 1e3);
|
|
869
869
|
}, T = (B) => {
|
|
870
870
|
let Q = B.touches;
|
|
871
|
-
const
|
|
872
|
-
offsetX:
|
|
871
|
+
const c = Q[0].pageX, F = Q[0].pageY, d = {
|
|
872
|
+
offsetX: c,
|
|
873
873
|
offsetY: F,
|
|
874
874
|
preventDefault: () => B.preventDefault()
|
|
875
875
|
};
|
|
@@ -879,7 +879,7 @@ const YA = pA, O = KA, EI = /* @__PURE__ */ QA({
|
|
|
879
879
|
if (!M.value)
|
|
880
880
|
M.value = Y;
|
|
881
881
|
else if (Y - M.value > 100) {
|
|
882
|
-
let x = FA({ x:
|
|
882
|
+
let x = FA({ x: c, y: F }, { x: Q[1].pageX, y: Q[1].pageY });
|
|
883
883
|
const oA = {
|
|
884
884
|
...d,
|
|
885
885
|
wheelDelta: x > p.value ? 1 : -1,
|
|
@@ -889,55 +889,55 @@ const YA = pA, O = KA, EI = /* @__PURE__ */ QA({
|
|
|
889
889
|
}
|
|
890
890
|
} else
|
|
891
891
|
DA(d);
|
|
892
|
-
},
|
|
892
|
+
}, uA = (B) => {
|
|
893
893
|
let Q = B.changedTouches;
|
|
894
|
-
const
|
|
894
|
+
const c = Q[0].pageX;
|
|
895
895
|
Q[0].pageY, iA({
|
|
896
|
-
offsetX:
|
|
896
|
+
offsetX: c
|
|
897
897
|
});
|
|
898
|
-
},
|
|
898
|
+
}, bA = (B) => {
|
|
899
899
|
let Q = B.touches;
|
|
900
|
-
const
|
|
901
|
-
offsetX:
|
|
900
|
+
const c = Q[0].pageX, F = Q[0].pageY, d = {
|
|
901
|
+
offsetX: c
|
|
902
902
|
};
|
|
903
|
-
Q.length >= 2 && (B.preventDefault(), p.value = FA({ x:
|
|
904
|
-
},
|
|
903
|
+
Q.length >= 2 && (B.preventDefault(), p.value = FA({ x: c, y: F }, { x: Q[1].pageX, y: Q[1].pageX })), wA(d);
|
|
904
|
+
}, xA = (B) => {
|
|
905
905
|
m(), r.value ? iA(B) : r.value = !1;
|
|
906
906
|
}, DA = (B) => {
|
|
907
|
-
m(),
|
|
907
|
+
m(), k.value || hA(B), r.value && (WA(B), N.value = !0);
|
|
908
908
|
}, rA = (B) => {
|
|
909
909
|
B.preventDefault(), B.wheelDelta && B.wheelDelta > 0 ? (E.value -= 4, E.value < 1 && (E.value = 1)) : E.value < 4 ? E.value = 4 : (E.value += 4, E.value > 24 && (E.value = 24)), m();
|
|
910
910
|
}, wA = (B) => {
|
|
911
|
-
r.value = !0, S.value = String(B.offsetX),
|
|
911
|
+
r.value = !0, S.value = String(B.offsetX), n.value = o.value, N.value = !1;
|
|
912
912
|
}, iA = (B) => {
|
|
913
913
|
if (r.value = !1, !N.value) {
|
|
914
914
|
let Q = (B.offsetX || 0) * l.value * 1e3 + J.value;
|
|
915
|
-
Q = dA(Q), o.value = L(Q).format("YYYY-MM-DD HH:mm:ss"), m(),
|
|
915
|
+
Q = dA(Q), o.value = L(Q).format("YYYY-MM-DD HH:mm:ss"), m(), k.value || hA(B);
|
|
916
916
|
}
|
|
917
917
|
i("change", o.value, "start"), i("click", o.value), g.isAutoPlay && f();
|
|
918
|
-
},
|
|
918
|
+
}, WA = (B) => {
|
|
919
919
|
K();
|
|
920
|
-
let Q = Number(S.value) - (B.offsetX || 0),
|
|
921
|
-
|
|
920
|
+
let Q = Number(S.value) - (B.offsetX || 0), c = new Date(n.value).getTime() + Q * l.value * 1e3;
|
|
921
|
+
c = dA(c), o.value = L(c).format("YYYY-MM-DD HH:mm:ss");
|
|
922
922
|
}, m = () => {
|
|
923
|
-
!w || !t || (t.clearRect(0, 0, w.width, w.height), t.setTransform(1, 0, 0, 1, 0, 0), t.scale(e.value, e.value),
|
|
923
|
+
!w || !t || (t.clearRect(0, 0, w.width, w.height), t.setTransform(1, 0, 0, 1, 0, 0), t.scale(e.value, e.value), VA(), OA(), vA(o.value));
|
|
924
924
|
}, hA = (B) => {
|
|
925
925
|
var d;
|
|
926
926
|
if (!t) return;
|
|
927
927
|
let Q = (B.offsetX || 0) * l.value * 1e3 + J.value;
|
|
928
|
-
const
|
|
929
|
-
if (
|
|
928
|
+
const c = q.value;
|
|
929
|
+
if (c[0] && Q < new Date(c[0]).getTime() || c[1] && Q > new Date(c[1]).getTime())
|
|
930
930
|
return;
|
|
931
931
|
t.beginPath(), t.moveTo((B.offsetX || 0) - 1, 0), t.lineTo((B.offsetX || 0) - 1, 45), t.strokeStyle = g.colors.moveLine, t.lineWidth = 1, t.stroke(), t.fillStyle = g.colors.moveDate;
|
|
932
|
-
let F = (d =
|
|
932
|
+
let F = (d = ZA(Q)) == null ? void 0 : d.text;
|
|
933
933
|
F = F ? ` (${F})` : "", t.font = "12px serif", t.fillText(L(Q).format("YYYY-MM-DD HH:mm:ss") + F, (B.offsetX || 0) - 50, 55);
|
|
934
|
-
},
|
|
934
|
+
}, vA = (B) => {
|
|
935
935
|
t && (t.beginPath(), t.moveTo(D.value / 2, 0), t.lineTo(D.value / 2, 30), t.strokeStyle = g.colors.meddleLine, t.lineWidth = 1, t.stroke(), t.fillStyle = g.colors.meddleLine, t.font = "12px serif", t.fillText(B, D.value / 2 - 50, 40));
|
|
936
|
-
},
|
|
936
|
+
}, OA = () => {
|
|
937
937
|
if (!t) return;
|
|
938
|
-
let Q = (new Date(
|
|
938
|
+
let Q = (new Date(PA()).getTime() - J.value) / 1e3 / l.value, c = P.value * 60 / l.value;
|
|
939
939
|
const F = q.value;
|
|
940
|
-
for (let d = Q; d <= D.value; d +=
|
|
940
|
+
for (let d = Q; d <= D.value; d += c) {
|
|
941
941
|
let Y = J.value + d * l.value * 1e3;
|
|
942
942
|
if (F[0] && Y < new Date(F[0]).getTime() || F[1] && Y > new Date(F[1]).getTime())
|
|
943
943
|
continue;
|
|
@@ -953,7 +953,7 @@ const YA = pA, O = KA, EI = /* @__PURE__ */ QA({
|
|
|
953
953
|
Q[0] && Q[1] && (B = L((new Date(Q[0]).getTime() + new Date(Q[1]).getTime()) / 2).format(
|
|
954
954
|
"YYYY-MM-DD HH:mm:ss"
|
|
955
955
|
)), o.value = g.startMeddleTime || B || L(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss");
|
|
956
|
-
},
|
|
956
|
+
}, PA = () => {
|
|
957
957
|
const B = L(J.value), Q = P.value - B.minute() % P.value;
|
|
958
958
|
return B.add(Q, "minutes").format("YYYY-MM-DD HH:mm");
|
|
959
959
|
}, GA = (B) => E.value >= 16 ? [
|
|
@@ -993,47 +993,48 @@ const YA = pA, O = KA, EI = /* @__PURE__ */ QA({
|
|
|
993
993
|
"20:00",
|
|
994
994
|
"21:00",
|
|
995
995
|
"22:00"
|
|
996
|
-
].includes(B) : E.value >= 4 ? ["00", "20", "40"].find((Q) => B.endsWith(Q)) : ["00", "10", "20", "30", "40", "50"].find((Q) => B.endsWith(Q)),
|
|
996
|
+
].includes(B) : E.value >= 4 ? ["00", "20", "40"].find((Q) => B.endsWith(Q)) : ["00", "10", "20", "30", "40", "50"].find((Q) => B.endsWith(Q)), VA = () => {
|
|
997
997
|
if (!t) return;
|
|
998
998
|
t.fillStyle = g.colors.scaleBar, t.fillRect(0, 0, D.value, 20);
|
|
999
999
|
const B = q.value;
|
|
1000
1000
|
g.markTime.forEach((Q) => {
|
|
1001
1001
|
if (B[0] && new Date(Q.endTime).getTime() < new Date(B[0]).getTime() || B[1] && new Date(Q.beginTime).getTime() > new Date(B[1]).getTime() || !t) return;
|
|
1002
1002
|
t.fillStyle = Q.bgColor;
|
|
1003
|
-
let
|
|
1003
|
+
let c = B[0] && new Date(Q.beginTime).getTime() < new Date(B[0]).getTime() ? B[0] : Q.beginTime, F = B[1] && new Date(Q.endTime).getTime() > new Date(B[1]).getTime() ? B[1] : Q.endTime, d = (new Date(c).getTime() - J.value) / 1e3 / l.value, Y = (new Date(F).getTime() - J.value) / 1e3 / l.value;
|
|
1004
1004
|
t.fillRect(d, 0, Y - d, 20);
|
|
1005
1005
|
});
|
|
1006
1006
|
}, FA = (B, Q) => {
|
|
1007
|
-
const
|
|
1008
|
-
return Math.hypot(
|
|
1007
|
+
const c = B.x - Q.x, F = B.y - Q.y;
|
|
1008
|
+
return Math.hypot(c, F);
|
|
1009
1009
|
}, dA = (B) => {
|
|
1010
1010
|
const Q = q.value;
|
|
1011
1011
|
return Q[0] && B < new Date(Q[0]).getTime() ? new Date(Q[0]).getTime() : Q[1] && B > new Date(Q[1]).getTime() ? new Date(Q[1]).getTime() : B;
|
|
1012
|
-
},
|
|
1012
|
+
}, ZA = (B) => g.markTime.find(
|
|
1013
1013
|
(Q) => new Date(Q.beginTime).getTime() < new Date(B).getTime() && new Date(B).getTime() < new Date(Q.endTime).getTime()
|
|
1014
|
-
),
|
|
1014
|
+
), TA = (B) => {
|
|
1015
1015
|
o.value = H(B, IA), m();
|
|
1016
1016
|
};
|
|
1017
1017
|
return sA(() => {
|
|
1018
|
-
C.value && (w = C.value,
|
|
1018
|
+
C.value && (w = C.value, k.value = /Mobi/i.test(navigator.userAgent), k.value || (w.addEventListener("mousewheel", rA), w.addEventListener("mousemove", DA), w.addEventListener("mousedown", wA), w.addEventListener("mouseup", iA), w.addEventListener("mouseleave", xA)), window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", R), cA(), t = w.getContext("2d"), h(), g.isAutoPlay && f());
|
|
1019
1019
|
}), tA(EA, () => {
|
|
1020
1020
|
m();
|
|
1021
1021
|
}), A({
|
|
1022
1022
|
play: f,
|
|
1023
1023
|
stop: K,
|
|
1024
|
-
setMeddleTime:
|
|
1024
|
+
setMeddleTime: TA,
|
|
1025
|
+
resize: R
|
|
1025
1026
|
}), (B, Q) => (W(), Z("canvas", {
|
|
1026
1027
|
onTouchmove: T,
|
|
1027
|
-
onTouchend:
|
|
1028
|
-
onTouchstart:
|
|
1028
|
+
onTouchend: uA,
|
|
1029
|
+
onTouchstart: bA,
|
|
1029
1030
|
onselectstart: "return false;",
|
|
1030
|
-
style:
|
|
1031
|
+
style: $A(`background-color: ${a.colors.background}; cursor: ${k.value ? "default" : "pointer"}`),
|
|
1031
1032
|
height: a.height,
|
|
1032
1033
|
ref_key: "canvasRef",
|
|
1033
1034
|
ref: C
|
|
1034
1035
|
}, null, 44, oI));
|
|
1035
1036
|
}
|
|
1036
|
-
}), eI = /* @__PURE__ */ CA(aI, [["__scopeId", "data-v-
|
|
1037
|
+
}), eI = /* @__PURE__ */ CA(aI, [["__scopeId", "data-v-f35f6346"]]), tI = {
|
|
1037
1038
|
id: "player-container",
|
|
1038
1039
|
class: "player-container"
|
|
1039
1040
|
}, sI = { class: "footer" }, DI = { class: "time-line-container" }, rI = /* @__PURE__ */ QA({
|
|
@@ -1049,35 +1050,35 @@ const YA = pA, O = KA, EI = /* @__PURE__ */ QA({
|
|
|
1049
1050
|
const C = A, e = a, E = G(null), D = G(H(H(/* @__PURE__ */ new Date(), z), IA)), o = G(
|
|
1050
1051
|
0
|
|
1051
1052
|
/* Pending */
|
|
1052
|
-
), r = G(), S = G(),
|
|
1053
|
+
), r = G(), S = G(), n = G(), N = G(!1), k = G(), p = G(!0), U = u(() => H(D.value, z)), M = u(() => {
|
|
1053
1054
|
if (!r.value)
|
|
1054
1055
|
return !1;
|
|
1055
|
-
const
|
|
1056
|
-
return
|
|
1056
|
+
const h = new URL(r.value).searchParams;
|
|
1057
|
+
return h.get("audio") ? !!Number(h.get("audio")) : !0;
|
|
1057
1058
|
}), t = async () => {
|
|
1058
|
-
const
|
|
1059
|
-
H(D.value,
|
|
1060
|
-
H(D.value,
|
|
1059
|
+
const h = await e.getPlaybackUrl(
|
|
1060
|
+
H(D.value, yA),
|
|
1061
|
+
H(D.value, RA)
|
|
1061
1062
|
);
|
|
1062
|
-
return r.value =
|
|
1063
|
-
}, w = (
|
|
1063
|
+
return r.value = h.playUrl, S.value = h.streamId, r.value;
|
|
1064
|
+
}, w = (h) => {
|
|
1064
1065
|
var K, f;
|
|
1065
|
-
if (j(/* @__PURE__ */ new Date()).isBefore(j(
|
|
1066
|
-
(K =
|
|
1066
|
+
if (j(/* @__PURE__ */ new Date()).isBefore(j(h))) {
|
|
1067
|
+
(K = n.value) == null || K.setMeddleTime(D.value), (f = n.value) == null || f.play(), V.warning({
|
|
1067
1068
|
message: "选择的时间不能晚于当前时间",
|
|
1068
|
-
appendTo:
|
|
1069
|
+
appendTo: k.value
|
|
1069
1070
|
});
|
|
1070
1071
|
return;
|
|
1071
1072
|
} else
|
|
1072
|
-
D.value = H(
|
|
1073
|
-
},
|
|
1074
|
-
|
|
1073
|
+
D.value = H(h, IA);
|
|
1074
|
+
}, y = async (h) => {
|
|
1075
|
+
h || await t(), I = YA(
|
|
1075
1076
|
{
|
|
1076
1077
|
type: "flv",
|
|
1077
1078
|
isLive: !1,
|
|
1078
1079
|
hasAudio: M.value,
|
|
1079
1080
|
hasVideo: !0,
|
|
1080
|
-
url:
|
|
1081
|
+
url: h ?? r.value
|
|
1081
1082
|
},
|
|
1082
1083
|
{
|
|
1083
1084
|
enableWorker: !0,
|
|
@@ -1086,9 +1087,9 @@ const YA = pA, O = KA, EI = /* @__PURE__ */ QA({
|
|
|
1086
1087
|
lazyLoadMaxDuration: 3 * 60,
|
|
1087
1088
|
deferLoadAfterSourceOpen: !0
|
|
1088
1089
|
}
|
|
1089
|
-
), I.attachMediaElement(E.value), await I.load(), await
|
|
1090
|
+
), I.attachMediaElement(E.value), await I.load(), await SA(), await I.play(), I == null || I.on(mA.ERROR, P);
|
|
1090
1091
|
}, J = () => {
|
|
1091
|
-
g = new
|
|
1092
|
+
g = new LA("#playback-player", {
|
|
1092
1093
|
autoplay: !0,
|
|
1093
1094
|
muted: !0,
|
|
1094
1095
|
controls: ["play", "fullscreen", "mute"],
|
|
@@ -1098,72 +1099,75 @@ const YA = pA, O = KA, EI = /* @__PURE__ */ QA({
|
|
|
1098
1099
|
}), g.on("playing", () => {
|
|
1099
1100
|
o.value = 1;
|
|
1100
1101
|
}), g.on("enterfullscreen", () => {
|
|
1101
|
-
N.value = !0,
|
|
1102
|
+
N.value = !0, k.value = "#player-container", C("fullscreenChange", N.value, k.value), SA(() => {
|
|
1103
|
+
var h;
|
|
1104
|
+
(h = n.value) == null || h.resize();
|
|
1105
|
+
});
|
|
1102
1106
|
}), g.on("exitfullscreen", () => {
|
|
1103
|
-
N.value = !1,
|
|
1107
|
+
N.value = !1, k.value = void 0, C("fullscreenChange", N.value, k.value);
|
|
1104
1108
|
});
|
|
1105
1109
|
}, l = async () => {
|
|
1106
1110
|
try {
|
|
1107
1111
|
if (S.value) {
|
|
1108
|
-
const
|
|
1109
|
-
H(D.value, nA),
|
|
1112
|
+
const h = await e.updatePlaybackUrl(
|
|
1110
1113
|
H(D.value, yA),
|
|
1114
|
+
H(D.value, RA),
|
|
1111
1115
|
S.value
|
|
1112
1116
|
);
|
|
1113
|
-
|
|
1117
|
+
h.playUrl && (r.value = void 0, S.value = void 0, await q(), r.value = h.playUrl, S.value = h.streamId, await y(r.value));
|
|
1114
1118
|
}
|
|
1115
1119
|
} catch {
|
|
1116
1120
|
o.value = 3;
|
|
1117
1121
|
}
|
|
1118
1122
|
}, q = async () => {
|
|
1119
1123
|
I == null || I.unload(), I == null || I.destroy(), I = null, S.value && (await e.stopPlayback(S.value), S.value = "");
|
|
1120
|
-
}, P = (
|
|
1121
|
-
switch (o.value = 3, String(
|
|
1124
|
+
}, P = (h) => {
|
|
1125
|
+
switch (o.value = 3, String(h)) {
|
|
1122
1126
|
case O.NETWORK_ERROR:
|
|
1123
1127
|
V.error({
|
|
1124
1128
|
message: "网络错误,请检查网络",
|
|
1125
|
-
appendTo:
|
|
1129
|
+
appendTo: k.value
|
|
1126
1130
|
});
|
|
1127
1131
|
break;
|
|
1128
1132
|
case O.MEDIA_ERROR:
|
|
1129
1133
|
I && !i && (i = !0, setTimeout(async () => {
|
|
1130
|
-
await q(), await
|
|
1134
|
+
await q(), await y(), console.error("播放错误,重新播放"), i = !1;
|
|
1131
1135
|
}, 2e3));
|
|
1132
1136
|
break;
|
|
1133
1137
|
case O.OTHER_ERROR:
|
|
1134
1138
|
V.error({
|
|
1135
1139
|
message: "其他错误,请联系管理员解决",
|
|
1136
|
-
appendTo:
|
|
1140
|
+
appendTo: k.value
|
|
1137
1141
|
});
|
|
1138
1142
|
break;
|
|
1139
1143
|
}
|
|
1140
|
-
}, EA = (
|
|
1141
|
-
const
|
|
1142
|
-
return j(
|
|
1144
|
+
}, EA = (h) => {
|
|
1145
|
+
const R = /* @__PURE__ */ new Date();
|
|
1146
|
+
return j(h).isAfter(j(R));
|
|
1143
1147
|
};
|
|
1144
1148
|
return tA(
|
|
1145
1149
|
() => o.value,
|
|
1146
|
-
(
|
|
1147
|
-
var
|
|
1148
|
-
switch (
|
|
1150
|
+
(h) => {
|
|
1151
|
+
var R, K, f, T;
|
|
1152
|
+
switch (h) {
|
|
1149
1153
|
case 1:
|
|
1150
|
-
(
|
|
1154
|
+
(R = n.value) == null || R.play(), p.value = !1;
|
|
1151
1155
|
break;
|
|
1152
1156
|
case 2:
|
|
1153
|
-
(K =
|
|
1157
|
+
(K = n.value) == null || K.stop();
|
|
1154
1158
|
break;
|
|
1155
1159
|
case 4:
|
|
1156
|
-
(f =
|
|
1160
|
+
(f = n.value) == null || f.stop(), p.value = !0;
|
|
1157
1161
|
break;
|
|
1158
1162
|
case 3:
|
|
1159
|
-
(T =
|
|
1163
|
+
(T = n.value) == null || T.stop(), p.value = !1;
|
|
1160
1164
|
break;
|
|
1161
1165
|
}
|
|
1162
1166
|
}
|
|
1163
1167
|
), tA(
|
|
1164
1168
|
() => D.value,
|
|
1165
|
-
async (
|
|
1166
|
-
o.value = 4, H(
|
|
1169
|
+
async (h, R) => {
|
|
1170
|
+
o.value = 4, H(h, z) !== H(R, z) ? (await q(), y().then(() => {
|
|
1167
1171
|
o.value = 1;
|
|
1168
1172
|
})) : l().then(() => {
|
|
1169
1173
|
setTimeout(() => {
|
|
@@ -1172,11 +1176,11 @@ const YA = pA, O = KA, EI = /* @__PURE__ */ QA({
|
|
|
1172
1176
|
});
|
|
1173
1177
|
}
|
|
1174
1178
|
), sA(async () => {
|
|
1175
|
-
|
|
1176
|
-
}),
|
|
1179
|
+
y(), J();
|
|
1180
|
+
}), lA(() => {
|
|
1177
1181
|
q(), g == null || g.destroy();
|
|
1178
|
-
}), (
|
|
1179
|
-
const K =
|
|
1182
|
+
}), (h, R) => {
|
|
1183
|
+
const K = AI("el-date-picker");
|
|
1180
1184
|
return W(), Z("div", tI, [
|
|
1181
1185
|
AA("video", {
|
|
1182
1186
|
class: "player",
|
|
@@ -1184,15 +1188,15 @@ const YA = pA, O = KA, EI = /* @__PURE__ */ QA({
|
|
|
1184
1188
|
ref_key: "videoInstance",
|
|
1185
1189
|
ref: E
|
|
1186
1190
|
}, null, 512),
|
|
1187
|
-
p.value ? (W(),
|
|
1191
|
+
p.value ? (W(), qA(eA(HA), {
|
|
1188
1192
|
key: 0,
|
|
1189
1193
|
class: "zh-loading"
|
|
1190
|
-
})) :
|
|
1191
|
-
|
|
1194
|
+
})) : fA("", !0),
|
|
1195
|
+
II(AA("div", sI, [
|
|
1192
1196
|
AA("div", DI, [
|
|
1193
1197
|
BA(eI, {
|
|
1194
1198
|
ref_key: "timeLineRef",
|
|
1195
|
-
ref:
|
|
1199
|
+
ref: n,
|
|
1196
1200
|
onClick: w,
|
|
1197
1201
|
"time-range": U.value,
|
|
1198
1202
|
"start-meddle-time": D.value
|
|
@@ -1200,7 +1204,7 @@ const YA = pA, O = KA, EI = /* @__PURE__ */ QA({
|
|
|
1200
1204
|
]),
|
|
1201
1205
|
BA(K, {
|
|
1202
1206
|
modelValue: D.value,
|
|
1203
|
-
"onUpdate:modelValue":
|
|
1207
|
+
"onUpdate:modelValue": R[0] || (R[0] = (f) => D.value = f),
|
|
1204
1208
|
teleported: !1,
|
|
1205
1209
|
"value-format": eA(IA),
|
|
1206
1210
|
clearable: !1,
|
|
@@ -1208,12 +1212,12 @@ const YA = pA, O = KA, EI = /* @__PURE__ */ QA({
|
|
|
1208
1212
|
"disabled-date": EA
|
|
1209
1213
|
}, null, 8, ["modelValue", "value-format"])
|
|
1210
1214
|
], 512), [
|
|
1211
|
-
[
|
|
1215
|
+
[gI, N.value]
|
|
1212
1216
|
])
|
|
1213
1217
|
]);
|
|
1214
1218
|
};
|
|
1215
1219
|
}
|
|
1216
|
-
}), wI = /* @__PURE__ */ CA(rI, [["__scopeId", "data-v-
|
|
1220
|
+
}), wI = /* @__PURE__ */ CA(rI, [["__scopeId", "data-v-18eb8cae"]]), hI = {
|
|
1217
1221
|
key: 0,
|
|
1218
1222
|
class: "live-container"
|
|
1219
1223
|
}, cI = {
|
|
@@ -1232,12 +1236,12 @@ const YA = pA, O = KA, EI = /* @__PURE__ */ QA({
|
|
|
1232
1236
|
setup(a) {
|
|
1233
1237
|
const A = a;
|
|
1234
1238
|
return (I, g) => A.mode === "live" ? (W(), Z("div", hI, [
|
|
1235
|
-
BA(iI,
|
|
1239
|
+
BA(iI, nA({
|
|
1236
1240
|
"get-live-url": A.getLiveUrl,
|
|
1237
1241
|
"stop-live-play": A.stopLivePlay
|
|
1238
1242
|
}, I.$attrs), null, 16, ["get-live-url", "stop-live-play"])
|
|
1239
1243
|
])) : (W(), Z("div", cI, [
|
|
1240
|
-
BA(wI,
|
|
1244
|
+
BA(wI, nA({
|
|
1241
1245
|
"get-playback-url": A.getPlaybackUrl,
|
|
1242
1246
|
"stop-playback": A.stopPlayback,
|
|
1243
1247
|
"update-playback-url": A.updatePlaybackUrl
|