@lazycatcloud/lzc-video-player 0.0.1

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.
Files changed (59) hide show
  1. package/README.md +2 -0
  2. package/dist/components/PlayList/index.vue.d.ts +19 -0
  3. package/dist/components/SlideItem/index.vue.d.ts +10 -0
  4. package/dist/components/Spectrum/index.vue.d.ts +32 -0
  5. package/dist/components/Video/components/LzcCurrentTimeDisplay.d.ts +53 -0
  6. package/dist/components/Video/components/LzcLoadingSpinner.d.ts +53 -0
  7. package/dist/components/Video/components/LzcModal/components/simpleList.vue.d.ts +36 -0
  8. package/dist/components/Video/components/LzcModal/index-horizontal.vue.d.ts +12 -0
  9. package/dist/components/Video/components/LzcModal/index-vertical.vue.d.ts +12 -0
  10. package/dist/components/Video/components/LzcModal/index.vue.d.ts +21 -0
  11. package/dist/components/Video/components/LzcModal/list.vue.d.ts +12 -0
  12. package/dist/components/Video/components/LzcModal/playrate.vue.d.ts +12 -0
  13. package/dist/components/Video/components/LzcModal/resolution.vue.d.ts +12 -0
  14. package/dist/components/Video/components/LzcModal/useModal.d.ts +1 -0
  15. package/dist/components/Video/components/LzcModal.d.ts +11 -0
  16. package/dist/components/Video/components/LzcOverlay/cast.vue.d.ts +15 -0
  17. package/dist/components/Video/components/LzcOverlay/castMiddleware.d.ts +1 -0
  18. package/dist/components/Video/components/LzcOverlay/castPlugin.d.ts +12 -0
  19. package/dist/components/Video/components/LzcOverlay/casting.vue.d.ts +12 -0
  20. package/dist/components/Video/components/LzcOverlay/error.vue.d.ts +12 -0
  21. package/dist/components/Video/components/LzcOverlay/helper.d.ts +31 -0
  22. package/dist/components/Video/components/LzcOverlay/index.vue.d.ts +12 -0
  23. package/dist/components/Video/components/LzcOverlay/playing.vue.d.ts +12 -0
  24. package/dist/components/Video/components/LzcOverlay/playingButtons.vue.d.ts +12 -0
  25. package/dist/components/Video/components/LzcOverlay/playingLayout.vue.d.ts +19 -0
  26. package/dist/components/Video/components/LzcOverlay/useCast.d.ts +16 -0
  27. package/dist/components/Video/components/LzcOverlay/useCommon.d.ts +5 -0
  28. package/dist/components/Video/components/LzcOverlay.d.ts +53 -0
  29. package/dist/components/Video/components/LzcPlayRate.d.ts +11 -0
  30. package/dist/components/Video/components/LzcPlayToggle.d.ts +53 -0
  31. package/dist/components/Video/components/LzcPlaylistButton.d.ts +12 -0
  32. package/dist/components/Video/components/LzcPlaylistNext.d.ts +13 -0
  33. package/dist/components/Video/components/LzcProgress.d.ts +53 -0
  34. package/dist/components/Video/components/LzcRemainingTimeDisplay.d.ts +55 -0
  35. package/dist/components/Video/components/LzcResolutionButton.d.ts +12 -0
  36. package/dist/components/Video/components/LzcSeekBar.d.ts +55 -0
  37. package/dist/components/Video/components/useLzcCommon.d.ts +3 -0
  38. package/dist/components/Video/index.vue.d.ts +20 -0
  39. package/dist/components/Video/useOrientation.d.ts +4 -0
  40. package/dist/components/Video/useSource.d.ts +7 -0
  41. package/dist/components/Video/useWebview.d.ts +8 -0
  42. package/dist/components/Video/useWebviewMiddleware.d.ts +1 -0
  43. package/dist/components/Video/videoFrame.d.ts +2 -0
  44. package/dist/index-horizontal.4350090a.js +31 -0
  45. package/dist/index-vertical.4c7b466b.js +28 -0
  46. package/dist/list.7099181d.js +173 -0
  47. package/dist/lzc-video-player.47190826.js +58363 -0
  48. package/dist/lzc-video-player.d.ts +2 -0
  49. package/dist/lzc-video-player.js +7 -0
  50. package/dist/model.d.ts +27 -0
  51. package/dist/playrate.b2b089b8.js +36 -0
  52. package/dist/resolution.2163011d.js +47 -0
  53. package/dist/simpleList.4d06b064.js +40 -0
  54. package/dist/stores/pinia.d.ts +2 -0
  55. package/dist/stores/playlist.d.ts +54 -0
  56. package/dist/use/useSdk.d.ts +3 -0
  57. package/dist/use/useUtils.d.ts +1 -0
  58. package/dist/use/useVideoFrame.d.ts +3 -0
  59. package/package.json +22 -0
