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
Binary file
Binary file
Binary file
package/src/App.vue ADDED
@@ -0,0 +1,18 @@
1
+ <template>
2
+ <div class="app-content h-full">
3
+ <router-view class="router-view"></router-view>
4
+ </div>
5
+ </template>
6
+ <style lang="scss" scoped>
7
+ .app-content {
8
+ flex: 1;
9
+ display: flex;
10
+ flex-direction: column;
11
+ background: #000;
12
+ }
13
+ .router-view {
14
+ flex: 1;
15
+ min-height: 0;
16
+ background: #000;
17
+ }
18
+ </style>
@@ -0,0 +1,104 @@
1
+ html {
2
+ height: 100vh;
3
+ // 默认的 font-size 为 16px,指定为 62.5% 后,其他地方 1rem = 10px, 1.4rem = 14px
4
+ font-size: 10px; // 16px * 0.625 = 10px;
5
+ }
6
+
7
+ body {
8
+ width: 100vw;
9
+ height: 100%;
10
+ overflow: hidden;
11
+ }
12
+
13
+ :root {
14
+ --lzc-safe-area-inset-bottom: var(
15
+ --lzc-safe-area-bottom,
16
+ env(safe-area-inset-bottom, 0px)
17
+ );
18
+ --lzc-safe-area-inset-top: var(
19
+ --lzc-safe-area-top,
20
+ env(safe-area-inset-top, 0px)
21
+ );
22
+ --lzc-safe-area-inset-left: var(
23
+ --lzc-safe-area-left,
24
+ env(safe-area-inset-left, 0px)
25
+ );
26
+ --lzc-safe-area-inset-right: var(
27
+ --lzc-safe-area-right,
28
+ env(safe-area-inset-right, 0px)
29
+ );
30
+ --lzc-client-safearea-view-width: var(--lzc-safe-area-view-width, 36px);
31
+ --lzc-client-safearea-view-height: var(--lzc-safe-area-view-height, 32px);
32
+ --lzc-client-safearea-view-top: var(--lzc-safe-area-inset-top, 6px);
33
+ --lzc-client-safearea-view-right: var(--lzc-safe-area-inset-right, 16px);
34
+ }
35
+
36
+ .lzc-safe-area-top-bar {
37
+ box-sizing: border-box;
38
+ padding-top: var(--lzc-safe-area-inset-top);
39
+ }
40
+
41
+ .lzc-safe-area-bottom-bar {
42
+ box-sizing: border-box;
43
+ padding-bottom: var(--lzc-safe-area-inset-bottom);
44
+ }
45
+
46
+ .lzc-safe-area-top-44 {
47
+ height: calc(44px + var(--lzc-safe-area-inset-top));
48
+ min-height: calc(44px + var(--lzc-safe-area-inset-top));
49
+ }
50
+
51
+ .lzc-safe-area-bottom-50 {
52
+ height: calc(50px + var(--lzc-safe-area-inset-bottom));
53
+ min-height: calc(50px + var(--lzc-safe-area-inset-bottom));
54
+ }
55
+
56
+ .lzc-preview-content-safe-area {
57
+ box-sizing: border-box;
58
+ padding-top: var(--lzc-safe-area-inset-top);
59
+ padding-bottom: var(--lzc-safe-area-inset-bottom);
60
+ }
61
+
62
+ ::-webkit-scrollbar {
63
+ width: 4px;
64
+ }
65
+
66
+ ::-webkit-scrollbar-thumb {
67
+ background-color: #d6d6dd;
68
+ border-radius: 9999px;
69
+ }
70
+
71
+ ::-webkit-scrollbar-track {
72
+ background: transparent;
73
+ }
74
+
75
+ @supports (-webkit-touch-callout: none) {
76
+ /* 解决ios中,整个页面会被弹性下拉上滑的问题 */
77
+ body {
78
+ width: 100vw;
79
+ height: -webkit-fill-available;
80
+ overflow: hidden;
81
+ position: fixed;
82
+ top: 0;
83
+ left: 0;
84
+ }
85
+ }
86
+
87
+ #app {
88
+ width: 100%;
89
+ height: 100%;
90
+ background: #0a1414;
91
+
92
+ transition: color 0.5s, background-color 0.5s;
93
+ line-height: 1.6;
94
+ font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
95
+ Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue",
96
+ sans-serif;
97
+ font-size: 1.5rem;
98
+ text-rendering: optimizeLegibility;
99
+ -webkit-font-smoothing: antialiased;
100
+ -moz-osx-font-smoothing: grayscale;
101
+
102
+ display: flex;
103
+ flex-direction: column;
104
+ }
Binary file
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 261.76 226.69" xmlns:v="https://vecta.io/nano"><path d="M161.096.001l-30.225 52.351L100.647.001H-.005l130.877 226.688L261.749.001z" fill="#41b883"/><path d="M161.096.001l-30.225 52.351L100.647.001H52.346l78.526 136.01L209.398.001z" fill="#34495e"/></svg>
@@ -0,0 +1,96 @@
1
+ <script lang="ts" setup>
2
+ import { useDialogPluginComponent } from "quasar"
3
+ import { t } from "@/i18n"
4
+
5
+ const props = defineProps<{
6
+ title: string
7
+ desc?: string
8
+ confirm?: () => void
9
+ }>()
10
+
11
+ const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } =
12
+ useDialogPluginComponent()
13
+
14
+ function onOk() {
15
+ onDialogOK()
16
+ props?.confirm?.()
17
+ }
18
+ </script>
19
+
20
+ <template>
21
+ <div class="lzc-video-player">
22
+ <q-dialog ref="dialogRef" @hide="onDialogHide">
23
+ <div class="card">
24
+ <span class="title">{{ title }}</span>
25
+ <span class="subtitle" v-if="desc">{{ desc }}</span>
26
+ <div class="buttons">
27
+ <span class="cancel" @click="onDialogCancel">{{
28
+ t("src.components.dialog.index.cancel", "取消")
29
+ }}</span>
30
+ <span class="confirm" @click="onOk">{{
31
+ t("src.components.dialog.index.confirm", "确定")
32
+ }}</span>
33
+ </div>
34
+ </div>
35
+ </q-dialog>
36
+ </div>
37
+ </template>
38
+
39
+ <style lang="scss" scoped>
40
+ .card {
41
+ min-width: 29rem;
42
+ min-height: 16rem;
43
+ background: #202020;
44
+ border-radius: 1rem;
45
+ padding: 2.2rem 2.4rem;
46
+
47
+ display: flex;
48
+ flex-direction: column;
49
+ align-items: center;
50
+ color: #fff;
51
+ }
52
+
53
+ .title {
54
+ height: 2.5rem;
55
+ font-size: 1.8rem;
56
+ font-weight: 600;
57
+ line-height: 2.5rem;
58
+ }
59
+
60
+ .subtitle {
61
+ height: 2rem;
62
+ font-size: 1.4rem;
63
+ font-weight: 400;
64
+ line-height: 2rem;
65
+ margin-bottom: 2rem;
66
+ margin-top: 0.9rem;
67
+ }
68
+
69
+ .buttons {
70
+ display: flex;
71
+ column-gap: 2.2rem;
72
+
73
+ > span {
74
+ width: 11rem;
75
+ height: 4rem;
76
+ border-radius: 0.6rem;
77
+ display: inline-flex;
78
+ justify-content: center;
79
+ align-items: center;
80
+
81
+ font-size: 1.4rem;
82
+ font-weight: 400;
83
+ line-height: 2rem;
84
+ }
85
+
86
+ .cancel {
87
+ cursor: pointer;
88
+ background: rgba(255, 255, 255, 0.1);
89
+ }
90
+
91
+ .confirm {
92
+ cursor: pointer;
93
+ background: #5f86ff;
94
+ }
95
+ }
96
+ </style>
@@ -0,0 +1,39 @@
1
+ <script lang="ts" setup>
2
+ defineProps<{
3
+ keyValue: string
4
+ selectedKeys: string[]
5
+ }>()
6
+
7
+ const namespace = "page-title-edit"
8
+ </script>
9
+
10
+ <template>
11
+ <div :class="`${namespace}-toggle`">
12
+ <q-icon
13
+ name="svguse:#icon-全选_已选中.svg"
14
+ v-if="selectedKeys.includes(keyValue)"
15
+ />
16
+ <div :class="`${namespace}-toggle-unselect`" v-else></div>
17
+ </div>
18
+ </template>
19
+
20
+ <style lang="scss" scoped>
21
+ .page-title-edit {
22
+ &-toggle {
23
+ font-size: 1.6rem;
24
+ width: 100%;
25
+ display: flex;
26
+ justify-content: center;
27
+ cursor: pointer;
28
+ padding: 2.4rem;
29
+
30
+ &-unselect {
31
+ width: 1.6rem;
32
+ height: 1.6rem;
33
+ background: rgba(255, 255, 255, 0.06);
34
+ border-radius: 8px;
35
+ border: 1px solid rgba(255, 255, 255, 0.2);
36
+ }
37
+ }
38
+ }
39
+ </style>