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.
@@ -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(), O = l.indexOf("micromessenger") > 0, M = l.indexOf("android") > 0;
8
- O && l.indexOf("wxwork");
9
- const L = O && l.indexOf("wxwork") > 0, j = /iphone|ipad|ipod|ios/.test(l);
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: v, onReady: h } = d || {}, m = j || M && L;
12
- let o = null, a = !1, f = !1, x = 0, b = 0, u = !1, w = !1, g = null, p = "";
13
- const S = async () => {
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 || (x = e.deltaY, b = n.currentTime());
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 - x) / i, s = n.duration();
24
- let c = b + s * r;
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
- }, W = (e) => {
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 (!L) return;
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
- }, $ = (e, n) => {
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 && v && (i.style = `zoom: calc(1 / $${v})`);
83
+ i && p && (i.style = `zoom: calc(1 / $${p})`);
84
84
  }
85
85
  }, k = async (e, n) => {
86
- const t = await S();
87
- o == null || o.dispose(), o = t(n, { ...e, fakeFullscreen: m }), o && ($(n, o), m && W(o));
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
- p && document.querySelector(`#${p} video`) && (o == null || o.dispose()), o = null;
98
+ o == null || o.dispose(), o = null;
101
99
  },
102
100
  tcplayerInstance: o
103
101
  };