@vtx/player 0.0.3 → 0.0.6

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 (90) hide show
  1. package/.eslintignore +11 -0
  2. package/.eslintrc.js +31 -0
  3. package/.prettierignore +10 -0
  4. package/.prettierrc.js +22 -0
  5. package/.storybook/main.js +58 -0
  6. package/.storybook/manager.js +7 -0
  7. package/.storybook/preview-head.html +5 -0
  8. package/.storybook/preview.js +9 -0
  9. package/.storybook/proxy.js +6 -0
  10. package/.storybook/theme.js +8 -0
  11. package/.stylelintrc.json +13 -0
  12. package/.vscode/extensions.json +10 -0
  13. package/.vscode/settings.json +16 -0
  14. package/README.md +2 -2
  15. package/commitlint.config.js +10 -0
  16. package/package.json +98 -100
  17. package/public/h5player.min.js +311 -0
  18. package/public/playctrl1/AudioRenderer.js +225 -0
  19. package/public/playctrl1/DecodeWorker.js +711 -0
  20. package/public/playctrl1/Decoder.js +1 -0
  21. package/public/playctrl1/SuperRender_10.js +396 -0
  22. package/public/playctrl2/Decoder.js +21 -0
  23. package/public/playctrl2/Decoder.wasm +0 -0
  24. package/public/playctrl2/Decoder.worker.js +1 -0
  25. package/public/playctrl3/Decoder.js +21 -0
  26. package/public/playctrl3/Decoder.wasm +0 -0
  27. package/public/playctrl3/Decoder.worker.js +1 -0
  28. package/rollup.config.js +52 -0
  29. package/src/api/fetch.ts +55 -0
  30. package/src/api/index.ts +43 -0
  31. package/{dist/types/api/types.d.ts → src/api/types.ts} +131 -117
  32. package/src/components/bill-player/index.less +58 -0
  33. package/src/components/bill-player/index.stories.mdx +24 -0
  34. package/src/components/bill-player/index.stories.tsx +13 -0
  35. package/src/components/bill-player/index.tsx +267 -0
  36. package/src/components/controls/images/arrow.png +0 -0
  37. package/src/components/controls/images/error.png +0 -0
  38. package/src/components/controls/index.less +182 -0
  39. package/src/components/controls/index.tsx +312 -0
  40. package/src/components/history-control/images/collapse.png +0 -0
  41. package/src/components/history-control/index.less +211 -0
  42. package/src/components/history-control/index.stories.mdx +62 -0
  43. package/src/components/history-control/index.stories.tsx +130 -0
  44. package/src/components/history-control/index.tsx +368 -0
  45. package/src/components/history-player/index.less +98 -0
  46. package/src/components/history-player/index.stories.mdx +38 -0
  47. package/src/components/history-player/index.stories.tsx +12 -0
  48. package/src/components/history-player/index.tsx +206 -0
  49. package/src/components/live-channel-player/index.stories.mdx +29 -0
  50. package/src/components/live-channel-player/index.stories.tsx +11 -0
  51. package/src/components/live-channel-player/index.tsx +75 -0
  52. package/src/components/live-control/index.less +65 -0
  53. package/src/components/live-control/index.stories.mdx +64 -0
  54. package/src/components/live-control/index.stories.tsx +61 -0
  55. package/src/components/live-control/index.tsx +274 -0
  56. package/src/components/live-player/index.less +71 -0
  57. package/src/components/live-player/index.stories.mdx +35 -0
  58. package/src/components/live-player/index.stories.tsx +12 -0
  59. package/src/components/live-player/index.tsx +118 -0
  60. package/src/components/player/index.ts +318 -0
  61. package/src/context/index.ts +13 -0
  62. package/src/hooks/useSettings.tsx +14 -0
  63. package/src/icons/index.less +27 -0
  64. package/src/icons/index.tsx +518 -0
  65. package/{dist/types/main.d.ts → src/main.ts} +9 -8
  66. package/src/stories/intro.stories.mdx +16 -0
  67. package/src/typings/@vtx/utils/index.d.ts +27 -0
  68. package/src/typings/h5player.d.ts +133 -0
  69. package/src/utils/index.ts +215 -0
  70. package/src/vite-env.d.ts +1 -0
  71. package/tsconfig.json +24 -0
  72. package/dist/index.d.ts +0 -223
  73. package/dist/index.es.js +0 -533
  74. package/dist/index.es.js.map +0 -1
  75. package/dist/index.umd.js +0 -533
  76. package/dist/index.umd.js.map +0 -1
  77. package/dist/types/api/fetch.d.ts +0 -12
  78. package/dist/types/api/index.d.ts +0 -16
  79. package/dist/types/components/bill-player/index.d.ts +0 -21
  80. package/dist/types/components/controls/index.d.ts +0 -52
  81. package/dist/types/components/history-control/index.d.ts +0 -39
  82. package/dist/types/components/history-player/index.d.ts +0 -31
  83. package/dist/types/components/live-channel-player/index.d.ts +0 -18
  84. package/dist/types/components/live-control/index.d.ts +0 -35
  85. package/dist/types/components/live-player/index.d.ts +0 -22
  86. package/dist/types/components/player/index.d.ts +0 -84
  87. package/dist/types/context/index.d.ts +0 -8
  88. package/dist/types/hooks/useSettings.d.ts +0 -9
  89. package/dist/types/icons/index.d.ts +0 -54
  90. package/dist/types/utils/index.d.ts +0 -60