@@ -0,0 +1,27 @@
1
+ export interface Doc {
2
+ _id?: string;
3
+ }
4
+ export interface VideoResolution {
5
+ res: number;
6
+ width: number;
7
+ height: number;
8
+ auto: boolean;
9
+ origin: boolean;
10
+ }
11
+ export interface PreviewInfo {
12
+ page: number;
13
+ image: HTMLImageElement;
14
+ len: number;
15
+ interval: number;
16
+ width: number;
17
+ height: number;
18
+ tile: number;
19
+ }
20
+ export interface VideoInfo extends Doc {
21
+ sourceUrl: string;
22
+ name: string;
23
+ duration: number;
24
+ currentTime: number;
25
+ invalid: boolean;
26
+ updateTime?: number;
27
+ }
@@ -0,0 +1,36 @@
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.4d06b064.js";
3
+ import "./lzc-video-player.47190826.js";
4
+ import "pinia";
5
+ const D = /* @__PURE__ */ n({
6
+ __name: "playrate",
7
+ props: {
8
+ player: null
9
+ },
10
+ setup(o) {
11
+ const e = o, r = [3, 2, 1.5, 1.25, 1, 0.75];
12
+ e.player.playbackRates(r);
13
+ const a = s(e.player.playbackRate()), l = ({ item: t }) => {
14
+ e.player.playbackRate(t), e.player.lzcModal().close();
15
+ }, p = (t) => t === a.value;
16
+ return e.player.on("ratechange", function() {
17
+ a.value = e.player.playbackRate(), e.player.trigger({
18
+ type: "tipToast",
19
+ toastValue: `${a.value}\u500D\u901F\u64AD\u653E\u4E2D`,
20
+ toastIcon: "svguse:#icon-\u500D\u901F.svg"
21
+ });
22
+ }), (t, g) => (u(), i(_, {
23
+ items: r,
24
+ isActive: p,
25
+ onSelect: l
26
+ }, {
27
+ default: y(({ data: c }) => [
28
+ m(f(c.item) + " x ", 1)
29
+ ]),
30
+ _: 1
31
+ }));
32
+ }
33
+ });
34
+ export {
35
+ D as default
36
+ };
@@ -0,0 +1,47 @@
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.4d06b064.js";
3
+ import "./lzc-video-player.47190826.js";
4
+ import "pinia";
5
+ const A = /* @__PURE__ */ p({
6
+ __name: "resolution",
7
+ props: {
8
+ player: null
9
+ },
10
+ setup(n) {
11
+ const t = n, l = t.player.supportResolution(), o = c(t.player.currentResolution());
12
+ t.player.qualityLevels().on("change", function() {
13
+ var u, r;
14
+ o.value = t.player.currentResolution();
15
+ const e = (u = o.value) != null && u.origin ? "\u539F\u59CB\u753B\u8D28" : `${(r = o.value) == null ? void 0 : r.res}P`;
16
+ t.player.trigger({
17
+ type: "tipToast",
18
+ toastValue: `\u5DF2\u6210\u529F\u5207\u6362\u81F3 ${e} \u6E05\u6670\u5EA6`,
19
+ toastIcon: ""
20
+ });
21
+ });
22
+ const s = ({ index: e }) => {
23
+ t.player.qualityLevels().selectedIndex !== e && (t.player.changeResolution(e), t.player.lzcModal().close(), t.player.trigger({
24
+ type: "tipToast",
25
+ toastValue: "\u5207\u6362\u4E2D\uFF0C\u8BF7\u7A0D\u7B49",
26
+ toastIcon: "",
27
+ uncloseable: !0
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
37
+ }, {
38
+ default: g(({ data: r }) => [
39
+ v(B(i(r.item, r.index)), 1)
40
+ ]),
41
+ _: 1
42
+ }, 8, ["items"]));
43
+ }
44
+ });
45
+ export {
46
+ A as default
47
+ };
@@ -0,0 +1,40 @@
1
+ import { b as n, d as o, _ as r } from "./lzc-video-player.47190826.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";
3
+ const C = { class: "simple-list" }, L = /* @__PURE__ */ _({
4
+ __name: "simpleList",
5
+ props: {
6
+ items: null,
7
+ isActive: null
8
+ },
9
+ emits: ["select"],
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,
16
+ class: "item",
17
+ clickable: "",
18
+ onClick: (h) => a.$emit("select", { item: e, index: t })
19
+ }, {
20
+ default: c(() => [
21
+ f("span", {
22
+ class: v(["text", { active: l.isActive(e) }])
23
+ }, [
24
+ k(a.$slots, "default", {
25
+ data: { item: e, index: t }
26
+ }, void 0, !0)
27
+ ], 2)
28
+ ]),
29
+ _: 2
30
+ }, 1032, ["onClick"]))), 128))
31
+ ]),
32
+ _: 3
33
+ })
34
+ ]));
35
+ }
36
+ });
37
+ const S = /* @__PURE__ */ r(L, [["__scopeId", "data-v-bf368e8a"]]);
38
+ export {
39
+ S
40
+ };
@@ -0,0 +1,2 @@
1
+ declare const pinia: import("pinia").Pinia;
2
+ export default pinia;
@@ -0,0 +1,54 @@
1
+ import { RemoteDB } from "@lazycatcloud/minidb";
2
+ import type { VideoInfo } from '../model';
3
+ export declare const useHistoryInfo: () => import("pinia").Store<"historyInfo", {
4
+ collection: RemoteDB<VideoInfo>;
5
+ infos: VideoInfo[];
6
+ }, {
7
+ getHistoryInfo(state: {
8
+ collection: {
9
+ find: (selector: Record<string, any>, options?: import("@lazycatcloud/minidb/dist/remoteDB").CollectionFindOptions | undefined) => {
10
+ fetch: () => Promise<VideoInfo[]>;
11
+ };
12
+ findOne: (selector: Record<string, any>, options?: import("@lazycatcloud/minidb/dist/remoteDB").CollectionFindOptions | undefined) => Promise<VideoInfo | null>;
13
+ upsertOrUpdate: (selector: Record<string, any>, doc: VideoInfo, options?: import("@lazycatcloud/minidb/dist/remoteDB").CollectionFindOptions | undefined) => Promise<VideoInfo | null>;
14
+ upsert: {
15
+ (doc: VideoInfo): Promise<VideoInfo | null>;
16
+ (doc: VideoInfo, base: VideoInfo | null | undefined): Promise<VideoInfo | null>;
17
+ (docs: VideoInfo[]): Promise<(VideoInfo | null)[]>;
18
+ (docs: VideoInfo[], bases: (VideoInfo | null | undefined)[]): Promise<(VideoInfo | null)[]>;
19
+ };
20
+ remove: {
21
+ (id: any): Promise<void>;
22
+ (ids: any[]): Promise<void>;
23
+ };
24
+ };
25
+ infos: {
26
+ sourceUrl: string;
27
+ name: string;
28
+ duration: number;
29
+ currentTime: number;
30
+ invalid: boolean;
31
+ updateTime?: number | undefined;
32
+ _id?: string | undefined;
33
+ }[];
34
+ } & import("pinia").PiniaCustomStateProperties<{
35
+ collection: RemoteDB<VideoInfo>;
36
+ infos: VideoInfo[];
37
+ }>): (sourceUrl: string) => {
38
+ sourceUrl: string;
39
+ name: string;
40
+ duration: number;
41
+ currentTime: number;
42
+ invalid: boolean;
43
+ updateTime?: number | undefined;
44
+ _id?: string | undefined;
45
+ } | undefined;
46
+ }, {
47
+ init(): Promise<void>;
48
+ refreshData(): Promise<void>;
49
+ deleteHistory(info: VideoInfo): Promise<void>;
50
+ updateHistoryCache(info: VideoInfo): Promise<void>;
51
+ updateHistory(info: VideoInfo, blob: Blob | null | undefined): Promise<void>;
52
+ markAsInvalid(sourceUrl: string): Promise<void>;
53
+ clear(): Promise<void>;
54
+ }>;
@@ -0,0 +1,3 @@
1
+ import { lzcAPIGateway } from "@lazycatcloud/sdk";
2
+ declare const lzcApi: lzcAPIGateway;
3
+ export default lzcApi;
@@ -0,0 +1 @@
1
+ export declare function isMobile(): RegExpMatchArray | null;
@@ -0,0 +1,3 @@
1
+ export declare const getFrame: (id: string) => string;
2
+ export declare const addFrame: (id: string, blob: Blob) => Promise<boolean>;
3
+ export declare const delFrame: (id: string) => Promise<void>;
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@lazycatcloud/lzc-video-player",
3
+ "version": "0.0.1",
4
+ "description": "",
5
+ "type": "module",
6
+ "main": "dist/lzc-video-player.js",
7
+ "types": "dist/lzc-video-player.d.ts",
8
+ "files": [
9
+ "dist",
10
+ "README.md"
11
+ ],
12
+ "access": "public",
13
+ "author": "",
14
+ "license": "ISC",
15
+ "scripts": {
16
+ "build": "vite build"
17
+ },
18
+ "publishConfig": {
19
+ "registry": "https://registry.npmjs.org",
20
+ "access": "public"
21
+ }
22
+ }