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.
- package/dist/_commonjsHelpers-10dfc225.js +0 -1
- package/dist/hammer-005503be.js +0 -1
- package/dist/tcplayer.v4.8.0.min-31e6d34b.js +0 -1
- package/dist/video-player.js +32 -33
- package/dist/video-player.umd.cjs +1 -2
- package/package.json +1 -1
- package/dist/_commonjsHelpers-10dfc225.js.map +0 -1
- package/dist/hammer-005503be.js.map +0 -1
- package/dist/tcplayer.v4.8.0.min-31e6d34b.js.map +0 -1
- package/dist/video-player.js.map +0 -1
- package/dist/video-player.umd.cjs.map +0 -1
package/dist/hammer-005503be.js
CHANGED
|
@@ -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
|
package/dist/video-player.js
CHANGED
|
@@ -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,
|
|
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),
|
|
70
|
+
i = a.map(q), p = a.map(N);
|
|
71
71
|
const c = Array.isArray(t.props) ? {} : t.props || {};
|
|
72
|
-
v =
|
|
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
|
-
|
|
76
|
+
p.forEach((d) => {
|
|
77
77
|
this.$root.props[d] = this[d];
|
|
78
78
|
});
|
|
79
|
-
}),
|
|
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(
|
|
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,
|
|
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 && !
|
|
184
|
+
!i && !p || (h ? s == null || s.pause() : s == null || s.play());
|
|
185
185
|
}, c = (s, u) => {
|
|
186
|
-
!i ||
|
|
186
|
+
!i || p || (v = s.deltaY, _ = u.currentTime());
|
|
187
187
|
}, d = (s, u) => {
|
|
188
|
-
if (!i ||
|
|
188
|
+
if (!i || p)
|
|
189
189
|
return;
|
|
190
|
-
const
|
|
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:
|
|
195
|
+
const { default: f } = await import("./hammer-005503be.js").then((y) => y.h);
|
|
196
196
|
await z();
|
|
197
|
-
const g = new
|
|
197
|
+
const g = new f.Manager(u);
|
|
198
198
|
g.add(
|
|
199
|
-
new
|
|
199
|
+
new f.Pan({
|
|
200
200
|
threshold: 10,
|
|
201
201
|
pointers: 0,
|
|
202
|
-
direction:
|
|
202
|
+
direction: f.DIRECTION_ALL
|
|
203
203
|
})
|
|
204
|
-
), g.add(new
|
|
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_,
|
|
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
|
-
|
|
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"),
|
|
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
|
-
}),
|
|
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
|
|
247
|
-
|
|
246
|
+
const f = document == null ? void 0 : document.getElementById(s);
|
|
247
|
+
f && w(u, f);
|
|
248
248
|
}, R = async (s, u) => {
|
|
249
|
-
const
|
|
250
|
-
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(),
|
|
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 (!
|
|
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 =
|
|
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:
|
|
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,
|
|
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),
|
|
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
|