package/.eslintignore ADDED
@@ -0,0 +1,11 @@
1
+ dist
2
+ node_modules
3
+ .cache
4
+ *.lock
5
+ .gitignore
6
+ .npmignore
7
+ .prettierignore
8
+ *.snap
9
+ .gitlab-ci.yml
10
+ storybook-static
11
+ *.js
package/.eslintrc.js ADDED
@@ -0,0 +1,31 @@
1
+ module.exports = {
2
+ parser: '@typescript-eslint/parser',
3
+ extends: [
4
+ 'eslint:recommended',
5
+ 'plugin:react/recommended',
6
+ 'plugin:@typescript-eslint/recommended',
7
+ 'prettier',
8
+ 'plugin:storybook/recommended',
9
+ ],
10
+ parserOptions: {
11
+ ecmaVersion: 'latest',
12
+ sourceType: 'module',
13
+ ecmaFeatures: {
14
+ jsx: true,
15
+ },
16
+ },
17
+ plugins: ['react', 'react-hooks', '@typescript-eslint', 'prettier'],
18
+ rules: {
19
+ 'react/react-in-jsx-scope': 'off',
20
+ 'react/prop-types': 'off',
21
+ },
22
+ env: {
23
+ browser: true,
24
+ es2021: true,
25
+ },
26
+ settings: {
27
+ 'import/resolver': {
28
+ typescript: {},
29
+ },
30
+ },
31
+ };
@@ -0,0 +1,10 @@
1
+ dist
2
+ node_modules
3
+ .cache
4
+ *.lock
5
+ .gitignore
6
+ .npmignore
7
+ .prettierignore
8
+ *.snap
9
+ .gitlab-ci.yml
10
+ storybook-static
package/.prettierrc.js ADDED
@@ -0,0 +1,22 @@
1
+ module.exports = {
2
+ // 一行最多 100 字符
3
+ printWidth: 100,
4
+ // 使用4个空格缩进
5
+ tabWidth: 4,
6
+ // 使用单引号
7
+ singleQuote: true,
8
+ // 复写样式
9
+ overrides: [
10
+ {
11
+ files: ['vite.config.ts', '*.js', '*.json'],
12
+ options: {
13
+ tabWidth: 2,
14
+ },
15
+ },
16
+ ],
17
+ /** import顺序 */
18
+ importOrder: ['index.less', '^react(.*)$', '^(?!(@/|./))(.*)$', '^@/(.*)$', '^[./]'],
19
+ /** import后添加分号 */
20
+ importOrderSeparation: true,
21
+ importOrderSortSpecifiers: true,
22
+ };
@@ -0,0 +1,58 @@
1
+ const { mergeConfig } = require('vite');
2
+ const { createStyleImportPlugin, AntdResolve } = require('vite-plugin-style-import');
3
+ // const { viteCommonjs, esbuildCommonjs } = require('@originjs/vite-plugin-commonjs');
4
+ const proxy = require('./proxy');
5
+ const path = require('path');
6
+
7
+ module.exports = {
8
+ stories: [
9
+ '../src/stories/intro.stories.mdx', // 入口文件
10
+ '../src/**/*.stories.mdx',
11
+ '../src/**/*.stories.@(js|jsx|ts|tsx)',
12
+ ],
13
+ addons: [
14
+ '@storybook/addon-links',
15
+ '@storybook/addon-essentials',
16
+ '@storybook/addon-interactions',
17
+ ],
18
+ framework: '@storybook/react',
19
+ core: {
20
+ builder: '@storybook/builder-vite',
21
+ },
22
+ features: {
23
+ storyStoreV7: true,
24
+ },
25
+ staticDirs: ['../public'], // 静态资源路径
26
+ async viteFinal(config) {
27
+ return mergeConfig(config, {
28
+ server: {
29
+ // 配置代理
30
+ proxy,
31
+ },
32
+ // 当第三方库没有导出esm模式文件时,启用此插件
33
+ // optimizeDeps: {
34
+ // esbuildOptions: {
35
+ // plugins: [esbuildCommonjs(['package-name'])],
36
+ // },
37
+ // },
38
+ css: {
39
+ preprocessorOptions: {
40
+ less: {
41
+ javascriptEnabled: true,
42
+ },
43
+ },
44
+ },
45
+ // antd组件库样式自动引入
46
+ plugins: [
47
+ // viteCommonjs(),
48
+ createStyleImportPlugin({
49
+ resolves: [AntdResolve()],
50
+ }),
51
+ ],
52
+ resolve: {
53
+ // 设置别名
54
+ alias: { '@': path.resolve(__dirname, '../src') },
55
+ },
56
+ });
57
+ },
58
+ };
@@ -0,0 +1,7 @@
1
+ import { addons } from '@storybook/addons';
2
+
3
+ import theme from './theme';
4
+
5
+ addons.setConfig({
6
+ theme,
7
+ });
@@ -0,0 +1,5 @@
1
+ <script>
2
+ window.global = window;
3
+ </script>
4
+ <script src="./h5player.min.js"></script>
5
+ <link rel="stylesheet" href="../node_modules/antd/dist/antd.css" />
@@ -0,0 +1,9 @@
1
+ export const parameters = {
2
+ actions: { argTypesRegex: "^on[A-Z].*" },
3
+ controls: {
4
+ matchers: {
5
+ color: /(background|color)$/i,
6
+ date: /Date$/,
7
+ },
8
+ },
9
+ }
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ '/cloud/': {
3
+ target: 'https://kanbandev.cloudhw.cn:8446/',
4
+ changeOrigin: true,
5
+ },
6
+ };
@@ -0,0 +1,8 @@
1
+ import { create } from '@storybook/theming';
2
+
3
+ export default create({
4
+ base: 'light',
5
+ brandTitle: '@vtx/player', // 标题
6
+ brandUrl: 'https://git.cloudhw.cn:3443/comopnent/url', // 链接地址
7
+ brandTarget: '_self',
8
+ });
@@ -0,0 +1,13 @@
1
+ {
2
+ "extends": [
3
+ "stylelint-config-standard",
4
+ "stylelint-config-prettier",
5
+ "stylelint-config-recommended",
6
+ "stylelint-config-recess-order"
7
+ ],
8
+ "plugins": ["stylelint-order"],
9
+ "rules": {
10
+ "selector-class-pattern": null
11
+ },
12
+ "ignoreFiles": ["node_modules/**", "dist/**/*", "storybook-static/**"]
13
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "recommendations": [
3
+ // eslint插件
4
+ "dbaeumer.vscode-eslint",
5
+ // prettier插件
6
+ "esbenp.prettier-vscode",
7
+ // stylelint插件
8
+ "stylelint.vscode-stylelint"
9
+ ]
10
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "css.validate": false,
3
+ "less.validate": false,
4
+ "scss.validate": false,
5
+ "editor.codeActionsOnSave": {
6
+ // 自动修复stylelint错误
7
+ "source.fixAll.stylelint": true
8
+ },
9
+ "cSpell.words": [
10
+ "ahooks",
11
+ "commitlint",
12
+ "esbuild",
13
+ "vite",
14
+ "YYYYMMDDTH"
15
+ ]
16
+ }
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # vtx-vis
2
-
1
+ # vtx-vis
2
+
3
3
  视频业务组件
