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.
Files changed (162) hide show
  1. package/.dockerignore +1 -0
  2. package/.eslintrc.cjs +18 -0
  3. package/.prettierrc.json +5 -0
  4. package/AGENTS.md +31 -0
  5. package/README.md +38 -0
  6. package/build.sh +10 -0
  7. package/demo/.vscode/extensions.json +3 -0
  8. package/demo/README.md +40 -0
  9. package/demo/env.d.ts +1 -0
  10. package/demo/index.html +13 -0
  11. package/demo/package-lock.json +2037 -0
  12. package/demo/package.json +25 -0
  13. package/demo/public/favicon.ico +0 -0
  14. package/demo/src/App.vue +25 -0
  15. package/demo/src/assets/base.css +70 -0
  16. package/demo/src/assets/logo.svg +1 -0
  17. package/demo/src/assets/main.css +33 -0
  18. package/demo/src/main.ts +8 -0
  19. package/demo/tsconfig.config.json +8 -0
  20. package/demo/tsconfig.json +16 -0
  21. package/demo/vite.config.ts +14 -0
  22. package/docs/progress-bar-style-analysis.md +87 -0
  23. package/env.d.ts +1 -0
  24. package/error_pages/502.html.tpl +13 -0
  25. package/i18next-parser.config.mjs +147 -0
  26. package/index.html +54 -0
  27. package/lazycat.png +0 -0
  28. package/lib/README.md +48 -0
  29. package/lib/package.json +22 -0
  30. package/lzc-build.local.yml +65 -0
  31. package/lzc-build.yml +65 -0
  32. package/lzc-manifest.yml +53 -0
  33. package/makefile +15 -0
  34. package/package.json +69 -0
  35. package/postcss.config.js +6 -0
  36. package/public/512x512.png +0 -0
  37. package/public/favicon.ico +0 -0
  38. package/public/languages/en/translation.json +125 -0
  39. package/public/languages/zh/translation.json +125 -0
  40. package/public/libass-wasm/4.1.0/default.woff2 +0 -0
  41. package/public/libass-wasm/4.1.0/subtitles-octopus-worker-legacy.js +40 -0
  42. package/public/libass-wasm/4.1.0/subtitles-octopus-worker.js +1 -0
  43. package/public/libass-wasm/4.1.0/subtitles-octopus-worker.wasm +0 -0
  44. package/public/libass-wasm/4.1.0/subtitles-octopus.js +1680 -0
  45. package/public/square-128x128.png +0 -0
  46. package/public/square-256x256.png +0 -0
  47. package/public/square-512x512.png +0 -0
  48. package/src/App.vue +18 -0
  49. package/src/assets/base.scss +104 -0
  50. package/src/assets/cloud.png +0 -0
  51. package/src/assets/logo.svg +1 -0
  52. package/src/components/Dialog/index.vue +96 -0
  53. package/src/components/MultipleEdit/choose.vue +39 -0
  54. package/src/components/PlayList/index.vue +521 -0
  55. package/src/components/Spectrum/index.vue +58 -0
  56. package/src/components/Video/NativeVideoPlayer.vue +748 -0
  57. package/src/components/Video/README.md +3 -0
  58. package/src/components/Video/clientPlayer.ts +348 -0
  59. package/src/components/Video/components/LzcModal/components/simpleList.vue +57 -0
  60. package/src/components/Video/components/LzcModal/list.vue +52 -0
  61. package/src/components/Video/components/LzcModal/playrate.vue +45 -0
  62. package/src/components/Video/components/LzcModal/resolution.vue +117 -0
  63. package/src/components/Video/components/LzcModal/subtitle.vue +499 -0
  64. package/src/components/Video/components/LzcModal/useModal.ts +18 -0
  65. package/src/components/Video/components/LzcOverlay/SubtitleLayer.vue +321 -0
  66. package/src/components/Video/components/LzcOverlay/cast.vue +253 -0
  67. package/src/components/Video/components/LzcOverlay/casting.vue +205 -0
  68. package/src/components/Video/components/LzcOverlay/error.vue +103 -0
  69. package/src/components/Video/components/LzcOverlay/helper.ts +81 -0
  70. package/src/components/Video/components/LzcOverlay/index.vue +99 -0
  71. package/src/components/Video/components/LzcOverlay/playing.vue +496 -0
  72. package/src/components/Video/components/LzcOverlay/playingButtons.vue +122 -0
  73. package/src/components/Video/components/LzcOverlay/playingLayout.vue +287 -0
  74. package/src/components/Video/components/LzcOverlay/useCast.ts +235 -0
  75. package/src/components/Video/components/LzcOverlay/useCommon.ts +41 -0
  76. package/src/components/Video/components/LzcOverlay/useOctopusRenderer.ts +230 -0
  77. package/src/components/Video/components/LzcOverlay/useSubtitleRenderEngine.ts +79 -0
  78. package/src/components/Video/components/LzcOverlay/useSubtitleTrack.ts +139 -0
  79. package/src/components/Video/components/useLzcCommon.ts +16 -0
  80. package/src/components/Video/directPlay.ts +345 -0
  81. package/src/components/Video/getSubtitleInfo.ts +42 -0
  82. package/src/components/Video/native/EventEmitter.ts +62 -0
  83. package/src/components/Video/native/NativeControls.vue +510 -0
  84. package/src/components/Video/native/NativeModal.vue +133 -0
  85. package/src/components/Video/native/NativePlayer.ts +913 -0
  86. package/src/components/Video/native/NativePlayer.vue +53 -0
  87. package/src/components/Video/native/index.ts +9 -0
  88. package/src/components/Video/native/native-player.css +183 -0
  89. package/src/components/Video/native/playerKey.ts +5 -0
  90. package/src/components/Video/native/useNativeCastMiddleware.ts +50 -0
  91. package/src/components/Video/native/useNativePlayer.ts +3 -0
  92. package/src/components/Video/native/useNativePlayerFullscreen.ts +44 -0
  93. package/src/components/Video/native/useNativePlayerHistory.ts +69 -0
  94. package/src/components/Video/native/useNativePlayerModal.ts +68 -0
  95. package/src/components/Video/native/useNativePlayerPlaylist.ts +67 -0
  96. package/src/components/Video/native/useNativePlayerState.ts +225 -0
  97. package/src/components/Video/player.ts +99 -0
  98. package/src/components/Video/theme/index.scss +291 -0
  99. package/src/components/Video/theme/videojs.css +1797 -0
  100. package/src/components/Video/useSource.ts +1431 -0
  101. package/src/components/Video/useSubtitlePreference.ts +66 -0
  102. package/src/components/Video/useWebview.ts +79 -0
  103. package/src/components/Video/videoFrame.ts +58 -0
  104. package/src/env.d.ts +3 -0
  105. package/src/i18n/README.md +392 -0
  106. package/src/i18n/index.ts +49 -0
  107. package/src/icons/Video_Player.svg +69 -0
  108. package/src/icons/box.svg +15 -0
  109. package/src/icons/client.svg +17 -0
  110. package/src/icons/logo.svg +28 -0
  111. package/src/icons//344/270/212/344/270/200/344/270/252.svg +6 -0
  112. package/src/icons//344/270/213/344/270/200/344/270/252.svg +4 -0
  113. package/src/icons//344/272/256/345/272/246.svg +13 -0
  114. package/src/icons//345/200/215/351/200/237.svg +14 -0
  115. package/src/icons//345/205/250/345/261/217.svg +16 -0
  116. package/src/icons//345/205/250/351/200/211_/345/267/262/351/200/211/344/270/255.svg +16 -0
  117. package/src/icons//345/205/250/351/200/211_/346/234/252/351/200/211/344/270/255.svg +15 -0
  118. package/src/icons//345/205/263/351/227/255/345/244/232/351/200/211.svg +14 -0
  119. package/src/icons//345/205/263/351/227/255/346/212/225/345/261/217.svg +11 -0
  120. package/src/icons//345/233/236/346/224/266/347/253/231.svg +15 -0
  121. package/src/icons//345/244/261/346/225/210.svg +17 -0
  122. package/src/icons//346/207/222/347/214/253/346/222/255/346/224/276/345/231/250-icon.png +0 -0
  123. package/src/icons//346/207/222/347/214/253/346/222/255/346/224/276/345/231/250.png +0 -0
  124. package/src/icons//346/212/225/345/261/217.svg +11 -0
  125. package/src/icons//346/212/225/351/200/201/344/270/255.jpg +0 -0
  126. package/src/icons//346/212/225/351/200/201/344/270/255.svg +21 -0
  127. package/src/icons//346/222/255/346/224/276.svg +3 -0
  128. package/src/icons//346/232/202/345/201/234.svg +4 -0
  129. package/src/icons//346/232/202/346/227/240.svg +21 -0
  130. package/src/icons//346/233/264/345/244/232/346/223/215/344/275/234.svg +11 -0
  131. package/src/icons//347/224/265/350/247/206.svg +18 -0
  132. package/src/icons//347/247/273/345/212/250/347/253/257_/350/203/214/346/231/257.webp +0 -0
  133. package/src/icons//350/203/214/346/231/257.png +0 -0
  134. package/src/icons//350/277/224/345/233/236.svg +13 -0
  135. package/src/icons//350/277/233/345/205/245/345/205/250/345/261/217.svg +13 -0
  136. package/src/icons//351/200/200/345/207/272/345/205/250/345/261/217.svg +15 -0
  137. package/src/icons//351/200/211/346/213/251.svg +15 -0
  138. package/src/icons//351/237/263/351/207/217.svg +13 -0
  139. package/src/index.d.ts +9 -0
  140. package/src/lzc-video-player.scss +7 -0
  141. package/src/lzc-video-player.ts +6 -0
  142. package/src/main.ts +62 -0
  143. package/src/model.ts +77 -0
  144. package/src/quasar-variables.sass +10 -0
  145. package/src/router/index.ts +74 -0
  146. package/src/stores/pinia.ts +3 -0
  147. package/src/stores/playlist.ts +146 -0
  148. package/src/use/useKeyBind.ts +61 -0
  149. package/src/use/useMultipleEdit.ts +60 -0
  150. package/src/use/useSdk.ts +5 -0
  151. package/src/use/useSubtitle.ts +39 -0
  152. package/src/use/useUtils.ts +22 -0
  153. package/src/use/useVideoFrame.ts +60 -0
  154. package/src/views/Home.ts +99 -0
  155. package/src/views/mobile/Home.vue +246 -0
  156. package/src/views/mobile/Player.vue +141 -0
  157. package/tailwind.config.js +15 -0
  158. package/tsconfig.config.json +8 -0
  159. package/tsconfig.json +20 -0
  160. package/vite.config.lib.ts +88 -0
  161. package/vite.config.ts +122 -0
  162. package/vue-shim.d.ts +4 -0
