lx-video-player 1.3.2 → 1.3.3
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/video-player.js +17 -19
- package/dist/video-player.umd.cjs +25 -25
- package/package.json +1 -1
package/dist/video-player.js
CHANGED
|
@@ -4,24 +4,24 @@ const A = {
|
|
|
4
4
|
maxBufferLength: 10,
|
|
5
5
|
maxBufferSize: 40 * 1024 * 1024,
|
|
6
6
|
maxMaxBufferLength: 30
|
|
7
|
-
}, l = navigator.userAgent.toLowerCase(),
|
|
8
|
-
|
|
9
|
-
const
|
|
7
|
+
}, l = navigator.userAgent.toLowerCase(), L = l.indexOf("micromessenger") > 0, M = l.indexOf("android") > 0;
|
|
8
|
+
L && l.indexOf("wxwork");
|
|
9
|
+
const b = L && l.indexOf("wxwork") > 0, $ = /iphone|ipad|ipod|ios/.test(l);
|
|
10
10
|
function B(d) {
|
|
11
|
-
const { zoom:
|
|
12
|
-
let o = null, a = !1, f = !1,
|
|
13
|
-
const
|
|
11
|
+
const { zoom: p, onReady: h } = d || {}, v = $ || M && b;
|
|
12
|
+
let o = null, a = !1, f = !1, m = 0, x = 0, u = !1, w = !1, g = null;
|
|
13
|
+
const O = async () => {
|
|
14
14
|
if (g) return g;
|
|
15
15
|
const e = await import("./tcplayer.v4.8.0.min-Cj579j9Z.js").then((n) => n.t);
|
|
16
16
|
return g = e == null ? void 0 : e.default, g;
|
|
17
17
|
}, P = (e) => {
|
|
18
18
|
!a && !f || (w ? e == null || e.pause() : e == null || e.play());
|
|
19
19
|
}, T = (e, n) => {
|
|
20
|
-
!a || f || (
|
|
20
|
+
!a || f || (m = e.deltaY, x = n.currentTime());
|
|
21
21
|
}, E = (e, n) => {
|
|
22
22
|
if (!a || f) return;
|
|
23
|
-
const t = u ? e.deltaY : e.deltaX, i = u ? window.innerHeight : window.innerWidth, r = (t -
|
|
24
|
-
let c =
|
|
23
|
+
const t = u ? e.deltaY : e.deltaX, i = u ? window.innerHeight : window.innerWidth, r = (t - m) / i, s = n.duration();
|
|
24
|
+
let c = x + s * r;
|
|
25
25
|
c < 0 && (c = 0), c > s && (c = s), n.currentTime(c);
|
|
26
26
|
}, H = async (e, n) => {
|
|
27
27
|
var t;
|
|
@@ -42,7 +42,7 @@ function B(d) {
|
|
|
42
42
|
});
|
|
43
43
|
} catch {
|
|
44
44
|
}
|
|
45
|
-
},
|
|
45
|
+
}, S = (e) => {
|
|
46
46
|
e.on("fullscreenchange", () => {
|
|
47
47
|
a = e.isFullscreen();
|
|
48
48
|
const n = e.el_, t = n.querySelector(".vjs-progress-control");
|
|
@@ -56,7 +56,7 @@ function B(d) {
|
|
|
56
56
|
left: `-${s}px`
|
|
57
57
|
}), n.classList.add("landscape"), t && (t.style.pointerEvents = "none")) : (n.setAttribute("style", ""), n.classList.remove("landscape"), t && (t.style.pointerEvents = ""));
|
|
58
58
|
else {
|
|
59
|
-
if (!
|
|
59
|
+
if (!b) return;
|
|
60
60
|
a ? (Object.assign(n.style, {
|
|
61
61
|
width: "100vw",
|
|
62
62
|
height: "100vh",
|
|
@@ -66,7 +66,7 @@ function B(d) {
|
|
|
66
66
|
}), t && (t.style.pointerEvents = "none")) : (n.removeAttribute("style"), t && (t.style.pointerEvents = ""));
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
|
-
},
|
|
69
|
+
}, W = (e, n) => {
|
|
70
70
|
n.on("play", () => {
|
|
71
71
|
w = !0;
|
|
72
72
|
}), n.on("pause", () => {
|
|
@@ -80,24 +80,22 @@ function B(d) {
|
|
|
80
80
|
if (t) {
|
|
81
81
|
H(n, t);
|
|
82
82
|
const i = t.querySelector(".vjs-progress-control .vjs-progress-holder");
|
|
83
|
-
i &&
|
|
83
|
+
i && p && (i.style = `zoom: calc(1 / $${p})`);
|
|
84
84
|
}
|
|
85
85
|
}, k = async (e, n) => {
|
|
86
|
-
const t = await
|
|
87
|
-
o == null || o.dispose(), o = t(n, { ...e, fakeFullscreen:
|
|
86
|
+
const t = await O();
|
|
87
|
+
o == null || o.dispose(), o = t(n, { ...e, fakeFullscreen: v }), o && (W(n, o), v && S(o));
|
|
88
88
|
};
|
|
89
89
|
return {
|
|
90
90
|
loadVideo: (e, n) => {
|
|
91
|
-
if (!(!e || !n))
|
|
92
|
-
p = e;
|
|
91
|
+
if (!(!e || !n))
|
|
93
92
|
try {
|
|
94
93
|
k(n, e);
|
|
95
94
|
} catch {
|
|
96
95
|
}
|
|
97
|
-
}
|
|
98
96
|
},
|
|
99
97
|
disposePlayer: () => {
|
|
100
|
-
|
|
98
|
+
o == null || o.dispose(), o = null;
|
|
101
99
|
},
|
|
102
100
|
tcplayerInstance: o
|
|
103
101
|
};
|