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__ */ _mergeNamespaces({
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
- }, [tcplayer_v4_8_0_minExports]);
11000
+ }, Symbol.toStringTag, { value: "Module" }));
11017
11001
  export {
11018
11002
  tcplayer_v4_8_0_min$1 as t
11019
11003
  };
@@ -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(), x = l.indexOf("micromessenger") > 0, k = l.indexOf("android") > 0;
8
- x && l.indexOf("wxwork");
9
- const m = x && 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
- const { onReady: w } = s || {}, h = D || k && m;
12
- let r, a = !1, f = !1, g = 0, v = 0, u = !1, p = !1, b = null;
13
- const y = async () => {
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-214cb8a6.js").then((n) => n.t);
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 b;
22
+ return w;
21
23
  }, L = (e) => {
22
24
  !a && !f || (p ? e == null || e.pause() : e == null || e.play());
23
- }, O = (e, n) => {
24
- !a || f || (g = e.deltaY, v = n.currentTime());
25
- }, T = (e, n) => {
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 t = u ? e.deltaY : e.deltaX, o = u ? window.innerHeight : window.innerWidth, i = (t - g) / o, c = n.duration();
29
- let d = v + c * i;
30
- d < 0 && (d = 0), d > c && (d = c), n.currentTime(d);
31
- }, 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) => {
32
34
  try {
33
- const { default: t } = await import("./hammer-005503be.js").then((i) => i.h), o = new t.Manager(n);
35
+ const { default: n } = await import("./hammer-005503be.js").then((i) => i.h), o = new n.Manager(t);
34
36
  o.add(
35
- new t.Pan({
37
+ new n.Pan({
36
38
  threshold: 10,
37
39
  pointers: 0,
38
- direction: t.DIRECTION_ALL
40
+ direction: n.DIRECTION_ALL
39
41
  })
40
- ), o.add(new t.Swipe()).recognizeWith(o.get("pan")), o.add(new t.Tap({ event: "doubletap", taps: 2 })), o.on("doubletap", () => {
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 n = e.el_, t = n.querySelector(".vjs-progress-control");
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(n.style, {
60
+ a ? (Object.assign(t.style, {
59
61
  top: `${c}px`,
60
62
  left: `-${c}px`
61
- }), 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 = ""));
62
64
  else {
63
- if (!m)
65
+ if (!x)
64
66
  return;
65
- a ? (Object.assign(n.style, {
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
- }), 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 = ""));
72
74
  }
73
75
  });
74
- }, I = (e, n) => {
75
- n.on("play", () => {
76
+ }, I = (e, t) => {
77
+ t.on("play", () => {
76
78
  p = !0;
77
- }), n.on("pause", () => {
79
+ }), t.on("pause", () => {
78
80
  p = !1;
79
- }), n.on("ended", () => {
81
+ }), t.on("ended", () => {
80
82
  p = !1;
81
- }), n.on("ready", () => {
82
- w == null || w(n);
83
+ }), t.on("ready", () => {
84
+ h == null || h(t);
83
85
  });
84
- const t = document == null ? void 0 : document.getElementById(e);
85
- t && E(n, t);
86
- }, S = async (e, n) => {
87
- r = (await y())(n, { ...e, fakeFullscreen: h }), r && (I(n, r), h && 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));
88
90
  };
89
91
  return {
90
- loadVideo: async (e, n) => {
91
- if (r && (r.dispose(), r = void 0), !(!e || !n))
92
+ loadVideo: async (e, t) => {
93
+ if (r && (r.dispose(), r = void 0), !(!e || !t))
92
94
  try {
93
- await S(n, e);
95
+ await S(t, e);
94
96
  } catch {
95
97
  }
96
98
  },