@lazycatcloud/lzc-video-player 0.0.15 → 0.0.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazycatcloud/lzc-video-player",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/lzc-video-player.js",
@@ -1,306 +0,0 @@
1
- import { openBlock as u, createElementBlock as d, pushScopeId as Q, popScopeId as H, createElementVNode as o, ref as f, computed as S, defineComponent as x, normalizeClass as y, withModifiers as w, createBlock as $, unref as i, isRef as X, withCtx as B, toDisplayString as g, createCommentVNode as k, useCssVars as Y, onMounted as Z, nextTick as ee, onUnmounted as te, watchEffect as se, createVNode as h, Fragment as I, renderList as le, createTextVNode as V } from "vue";
2
- import { _ as D, Q as T, a as ne, E as U, u as ie, r as ue, b as oe, c as ae, f as K, g as ce } from "./lzc-video-player.d63bcadd.js";
3
- import "pinia";
4
- const de = {}, re = (e) => (Q("data-v-7a0e044b"), e = e(), H(), e), _e = /* @__PURE__ */ re(() => /* @__PURE__ */ o("ul", null, [
5
- /* @__PURE__ */ o("li", { class: "m1" }),
6
- /* @__PURE__ */ o("li", { class: "m2" }),
7
- /* @__PURE__ */ o("li", { class: "m3" })
8
- ], -1)), pe = [
9
- _e
10
- ];
11
- function ve(e, s) {
12
- return u(), d("div", null, pe);
13
- }
14
- const me = /* @__PURE__ */ D(de, [["render", ve], ["__scopeId", "data-v-7a0e044b"]]);
15
- function ye() {
16
- const e = f(!1), s = f([]), l = f([]), a = S(
17
- () => s.value.length > 0 && l.value.length === s.value.length
18
- );
19
- function r() {
20
- if (a.value) {
21
- s.value = [];
22
- return;
23
- }
24
- s.value = l.value;
25
- }
26
- function c() {
27
- e.value = !1, s.value = [];
28
- }
29
- function p(v) {
30
- if (s.value.includes(v)) {
31
- s.value = s.value.filter((b) => b !== v);
32
- return;
33
- }
34
- s.value.push(v);
35
- }
36
- function m(v) {
37
- console.log("updateData"), l.value = v;
38
- }
39
- return {
40
- selectedKeys: s,
41
- isEditing: e,
42
- isSelectAll: a,
43
- hdlSelectAll: r,
44
- hdlCancel: c,
45
- hdlToggleItem: p,
46
- updateData: m
47
- };
48
- }
49
- const ge = /* @__PURE__ */ x({
50
- __name: "choose",
51
- props: {
52
- keyValue: null,
53
- selectedKeys: null
54
- },
55
- emits: ["toggle"],
56
- setup(e, { emit: s }) {
57
- const l = "page-title-edit";
58
- function a(r) {
59
- s("toggle", r);
60
- }
61
- return (r, c) => (u(), d("div", {
62
- class: y(`${l}-toggle`),
63
- onClick: c[0] || (c[0] = w((p) => a(e.keyValue), ["stop"]))
64
- }, [
65
- e.selectedKeys.includes(e.keyValue) ? (u(), $(T, {
66
- key: 0,
67
- name: "svguse:#icon-\u5168\u9009_\u5DF2\u9009\u4E2D.svg"
68
- })) : (u(), d("div", {
69
- key: 1,
70
- class: y(`${l}-toggle-unselect`)
71
- }, null, 2))
72
- ], 2));
73
- }
74
- });
75
- const fe = /* @__PURE__ */ D(ge, [["__scopeId", "data-v-b520dd6c"]]), he = { class: "card" }, ke = { class: "title" }, $e = {
76
- key: 0,
77
- class: "subtitle"
78
- }, Ce = { class: "buttons" }, xe = /* @__PURE__ */ x({
79
- __name: "index",
80
- props: {
81
- show: { type: Boolean },
82
- title: null,
83
- desc: null
84
- },
85
- emits: ["update:show", "confirm"],
86
- setup(e, { emit: s }) {
87
- const l = e, a = S({
88
- set(r) {
89
- s("update:show", r);
90
- },
91
- get() {
92
- return !!l.show;
93
- }
94
- });
95
- return (r, c) => (u(), $(ne, {
96
- "model-value": i(a),
97
- "onUpdate:model-value": c[2] || (c[2] = (p) => X(a) ? a.value = p : null)
98
- }, {
99
- default: B(() => [
100
- o("div", he, [
101
- o("span", ke, g(e.title), 1),
102
- e.desc ? (u(), d("span", $e, g(e.desc), 1)) : k("", !0),
103
- o("div", Ce, [
104
- o("span", {
105
- class: "cancel",
106
- onClick: c[0] || (c[0] = (p) => a.value = !1)
107
- }, "\u53D6\u6D88"),
108
- o("span", {
109
- class: "confirm",
110
- onClick: c[1] || (c[1] = (p) => r.$emit("confirm"))
111
- }, "\u786E\u5B9A")
112
- ])
113
- ])
114
- ]),
115
- _: 1
116
- }, 8, ["model-value"]));
117
- }
118
- });
119
- const De = /* @__PURE__ */ D(xe, [["__scopeId", "data-v-136158d9"]]), M = (e) => (Q("data-v-519f4592"), e = e(), H(), e), be = { class: "list-top-bar" }, Ee = /* @__PURE__ */ M(() => /* @__PURE__ */ o("span", { class: "cancel-edit-text" }, "\u8BF7\u9009\u62E9", -1)), Fe = {
120
- key: 1,
121
- class: "title"
122
- }, Ie = { class: "clear" }, Ve = { key: 0 }, we = ["onClick"], Be = { class: "item" }, Te = { class: "item-pic" }, Se = { class: "item-info" }, Pe = { class: "item-info-title" }, Ae = { class: "item-info-subtitle" }, Ue = {
123
- key: 1,
124
- class: "empty-text"
125
- }, Ke = /* @__PURE__ */ M(() => /* @__PURE__ */ o("span", null, "\u6682\u65E0\u64AD\u653E\u5185\u5BB9", -1)), Qe = [
126
- Ke
127
- ], He = /* @__PURE__ */ x({
128
- __name: "index",
129
- props: {
130
- player: null,
131
- isPlaying: null
132
- },
133
- emits: ["openVideo", "back"],
134
- setup(e, { emit: s }) {
135
- const l = e;
136
- Y((t) => ({
137
- "13fc6c5c": "url(" + i(U) + ")"
138
- }));
139
- const a = ie(), r = f(l.player ? l.player.currentTime() : 0), c = () => {
140
- r.value = l.player.currentTime();
141
- }, p = "page-title-edit", {
142
- selectedKeys: m,
143
- isEditing: v,
144
- isSelectAll: b,
145
- hdlSelectAll: P,
146
- hdlCancel: E,
147
- hdlToggleItem: N,
148
- updateData: O
149
- } = ye(), C = f(!1), F = f(null), q = S(() => !!a.infos.length), L = (t) => t._id ? ce(t._id) : U;
150
- function z(t) {
151
- s("openVideo", t);
152
- }
153
- function R(t) {
154
- return !t.duration || t.duration == 0 || !t.currentTime || t.currentTime == 0 ? "0" : (t.currentTime / t.duration * 100).toFixed(0);
155
- }
156
- function j(t) {
157
- return !t.invalid && l.isPlaying(t) && l.player ? `\u6B63\u5728\u89C2\u770B\uFF1A${K(r.value)}` : `\u89C2\u770B\u81F3: ${R(t)}%`;
158
- }
159
- function G() {
160
- C.value = !1, a.batchDeleteHistory(m.value);
161
- const t = a.infos.find(l.isPlaying);
162
- t && m.value.includes(t._id) && s("back"), E();
163
- }
164
- function J() {
165
- !m.value.length || (C.value = !0);
166
- }
167
- return Z(() => {
168
- const t = a.infos.findIndex(l.isPlaying);
169
- t > -1 && ee(() => {
170
- F.value && F.value.$el.scrollBy(0, ue(9.4) * t);
171
- }), l.player && l.player.on("timeupdate", c);
172
- }), te(() => {
173
- l.player && l.player.off("timeupdate", c);
174
- }), se(() => {
175
- const t = a.infos.map((_) => _._id);
176
- O(t);
177
- }), (t, _) => {
178
- var A;
179
- return u(), d("div", {
180
- class: "list",
181
- onClick: _[4] || (_[4] = w(() => {
182
- }, ["stop"]))
183
- }, [
184
- h(De, {
185
- title: "\u786E\u8BA4\u5220\u9664",
186
- desc: "\u662F\u5426\u5220\u9664\u5DF2\u9009\u4E2D\u7684\u89C6\u9891",
187
- show: C.value,
188
- "onUpdate:show": _[0] || (_[0] = (n) => C.value = n),
189
- onConfirm: G
190
- }, null, 8, ["show"]),
191
- o("div", be, [
192
- i(v) ? (u(), d("div", {
193
- key: 0,
194
- class: "title cancel-edit",
195
- onClick: _[1] || (_[1] = w(
196
- (...n) => i(E) && i(E)(...n),
197
- ["stop"]
198
- ))
199
- }, [
200
- h(T, { name: "svguse:#icon-\u5173\u95ED\u591A\u9009.svg" }),
201
- Ee
202
- ])) : (u(), d("span", Fe, "\u64AD\u653E\u5217\u8868")),
203
- o("div", Ie, [
204
- i(q) ? (u(), d("div", Ve, [
205
- i(v) ? (u(), d("span", {
206
- key: 1,
207
- class: y(`${p}-select`),
208
- onClick: _[3] || (_[3] = (...n) => i(P) && i(P)(...n))
209
- }, g(i(b) ? "\u53D6\u6D88\u5168\u9009" : "\u5168\u9009"), 3)) : (u(), d("span", {
210
- key: 0,
211
- class: y(`${p}-edit`),
212
- onClick: _[2] || (_[2] = (n) => v.value = !0)
213
- }, " \u7F16\u8F91 ", 2))
214
- ])) : k("", !0)
215
- ])
216
- ]),
217
- h(oe, {
218
- class: y(`list-items ${i(v) ? "list-editing" : ""}`),
219
- ref_key: "qlist",
220
- ref: F
221
- }, {
222
- default: B(() => [
223
- i(a).infos.length > 0 ? (u(!0), d(I, { key: 0 }, le(i(a).infos, (n) => (u(), d("div", {
224
- key: n.sourceUrl,
225
- onClick: (W) => z(n),
226
- class: y(["info-item", { active: e.isPlaying(n) }])
227
- }, [
228
- o("div", Be, [
229
- o("div", Te, [
230
- h(ae, {
231
- fit: "cover",
232
- loading: "eager",
233
- src: L(n),
234
- "no-spinner": ""
235
- }, {
236
- default: B(() => [
237
- o("div", {
238
- class: y(["absolute-bottom-right text-subtitle2 item-subtitle", { "item-invalid": n.invalid }])
239
- }, [
240
- n.invalid ? (u(), d(I, { key: 0 }, [
241
- h(T, { name: "svguse:#icon-\u5931\u6548.svg" }),
242
- V(" \u5DF2\u5931\u6548 ")
243
- ], 64)) : (u(), d(I, { key: 1 }, [
244
- V(g(i(K)(n.duration)), 1)
245
- ], 64))
246
- ], 2)
247
- ]),
248
- _: 2
249
- }, 1032, ["src"])
250
- ]),
251
- o("div", Se, [
252
- o("div", Pe, g(n.name || n.sourceUrl), 1),
253
- o("div", Ae, [
254
- !n.invalid && e.isPlaying(n) ? (u(), $(me, { key: 0 })) : k("", !0),
255
- V(" " + g(j(n)), 1)
256
- ])
257
- ]),
258
- o("div", null, [
259
- i(v) ? (u(), $(fe, {
260
- key: 0,
261
- keyValue: n._id,
262
- selectedKeys: i(m),
263
- onToggle: (W) => i(N)(n._id)
264
- }, null, 8, ["keyValue", "selectedKeys", "onToggle"])) : k("", !0)
265
- ])
266
- ])
267
- ], 10, we))), 128)) : (u(), d("div", Ue, Qe))
268
- ]),
269
- _: 1
270
- }, 8, ["class"]),
271
- i(v) ? (u(), d("div", {
272
- key: 0,
273
- class: y(`${p}-delete ${((A = i(m)) == null ? void 0 : A.length) && `${p}-delete-active`}`),
274
- onClick: J
275
- }, " \u5220\u9664" + g(i(m).length > 0 ? `\uFF08${i(m).length}\uFF09` : ""), 3)) : k("", !0)
276
- ]);
277
- };
278
- }
279
- });
280
- const Me = /* @__PURE__ */ D(He, [["__scopeId", "data-v-519f4592"]]), Le = /* @__PURE__ */ x({
281
- __name: "list",
282
- props: {
283
- player: null
284
- },
285
- setup(e) {
286
- const s = e;
287
- function l(c) {
288
- return c.sourceUrl === s.player.currentSrc();
289
- }
290
- function a() {
291
- s.player.trigger({ type: "back" });
292
- }
293
- function r(c) {
294
- s.player.trigger({ type: "openVideo", info: c });
295
- }
296
- return (c, p) => (u(), $(Me, {
297
- player: e.player,
298
- isPlaying: l,
299
- onBack: a,
300
- onOpenVideo: r
301
- }, null, 8, ["player"]));
302
- }
303
- });
304
- export {
305
- Le as default
306
- };