@lazycatcloud/lzc-video-player 0.0.2 → 0.0.4

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,8 +1,8 @@
1
- import { defineComponent as n, ref as s, openBlock as u, createBlock as i, withCtx as y, createTextVNode as m, toDisplayString as f } from "vue";
2
- import { S as _ } from "./simpleList.15646ead.js";
3
- import "./lzc-video-player.c352003d.js";
1
+ import { defineComponent as s, ref as u, openBlock as i, createBlock as y, withCtx as m, createTextVNode as f, toDisplayString as _ } from "vue";
2
+ import { S as g } from "./simpleList.95523394.js";
3
+ import "./lzc-video-player.78765609.js";
4
4
  import "pinia";
5
- const D = /* @__PURE__ */ n({
5
+ const D = /* @__PURE__ */ s({
6
6
  __name: "playrate",
7
7
  props: {
8
8
  player: null
@@ -10,22 +10,22 @@ const D = /* @__PURE__ */ n({
10
10
  setup(o) {
11
11
  const e = o, r = [3, 2, 1.5, 1.25, 1, 0.75];
12
12
  e.player.playbackRates(r);
13
- const a = s(e.player.playbackRate()), l = ({ item: t }) => {
13
+ const a = u(e.player.playbackRate()), l = ({ item: t }) => {
14
14
  e.player.playbackRate(t), e.player.lzcModal().close();
15
- }, p = (t) => t === a.value;
15
+ }, p = (t, c) => t === a.value;
16
16
  return e.player.on("ratechange", function() {
17
17
  a.value = e.player.playbackRate(), e.player.trigger({
18
18
  type: "tipToast",
19
19
  toastValue: `${a.value}\u500D\u901F\u64AD\u653E\u4E2D`,
20
20
  toastIcon: "svguse:#icon-\u500D\u901F.svg"
21
21
  });
22
- }), (t, g) => (u(), i(_, {
22
+ }), (t, c) => (i(), y(g, {
23
23
  items: r,
24
24
  isActive: p,
25
25
  onSelect: l
26
26
  }, {
27
- default: y(({ data: c }) => [
28
- m(f(c.item) + " x ", 1)
27
+ default: m(({ data: n }) => [
28
+ f(_(n.item) + " x ", 1)
29
29
  ]),
30
30
  _: 1
31
31
  }));
@@ -1,14 +1,14 @@
1
- import { defineComponent as p, ref as c, openBlock as y, createBlock as f, unref as m, withCtx as g, createTextVNode as v, toDisplayString as B } from "vue";
2
- import { S as F } from "./simpleList.15646ead.js";
3
- import "./lzc-video-player.c352003d.js";
1
+ import { defineComponent as y, ref as f, openBlock as m, createBlock as g, unref as v, withCtx as B, createTextVNode as F, toDisplayString as _ } from "vue";
2
+ import { S as D } from "./simpleList.95523394.js";
3
+ import "./lzc-video-player.78765609.js";
4
4
  import "pinia";
5
- const A = /* @__PURE__ */ p({
5
+ const R = /* @__PURE__ */ y({
6
6
  __name: "resolution",
7
7
  props: {
8
8
  player: null
9
9
  },
10
- setup(n) {
11
- const t = n, l = t.player.supportResolution(), o = c(t.player.currentResolution());
10
+ setup(s) {
11
+ const t = s, a = t.player.supportResolution(), o = f(t.player.currentResolution());
12
12
  t.player.qualityLevels().on("change", function() {
13
13
  var u, r;
14
14
  o.value = t.player.currentResolution();
@@ -19,29 +19,29 @@ const A = /* @__PURE__ */ p({
19
19
  toastIcon: ""
20
20
  });
21
21
  });
22
- const s = ({ index: e }) => {
22
+ const i = ({ index: e }) => {
23
23
  t.player.qualityLevels().selectedIndex !== e && (t.player.changeResolution(e), t.player.lzcModal().close(), t.player.trigger({
24
24
  type: "tipToast",
25
25
  toastValue: "\u5207\u6362\u4E2D\uFF0C\u8BF7\u7A0D\u7B49",
26
26
  toastIcon: "",
27
27
  uncloseable: !0
28
28
  }));
29
- }, a = (e) => {
30
- var u, r;
31
- return (u = o.value) != null && u.auto ? e === 0 : e === ((r = o.value) == null ? void 0 : r.res);
32
- }, i = (e, u) => u == 0 ? "\u539F\u59CB\u753B\u8D28" : e === 0 ? "\u81EA\u52A8" : `${e} P`;
33
- return (e, u) => (y(), f(F, {
34
- items: m(l),
35
- isActive: a,
36
- onSelect: s
29
+ }, p = (e, u) => {
30
+ var r, n, l;
31
+ return (r = o.value) != null && r.auto ? e === 0 : (n = o.value) != null && n.origin ? u === 0 : e === ((l = o.value) == null ? void 0 : l.res) && u > 0;
32
+ }, c = (e, u) => u == 0 ? "\u539F\u59CB\u753B\u8D28" : e === 0 ? "\u81EA\u52A8" : `${e} P`;
33
+ return (e, u) => (m(), g(D, {
34
+ items: v(a),
35
+ isActive: p,
36
+ onSelect: i
37
37
  }, {
38
- default: g(({ data: r }) => [
39
- v(B(i(r.item, r.index)), 1)
38
+ default: B(({ data: r }) => [
39
+ F(_(c(r.item, r.index)), 1)
40
40
  ]),
41
41
  _: 1
42
42
  }, 8, ["items"]));
43
43
  }
44
44
  });
45
45
  export {
46
- A as default
46
+ R as default
47
47
  };
@@ -1,5 +1,5 @@
1
- import { b as n, d as o, _ as r } from "./lzc-video-player.c352003d.js";
2
- import { defineComponent as _, openBlock as s, createElementBlock as i, createVNode as m, withCtx as c, Fragment as d, renderList as p, createBlock as u, createElementVNode as f, normalizeClass as v, renderSlot as k } from "vue";
1
+ import { b as o, d as n, _ as r } from "./lzc-video-player.78765609.js";
2
+ import { defineComponent as _, openBlock as s, createElementBlock as c, createVNode as m, withCtx as i, Fragment as d, renderList as p, createBlock as u, createElementVNode as f, normalizeClass as v, renderSlot as k } from "vue";
3
3
  const C = { class: "simple-list" }, L = /* @__PURE__ */ _({
4
4
  __name: "simpleList",
5
5
  props: {
@@ -8,21 +8,21 @@ const C = { class: "simple-list" }, L = /* @__PURE__ */ _({
8
8
  },
9
9
  emits: ["select"],
10
10
  setup(l) {
11
- return (a, b) => (s(), i("div", C, [
12
- m(n, null, {
13
- default: c(() => [
14
- (s(!0), i(d, null, p(l.items, (e, t) => (s(), u(o, {
15
- key: t,
11
+ return (a, h) => (s(), c("div", C, [
12
+ m(o, null, {
13
+ default: i(() => [
14
+ (s(!0), c(d, null, p(l.items, (t, e) => (s(), u(n, {
15
+ key: e,
16
16
  class: "item",
17
17
  clickable: "",
18
- onClick: (h) => a.$emit("select", { item: e, index: t })
18
+ onClick: (y) => a.$emit("select", { item: t, index: e })
19
19
  }, {
20
- default: c(() => [
20
+ default: i(() => [
21
21
  f("span", {
22
- class: v(["text", { active: l.isActive(e) }])
22
+ class: v(["text", { active: l.isActive(t, e) }])
23
23
  }, [
24
24
  k(a.$slots, "default", {
25
- data: { item: e, index: t }
25
+ data: { item: t, index: e }
26
26
  }, void 0, !0)
27
27
  ], 2)
28
28
  ]),
@@ -34,7 +34,7 @@ const C = { class: "simple-list" }, L = /* @__PURE__ */ _({
34
34
  ]));
35
35
  }
36
36
  });
37
- const S = /* @__PURE__ */ r(L, [["__scopeId", "data-v-bf368e8a"]]);
37
+ const $ = /* @__PURE__ */ r(L, [["__scopeId", "data-v-39acdf40"]]);
38
38
  export {
39
- S
39
+ $ as S
40
40
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazycatcloud/lzc-video-player",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/lzc-video-player.js",
@@ -1,173 +0,0 @@
1
- import { openBlock as c, createElementBlock as a, createElementVNode as s, renderSlot as $, withModifiers as A, defineComponent as y, useCssVars as E, pushScopeId as V, popScopeId as P, unref as u, ref as N, onMounted as Q, nextTick as U, createVNode as d, createTextVNode as _, withCtx as p, Fragment as h, renderList as H, createBlock as f, normalizeClass as C, toDisplayString as g, createCommentVNode as O } from "vue";
2
- import { _ as b, E as I, u as q, r as L, Q as B, b as M, c as z, f as S, g as j } from "./lzc-video-player.c352003d.js";
3
- import "pinia";
4
- const G = {}, J = { class: "container" }, K = { class: "content" };
5
- function R(t, n) {
6
- return c(), a("div", J, [
7
- s("div", K, [
8
- $(t.$slots, "default", {}, void 0, !0)
9
- ]),
10
- s("div", {
11
- class: "right",
12
- onClick: n[0] || (n[0] = A(() => {
13
- }, ["stop", "prevent"]))
14
- }, [
15
- $(t.$slots, "right", {}, void 0, !0)
16
- ])
17
- ]);
18
- }
19
- const W = /* @__PURE__ */ b(G, [["render", R], ["__scopeId", "data-v-5b362d85"]]), X = (t) => (V("data-v-5c7ab7eb"), t = t(), P(), t), Y = /* @__PURE__ */ X(() => /* @__PURE__ */ s("ul", null, [
20
- /* @__PURE__ */ s("li", { class: "m1" }),
21
- /* @__PURE__ */ s("li", { class: "m2" }),
22
- /* @__PURE__ */ s("li", { class: "m3" })
23
- ], -1)), Z = [
24
- Y
25
- ], ee = /* @__PURE__ */ y({
26
- __name: "index",
27
- props: {
28
- height: { default: "1rem" },
29
- width: { default: "0.15rem" },
30
- gap: { default: "0.2rem" }
31
- },
32
- setup(t) {
33
- return E((n) => ({
34
- "401b04e7": t.height,
35
- "3c437bf4": t.width,
36
- becc99d4: t.gap
37
- })), (n, l) => (c(), a("div", null, Z));
38
- }
39
- });
40
- const te = /* @__PURE__ */ b(ee, [["__scopeId", "data-v-5c7ab7eb"]]), m = (t) => (V("data-v-a63805f4"), t = t(), P(), t), se = { class: "list" }, ie = { class: "list-top-bar" }, ne = /* @__PURE__ */ m(() => /* @__PURE__ */ s("span", { class: "title" }, "\u64AD\u653E\u5217\u8868", -1)), ce = ["onClick"], oe = /* @__PURE__ */ m(() => /* @__PURE__ */ s("span", { class: "delete-separator" }, null, -1)), re = /* @__PURE__ */ m(() => /* @__PURE__ */ s("span", { class: "delete-text" }, "\u5220\u9664", -1)), ae = [
41
- oe,
42
- re
43
- ], le = { class: "item" }, ue = { class: "item-pic" }, de = { class: "item-info" }, _e = { class: "item-info-title" }, pe = { class: "item-info-subtitle" }, me = {
44
- key: 1,
45
- class: "empty-text"
46
- }, ve = /* @__PURE__ */ m(() => /* @__PURE__ */ s("span", null, "\u6682\u65E0\u64AD\u653E\u5185\u5BB9", -1)), he = [
47
- ve
48
- ], ge = /* @__PURE__ */ y({
49
- __name: "index",
50
- props: {
51
- isPlaying: null
52
- },
53
- emits: ["openVideo", "back"],
54
- setup(t, { emit: n }) {
55
- const l = t;
56
- E((e) => ({
57
- b99d7630: "url(" + u(I) + ")"
58
- }));
59
- const r = q(), v = (e) => e._id ? j(e._id) : I, o = N(null);
60
- function x(e) {
61
- n("openVideo", e);
62
- }
63
- function T(e) {
64
- r.deleteHistory(e), l.isPlaying(e) && n("back");
65
- }
66
- function w(e) {
67
- return !e.duration || e.duration == 0 || !e.currentTime || e.currentTime == 0 ? "0" : (e.currentTime / e.duration * 100).toFixed(0);
68
- }
69
- function D(e) {
70
- return !e.invalid && l.isPlaying(e) ? `\u6B63\u5728\u89C2\u770B\uFF1A${S(e.currentTime)}` : `\u89C2\u770B\u81F3: ${w(e)}%`;
71
- }
72
- return Q(() => {
73
- const e = r.infos.findIndex(l.isPlaying);
74
- e > -1 && U(() => {
75
- o.value && o.value.$el.scrollBy(0, L(9.4) * e);
76
- });
77
- }), (e, k) => (c(), a("div", se, [
78
- s("div", ie, [
79
- ne,
80
- s("div", {
81
- class: "clear",
82
- onClick: k[0] || (k[0] = (i) => u(r).clear())
83
- }, [
84
- d(B, { name: "svguse:#icon-\u56DE\u6536\u7AD9.svg" }),
85
- _(" \u6E05\u7A7A ")
86
- ])
87
- ]),
88
- d(M, {
89
- class: "list-items",
90
- ref_key: "qlist",
91
- ref: o
92
- }, {
93
- default: p(() => [
94
- u(r).infos.length > 0 ? (c(!0), a(h, { key: 0 }, H(u(r).infos, (i) => (c(), f(W, {
95
- key: i.sourceUrl,
96
- onClick: (F) => x(i),
97
- class: C(["slide-item", { active: t.isPlaying(i) }])
98
- }, {
99
- right: p(() => [
100
- s("div", {
101
- class: "delete-area",
102
- onClick: (F) => T(i)
103
- }, ae, 8, ce)
104
- ]),
105
- default: p(() => [
106
- s("div", le, [
107
- s("div", ue, [
108
- d(z, {
109
- fit: "fill",
110
- src: v(i),
111
- "no-spinner": ""
112
- }, {
113
- default: p(() => [
114
- s("div", {
115
- class: C(["absolute-bottom-right text-subtitle2 item-subtitle", { "item-invalid": i.invalid }])
116
- }, [
117
- i.invalid ? (c(), a(h, { key: 0 }, [
118
- d(B, { name: "svguse:#icon-\u5931\u6548.svg" }),
119
- _(" \u5DF2\u5931\u6548 ")
120
- ], 64)) : (c(), a(h, { key: 1 }, [
121
- _(g(u(S)(i.duration)), 1)
122
- ], 64))
123
- ], 2)
124
- ]),
125
- _: 2
126
- }, 1032, ["src"])
127
- ]),
128
- s("div", de, [
129
- s("div", _e, g(i.name || i.sourceUrl), 1),
130
- s("div", pe, [
131
- !i.invalid && t.isPlaying(i) ? (c(), f(te, {
132
- key: 0,
133
- height: "1.1rem"
134
- })) : O("", !0),
135
- _(" " + g(D(i)), 1)
136
- ])
137
- ])
138
- ])
139
- ]),
140
- _: 2
141
- }, 1032, ["onClick", "class"]))), 128)) : (c(), a("div", me, he))
142
- ]),
143
- _: 1
144
- }, 512)
145
- ]));
146
- }
147
- });
148
- const fe = /* @__PURE__ */ b(ge, [["__scopeId", "data-v-a63805f4"]]), ke = /* @__PURE__ */ y({
149
- __name: "list",
150
- props: {
151
- player: null
152
- },
153
- setup(t) {
154
- const n = t;
155
- function l(o) {
156
- return o.sourceUrl === n.player.currentSrc();
157
- }
158
- function r() {
159
- n.player.trigger({ type: "back" });
160
- }
161
- function v(o) {
162
- n.player.trigger({ type: "openVideo", info: o });
163
- }
164
- return (o, x) => (c(), f(fe, {
165
- isPlaying: l,
166
- onBack: r,
167
- onOpenVideo: v
168
- }));
169
- }
170
- });
171
- export {
172
- ke as default
173
- };