@@ -0,0 +1,10 @@
1
+ module.exports = {
2
+ extends: ['@commitlint/config-conventional'],
3
+ rules: {
4
+ 'type-enum': [
5
+ 2,
6
+ 'always',
7
+ ['build', 'ci', 'docs', 'feat', 'fix', 'perf', 'chore', 'refactor', 'style', 'test'],
8
+ ],
9
+ },
10
+ };
package/package.json CHANGED
@@ -1,100 +1,98 @@
1
- {
2
- "name": "@vtx/player",
3
- "version": "0.0.3",
4
- "private": false,
5
- "description": "视频业务组件",
6
- "main": "./dist/index.umd.js",
7
- "module": "./dist/index.es.js",
8
- "types": "./dist/index.d.ts",
9
- "files": [
10
- "dist"
11
- ],
12
- "scripts": {
13
- "start": "start-storybook -p 6006",
14
- "build": "npm run clean && rollup --config",
15
- "build-docs": "build-storybook",
16
- "lint:script": "eslint src --ext .ts,.tsx",
17
- "lint:style": "stylelint src/**/*.less --custom-syntax postcss-less --fix",
18
- "clean": "rimraf dist"
19
- },
20
- "husky": {
21
- "hooks": {
22
- "pre-commit": "lint-staged",
23
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
24
- }
25
- },
26
- "lint-staged": {
27
- "src/**/*.{ts,tsx,less,md,mdx,json}": "npm run lint:script",
28
- "src/**/*.{less}": "npm run lint:style"
29
- },
30
- "peerDependencies": {
31
- "react": ">=16.9.0",
32
- "react-dom": ">=16.9.0"
33
- },
34
- "dependencies": {
35
- "ahooks": "^3.4.0",
36
- "antd": "^4.20.7",
37
- "flv.js": "^1.6.2",
38
- "hls.js": "^1.1.5",
39
- "js-base64": "^3.7.2",
40
- "react-collapsed": "^3.3.2"
41
- },
42
- "devDependencies": {
43
- "@babel/core": "^7.18.2",
44
- "@babel/preset-env": "^7.18.2",
45
- "@commitlint/cli": "^17.0.2",
46
- "@commitlint/config-conventional": "^17.0.2",
47
- "@rollup/plugin-babel": "^5.3.1",
48
- "@rollup/plugin-commonjs": "^22.0.0",
49
- "@rollup/plugin-node-resolve": "^13.3.0",
50
- "@rollup/plugin-typescript": "^8.3.2",
51
- "@rollup/plugin-url": "^7.0.0",
52
- "@storybook/addon-actions": "^6.5.7",
53
- "@storybook/addon-essentials": "^6.5.7",
54
- "@storybook/addon-interactions": "^6.5.7",
55
- "@storybook/addon-links": "^6.5.7",
56
- "@storybook/builder-vite": "^0.1.36",
57
- "@storybook/react": "^6.5.7",
58
- "@storybook/testing-library": "^0.0.11",
59
- "@trivago/prettier-plugin-sort-imports": "^3.2.0",
60
- "@types/react": "^18.0.0",
61
- "@types/react-dom": "^18.0.0",
62
- "@typescript-eslint/eslint-plugin": "^5.26.0",
63
- "@typescript-eslint/parser": "^5.26.0",
64
- "@vitejs/plugin-react": "^1.3.0",
65
- "consola": "^2.15.3",
66
- "eslint": "^8.16.0",
67
- "eslint-config-prettier": "^8.5.0",
68
- "eslint-import-resolver-typescript": "^2.7.1",
69
- "eslint-plugin-import": "^2.26.0",
70
- "eslint-plugin-prettier": "^4.0.0",
71
- "eslint-plugin-react": "^7.30.0",
72
- "eslint-plugin-react-hooks": "^4.5.0",
73
- "eslint-plugin-storybook": "^0.5.12",
74
- "husky": "^8.0.1",
75
- "less": "^4.1.2",
76
- "lint-staged": "^13.0.1",
77
- "postcss": "^8.4.14",
78
- "postcss-less": "^6.0.0",
79
- "prettier": "^2.6.2",
80
- "react": "^18.1.0",
81
- "react-dom": "^18.1.0",
82
- "rimraf": "^3.0.2",
83
- "rollup-plugin-dts": "^4.2.2",
84
- "rollup-plugin-peer-deps-external": "^2.2.4",
85
- "rollup-plugin-postcss": "^4.0.2",
86
- "rollup-plugin-terser": "^7.0.2",
87
- "stylelint": "^14.8.5",
88
- "stylelint-config-prettier": "^9.0.3",
89
- "stylelint-config-recess-order": "^3.0.0",
90
- "stylelint-config-recommended": "^7.0.0",
91
- "stylelint-config-standard": "^25.0.0",
92
- "stylelint-order": "^5.0.0",
93
- "typescript": "^4.6.3",
94
- "vite": "^2.9.9",
95
- "vite-plugin-style-import": "^2.0.0"
96
- },
97
- "repository": "https://git.cloudhw.cn:3443/front-end/business/vtx-vis.git",
98
- "author": "chenxinyu <chenxinyu@vortexInfo.cn>",
99
- "license": "MIT"
100
- }
1
+ {
2
+ "name": "@vtx/player",
3
+ "version": "0.0.6",
4
+ "private": false,
5
+ "description": "视频业务组件",
6
+ "main": "./dist/index.umd.js",
7
+ "module": "./dist/index.es.js",
8
+ "types": "./dist/index.d.ts",
9
+ "file": "dist",
10
+ "scripts": {
11
+ "start": "start-storybook -p 6006",
12
+ "build": "npm run clean && rollup --config",
13
+ "build-docs": "build-storybook",
14
+ "lint:script": "eslint src --ext .ts,.tsx",
15
+ "lint:style": "stylelint src/**/*.less --custom-syntax postcss-less --fix",
16
+ "clean": "rimraf dist"
17
+ },
18
+ "husky": {
19
+ "hooks": {
20
+ "pre-commit": "lint-staged",
21
+ "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
22
+ }
23
+ },
24
+ "lint-staged": {
25
+ "src/**/*.{ts,tsx,less,md,mdx,json}": "npm run lint:script",
26
+ "src/**/*.{less}": "npm run lint:style"
27
+ },
28
+ "peerDependencies": {
29
+ "react": ">=16.9.0",
30
+ "react-dom": ">=16.9.0"
31
+ },
32
+ "dependencies": {
33
+ "ahooks": "^3.4.0",
34
+ "antd": "^4.20.7",
35
+ "flv.js": "^1.6.2",
36
+ "hls.js": "^1.1.5",
37
+ "js-base64": "^3.7.2",
38
+ "react-collapsed": "^3.3.2"
39
+ },
40
+ "devDependencies": {
41
+ "@babel/core": "^7.18.2",
42
+ "@babel/preset-env": "^7.18.2",
43
+ "@commitlint/cli": "^17.0.2",
44
+ "@commitlint/config-conventional": "^17.0.2",
45
+ "@rollup/plugin-babel": "^5.3.1",
46
+ "@rollup/plugin-commonjs": "^22.0.0",
47
+ "@rollup/plugin-node-resolve": "^13.3.0",
48
+ "@rollup/plugin-typescript": "^8.3.2",
49
+ "@rollup/plugin-url": "^7.0.0",
50
+ "@storybook/addon-actions": "^6.5.7",
51
+ "@storybook/addon-essentials": "^6.5.7",
52
+ "@storybook/addon-interactions": "^6.5.7",
53
+ "@storybook/addon-links": "^6.5.7",
54
+ "@storybook/builder-vite": "^0.1.36",
55
+ "@storybook/react": "^6.5.7",
56
+ "@storybook/testing-library": "^0.0.11",
57
+ "@trivago/prettier-plugin-sort-imports": "^3.2.0",
58
+ "@types/react": "^18.0.0",
59
+ "@types/react-dom": "^18.0.0",
60
+ "@typescript-eslint/eslint-plugin": "^5.26.0",
61
+ "@typescript-eslint/parser": "^5.26.0",
62
+ "@vitejs/plugin-react": "^1.3.0",
63
+ "consola": "^2.15.3",
64
+ "eslint": "^8.16.0",
65
+ "eslint-config-prettier": "^8.5.0",
66
+ "eslint-import-resolver-typescript": "^2.7.1",
67
+ "eslint-plugin-import": "^2.26.0",
68
+ "eslint-plugin-prettier": "^4.0.0",
69
+ "eslint-plugin-react": "^7.30.0",
70
+ "eslint-plugin-react-hooks": "^4.5.0",
71
+ "eslint-plugin-storybook": "^0.5.12",
72
+ "husky": "^8.0.1",
73
+ "less": "^4.1.2",
74
+ "lint-staged": "^13.0.1",
75
+ "postcss": "^8.4.14",
76
+ "postcss-less": "^6.0.0",
77
+ "prettier": "^2.6.2",
78
+ "react": "^18.1.0",
79
+ "react-dom": "^18.1.0",
80
+ "rimraf": "^3.0.2",
81
+ "rollup-plugin-dts": "^4.2.2",
82
+ "rollup-plugin-peer-deps-external": "^2.2.4",
83
+ "rollup-plugin-postcss": "^4.0.2",
84
+ "rollup-plugin-terser": "^7.0.2",
85
+ "stylelint": "^14.8.5",
86
+ "stylelint-config-prettier": "^9.0.3",
87
+ "stylelint-config-recess-order": "^3.0.0",
88
+ "stylelint-config-recommended": "^7.0.0",
89
+ "stylelint-config-standard": "^25.0.0",
90
+ "stylelint-order": "^5.0.0",
91
+ "typescript": "^4.6.3",
92
+ "vite": "^2.9.9",
93
+ "vite-plugin-style-import": "^2.0.0"
94
+ },
95
+ "repository": "https://git.cloudhw.cn:3443/front-end/business/vtx-vis.git",
96
+ "author": "chenxinyu <chenxinyu@vortexInfo.cn>",
97
+ "license": "MIT"
98
+ }