lx-video-player 1.0.13 → 1.0.14

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