package/.dockerignore ADDED
@@ -0,0 +1 @@
1
+ *
package/.eslintrc.cjs ADDED
@@ -0,0 +1,18 @@
1
+ /* eslint-env node */
2
+ require("@rushstack/eslint-patch/modern-module-resolution")
3
+
4
+ module.exports = {
5
+ root: true,
6
+ extends: [
7
+ "plugin:vue/vue3-essential",
8
+ "eslint:recommended",
9
+ "@vue/eslint-config-typescript",
10
+ "@vue/eslint-config-prettier",
11
+ ],
12
+ rules: {
13
+ "vue/multi-word-component-names": "warn",
14
+ },
15
+ parserOptions: {
16
+ ecmaVersion: "latest",
17
+ },
18
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "printWidth": 80,
3
+ "semi": false,
4
+ "trailingComma": "all"
5
+ }
package/AGENTS.md ADDED
@@ -0,0 +1,31 @@
1
+ # LZC Video Player - Agent Guide
2
+
3
+ 本项目已切换为原生 `<video>` 播放器,禁止引入或恢复 `video.js` 相关依赖与实现。请优先阅读此文件后再改动代码。
4
+
5
+ ## 目标与约束
6
+ - 播放器核心使用原生 `<video>`,功能保持不变。
7
+ - 保留现有 UI/交互逻辑与业务行为,禁止删功能。
8
+ - 不要新增 `video.js`、`videojs-*` 依赖或引用。
9
+
10
+ ## 关键入口与结构
11
+ - 播放器主组件:`src/components/Video/NativeVideoPlayer.vue`
12
+ - 原生播放器实现:`src/components/Video/native/NativePlayer.ts`
13
+ - 统一播放器接口:`src/components/Video/player.ts`
14
+ - 播放器 overlay:`src/components/Video/components/LzcOverlay/`
15
+ - 原生控制条:`src/components/Video/native/NativeControls.vue`
16
+ - 播放源/清晰度/字幕逻辑:`src/components/Video/useSource.ts`
17
+
18
+ ## 运行与验证
19
+ - 类型检查:`npm run type-check`
20
+ - 构建:`npm run build`
21
+ - 仅打包:`npm run build-only`
22
+
23
+ ## 约定与注意事项
24
+ - 保持 `LzcPlayer` 接口完整,避免破坏依赖它的业务层。
25
+ - 新增逻辑尽量放在 `native/` 或 `use*` 中,保持组件薄。
26
+ - 对视频事件的兼容依赖 `NativePlayer` 触发,谨慎改动事件名。
27
+ - Overlay/controls 的显隐逻辑使用现有 class 体系(如 `vjs-*`)以复用样式。
28
+
29
+ ## 排错建议
30
+ - 播放相关行为异常,先检查 `NativePlayer.ts` 事件触发与状态同步。
31
+ - 清晰度/字幕问题,先看 `useSource.ts` 与 `NativePlayer.qualityLevels()` 兼容 stub。
package/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # 懒猫云应用
2
+
3
+ ## 构建
4
+
5
+ ```
6
+ lzc-cli project build -o you-awesome.lpk
7
+ ```
8
+
9
+ 将会在当前的目录下构建出一个 lpk 包。
10
+
11
+ ## 安装
12
+
13
+ ```
14
+ lzc-cli app install you-awesome.lpk
15
+ ```
16
+
17
+ ## 开发
18
+
19
+ ```
20
+ lzc-cli project devshell -b
21
+ ```
22
+
23
+ ## 成为懒猫云应用开发者
24
+
25
+ 在 https://developer.lazycat.cloud/ 注册一个开发者帐号,注册开发者帐号后,你可以申请自己的应用,并发布到[商店](https://appstore.lazycat.cloud/)中。
26
+
27
+ ## 使用 lzc-cli 发布应用
28
+
29
+ 在你申请应用成功后,后面的应用升级可以直接通过 `lzc-cli` 进行发布
30
+ `lzc-cli appstore publish <lpk包地址>`
31
+
32
+ # 查看发布的应用
33
+
34
+ 发布成功后,你可以在 https://appstore.lazycat.cloud/#/shop 中查看你的应用。
35
+
36
+ ## 交流和帮助
37
+
38
+ 你可以在 https://bbs.lazycat.cloud/ 畅所欲言。
package/build.sh ADDED
@@ -0,0 +1,10 @@
1
+ #!/bin/sh
2
+
3
+ export VERSION=$(cat lzc-manifest.yml | grep "^version:" | awk '{print $2}')
4
+
5
+ rm -rf build
6
+ mkdir -p build
7
+
8
+ npm run build
9
+ cp -r error_pages/* build/
10
+ cp -r dist build/dist
@@ -0,0 +1,3 @@
1
+ {
2
+ "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
3
+ }
package/demo/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # demo
2
+
3
+ This template should help get you started developing with Vue 3 in Vite.
4
+
5
+ ## Recommended IDE Setup
6
+
7
+ [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
8
+
9
+ ## Type Support for `.vue` Imports in TS
10
+
11
+ TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
12
+
13
+ If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
14
+
15
+ 1. Disable the built-in TypeScript Extension
16
+ 1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette
17
+ 2. Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
18
+ 2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
19
+
20
+ ## Customize configuration
21
+
22
+ See [Vite Configuration Reference](https://vitejs.dev/config/).
23
+
24
+ ## Project Setup
25
+
26
+ ```sh
27
+ npm install
28
+ ```
29
+
30
+ ### Compile and Hot-Reload for Development
31
+
32
+ ```sh
33
+ npm run dev
34
+ ```
35
+
36
+ ### Type-Check, Compile and Minify for Production
37
+
38
+ ```sh
39
+ npm run build
40
+ ```
package/demo/env.d.ts ADDED
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" href="/favicon.ico" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Vite App</title>
8
+ </head>
9
+ <body>
10
+ <div id="app"></div>
11
+ <script type="module" src="/src/main.ts"></script>
12
+ </body>
13
+ </html>