@vtx/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.
- package/.eslintignore +11 -0
- package/.eslintrc.js +31 -0
- package/.prettierignore +10 -0
- package/.prettierrc.js +22 -0
- package/.storybook/main.js +58 -0
- package/.storybook/manager.js +7 -0
- package/.storybook/preview-head.html +5 -0
- package/.storybook/preview.js +9 -0
- package/.storybook/proxy.js +6 -0
- package/.storybook/theme.js +8 -0
- package/.stylelintrc.json +13 -0
- package/.vscode/extensions.json +10 -0
- package/.vscode/settings.json +16 -0
- package/README.md +3 -0
- package/commitlint.config.js +10 -0
- package/package.json +98 -0
- package/public/h5player.min.js +311 -0
- package/public/playctrl1/AudioRenderer.js +225 -0
- package/public/playctrl1/DecodeWorker.js +711 -0
- package/public/playctrl1/Decoder.js +1 -0
- package/public/playctrl1/SuperRender_10.js +396 -0
- package/public/playctrl2/Decoder.js +21 -0
- package/public/playctrl2/Decoder.wasm +0 -0
- package/public/playctrl2/Decoder.worker.js +1 -0
- package/public/playctrl3/Decoder.js +21 -0
- package/public/playctrl3/Decoder.wasm +0 -0
- package/public/playctrl3/Decoder.worker.js +1 -0
- package/rollup.config.js +52 -0
- package/src/api/fetch.ts +50 -0
- package/src/api/index.ts +44 -0
- package/src/api/types.ts +141 -0
- package/src/components/bill-player/index.less +58 -0
- package/src/components/bill-player/index.stories.mdx +24 -0
- package/src/components/bill-player/index.stories.tsx +14 -0
- package/src/components/bill-player/index.tsx +269 -0
- package/src/components/controls/images/arrow.png +0 -0
- package/src/components/controls/images/error.png +0 -0
- package/src/components/controls/index.less +182 -0
- package/src/components/controls/index.tsx +312 -0
- package/src/components/history-control/images/collapse.png +0 -0
- package/src/components/history-control/index.less +211 -0
- package/src/components/history-control/index.stories.mdx +64 -0
- package/src/components/history-control/index.stories.tsx +140 -0
- package/src/components/history-control/index.tsx +344 -0
- package/src/components/history-player/index.less +98 -0
- package/src/components/history-player/index.stories.mdx +38 -0
- package/src/components/history-player/index.stories.tsx +12 -0
- package/src/components/history-player/index.tsx +205 -0
- package/src/components/live-channel-player/index.stories.mdx +29 -0
- package/src/components/live-channel-player/index.stories.tsx +11 -0
- package/src/components/live-channel-player/index.tsx +79 -0
- package/src/components/live-control/index.less +65 -0
- package/src/components/live-control/index.stories.mdx +66 -0
- package/src/components/live-control/index.stories.tsx +69 -0
- package/src/components/live-control/index.tsx +255 -0
- package/src/components/live-player/index.less +71 -0
- package/src/components/live-player/index.stories.mdx +35 -0
- package/src/components/live-player/index.stories.tsx +12 -0
- package/src/components/live-player/index.tsx +118 -0
- package/src/components/player/index.ts +293 -0
- package/src/context/index.ts +13 -0
- package/src/hooks/useSettings.tsx +14 -0
- package/src/icons/index.less +27 -0
- package/src/icons/index.tsx +518 -0
- package/src/main.ts +9 -0
- package/src/stories/intro.stories.mdx +16 -0
- package/src/typings/@vtx/utils/index.d.ts +27 -0
- package/src/typings/h5player.d.ts +133 -0
- package/src/utils/index.ts +177 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.json +24 -0
|
@@ -0,0 +1,518 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
|
|
3
|
+
import React, { MouseEventHandler } from 'react';
|
|
4
|
+
|
|
5
|
+
import Icon from '@ant-design/icons';
|
|
6
|
+
import type { CustomIconComponentProps } from '@ant-design/icons/lib/components/Icon';
|
|
7
|
+
|
|
8
|
+
interface IconProps extends Partial<CustomIconComponentProps> {
|
|
9
|
+
onClick?: MouseEventHandler<HTMLSpanElement>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface ActiveIconProps extends IconProps {
|
|
13
|
+
active?: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const PauseSvg = () => {
|
|
17
|
+
return (
|
|
18
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
19
|
+
<g transform="translate(-711 -629)">
|
|
20
|
+
<g transform="translate(-192.26 115.214)">
|
|
21
|
+
<rect width="3" height="15.4" rx="1.5" transform="translate(909.76 518.086)" />
|
|
22
|
+
<rect width="3" height="15.4" rx="1.5" transform="translate(917.76 518.086)" />
|
|
23
|
+
</g>
|
|
24
|
+
</g>
|
|
25
|
+
</svg>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const PlaySvg = () => {
|
|
30
|
+
return (
|
|
31
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
32
|
+
<g transform="translate(-663 -629)">
|
|
33
|
+
<path
|
|
34
|
+
d="M206.5,108.605a.416.416,0,0,1-.416-.416V95.227a.416.416,0,0,1,.656-.339l9.274,6.481a.416.416,0,0,1,0,.705l-9.274,6.453A.416.416,0,0,1,206.5,108.605Z"
|
|
35
|
+
transform="translate(464.965 539.291)"
|
|
36
|
+
/>
|
|
37
|
+
</g>
|
|
38
|
+
</svg>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const CaptureSvg = () => {
|
|
43
|
+
return (
|
|
44
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
45
|
+
<g transform="translate(-711 -629)">
|
|
46
|
+
<path
|
|
47
|
+
d="M88.583,130.224H83.589l-.472-1.181a1.754,1.754,0,0,0-1.511-1.023H78.668a1.754,1.754,0,0,0-1.511,1.023l-.472,1.181H75.363a2.2,2.2,0,0,0-2.2,2.2v8.813a2.2,2.2,0,0,0,2.2,2.2h13.22a2.2,2.2,0,0,0,2.2-2.2v-8.813A2.2,2.2,0,0,0,88.583,130.224Zm-6.61,10.282a3.672,3.672,0,1,1,3.672-3.672A3.672,3.672,0,0,1,81.973,140.506Zm5.141-6.977a.734.734,0,1,1,.734-.734A.734.734,0,0,1,87.114,133.529Z"
|
|
48
|
+
transform="translate(641.026 505.268)"
|
|
49
|
+
/>
|
|
50
|
+
</g>
|
|
51
|
+
</svg>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const FullScreenSvg = () => {
|
|
56
|
+
return (
|
|
57
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
58
|
+
<g transform="translate(-860 -680)">
|
|
59
|
+
<path
|
|
60
|
+
d="M65.787,68.768h-3.5a.686.686,0,1,1,0-1.373h3.5V64.169a.686.686,0,0,1,1.373,0V67.4A1.374,1.374,0,0,1,65.787,68.768Zm-9.924,0H52.431A1.374,1.374,0,0,1,51.058,67.4V63.963a.686.686,0,1,1,1.373,0V67.4h3.432a.686.686,0,1,1,0,1.373Zm-4.119-9.679a.686.686,0,0,1-.686-.686V55.039a1.374,1.374,0,0,1,1.373-1.373h3.364a.686.686,0,1,1,0,1.373H52.431V58.4a.686.686,0,0,1-.686.686Zm14.729-.137a.686.686,0,0,1-.686-.686V55.039h-3.5a.686.686,0,0,1,0-1.373h3.5a1.374,1.374,0,0,1,1.373,1.373v3.226A.686.686,0,0,1,66.474,58.952Z"
|
|
61
|
+
transform="translate(812.892 630.783)"
|
|
62
|
+
/>
|
|
63
|
+
<g transform="translate(794.927 616.37)">
|
|
64
|
+
<path
|
|
65
|
+
d="M211.424,213.827h-7.872a1.229,1.229,0,0,1-1.312-1.128v-6.77a1.229,1.229,0,0,1,1.312-1.128h7.872a1.229,1.229,0,0,1,1.312,1.128v6.77A1.229,1.229,0,0,1,211.424,213.827Z"
|
|
66
|
+
transform="translate(-130.415 -133.684)"
|
|
67
|
+
/>
|
|
68
|
+
</g>
|
|
69
|
+
</g>
|
|
70
|
+
</svg>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const ExitFullScreenSvg = () => {
|
|
75
|
+
return (
|
|
76
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
77
|
+
<g transform="translate(-889 -603)">
|
|
78
|
+
<path
|
|
79
|
+
d="M74.507,78.475H69.817a1.405,1.405,0,0,1-1.407-1.407V72.377a1.405,1.405,0,0,1,1.407-1.407h4.691a1.405,1.405,0,0,1,1.407,1.407v4.691A1.405,1.405,0,0,1,74.507,78.475Zm-7.036,4.409a.653.653,0,0,1-.657-.657V80.182a.108.108,0,0,0-.113-.113H64.657a.657.657,0,0,1,0-1.313H66.7a1.425,1.425,0,0,1,1.426,1.426v2.045A.653.653,0,0,1,67.471,82.884Zm-.769-12.2H64.657a.657.657,0,0,1,0-1.313H66.7a.108.108,0,0,0,.113-.113V67.217a.657.657,0,0,1,1.313,0v2.045A1.425,1.425,0,0,1,66.7,70.688Zm13.059,0H77.716a1.425,1.425,0,0,1-1.426-1.426V67.217a.657.657,0,0,1,1.313,0v2.045a.108.108,0,0,0,.113.113h2.045a.657.657,0,0,1,0,1.313Zm-2.815,12.2a.653.653,0,0,1-.657-.657V80.182a1.425,1.425,0,0,1,1.426-1.426h2.045a.657.657,0,0,1,0,1.313H77.716a.108.108,0,0,0-.113.113v2.045A.653.653,0,0,1,76.947,82.884Z"
|
|
80
|
+
transform="translate(828.791 540.278)"
|
|
81
|
+
/>
|
|
82
|
+
</g>
|
|
83
|
+
</svg>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const VolumeSmallSvg = () => {
|
|
88
|
+
return (
|
|
89
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
90
|
+
<g transform="translate(-752 -659)">
|
|
91
|
+
<g transform="translate(-141 38)">
|
|
92
|
+
<path
|
|
93
|
+
style={{ opacity: '0.25' }}
|
|
94
|
+
d="M77.007,120.062a7.285,7.285,0,0,1,0,11.368.624.624,0,1,1-.781-.973,6.037,6.037,0,0,0,0-9.422.624.624,0,1,1,.781-.973Z"
|
|
95
|
+
transform="translate(834.56 507.076)"
|
|
96
|
+
/>
|
|
97
|
+
<path
|
|
98
|
+
d="M63.1,130.527a1.663,1.663,0,0,1-1.663-1.663v-5.821A1.663,1.663,0,0,1,63.1,121.38h3.326l3.484-3.02a1.663,1.663,0,0,1,2.753,1.257V132.29a1.663,1.663,0,0,1-2.753,1.257l-3.484-3.02Z"
|
|
99
|
+
transform="translate(834.56 507.046)"
|
|
100
|
+
/>
|
|
101
|
+
<path
|
|
102
|
+
d="M74.672,122.522a4,4,0,0,1,0,6.863.624.624,0,1,1-.685-1.042,2.757,2.757,0,0,0,0-4.779.624.624,0,1,1,.685-1.042Z"
|
|
103
|
+
transform="translate(834.56 506.581)"
|
|
104
|
+
/>
|
|
105
|
+
</g>
|
|
106
|
+
</g>
|
|
107
|
+
</svg>
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const VolumeLargeSvg = () => {
|
|
112
|
+
return (
|
|
113
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
114
|
+
<g transform="translate(-752 -660)">
|
|
115
|
+
<g transform="translate(-141 39)">
|
|
116
|
+
<path
|
|
117
|
+
d="M77.007,120.062a7.285,7.285,0,0,1,0,11.368.624.624,0,1,1-.781-.973,6.037,6.037,0,0,0,0-9.422.624.624,0,1,1,.781-.973Z"
|
|
118
|
+
transform="translate(834.56 507.076)"
|
|
119
|
+
/>
|
|
120
|
+
<path
|
|
121
|
+
d="M63.1,130.527a1.663,1.663,0,0,1-1.663-1.663v-5.821A1.663,1.663,0,0,1,63.1,121.38h3.326l3.484-3.02a1.663,1.663,0,0,1,2.753,1.257V132.29a1.663,1.663,0,0,1-2.753,1.257l-3.484-3.02Z"
|
|
122
|
+
transform="translate(834.56 507.046)"
|
|
123
|
+
/>
|
|
124
|
+
<path
|
|
125
|
+
d="M74.672,122.522a4,4,0,0,1,0,6.863.624.624,0,1,1-.685-1.042,2.757,2.757,0,0,0,0-4.779.624.624,0,1,1,.685-1.042Z"
|
|
126
|
+
transform="translate(834.56 506.581)"
|
|
127
|
+
/>
|
|
128
|
+
</g>
|
|
129
|
+
</g>
|
|
130
|
+
</svg>
|
|
131
|
+
);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const VolumeMutedSvg = () => {
|
|
135
|
+
return (
|
|
136
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
137
|
+
<g transform="translate(-711 -629)">
|
|
138
|
+
<path
|
|
139
|
+
d="M72.26,118.527a1.663,1.663,0,0,1,.406,1.089V132.29a1.663,1.663,0,0,1-2.753,1.257l-3.484-3.02H63.1a1.663,1.663,0,0,1-1.663-1.663v-5.821a1.663,1.663,0,0,1,1.663-1.663h3.326l3.484-3.02A1.663,1.663,0,0,1,72.26,118.527Zm7.292,4.78a.624.624,0,0,1,0,.881l-1.763,1.763,1.763,1.763a.624.624,0,1,1-.881.881l-1.763-1.763L75.144,128.6a.624.624,0,0,1-.881-.881l1.763-1.763-1.763-1.763a.624.624,0,1,1,.881-.882l1.763,1.763,1.763-1.763a.624.624,0,0,1,.881,0Z"
|
|
140
|
+
transform="translate(652.56 515.047)"
|
|
141
|
+
/>
|
|
142
|
+
</g>
|
|
143
|
+
</svg>
|
|
144
|
+
);
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const SettingsSvg = () => {
|
|
148
|
+
return (
|
|
149
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
150
|
+
<g transform="translate(-711 -629)">
|
|
151
|
+
<path
|
|
152
|
+
d="M169.26,145.115l-1.347-1.37a6.122,6.122,0,0,0,.03-.621,6.191,6.191,0,0,0-.03-.621l1.345-1.37a.854.854,0,0,0,.314-1.164l-1.278-2.215a.854.854,0,0,0-1.164-.314l-1.86.479a6.419,6.419,0,0,0-1.074-.621l-.513-1.846a.854.854,0,0,0-.852-.852h-2.561a.854.854,0,0,0-.852.852L158.9,137.3a6.394,6.394,0,0,0-1.074.621l-1.86-.479a.852.852,0,0,0-1.164.314l-1.274,2.215a.852.852,0,0,0,.314,1.164l1.345,1.37a6.117,6.117,0,0,0-.03.621,6.215,6.215,0,0,0,.03.621l-1.345,1.37a.854.854,0,0,0-.314,1.164l1.278,2.215a.854.854,0,0,0,1.164.314l1.86-.479a6.418,6.418,0,0,0,1.074.621l.513,1.851a.854.854,0,0,0,.852.852h2.559a.854.854,0,0,0,.852-.852l.513-1.851a6.394,6.394,0,0,0,1.074-.621l1.858.479a.852.852,0,0,0,1.164-.314l1.278-2.215A.858.858,0,0,0,169.26,145.115Zm-7.709.994a2.985,2.985,0,1,1,2.985-2.985A2.987,2.987,0,0,1,161.552,146.109Z"
|
|
153
|
+
transform="translate(561.449 497.871)"
|
|
154
|
+
/>
|
|
155
|
+
</g>
|
|
156
|
+
</svg>
|
|
157
|
+
);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const CloseAllSvg = () => {
|
|
161
|
+
return (
|
|
162
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
163
|
+
<g transform="translate(1 2)">
|
|
164
|
+
<path
|
|
165
|
+
d="M147.521,153.182h0Zm6.916-5.215-.849-.849-2.607,2.607-2.607-2.607-.852.849,2.61,2.607-2.607,2.607.849.852,2.607-2.607,2.607,2.607.849-.849-2.607-2.61Zm-12.98,3.11v-9.235h10.373v4.147h1.2v-5.351H140.257v11.643h5.319v-1.2h-4.118ZM138.2,138.645h10.368v1.033h1.2v-2.235H137v12.715h2.274v-1.2H138.2Z"
|
|
166
|
+
transform="translate(-134.719 -134.739)"
|
|
167
|
+
/>
|
|
168
|
+
</g>
|
|
169
|
+
</svg>
|
|
170
|
+
);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const ExpandSvg = () => {
|
|
174
|
+
return (
|
|
175
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
176
|
+
<g transform="translate(2 3)">
|
|
177
|
+
<path
|
|
178
|
+
d="M.16,14.318A.162.162,0,0,1,0,14.155V13.017a.162.162,0,0,1,.16-.163H15.837a.162.162,0,0,1,.16.163v1.138a.162.162,0,0,1-.16.163Zm5.759-4.271a.162.162,0,0,1-.16-.162V8.745a.162.162,0,0,1,.16-.163h9.6a.162.162,0,0,1,.16.163V9.885a.162.162,0,0,1-.16.162ZM0,9.663V4.656a.177.177,0,0,1,.288-.14l3.125,2.5a.18.18,0,0,1,0,.281L.29,9.8a.173.173,0,0,1-.11.039A.179.179,0,0,1,0,9.663ZM5.919,5.736a.162.162,0,0,1-.16-.163V4.433a.162.162,0,0,1,.16-.162h9.6a.162.162,0,0,1,.16.162V5.573a.162.162,0,0,1-.16.163ZM.16,1.464A.162.162,0,0,1,0,1.3V.163A.162.162,0,0,1,.16,0H15.837A.162.162,0,0,1,16,.163V1.3a.162.162,0,0,1-.16.163Z"
|
|
179
|
+
transform="translate(2.501 1.8)"
|
|
180
|
+
/>
|
|
181
|
+
</g>
|
|
182
|
+
</svg>
|
|
183
|
+
);
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
const FoldSvg = () => {
|
|
187
|
+
return (
|
|
188
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
189
|
+
<g transform="translate(2 3)">
|
|
190
|
+
<path
|
|
191
|
+
d="M.16,14.318A.161.161,0,0,1,0,14.155V13.016a.162.162,0,0,1,.16-.163H15.838a.163.163,0,0,1,.16.163v1.139a.162.162,0,0,1-.16.163Zm5.759-4.271a.161.161,0,0,1-.16-.163V8.745a.162.162,0,0,1,.16-.163h9.6a.162.162,0,0,1,.16.163V9.884a.161.161,0,0,1-.16.163ZM3.194,9.8.068,7.3a.18.18,0,0,1,0-.281l3.126-2.5a.177.177,0,0,1,.288.141V9.662a.179.179,0,0,1-.178.18A.172.172,0,0,1,3.194,9.8ZM5.919,5.736a.162.162,0,0,1-.16-.163V4.434a.161.161,0,0,1,.16-.163h9.6a.161.161,0,0,1,.16.163V5.573a.162.162,0,0,1-.16.163ZM.16,1.464A.162.162,0,0,1,0,1.3V.163A.161.161,0,0,1,.16,0H15.838A.162.162,0,0,1,16,.163V1.3a.163.163,0,0,1-.16.163Z"
|
|
192
|
+
transform="translate(2.501 1.8)"
|
|
193
|
+
/>
|
|
194
|
+
</g>
|
|
195
|
+
</svg>
|
|
196
|
+
);
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
const Grid1x1Svg = () => {
|
|
200
|
+
return (
|
|
201
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
202
|
+
<g transform="translate(-939 -98)">
|
|
203
|
+
<g transform="translate(18.5)">
|
|
204
|
+
<path
|
|
205
|
+
d="M21,18H0V0H21V18ZM.914,1V17H20.085V1Z"
|
|
206
|
+
transform="translate(922 101.001)"
|
|
207
|
+
/>
|
|
208
|
+
<rect width="16.998" height="14" transform="translate(924 103)" />
|
|
209
|
+
</g>
|
|
210
|
+
</g>
|
|
211
|
+
</svg>
|
|
212
|
+
);
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const Grid2x2Svg = () => {
|
|
216
|
+
return (
|
|
217
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
218
|
+
<g transform="translate(-954 -98)">
|
|
219
|
+
<g transform="translate(-0.5)">
|
|
220
|
+
<path
|
|
221
|
+
d="M21,18H0V0H21V18ZM.914,1V17H20.085V1Z"
|
|
222
|
+
transform="translate(956 101)"
|
|
223
|
+
/>
|
|
224
|
+
<rect width="8" height="6.5" transform="translate(958 103)" />
|
|
225
|
+
<rect width="8" height="6.5" transform="translate(958 110.5)" />
|
|
226
|
+
<rect width="7.998" height="6.5" transform="translate(967 103)" />
|
|
227
|
+
<rect width="7.998" height="6.5" transform="translate(967 110.5)" />
|
|
228
|
+
</g>
|
|
229
|
+
</g>
|
|
230
|
+
</svg>
|
|
231
|
+
);
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
const Grid3x3Svg = () => {
|
|
235
|
+
return (
|
|
236
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
237
|
+
<defs>
|
|
238
|
+
<style></style>
|
|
239
|
+
</defs>
|
|
240
|
+
<g transform="translate(-954.5 -98)">
|
|
241
|
+
<path
|
|
242
|
+
d="M21,18H0V0H21V18ZM.914,1V17H20.085V1Z"
|
|
243
|
+
transform="translate(955.999 101)"
|
|
244
|
+
/>
|
|
245
|
+
<rect width="5" height="4" transform="translate(958 103)" />
|
|
246
|
+
<rect width="5" height="4" transform="translate(958 108)" />
|
|
247
|
+
<rect width="5" height="4" transform="translate(958 113)" />
|
|
248
|
+
<rect width="5" height="4" transform="translate(964 103)" />
|
|
249
|
+
<rect width="5" height="4" transform="translate(964 108)" />
|
|
250
|
+
<rect width="5" height="4" transform="translate(964 113)" />
|
|
251
|
+
<rect width="5" height="4" transform="translate(970 103)" />
|
|
252
|
+
<rect width="5" height="4" transform="translate(970 108)" />
|
|
253
|
+
<rect width="5" height="4" transform="translate(970 113)" />
|
|
254
|
+
</g>
|
|
255
|
+
</svg>
|
|
256
|
+
);
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
const CloseSvg = () => {
|
|
260
|
+
return (
|
|
261
|
+
<svg viewBox="64 64 896 896" focusable="false">
|
|
262
|
+
<path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z" />
|
|
263
|
+
</svg>
|
|
264
|
+
);
|
|
265
|
+
};
|
|
266
|
+
const VideoPlaySvg = () => {
|
|
267
|
+
return (
|
|
268
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14">
|
|
269
|
+
<path
|
|
270
|
+
d="M206.363,104.212a.284.284,0,0,1-.284-.284V95.1a.284.284,0,0,1,.447-.231l6.32,4.417a.284.284,0,0,1,0,.481l-6.32,4.4A.284.284,0,0,1,206.363,104.212Z"
|
|
271
|
+
transform="translate(-201.597 -92.334)"
|
|
272
|
+
/>
|
|
273
|
+
</svg>
|
|
274
|
+
);
|
|
275
|
+
};
|
|
276
|
+
const VideoCloseSvg = () => {
|
|
277
|
+
return (
|
|
278
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14">
|
|
279
|
+
<path
|
|
280
|
+
d="M5.042,4.457,8.631.179A.109.109,0,0,0,8.548,0H7.457a.223.223,0,0,0-.168.078L4.329,3.607,1.369.078A.218.218,0,0,0,1.2,0H.109A.109.109,0,0,0,.026.179L3.615,4.457.026,8.735a.109.109,0,0,0,.083.179H1.2a.223.223,0,0,0,.168-.078l2.96-3.529,2.96,3.529a.218.218,0,0,0,.168.078H8.548a.109.109,0,0,0,.083-.179Z"
|
|
281
|
+
transform="translate(2.666 2.543)"
|
|
282
|
+
/>
|
|
283
|
+
</svg>
|
|
284
|
+
);
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
const TimePositionSvg = () => {
|
|
288
|
+
return (
|
|
289
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="7" height="35" viewBox="0 0 7 35">
|
|
290
|
+
<defs>
|
|
291
|
+
<style></style>
|
|
292
|
+
</defs>
|
|
293
|
+
<g transform="translate(-572 -861)">
|
|
294
|
+
<path
|
|
295
|
+
style={{ fill: '#177ddc' }}
|
|
296
|
+
d="M3.5,0,7,4H0Z"
|
|
297
|
+
transform="translate(579 865) rotate(180)"
|
|
298
|
+
/>
|
|
299
|
+
<path
|
|
300
|
+
style={{ fill: '#177ddc' }}
|
|
301
|
+
d="M3.5,0,7,4H0Z"
|
|
302
|
+
transform="translate(572 892)"
|
|
303
|
+
/>
|
|
304
|
+
<line style={{ stroke: '#177ddc' }} y2="29" transform="translate(575.5 863.5)" />
|
|
305
|
+
</g>
|
|
306
|
+
</svg>
|
|
307
|
+
);
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
const TalkDisableSvg = () => {
|
|
311
|
+
return (
|
|
312
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
313
|
+
<g transform="translate(-1818 -474)">
|
|
314
|
+
<path
|
|
315
|
+
d="M130,10.815l-.873.873a5.333,5.333,0,0,1-.208-.616.58.58,0,0,1-.019-.143V8.482a.556.556,0,0,1,.531-.558.546.546,0,0,1,.562.546v2.217A1.072,1.072,0,0,0,130,10.815Zm1.883,1.166-.755.755a4.264,4.264,0,0,0,7-1.7,1.084,1.084,0,0,0,.056-.347v-2.2a.556.556,0,0,1,.531-.558.546.546,0,0,1,.562.546V10.93a.59.59,0,0,1-.019.143,5.37,5.37,0,0,1-4.5,3.912.136.136,0,0,0-.12.135v1a.274.274,0,0,0,.273.273h1.366a1.093,1.093,0,0,1,1.093,1.093h-6.559a1.09,1.09,0,0,1,1.093-1.093h1.366a.274.274,0,0,0,.273-.273v-1a.136.136,0,0,0-.12-.135,5.357,5.357,0,0,1-3.068-1.479l-1.9,1.9a.544.544,0,0,1-.772,0,.547.547,0,0,1,0-.774l1.965-1.964.791-.791.763-.763.825-.825,7.541-7.541a.547.547,0,1,1,.774.774l-2.975,2.973V9.563a3.274,3.274,0,0,1-5.486,2.418Zm5.486-8.7v.166l-6.531,6.532a3.292,3.292,0,0,1-.026-.413V3.279a3.279,3.279,0,1,1,6.557,0Z"
|
|
316
|
+
transform="translate(1695.986 477.256)"
|
|
317
|
+
/>
|
|
318
|
+
</g>
|
|
319
|
+
</svg>
|
|
320
|
+
);
|
|
321
|
+
};
|
|
322
|
+
const TalkSvg = () => {
|
|
323
|
+
return (
|
|
324
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
325
|
+
<defs>
|
|
326
|
+
<style></style>
|
|
327
|
+
</defs>
|
|
328
|
+
<g transform="translate(-1772 -526)">
|
|
329
|
+
<g transform="translate(1779 529)">
|
|
330
|
+
<path
|
|
331
|
+
d="M326.557,3.279V9.563a3.279,3.279,0,1,1-6.557,0V3.279a3.279,3.279,0,1,1,6.557,0Z"
|
|
332
|
+
transform="translate(-318.088)"
|
|
333
|
+
/>
|
|
334
|
+
<path
|
|
335
|
+
d="M218.382,464.534v2.459a.59.59,0,0,1-.019.143,5.37,5.37,0,0,1-4.506,3.912.136.136,0,0,0-.12.135v1a.274.274,0,0,0,.273.273h1.366a1.094,1.094,0,0,1,1.093,1.093h-6.557a1.094,1.094,0,0,1,1.093-1.093h1.366a.274.274,0,0,0,.273-.273v-1a.136.136,0,0,0-.12-.135,5.373,5.373,0,0,1-4.506-3.914.58.58,0,0,1-.019-.143v-2.447a.556.556,0,0,1,.531-.558.546.546,0,0,1,.562.546v2.217a1.085,1.085,0,0,0,.056.347,4.266,4.266,0,0,0,8.084,0,1.084,1.084,0,0,0,.056-.347v-2.2a.556.556,0,0,1,.531-.558A.546.546,0,0,1,218.382,464.534Z"
|
|
336
|
+
transform="translate(-208.001 -456.064)"
|
|
337
|
+
/>
|
|
338
|
+
</g>
|
|
339
|
+
</g>
|
|
340
|
+
</svg>
|
|
341
|
+
);
|
|
342
|
+
};
|
|
343
|
+
const CloudControlSvg = () => {
|
|
344
|
+
return (
|
|
345
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
346
|
+
<defs>
|
|
347
|
+
<style></style>
|
|
348
|
+
</defs>
|
|
349
|
+
<g transform="translate(-1847 -503)">
|
|
350
|
+
<path
|
|
351
|
+
d="M79.3,67.036l-3.722,3.718a3.474,3.474,0,0,1,0,3.857L79.3,78.328A8.684,8.684,0,0,0,79.3,67.036Zm-1.683,7.357V70.9l2.155,1.78ZM69.8,70.759l-3.718-3.718a8.7,8.7,0,0,0,0,11.3L69.8,74.615A3.482,3.482,0,0,1,69.8,70.759Zm-2.409,3.635-2.155-1.711,2.155-1.748v3.459Zm3.371,1.184-3.718,3.718a8.7,8.7,0,0,0,11.3,0l-3.718-3.718A3.473,3.473,0,0,1,70.764,75.577Zm1.91,4.028-1.817-2.15h3.769ZM74.621,69.8l3.722-3.722a8.7,8.7,0,0,0-11.3,0L70.764,69.8A3.482,3.482,0,0,1,74.621,69.8ZM72.7,65.617l1.956,2.15H70.991Z"
|
|
352
|
+
transform="translate(1786.307 442.315)"
|
|
353
|
+
/>
|
|
354
|
+
</g>
|
|
355
|
+
</svg>
|
|
356
|
+
);
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
/** 暂停Icon */
|
|
360
|
+
export const PauseIcon = (props: IconProps) => (
|
|
361
|
+
<Icon className="control-icon" component={PauseSvg} {...props} />
|
|
362
|
+
);
|
|
363
|
+
|
|
364
|
+
/** 播放Icon */
|
|
365
|
+
export const PlayIcon = (props: IconProps) => (
|
|
366
|
+
<Icon className="control-icon" component={PlaySvg} {...props} />
|
|
367
|
+
);
|
|
368
|
+
|
|
369
|
+
/** 截图Icon */
|
|
370
|
+
export const CaptureIcon = (props: IconProps) => (
|
|
371
|
+
<Icon className="control-icon" component={CaptureSvg} {...props} />
|
|
372
|
+
);
|
|
373
|
+
|
|
374
|
+
/** 全屏Icon */
|
|
375
|
+
export const FullScreenIcon = (props: IconProps) => (
|
|
376
|
+
<Icon className="control-icon" component={FullScreenSvg} {...props} />
|
|
377
|
+
);
|
|
378
|
+
|
|
379
|
+
/** 退出全屏Icon */
|
|
380
|
+
export const ExitFullScreenIcon = (props: IconProps) => (
|
|
381
|
+
<Icon className="control-icon" component={ExitFullScreenSvg} {...props} />
|
|
382
|
+
);
|
|
383
|
+
|
|
384
|
+
/** 音量低Icon */
|
|
385
|
+
export const VolumeSmallIcon = (props: IconProps) => (
|
|
386
|
+
<Icon className="control-icon" component={VolumeSmallSvg} {...props} />
|
|
387
|
+
);
|
|
388
|
+
|
|
389
|
+
/** 音量高Icon */
|
|
390
|
+
export const VolumeLargeIcon = (props: IconProps) => (
|
|
391
|
+
<Icon className="control-icon" component={VolumeLargeSvg} {...props} />
|
|
392
|
+
);
|
|
393
|
+
/** 静音Icon */
|
|
394
|
+
export const VolumeMutedIcon = (props: IconProps) => (
|
|
395
|
+
<Icon className="control-icon" component={VolumeMutedSvg} {...props} />
|
|
396
|
+
);
|
|
397
|
+
|
|
398
|
+
/** 设置Icon */
|
|
399
|
+
export const SettingsIcon = (props: IconProps) => (
|
|
400
|
+
<Icon className="control-icon" component={SettingsSvg} {...props} />
|
|
401
|
+
);
|
|
402
|
+
|
|
403
|
+
/** 关闭全部Icon */
|
|
404
|
+
export const CloseAllIcon = (props: IconProps) => (
|
|
405
|
+
<Icon className="control-icon" component={CloseAllSvg} {...props} />
|
|
406
|
+
);
|
|
407
|
+
|
|
408
|
+
/** 展开Icon */
|
|
409
|
+
export const ExpandIcon = (props: IconProps) => (
|
|
410
|
+
<Icon className="control-icon" component={ExpandSvg} {...props} />
|
|
411
|
+
);
|
|
412
|
+
|
|
413
|
+
/** 收缩Icon */
|
|
414
|
+
export const FoldIcon = (props: IconProps) => (
|
|
415
|
+
<Icon className="control-icon" component={FoldSvg} {...props} />
|
|
416
|
+
);
|
|
417
|
+
|
|
418
|
+
/** 停止对讲Icon */
|
|
419
|
+
export const TalkDisableIcon = (props: ActiveIconProps) => {
|
|
420
|
+
const { active = false } = props;
|
|
421
|
+
return (
|
|
422
|
+
<Icon
|
|
423
|
+
className={`control-icon ${active ? 'active' : ''}`}
|
|
424
|
+
component={TalkDisableSvg}
|
|
425
|
+
{...props}
|
|
426
|
+
/>
|
|
427
|
+
);
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
/** 对讲Icon */
|
|
431
|
+
export const TalkIcon = (props: ActiveIconProps) => {
|
|
432
|
+
const { active = false } = props;
|
|
433
|
+
return (
|
|
434
|
+
<Icon className={`control-icon ${active ? 'active' : ''}`} component={TalkSvg} {...props} />
|
|
435
|
+
);
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
/** 云台控制 */
|
|
439
|
+
export const CloudControlIcon = (props: ActiveIconProps) => {
|
|
440
|
+
const { active = false } = props;
|
|
441
|
+
return (
|
|
442
|
+
<Icon
|
|
443
|
+
className={`control-icon ${active ? 'active' : ''}`}
|
|
444
|
+
component={CloudControlSvg}
|
|
445
|
+
{...props}
|
|
446
|
+
/>
|
|
447
|
+
);
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
/** 1x1网格Icon */
|
|
451
|
+
export const Grid1x1Icon = (props: ActiveIconProps) => {
|
|
452
|
+
const { active = false } = props;
|
|
453
|
+
return (
|
|
454
|
+
<Icon
|
|
455
|
+
className={`control-icon ${active ? 'active' : ''}`}
|
|
456
|
+
component={Grid1x1Svg}
|
|
457
|
+
{...props}
|
|
458
|
+
/>
|
|
459
|
+
);
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
/** 2x2网格Icon */
|
|
463
|
+
export const Grid2x2Icon = (props: ActiveIconProps) => {
|
|
464
|
+
const { active = false } = props;
|
|
465
|
+
return (
|
|
466
|
+
<Icon
|
|
467
|
+
className={`control-icon ${active ? 'active' : ''}`}
|
|
468
|
+
component={Grid2x2Svg}
|
|
469
|
+
{...props}
|
|
470
|
+
/>
|
|
471
|
+
);
|
|
472
|
+
};
|
|
473
|
+
|
|
474
|
+
/** 3x3网格Icon */
|
|
475
|
+
export const Grid3x3Icon = (props: ActiveIconProps) => {
|
|
476
|
+
const { active = false } = props;
|
|
477
|
+
return (
|
|
478
|
+
<Icon
|
|
479
|
+
className={`control-icon ${active ? 'active' : ''}`}
|
|
480
|
+
component={Grid3x3Svg}
|
|
481
|
+
{...props}
|
|
482
|
+
/>
|
|
483
|
+
);
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
/** 关闭Icon */
|
|
487
|
+
export const CloseIcon = (props: IconProps) => {
|
|
488
|
+
return <Icon className={`close-icon`} component={CloseSvg} {...props} />;
|
|
489
|
+
};
|
|
490
|
+
|
|
491
|
+
/** 视频播放Icon */
|
|
492
|
+
export const VideoPlayIcon = (props: ActiveIconProps) => {
|
|
493
|
+
const { active = false } = props;
|
|
494
|
+
return (
|
|
495
|
+
<Icon
|
|
496
|
+
className={`control-icon ${active ? 'active' : ''}`}
|
|
497
|
+
component={VideoPlaySvg}
|
|
498
|
+
{...props}
|
|
499
|
+
/>
|
|
500
|
+
);
|
|
501
|
+
};
|
|
502
|
+
|
|
503
|
+
/** 视频关闭Icon */
|
|
504
|
+
export const VideoCloseIcon = (props: ActiveIconProps) => {
|
|
505
|
+
const { active = false } = props;
|
|
506
|
+
return (
|
|
507
|
+
<Icon
|
|
508
|
+
className={`control-icon ${active ? 'active' : ''}`}
|
|
509
|
+
component={VideoCloseSvg}
|
|
510
|
+
{...props}
|
|
511
|
+
/>
|
|
512
|
+
);
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
/** 时间刻度Icon */
|
|
516
|
+
export const TimePositionIcon = (props: IconProps) => {
|
|
517
|
+
return <Icon component={TimePositionSvg} {...props} />;
|
|
518
|
+
};
|
package/src/main.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import 'antd/dist/antd.css';
|
|
2
|
+
|
|
3
|
+
export { default as Player } from './components/player';
|
|
4
|
+
export { default as LivePlayer } from './components/live-player';
|
|
5
|
+
export { default as HistoryPlayer } from './components/history-player';
|
|
6
|
+
export { default as LiveControl } from './components/live-control';
|
|
7
|
+
export { default as HistoryControl } from './components/history-control';
|
|
8
|
+
export { default as BillPlayer } from './components/bill-player';
|
|
9
|
+
export { default as LiveChannelPlayer } from './components/live-channel-player';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ArgsTable, Canvas, Meta, Story } from '@storybook/addon-docs';
|
|
2
|
+
import { Alert } from 'antd';
|
|
3
|
+
|
|
4
|
+
<Meta title="介绍" />
|
|
5
|
+
|
|
6
|
+
# @vtx/player
|
|
7
|
+
基于业务的React视频流播放器
|
|
8
|
+
|
|
9
|
+
## 包含的组件
|
|
10
|
+
- 实时视频播放器
|
|
11
|
+
- 历史视频播放器
|
|
12
|
+
- 实时视频控制器
|
|
13
|
+
- 历史视频控制器
|
|
14
|
+
- 业务播放器
|
|
15
|
+
|
|
16
|
+
## FAQ
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare class Result<T> {
|
|
2
|
+
/** 数据 */
|
|
3
|
+
data: T;
|
|
4
|
+
/** 异常 */
|
|
5
|
+
exception: unknown;
|
|
6
|
+
/** 信息 */
|
|
7
|
+
msg: string;
|
|
8
|
+
/** 0为成功,1为失败 */
|
|
9
|
+
result: 0 | 1;
|
|
10
|
+
/** 时间戳 */
|
|
11
|
+
timestamp: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare class ArrayResult<T> {
|
|
15
|
+
rows: T[];
|
|
16
|
+
total: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare module '@vtx/utils' {
|
|
20
|
+
export const request: {
|
|
21
|
+
get: <T>(url: string, options?: { data: unknown; timeout?: number }) => Promise<T>;
|
|
22
|
+
post: <T>(
|
|
23
|
+
url: string,
|
|
24
|
+
options?: { data: unknown; timeout?: number; extraHeader?: unknown }
|
|
25
|
+
) => Promise<T>;
|
|
26
|
+
};
|
|
27
|
+
}
|