lzc-video-player 0.0.0
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/.dockerignore +1 -0
- package/.eslintrc.cjs +18 -0
- package/.prettierrc.json +5 -0
- package/AGENTS.md +31 -0
- package/README.md +38 -0
- package/build.sh +10 -0
- package/demo/.vscode/extensions.json +3 -0
- package/demo/README.md +40 -0
- package/demo/env.d.ts +1 -0
- package/demo/index.html +13 -0
- package/demo/package-lock.json +2037 -0
- package/demo/package.json +25 -0
- package/demo/public/favicon.ico +0 -0
- package/demo/src/App.vue +25 -0
- package/demo/src/assets/base.css +70 -0
- package/demo/src/assets/logo.svg +1 -0
- package/demo/src/assets/main.css +33 -0
- package/demo/src/main.ts +8 -0
- package/demo/tsconfig.config.json +8 -0
- package/demo/tsconfig.json +16 -0
- package/demo/vite.config.ts +14 -0
- package/docs/progress-bar-style-analysis.md +87 -0
- package/env.d.ts +1 -0
- package/error_pages/502.html.tpl +13 -0
- package/i18next-parser.config.mjs +147 -0
- package/index.html +54 -0
- package/lazycat.png +0 -0
- package/lib/README.md +48 -0
- package/lib/package.json +22 -0
- package/lzc-build.local.yml +65 -0
- package/lzc-build.yml +65 -0
- package/lzc-manifest.yml +53 -0
- package/makefile +15 -0
- package/package.json +69 -0
- package/postcss.config.js +6 -0
- package/public/512x512.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/languages/en/translation.json +125 -0
- package/public/languages/zh/translation.json +125 -0
- package/public/libass-wasm/4.1.0/default.woff2 +0 -0
- package/public/libass-wasm/4.1.0/subtitles-octopus-worker-legacy.js +40 -0
- package/public/libass-wasm/4.1.0/subtitles-octopus-worker.js +1 -0
- package/public/libass-wasm/4.1.0/subtitles-octopus-worker.wasm +0 -0
- package/public/libass-wasm/4.1.0/subtitles-octopus.js +1680 -0
- package/public/square-128x128.png +0 -0
- package/public/square-256x256.png +0 -0
- package/public/square-512x512.png +0 -0
- package/src/App.vue +18 -0
- package/src/assets/base.scss +104 -0
- package/src/assets/cloud.png +0 -0
- package/src/assets/logo.svg +1 -0
- package/src/components/Dialog/index.vue +96 -0
- package/src/components/MultipleEdit/choose.vue +39 -0
- package/src/components/PlayList/index.vue +521 -0
- package/src/components/Spectrum/index.vue +58 -0
- package/src/components/Video/NativeVideoPlayer.vue +748 -0
- package/src/components/Video/README.md +3 -0
- package/src/components/Video/clientPlayer.ts +348 -0
- package/src/components/Video/components/LzcModal/components/simpleList.vue +57 -0
- package/src/components/Video/components/LzcModal/list.vue +52 -0
- package/src/components/Video/components/LzcModal/playrate.vue +45 -0
- package/src/components/Video/components/LzcModal/resolution.vue +117 -0
- package/src/components/Video/components/LzcModal/subtitle.vue +499 -0
- package/src/components/Video/components/LzcModal/useModal.ts +18 -0
- package/src/components/Video/components/LzcOverlay/SubtitleLayer.vue +321 -0
- package/src/components/Video/components/LzcOverlay/cast.vue +253 -0
- package/src/components/Video/components/LzcOverlay/casting.vue +205 -0
- package/src/components/Video/components/LzcOverlay/error.vue +103 -0
- package/src/components/Video/components/LzcOverlay/helper.ts +81 -0
- package/src/components/Video/components/LzcOverlay/index.vue +99 -0
- package/src/components/Video/components/LzcOverlay/playing.vue +496 -0
- package/src/components/Video/components/LzcOverlay/playingButtons.vue +122 -0
- package/src/components/Video/components/LzcOverlay/playingLayout.vue +287 -0
- package/src/components/Video/components/LzcOverlay/useCast.ts +235 -0
- package/src/components/Video/components/LzcOverlay/useCommon.ts +41 -0
- package/src/components/Video/components/LzcOverlay/useOctopusRenderer.ts +230 -0
- package/src/components/Video/components/LzcOverlay/useSubtitleRenderEngine.ts +79 -0
- package/src/components/Video/components/LzcOverlay/useSubtitleTrack.ts +139 -0
- package/src/components/Video/components/useLzcCommon.ts +16 -0
- package/src/components/Video/directPlay.ts +345 -0
- package/src/components/Video/getSubtitleInfo.ts +42 -0
- package/src/components/Video/native/EventEmitter.ts +62 -0
- package/src/components/Video/native/NativeControls.vue +510 -0
- package/src/components/Video/native/NativeModal.vue +133 -0
- package/src/components/Video/native/NativePlayer.ts +913 -0
- package/src/components/Video/native/NativePlayer.vue +53 -0
- package/src/components/Video/native/index.ts +9 -0
- package/src/components/Video/native/native-player.css +183 -0
- package/src/components/Video/native/playerKey.ts +5 -0
- package/src/components/Video/native/useNativeCastMiddleware.ts +50 -0
- package/src/components/Video/native/useNativePlayer.ts +3 -0
- package/src/components/Video/native/useNativePlayerFullscreen.ts +44 -0
- package/src/components/Video/native/useNativePlayerHistory.ts +69 -0
- package/src/components/Video/native/useNativePlayerModal.ts +68 -0
- package/src/components/Video/native/useNativePlayerPlaylist.ts +67 -0
- package/src/components/Video/native/useNativePlayerState.ts +225 -0
- package/src/components/Video/player.ts +99 -0
- package/src/components/Video/theme/index.scss +291 -0
- package/src/components/Video/theme/videojs.css +1797 -0
- package/src/components/Video/useSource.ts +1431 -0
- package/src/components/Video/useSubtitlePreference.ts +66 -0
- package/src/components/Video/useWebview.ts +79 -0
- package/src/components/Video/videoFrame.ts +58 -0
- package/src/env.d.ts +3 -0
- package/src/i18n/README.md +392 -0
- package/src/i18n/index.ts +49 -0
- package/src/icons/Video_Player.svg +69 -0
- package/src/icons/box.svg +15 -0
- package/src/icons/client.svg +17 -0
- package/src/icons/logo.svg +28 -0
- package/src/icons//344/270/212/344/270/200/344/270/252.svg +6 -0
- package/src/icons//344/270/213/344/270/200/344/270/252.svg +4 -0
- package/src/icons//344/272/256/345/272/246.svg +13 -0
- package/src/icons//345/200/215/351/200/237.svg +14 -0
- package/src/icons//345/205/250/345/261/217.svg +16 -0
- package/src/icons//345/205/250/351/200/211_/345/267/262/351/200/211/344/270/255.svg +16 -0
- package/src/icons//345/205/250/351/200/211_/346/234/252/351/200/211/344/270/255.svg +15 -0
- package/src/icons//345/205/263/351/227/255/345/244/232/351/200/211.svg +14 -0
- package/src/icons//345/205/263/351/227/255/346/212/225/345/261/217.svg +11 -0
- package/src/icons//345/233/236/346/224/266/347/253/231.svg +15 -0
- package/src/icons//345/244/261/346/225/210.svg +17 -0
- package/src/icons//346/207/222/347/214/253/346/222/255/346/224/276/345/231/250-icon.png +0 -0
- package/src/icons//346/207/222/347/214/253/346/222/255/346/224/276/345/231/250.png +0 -0
- package/src/icons//346/212/225/345/261/217.svg +11 -0
- package/src/icons//346/212/225/351/200/201/344/270/255.jpg +0 -0
- package/src/icons//346/212/225/351/200/201/344/270/255.svg +21 -0
- package/src/icons//346/222/255/346/224/276.svg +3 -0
- package/src/icons//346/232/202/345/201/234.svg +4 -0
- package/src/icons//346/232/202/346/227/240.svg +21 -0
- package/src/icons//346/233/264/345/244/232/346/223/215/344/275/234.svg +11 -0
- package/src/icons//347/224/265/350/247/206.svg +18 -0
- package/src/icons//347/247/273/345/212/250/347/253/257_/350/203/214/346/231/257.webp +0 -0
- package/src/icons//350/203/214/346/231/257.png +0 -0
- package/src/icons//350/277/224/345/233/236.svg +13 -0
- package/src/icons//350/277/233/345/205/245/345/205/250/345/261/217.svg +13 -0
- package/src/icons//351/200/200/345/207/272/345/205/250/345/261/217.svg +15 -0
- package/src/icons//351/200/211/346/213/251.svg +15 -0
- package/src/icons//351/237/263/351/207/217.svg +13 -0
- package/src/index.d.ts +9 -0
- package/src/lzc-video-player.scss +7 -0
- package/src/lzc-video-player.ts +6 -0
- package/src/main.ts +62 -0
- package/src/model.ts +77 -0
- package/src/quasar-variables.sass +10 -0
- package/src/router/index.ts +74 -0
- package/src/stores/pinia.ts +3 -0
- package/src/stores/playlist.ts +146 -0
- package/src/use/useKeyBind.ts +61 -0
- package/src/use/useMultipleEdit.ts +60 -0
- package/src/use/useSdk.ts +5 -0
- package/src/use/useSubtitle.ts +39 -0
- package/src/use/useUtils.ts +22 -0
- package/src/use/useVideoFrame.ts +60 -0
- package/src/views/Home.ts +99 -0
- package/src/views/mobile/Home.vue +246 -0
- package/src/views/mobile/Player.vue +141 -0
- package/tailwind.config.js +15 -0
- package/tsconfig.config.json +8 -0
- package/tsconfig.json +20 -0
- package/vite.config.lib.ts +88 -0
- package/vite.config.ts +122 -0
- package/vue-shim.d.ts +4 -0
package/vite.config.ts
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { fileURLToPath, URL } from "node:url"
|
|
2
|
+
import { defineConfig } from "vite"
|
|
3
|
+
import vue from "@vitejs/plugin-vue"
|
|
4
|
+
import { quasar, transformAssetUrls } from "@quasar/vite-plugin"
|
|
5
|
+
import { createSvgIconsPlugin } from "vite-plugin-svg-icons"
|
|
6
|
+
import path from "node:path"
|
|
7
|
+
import { VitePWA } from "vite-plugin-pwa"
|
|
8
|
+
import type { Plugin } from "rollup"
|
|
9
|
+
import fs from "fs"
|
|
10
|
+
import AutoImport from "unplugin-auto-import/vite"
|
|
11
|
+
|
|
12
|
+
const version = process.env["VERSION"] || "0.0.0-dev"
|
|
13
|
+
|
|
14
|
+
function useCredentials() {
|
|
15
|
+
return {
|
|
16
|
+
name: "use-credentials",
|
|
17
|
+
transformIndexHtml(html: string) {
|
|
18
|
+
return html.replace("crossorigin", 'crossorigin="use-credentials"')
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//TODO: 升级到 vite5 后可以删除
|
|
24
|
+
function svgLoader(): Plugin {
|
|
25
|
+
return {
|
|
26
|
+
name: "vite-svg-patch-plugin",
|
|
27
|
+
transform: function (code, id) {
|
|
28
|
+
if (id.endsWith(".svg?inline")) {
|
|
29
|
+
const filename = id.substring(0, id.length - "?inline".length)
|
|
30
|
+
const extractedSvg = fs.readFileSync(filename, "utf8")
|
|
31
|
+
const decoded = unescape(encodeURIComponent(extractedSvg))
|
|
32
|
+
return `export default 'data:image/svg+xml;base64,${btoa(decoded)}'`
|
|
33
|
+
}
|
|
34
|
+
return code
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// https://vitejs.dev/config/
|
|
40
|
+
export default defineConfig({
|
|
41
|
+
define: {
|
|
42
|
+
__APP_VERSION__: JSON.stringify(version),
|
|
43
|
+
"process.env.NODE_ENV": '"production"',
|
|
44
|
+
},
|
|
45
|
+
plugins: [
|
|
46
|
+
vue({
|
|
47
|
+
template: {
|
|
48
|
+
transformAssetUrls,
|
|
49
|
+
compilerOptions: {
|
|
50
|
+
isCustomElement: (tag) => tag.startsWith("lzc"),
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
}),
|
|
54
|
+
AutoImport({
|
|
55
|
+
imports: [{ "@/i18n": ["t"] }],
|
|
56
|
+
// dts: "./types/auto-imports.d.ts",
|
|
57
|
+
dts: false, // 禁用自动生成dts文件
|
|
58
|
+
vueTemplate: true,
|
|
59
|
+
}),
|
|
60
|
+
quasar({
|
|
61
|
+
sassVariables: "src/quasar-variables.sass",
|
|
62
|
+
}),
|
|
63
|
+
svgLoader(),
|
|
64
|
+
createSvgIconsPlugin({
|
|
65
|
+
// 指定需要缓存的图标文件夹
|
|
66
|
+
iconDirs: [path.resolve(process.cwd(), "src/icons")],
|
|
67
|
+
// 指定symbolId格式
|
|
68
|
+
symbolId: "icon-[name].svg",
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* 自定义插入位置
|
|
72
|
+
* @default: body-last
|
|
73
|
+
*/
|
|
74
|
+
inject: "body-last",
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* custom dom id
|
|
78
|
+
* @default: __svg__icons__dom__
|
|
79
|
+
*/
|
|
80
|
+
customDomId: "__svg__icons__dom__",
|
|
81
|
+
}),
|
|
82
|
+
VitePWA({
|
|
83
|
+
registerType: "autoUpdate",
|
|
84
|
+
useCredentials: true,
|
|
85
|
+
devOptions: {
|
|
86
|
+
enabled: false,
|
|
87
|
+
},
|
|
88
|
+
workbox: {
|
|
89
|
+
skipWaiting: true,
|
|
90
|
+
globPatterns: ["**/*.{js,css,png,svg,ico}"],
|
|
91
|
+
runtimeCaching: [
|
|
92
|
+
{
|
|
93
|
+
urlPattern: /_lzc\/media\/hls\/(.*?)\/(.*?).vtt/i,
|
|
94
|
+
handler: "CacheFirst",
|
|
95
|
+
options: {
|
|
96
|
+
cacheName: "vtt-cache",
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
manifest: {
|
|
102
|
+
name: "视频播放器",
|
|
103
|
+
short_name: "视频播放器",
|
|
104
|
+
description: "懒猫微服播放器",
|
|
105
|
+
theme_color: "#ffffff",
|
|
106
|
+
icons: [
|
|
107
|
+
{
|
|
108
|
+
src: "512x512.png",
|
|
109
|
+
sizes: "512x512",
|
|
110
|
+
type: "image/png",
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
}),
|
|
115
|
+
useCredentials(),
|
|
116
|
+
],
|
|
117
|
+
resolve: {
|
|
118
|
+
alias: {
|
|
119
|
+
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
})
|
package/vue-shim.d.ts
ADDED