lx-video-player 1.0.14 → 1.0.16
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,20 +1,4 @@
|
|
|
1
1
|
import { g as getDefaultExportFromCjs, c as commonjsGlobal } from "./_commonjsHelpers-10dfc225.js";
|
|
2
|
-
function _mergeNamespaces(r, t) {
|
|
3
|
-
for (var e = 0; e < t.length; e++) {
|
|
4
|
-
const n = t[e];
|
|
5
|
-
if (typeof n != "string" && !Array.isArray(n)) {
|
|
6
|
-
for (const s in n)
|
|
7
|
-
if (s !== "default" && !(s in r)) {
|
|
8
|
-
const a = Object.getOwnPropertyDescriptor(n, s);
|
|
9
|
-
a && Object.defineProperty(r, s, a.get ? a : {
|
|
10
|
-
enumerable: !0,
|
|
11
|
-
get: () => n[s]
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return Object.freeze(Object.defineProperty(r, Symbol.toStringTag, { value: "Module" }));
|
|
17
|
-
}
|
|
18
2
|
var tcplayer_v4_8_0_min$2 = { exports: {} };
|
|
19
3
|
(function(module, exports) {
|
|
20
4
|
(function(r, t) {
|
|
@@ -11010,10 +10994,10 @@ var tcplayer_v4_8_0_min$2 = { exports: {} };
|
|
|
11010
10994
|
});
|
|
11011
10995
|
})(tcplayer_v4_8_0_min$2);
|
|
11012
10996
|
var tcplayer_v4_8_0_minExports = tcplayer_v4_8_0_min$2.exports;
|
|
11013
|
-
const tcplayer_v4_8_0_min = /* @__PURE__ */ getDefaultExportFromCjs(tcplayer_v4_8_0_minExports), tcplayer_v4_8_0_min$1 = /* @__PURE__ */
|
|
10997
|
+
const tcplayer_v4_8_0_min = /* @__PURE__ */ getDefaultExportFromCjs(tcplayer_v4_8_0_minExports), tcplayer_v4_8_0_min$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11014
10998
|
__proto__: null,
|
|
11015
10999
|
default: tcplayer_v4_8_0_min
|
|
11016
|
-
},
|
|
11000
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
11017
11001
|
export {
|
|
11018
11002
|
tcplayer_v4_8_0_min$1 as t
|
|
11019
11003
|
};
|
package/dist/video-player.js
CHANGED
|
@@ -4,40 +4,42 @@ const M = {
|
|
|
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(), y = l.indexOf("micromessenger") > 0, k = l.indexOf("android") > 0;
|
|
8
|
+
y && l.indexOf("wxwork");
|
|
9
|
+
const x = y && l.indexOf("wxwork") > 0, D = /iphone|ipad|ipod|ios/.test(l);
|
|
10
10
|
function P(s) {
|
|
11
|
-
const { onReady:
|
|
12
|
-
let r, a = !1, f = !1,
|
|
13
|
-
const
|
|
11
|
+
const { onReady: h } = s || {}, g = D || k && x;
|
|
12
|
+
let r, a = !1, f = !1, v = 0, m = 0, u = !1, p = !1, w = null;
|
|
13
|
+
const b = async () => {
|
|
14
|
+
if (w)
|
|
15
|
+
return w;
|
|
14
16
|
try {
|
|
15
|
-
const e = await import("./tcplayer.v4.8.0.min-
|
|
16
|
-
console.log(e, "tcplayer---------");
|
|
17
|
+
const { default: e } = await import("./tcplayer.v4.8.0.min-31e6d34b.js").then((t) => t.t);
|
|
18
|
+
console.log(e, "tcplayer---------"), w = e;
|
|
17
19
|
} catch (e) {
|
|
18
|
-
console.log(e, "error------");
|
|
20
|
+
console.log(e, "tcplayer error------");
|
|
19
21
|
}
|
|
20
|
-
return
|
|
22
|
+
return w;
|
|
21
23
|
}, L = (e) => {
|
|
22
24
|
!a && !f || (p ? e == null || e.pause() : e == null || e.play());
|
|
23
|
-
}, O = (e,
|
|
24
|
-
!a || f || (
|
|
25
|
-
}, T = (e,
|
|
25
|
+
}, O = (e, t) => {
|
|
26
|
+
!a || f || (v = e.deltaY, m = t.currentTime());
|
|
27
|
+
}, T = (e, t) => {
|
|
26
28
|
if (!a || f)
|
|
27
29
|
return;
|
|
28
|
-
const
|
|
29
|
-
let d =
|
|
30
|
-
d < 0 && (d = 0), d > c && (d = c),
|
|
31
|
-
}, E = async (e,
|
|
30
|
+
const n = u ? e.deltaY : e.deltaX, o = u ? window.innerHeight : window.innerWidth, i = (n - v) / o, c = t.duration();
|
|
31
|
+
let d = m + c * i;
|
|
32
|
+
d < 0 && (d = 0), d > c && (d = c), t.currentTime(d);
|
|
33
|
+
}, E = async (e, t) => {
|
|
32
34
|
try {
|
|
33
|
-
const { default:
|
|
35
|
+
const { default: n } = await import("./hammer-005503be.js").then((i) => i.h), o = new n.Manager(t);
|
|
34
36
|
o.add(
|
|
35
|
-
new
|
|
37
|
+
new n.Pan({
|
|
36
38
|
threshold: 10,
|
|
37
39
|
pointers: 0,
|
|
38
|
-
direction:
|
|
40
|
+
direction: n.DIRECTION_ALL
|
|
39
41
|
})
|
|
40
|
-
), o.add(new
|
|
42
|
+
), o.add(new n.Swipe()).recognizeWith(o.get("pan")), o.add(new n.Tap({ event: "doubletap", taps: 2 })), o.on("doubletap", () => {
|
|
41
43
|
L(e);
|
|
42
44
|
}), o.on("panstart", (i) => {
|
|
43
45
|
O(i, e);
|
|
@@ -49,48 +51,48 @@ function P(s) {
|
|
|
49
51
|
}, H = (e) => {
|
|
50
52
|
e.on("fullscreenchange", () => {
|
|
51
53
|
a = e.isFullscreen();
|
|
52
|
-
const
|
|
54
|
+
const t = e.el_, n = t.querySelector(".vjs-progress-control");
|
|
53
55
|
u = e.videoWidth() > e.videoHeight();
|
|
54
56
|
const o = window.innerWidth, i = window.innerHeight;
|
|
55
57
|
f = window.orientation === 90 || window.orientation === -90;
|
|
56
58
|
const c = Math.floor(Math.abs((o - i) / 2));
|
|
57
59
|
if (u)
|
|
58
|
-
a ? (Object.assign(
|
|
60
|
+
a ? (Object.assign(t.style, {
|
|
59
61
|
top: `${c}px`,
|
|
60
62
|
left: `-${c}px`
|
|
61
|
-
}),
|
|
63
|
+
}), t.classList.add("landscape"), n && (n.style.pointerEvents = "none")) : (t.classList.remove("landscape"), t.setAttribute("style", ""), n && (n.style.pointerEvents = ""));
|
|
62
64
|
else {
|
|
63
|
-
if (!
|
|
65
|
+
if (!x)
|
|
64
66
|
return;
|
|
65
|
-
a ? (Object.assign(
|
|
67
|
+
a ? (Object.assign(t.style, {
|
|
66
68
|
width: "100vw",
|
|
67
69
|
height: "100vh",
|
|
68
70
|
position: "fixed",
|
|
69
71
|
zIndex: "999",
|
|
70
72
|
top: "0px"
|
|
71
|
-
}),
|
|
73
|
+
}), n && (n.style.pointerEvents = "none")) : (t.removeAttribute("style"), n && (n.style.pointerEvents = ""));
|
|
72
74
|
}
|
|
73
75
|
});
|
|
74
|
-
}, I = (e,
|
|
75
|
-
|
|
76
|
+
}, I = (e, t) => {
|
|
77
|
+
t.on("play", () => {
|
|
76
78
|
p = !0;
|
|
77
|
-
}),
|
|
79
|
+
}), t.on("pause", () => {
|
|
78
80
|
p = !1;
|
|
79
|
-
}),
|
|
81
|
+
}), t.on("ended", () => {
|
|
80
82
|
p = !1;
|
|
81
|
-
}),
|
|
82
|
-
|
|
83
|
+
}), t.on("ready", () => {
|
|
84
|
+
h == null || h(t);
|
|
83
85
|
});
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
}, S = async (e,
|
|
87
|
-
r = (await
|
|
86
|
+
const n = document == null ? void 0 : document.getElementById(e);
|
|
87
|
+
n && E(t, n);
|
|
88
|
+
}, S = async (e, t) => {
|
|
89
|
+
r = (await b())(t, { ...e, fakeFullscreen: g }), r && (I(t, r), g && H(r));
|
|
88
90
|
};
|
|
89
91
|
return {
|
|
90
|
-
loadVideo: async (e,
|
|
91
|
-
if (r && (r.dispose(), r = void 0), !(!e || !
|
|
92
|
+
loadVideo: async (e, t) => {
|
|
93
|
+
if (r && (r.dispose(), r = void 0), !(!e || !t))
|
|
92
94
|
try {
|
|
93
|
-
await S(
|
|
95
|
+
await S(t, e);
|
|
94
96
|
} catch {
|
|
95
97
|
}
|
|
96
98
|
},
|