lx-video-player 1.0.3 → 1.0.5

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.
@@ -6,4 +6,3 @@ export {
6
6
  o as c,
7
7
  l as g
8
8
  };
9
- //# sourceMappingURL=_commonjsHelpers-10dfc225.js.map
@@ -1186,4 +1186,3 @@ const Fe = /* @__PURE__ */ be(He), Ve = /* @__PURE__ */ Object.freeze(/* @__PURE
1186
1186
  export {
1187
1187
  Ve as h
1188
1188
  };
1189
- //# sourceMappingURL=hammer-005503be.js.map
@@ -11001,4 +11001,3 @@ const tcplayer_v4_8_0_min = /* @__PURE__ */ getDefaultExportFromCjs(tcplayer_v4_
11001
11001
  export {
11002
11002
  tcplayer_v4_8_0_min$1 as t
11003
11003
  };
11004
- //# sourceMappingURL=tcplayer.v4.8.0.min-31e6d34b.js.map
@@ -62,21 +62,21 @@ function Z(e) {
62
62
  }
63
63
  function Q(e, n) {
64
64
  const o = typeof n == "function" && !n.cid;
65
- let r = !1, i, f, v;
65
+ let r = !1, i, p, v;
66
66
  function _(m) {
67
67
  if (r)
68
68
  return;
69
69
  const t = typeof m == "function" ? m.options : m, a = Array.isArray(t.props) ? t.props : Object.keys(t.props || {});
70
- i = a.map(q), f = a.map(N);
70
+ i = a.map(q), p = a.map(N);
71
71
  const c = Array.isArray(t.props) ? {} : t.props || {};
72
- v = f.reduce((d, w, b) => (d[w] = c[a[b]], d), {}), L(t, "beforeCreate", function() {
72
+ v = p.reduce((d, w, b) => (d[w] = c[a[b]], d), {}), L(t, "beforeCreate", function() {
73
73
  const d = this.$emit;
74
74
  this.$emit = (w, ...b) => (this.$root.$options.customElement.dispatchEvent(X(w, b)), d.call(this, w, ...b));
75
75
  }), L(t, "created", function() {
76
- f.forEach((d) => {
76
+ p.forEach((d) => {
77
77
  this.$root.props[d] = this[d];
78
78
  });
79
- }), f.forEach((d) => {
79
+ }), p.forEach((d) => {
80
80
  Object.defineProperty(h.prototype, d, {
81
81
  get() {
82
82
  return this._wrapper.props[d];
@@ -144,7 +144,7 @@ function Q(e, n) {
144
144
  O(this.vueComponent, "activated");
145
145
  else {
146
146
  const a = () => {
147
- t.props = U(f), i.forEach((c) => {
147
+ t.props = U(p), i.forEach((c) => {
148
148
  l(this, c);
149
149
  });
150
150
  };
@@ -174,34 +174,34 @@ function ne() {
174
174
  const e = A(!1), n = A({
175
175
  status: H.converted
176
176
  }), o = te || ee && P, r = A();
177
- let i = !1, f = !1, v = 0, _ = 0, l = !1, h = !1, m = null;
177
+ let i = !1, p = !1, v = 0, _ = 0, l = !1, h = !1, m = null;
178
178
  const t = async () => {
179
179
  if (m)
180
180
  return m;
181
181
  const { default: s } = await import("./tcplayer.v4.8.0.min-31e6d34b.js").then((u) => u.t);
182
182
  return m = s, m;
183
183
  }, a = (s) => {
184
- !i && !f || (h ? s == null || s.pause() : s == null || s.play());
184
+ !i && !p || (h ? s == null || s.pause() : s == null || s.play());
185
185
  }, c = (s, u) => {
186
- !i || f || (v = s.deltaY, _ = u.currentTime());
186
+ !i || p || (v = s.deltaY, _ = u.currentTime());
187
187
  }, d = (s, u) => {
188
- if (!i || f)
188
+ if (!i || p)
189
189
  return;
190
- const p = l ? s.deltaY : s.deltaX, g = l ? window.innerHeight : window.innerWidth, y = (p - v) / g, E = u.duration();
190
+ const f = l ? s.deltaY : s.deltaX, g = l ? window.innerHeight : window.innerWidth, y = (f - v) / g, E = u.duration();
191
191
  let $ = _ + E * y;
192
192
  $ < 0 && ($ = 0), $ > E && ($ = E), u.currentTime($);
193
193
  }, w = async (s, u) => {
194
194
  try {
195
- const { default: p } = await import("./hammer-005503be.js").then((y) => y.h);
195
+ const { default: f } = await import("./hammer-005503be.js").then((y) => y.h);
196
196
  await z();
197
- const g = new p.Manager(u);
197
+ const g = new f.Manager(u);
198
198
  g.add(
199
- new p.Pan({
199
+ new f.Pan({
200
200
  threshold: 10,
201
201
  pointers: 0,
202
- direction: p.DIRECTION_ALL
202
+ direction: f.DIRECTION_ALL
203
203
  })
204
- ), g.add(new p.Swipe()).recognizeWith(g.get("pan")), g.add(new p.Tap({ event: "doubletap", taps: 2 })), g.on("doubletap", () => {
204
+ ), g.add(new f.Swipe()).recognizeWith(g.get("pan")), g.add(new f.Tap({ event: "doubletap", taps: 2 })), g.on("doubletap", () => {
205
205
  a(s);
206
206
  }), g.on("panstart", (y) => {
207
207
  c(y, s);
@@ -213,16 +213,16 @@ function ne() {
213
213
  }, b = (s) => {
214
214
  s.on("fullscreenchange", () => {
215
215
  i = s.isFullscreen();
216
- const u = s.el_, p = u.querySelector(".vjs-progress-control");
216
+ const u = s.el_, f = u.querySelector(".vjs-progress-control");
217
217
  l = s.videoWidth() > s.videoHeight();
218
218
  const g = window.innerWidth, y = window.innerHeight;
219
- f = window.orientation === 90 || window.orientation === -90;
219
+ p = window.orientation === 90 || window.orientation === -90;
220
220
  const E = Math.floor(Math.abs((g - y) / 2));
221
221
  if (l)
222
222
  i ? (Object.assign(u.style, {
223
223
  top: `${E}px`,
224
224
  left: `-${E}px`
225
- }), u.classList.add("landscape"), p && (p.style.pointerEvents = "none")) : (u.classList.remove("landscape"), u.setAttribute("style", ""), p && (p.style.pointerEvents = ""));
225
+ }), u.classList.add("landscape"), f && (f.style.pointerEvents = "none")) : (u.classList.remove("landscape"), u.setAttribute("style", ""), f && (f.style.pointerEvents = ""));
226
226
  else {
227
227
  if (!P)
228
228
  return;
@@ -232,7 +232,7 @@ function ne() {
232
232
  position: "fixed",
233
233
  zIndex: "999",
234
234
  top: "0px"
235
- }), p && (p.style.pointerEvents = "none")) : (u.removeAttribute("style"), p && (p.style.pointerEvents = ""));
235
+ }), f && (f.style.pointerEvents = "none")) : (u.removeAttribute("style"), f && (f.style.pointerEvents = ""));
236
236
  }
237
237
  });
238
238
  }, C = (s, u) => {
@@ -243,11 +243,11 @@ function ne() {
243
243
  }), u.on("ended", () => {
244
244
  h = !1;
245
245
  });
246
- const p = document == null ? void 0 : document.getElementById(s);
247
- p && w(u, p);
246
+ const f = document == null ? void 0 : document.getElementById(s);
247
+ f && w(u, f);
248
248
  }, R = async (s, u) => {
249
- const p = await t();
250
- r.value = p(u, { ...s, fakeFullscreen: o }), r.value && (C(u, r.value), e.value = !1, o && b(r.value));
249
+ const f = await t();
250
+ r.value = f(u, { ...s, fakeFullscreen: o }), r.value && (C(u, r.value), e.value = !1, o && b(r.value));
251
251
  }, V = async (s, u) => {
252
252
  if (r.value && (r.value.dispose(), r.value = void 0), !(!s || !u)) {
253
253
  e.value = !0;
@@ -271,11 +271,11 @@ const oe = /* @__PURE__ */ k({
271
271
  __name: "VideoPlayer",
272
272
  props: {
273
273
  selector: { default: "tcplayer" },
274
- options: { default: "" }
274
+ options: { default: null }
275
275
  },
276
276
  emits: ["ready", "play", "pause", "ended", "error"],
277
277
  setup(e, { emit: n }) {
278
- const o = e, { loadVideo: r, tcplayerInstance: i } = ne(), f = A(null), v = () => {
278
+ const o = e, { loadVideo: r, tcplayerInstance: i } = ne(), p = A(null), v = () => {
279
279
  const t = document.querySelector(`lx-video-player[selector=${o.selector}]`) || document.querySelector("#lx-video-player-container");
280
280
  return t && t instanceof HTMLElement ? t : null;
281
281
  }, _ = () => {
@@ -292,16 +292,16 @@ const oe = /* @__PURE__ */ k({
292
292
  }, h = async () => {
293
293
  if (!(!o.options || o.options === "{}"))
294
294
  try {
295
- if (!f.value && (f.value = _(), !f.value))
295
+ if (!p.value && (p.value = _(), !p.value))
296
296
  return;
297
297
  await z();
298
- const t = JSON.parse(o.options || "{}");
298
+ const t = typeof o.options == "string" ? JSON.parse(o.options || "{}") : o.options;
299
299
  await r(o.selector, t), i.value && (l("ready", i.value), i.value.on("play", l("play")), i.value.on("pause", l("pause")), i.value.on("ended", l("ended")));
300
300
  } catch {
301
301
  }
302
302
  }, m = () => {
303
303
  var t;
304
- (t = f.value) != null && t.parentNode && (f.value.parentNode.removeChild(f.value), f.value = null);
304
+ (t = p.value) != null && t.parentNode && (p.value.parentNode.removeChild(p.value), p.value = null);
305
305
  };
306
306
  return F(() => {
307
307
  setTimeout(() => {
@@ -309,12 +309,12 @@ const oe = /* @__PURE__ */ k({
309
309
  });
310
310
  }), M(() => {
311
311
  i.value && i.value.dispose(), m();
312
- }), B(() => o.options, h), { __sfc: !0, props: o, emit: n, loadVideo: r, tcplayerInstance: i, videoElement: f, getHostElement: v, createVideoElement: _, handleEmit: l, initializePlayer: h, cleanupVideoElement: m };
312
+ }), B(() => o.options, h), { __sfc: !0, props: o, emit: n, loadVideo: r, tcplayerInstance: i, videoElement: p, getHostElement: v, createVideoElement: _, handleEmit: l, initializePlayer: h, cleanupVideoElement: m };
313
313
  }
314
314
  });
315
- function re(e, n, o, r, i, f, v, _) {
315
+ function re(e, n, o, r, i, p, v, _) {
316
316
  var l = typeof e == "function" ? e.options : e;
317
- n && (l.render = n, l.staticRenderFns = o, l._compiled = !0), r && (l.functional = !0), f && (l._scopeId = "data-v-" + f);
317
+ n && (l.render = n, l.staticRenderFns = o, l._compiled = !0), r && (l.functional = !0), p && (l._scopeId = "data-v-" + p);
318
318
  var h;
319
319
  if (v ? (h = function(a) {
320
320
  a = a || // cached call
@@ -367,4 +367,3 @@ export {
367
367
  H as VideoStatus,
368
368
  le as default
369
369
  };
370
- //# sourceMappingURL=video-player.js.map