lx-video-player 1.0.12 → 1.0.13

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,90 +4,95 @@ const M = {
4
4
  maxBufferLength: 10,
5
5
  maxBufferSize: 40 * 1024 * 1024,
6
6
  maxMaxBufferLength: 30
7
- }, l = navigator.userAgent.toLowerCase(), b = l.indexOf("micromessenger") > 0, k = l.indexOf("android") > 0;
8
- b && l.indexOf("wxwork");
9
- const x = b && l.indexOf("wxwork") > 0, D = /iphone|ipad|ipod|ios/.test(l);
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
11
  const { onReady: h } = s || {}, g = D || k && x;
12
12
  let r, a = !1, f = !1, v = 0, m = 0, u = !1, p = !1, w = null;
13
- const L = async () => {
13
+ const b = async () => {
14
14
  if (w)
15
15
  return w;
16
- const { default: e } = await import("./tcplayer.v4.8.0.min-31e6d34b.js").then((n) => n.t);
17
- return w = e, w;
18
- }, O = (e) => {
16
+ try {
17
+ const { default: e } = await import("./tcplayer.v4.8.0.min-31e6d34b.js").then((t) => t.t);
18
+ console.log(e, "tcplayer---------"), w = e;
19
+ } catch (e) {
20
+ console.log(e, "error------");
21
+ }
22
+ return w;
23
+ }, L = (e) => {
19
24
  !a && !f || (p ? e == null || e.pause() : e == null || e.play());
20
- }, y = (e, n) => {
21
- !a || f || (v = e.deltaY, m = n.currentTime());
22
- }, T = (e, n) => {
25
+ }, O = (e, t) => {
26
+ !a || f || (v = e.deltaY, m = t.currentTime());
27
+ }, T = (e, t) => {
23
28
  if (!a || f)
24
29
  return;
25
- const t = u ? e.deltaY : e.deltaX, i = u ? window.innerHeight : window.innerWidth, o = (t - v) / i, c = n.duration();
26
- let d = m + c * o;
27
- d < 0 && (d = 0), d > c && (d = c), n.currentTime(d);
28
- }, E = async (e, n) => {
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) => {
29
34
  try {
30
- const { default: t } = await import("./hammer-005503be.js").then((o) => o.h), i = new t.Manager(n);
31
- i.add(
32
- new t.Pan({
35
+ const { default: n } = await import("./hammer-005503be.js").then((i) => i.h), o = new n.Manager(t);
36
+ o.add(
37
+ new n.Pan({
33
38
  threshold: 10,
34
39
  pointers: 0,
35
- direction: t.DIRECTION_ALL
40
+ direction: n.DIRECTION_ALL
36
41
  })
37
- ), i.add(new t.Swipe()).recognizeWith(i.get("pan")), i.add(new t.Tap({ event: "doubletap", taps: 2 })), i.on("doubletap", () => {
38
- O(e);
39
- }), i.on("panstart", (o) => {
40
- y(o, e);
41
- }), i.on("panmove", (o) => {
42
- T(o, e);
42
+ ), o.add(new n.Swipe()).recognizeWith(o.get("pan")), o.add(new n.Tap({ event: "doubletap", taps: 2 })), o.on("doubletap", () => {
43
+ L(e);
44
+ }), o.on("panstart", (i) => {
45
+ O(i, e);
46
+ }), o.on("panmove", (i) => {
47
+ T(i, e);
43
48
  });
44
49
  } catch {
45
50
  }
46
51
  }, H = (e) => {
47
52
  e.on("fullscreenchange", () => {
48
53
  a = e.isFullscreen();
49
- const n = e.el_, t = n.querySelector(".vjs-progress-control");
54
+ const t = e.el_, n = t.querySelector(".vjs-progress-control");
50
55
  u = e.videoWidth() > e.videoHeight();
51
- const i = window.innerWidth, o = window.innerHeight;
56
+ const o = window.innerWidth, i = window.innerHeight;
52
57
  f = window.orientation === 90 || window.orientation === -90;
53
- const c = Math.floor(Math.abs((i - o) / 2));
58
+ const c = Math.floor(Math.abs((o - i) / 2));
54
59
  if (u)
55
- a ? (Object.assign(n.style, {
60
+ a ? (Object.assign(t.style, {
56
61
  top: `${c}px`,
57
62
  left: `-${c}px`
58
- }), n.classList.add("landscape"), t && (t.style.pointerEvents = "none")) : (n.classList.remove("landscape"), n.setAttribute("style", ""), t && (t.style.pointerEvents = ""));
63
+ }), t.classList.add("landscape"), n && (n.style.pointerEvents = "none")) : (t.classList.remove("landscape"), t.setAttribute("style", ""), n && (n.style.pointerEvents = ""));
59
64
  else {
60
65
  if (!x)
61
66
  return;
62
- a ? (Object.assign(n.style, {
67
+ a ? (Object.assign(t.style, {
63
68
  width: "100vw",
64
69
  height: "100vh",
65
70
  position: "fixed",
66
71
  zIndex: "999",
67
72
  top: "0px"
68
- }), t && (t.style.pointerEvents = "none")) : (n.removeAttribute("style"), t && (t.style.pointerEvents = ""));
73
+ }), n && (n.style.pointerEvents = "none")) : (t.removeAttribute("style"), n && (n.style.pointerEvents = ""));
69
74
  }
70
75
  });
71
- }, I = (e, n) => {
72
- n.on("play", () => {
76
+ }, I = (e, t) => {
77
+ t.on("play", () => {
73
78
  p = !0;
74
- }), n.on("pause", () => {
79
+ }), t.on("pause", () => {
75
80
  p = !1;
76
- }), n.on("ended", () => {
81
+ }), t.on("ended", () => {
77
82
  p = !1;
78
- }), n.on("ready", () => {
79
- h == null || h(n);
83
+ }), t.on("ready", () => {
84
+ h == null || h(t);
80
85
  });
81
- const t = document == null ? void 0 : document.getElementById(e);
82
- t && E(n, t);
83
- }, S = async (e, n) => {
84
- r = (await L())(n, { ...e, fakeFullscreen: g }), r && (I(n, r), g && H(r));
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));
85
90
  };
86
91
  return {
87
- loadVideo: async (e, n) => {
88
- if (r && (r.dispose(), r = void 0), !(!e || !n))
92
+ loadVideo: async (e, t) => {
93
+ if (r && (r.dispose(), r = void 0), !(!e || !t))
89
94
  try {
90
- await S(n, e);
95
+ await S(t, e);
91
96
  } catch {
92
97
  }
93
98
  },