@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.
- 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 +2 -2
- package/commitlint.config.js +10 -0
- package/package.json +98 -100
- 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 +55 -0
- package/src/api/index.ts +43 -0
- package/{dist/types/api/types.d.ts → src/api/types.ts} +131 -117
- 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 +13 -0
- package/src/components/bill-player/index.tsx +267 -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 +62 -0
- package/src/components/history-control/index.stories.tsx +130 -0
- package/src/components/history-control/index.tsx +368 -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 +206 -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 +75 -0
- package/src/components/live-control/index.less +65 -0
- package/src/components/live-control/index.stories.mdx +64 -0
- package/src/components/live-control/index.stories.tsx +61 -0
- package/src/components/live-control/index.tsx +274 -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 +318 -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/{dist/types/main.d.ts → src/main.ts} +9 -8
- 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 +215 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.json +24 -0
- package/dist/index.d.ts +0 -223
- package/dist/index.es.js +0 -533
- package/dist/index.es.js.map +0 -1
- package/dist/index.umd.js +0 -533
- package/dist/index.umd.js.map +0 -1
- package/dist/types/api/fetch.d.ts +0 -12
- package/dist/types/api/index.d.ts +0 -16
- package/dist/types/components/bill-player/index.d.ts +0 -21
- package/dist/types/components/controls/index.d.ts +0 -52
- package/dist/types/components/history-control/index.d.ts +0 -39
- package/dist/types/components/history-player/index.d.ts +0 -31
- package/dist/types/components/live-channel-player/index.d.ts +0 -18
- package/dist/types/components/live-control/index.d.ts +0 -35
- package/dist/types/components/live-player/index.d.ts +0 -22
- package/dist/types/components/player/index.d.ts +0 -84
- package/dist/types/context/index.d.ts +0 -8
- package/dist/types/hooks/useSettings.d.ts +0 -9
- package/dist/types/icons/index.d.ts +0 -54
- package/dist/types/utils/index.d.ts +0 -60
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var Module={};var initializedJS=false;function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}JSPlayerModule(Module).then(function(instance){Module=instance})}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();if(!initializedJS){Module["___embind_register_native_and_builtin_types"]();initializedJS=true}try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{Module["__emscripten_thread_exit"](-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}postMessage({"cmd":"cancelDone"})}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import babel from '@rollup/plugin-babel';
|
|
2
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
3
|
+
import resolve from '@rollup/plugin-node-resolve';
|
|
4
|
+
import typescript from '@rollup/plugin-typescript';
|
|
5
|
+
import url from '@rollup/plugin-url';
|
|
6
|
+
import dts from 'rollup-plugin-dts';
|
|
7
|
+
import external from 'rollup-plugin-peer-deps-external';
|
|
8
|
+
import postcss from 'rollup-plugin-postcss';
|
|
9
|
+
import { terser } from 'rollup-plugin-terser';
|
|
10
|
+
|
|
11
|
+
const packageJson = require('./package.json');
|
|
12
|
+
|
|
13
|
+
export default [
|
|
14
|
+
{
|
|
15
|
+
input: 'src/main.ts',
|
|
16
|
+
output: [
|
|
17
|
+
// 构建cjs格式包
|
|
18
|
+
{
|
|
19
|
+
file: packageJson.main,
|
|
20
|
+
format: 'cjs',
|
|
21
|
+
sourcemap: true,
|
|
22
|
+
},
|
|
23
|
+
// 构建esm格式包
|
|
24
|
+
{
|
|
25
|
+
file: packageJson.module,
|
|
26
|
+
format: 'esm',
|
|
27
|
+
sourcemap: true,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
plugins: [
|
|
31
|
+
external(), // 排除peerDependencies中的包不被压缩到输出文件中
|
|
32
|
+
resolve(), // 添加rollup引用第三方包支持
|
|
33
|
+
babel({
|
|
34
|
+
exclude: 'node_modules/**',
|
|
35
|
+
presets: [['@babel/preset-env']],
|
|
36
|
+
babelHelpers: 'bundled',
|
|
37
|
+
}),
|
|
38
|
+
commonjs(), // 添加commonJs支持
|
|
39
|
+
postcss(), // 处理css文件
|
|
40
|
+
url(), // 处理图片文件
|
|
41
|
+
typescript({ tsconfig: './tsconfig.json' }), //处理 typescript文件
|
|
42
|
+
terser(), // 文件压缩
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
// 打包d.ts文件
|
|
47
|
+
input: 'dist/types/main.d.ts',
|
|
48
|
+
output: [{ file: packageJson.types, format: 'esm' }],
|
|
49
|
+
external: [/\.less$/],
|
|
50
|
+
plugins: [dts()],
|
|
51
|
+
},
|
|
52
|
+
];
|
package/src/api/fetch.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { getUrlParam } from '@/utils';
|
|
2
|
+
interface VMFetchProps {
|
|
3
|
+
/** 请求体 */
|
|
4
|
+
data?: any;
|
|
5
|
+
/** 请求头 */
|
|
6
|
+
headersEx?: object;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 数据fetch总入口
|
|
11
|
+
* @param props
|
|
12
|
+
*/
|
|
13
|
+
const Fetch = async <T>(
|
|
14
|
+
url: string,
|
|
15
|
+
type: 'GET' | 'POST' = 'GET',
|
|
16
|
+
params?: VMFetchProps
|
|
17
|
+
): Promise<T> => {
|
|
18
|
+
const { data, headersEx } = params || {};
|
|
19
|
+
const token = getUrlParam('token');
|
|
20
|
+
try {
|
|
21
|
+
let headers: HeadersInit = {
|
|
22
|
+
'content-type': 'application/json',
|
|
23
|
+
Authorization: token ? `Bearer ${token}` : '',
|
|
24
|
+
};
|
|
25
|
+
if (headersEx) {
|
|
26
|
+
headers = { ...headers, ...headersEx };
|
|
27
|
+
}
|
|
28
|
+
if (type === 'GET' && data) {
|
|
29
|
+
const queryString = Object.keys(data)
|
|
30
|
+
.map((key) => key + '=' + data[key])
|
|
31
|
+
.join('&');
|
|
32
|
+
|
|
33
|
+
url += '?' + queryString;
|
|
34
|
+
}
|
|
35
|
+
const resp = await fetch(encodeURI(url), {
|
|
36
|
+
body: type === 'POST' ? JSON.stringify(data) : undefined,
|
|
37
|
+
headers,
|
|
38
|
+
method: type,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const json: Result<T> = await resp.json();
|
|
42
|
+
if (json.result === 0) return json.data;
|
|
43
|
+
else {
|
|
44
|
+
const error = {
|
|
45
|
+
exception: json.exception,
|
|
46
|
+
msg: json.msg,
|
|
47
|
+
};
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
} catch (e) {
|
|
51
|
+
return Promise.reject(e);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default Fetch;
|
package/src/api/index.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import Fetch from './fetch';
|
|
2
|
+
import * as Types from './types';
|
|
3
|
+
|
|
4
|
+
/** 获取预览地址 */
|
|
5
|
+
export const getPreviewUrl = (data: Types.GetPreviewUrlParams) =>
|
|
6
|
+
Fetch<Types.GetPreviewUrlResp>('/cloud/vis/base/np/artemis/previewUrl.smvc', 'GET', {
|
|
7
|
+
data,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
/** 获取历史地址 */
|
|
11
|
+
export const getHistoryUrl = (data: Types.GetHistoryUrlParams) =>
|
|
12
|
+
Fetch<Types.GetHistoryUrlResp>('/cloud/vis/base/np/artemis/playbackUrl.smvc', 'GET', {
|
|
13
|
+
data,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
/** 获取视频信息 */
|
|
17
|
+
export const loadVideoInfo = (data: Types.LoadVideoInfoParams) =>
|
|
18
|
+
Fetch<Types.LoadVideoInfoResp>('/cloud/vis/base/np/videoCommon/loadVideoInfos.smvc', 'GET', {
|
|
19
|
+
data,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
/** 云台控制 */
|
|
23
|
+
export const cloudControl = (data: Types.CloudControlParams) =>
|
|
24
|
+
Fetch('/cloud/vis/base/np/artemis/controlling.smvc', 'GET', {
|
|
25
|
+
data,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 获取通道信息
|
|
30
|
+
* @param channelId 通道ID
|
|
31
|
+
* @returns
|
|
32
|
+
*/
|
|
33
|
+
export const loadVideoChannel = async (channelId: string) => {
|
|
34
|
+
const result = await Fetch<string>(
|
|
35
|
+
'/cloud/vis/base/np/videoDevice/loadTheVideoChannel.smvc',
|
|
36
|
+
'GET',
|
|
37
|
+
{
|
|
38
|
+
data: { parameters: JSON.stringify({ videoChannelId: channelId }) },
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
const parseResult = JSON.parse(result) as Types.LoadVideoChannelResp[];
|
|
42
|
+
return parseResult[0];
|
|
43
|
+
};
|
|
@@ -1,117 +1,131 @@
|
|
|
1
|
-
/** 获取预览地址Resp */
|
|
2
|
-
export interface GetPreviewUrlResp {
|
|
3
|
-
/** 对讲地址 */
|
|
4
|
-
apiUrl: string;
|
|
5
|
-
/** 地址 */
|
|
6
|
-
url: string;
|
|
7
|
-
/** 设备名称 */
|
|
8
|
-
deviceName: string;
|
|
9
|
-
/** 设备ID */
|
|
10
|
-
deviceId: string;
|
|
11
|
-
/** 通道名称 */
|
|
12
|
-
channelName: string;
|
|
13
|
-
/** 通道编号 */
|
|
14
|
-
channelNum: string;
|
|
15
|
-
/** 播放器 */
|
|
16
|
-
player: string | null;
|
|
17
|
-
/** 是否可以对讲,1为可以,0为不可以 */
|
|
18
|
-
beenHasVideo?: 1 | 0;
|
|
19
|
-
/** 云台类型,1全功能,2不能转动,3不能变焦,4无功能 */
|
|
20
|
-
ptzType?: 1 | 2 | 3 | 4;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/** 历史地址子项 */
|
|
34
|
-
export interface HistoryUrlItem {
|
|
35
|
-
/** 开始时间 */
|
|
36
|
-
beginTime: string;
|
|
37
|
-
/** 结束时间 */
|
|
38
|
-
endTime: string;
|
|
39
|
-
/** 回放地址 */
|
|
40
|
-
playbackUrl: string | null;
|
|
41
|
-
/** 大小 */
|
|
42
|
-
size: number;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
/** 频道号 */
|
|
64
|
-
channelNum: string;
|
|
65
|
-
/** 设备ID */
|
|
66
|
-
deviceId: string;
|
|
67
|
-
/** 协议 */
|
|
68
|
-
protocol?: string;
|
|
69
|
-
/** 开始时间,格式:2022-06-01 00:00:00 */
|
|
70
|
-
beginTime: string;
|
|
71
|
-
/** 结束时间,格式:2022-06-01 23:59:59 */
|
|
72
|
-
endTime: string;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
export interface LoadVideoInfo {
|
|
82
|
-
/** 频道号 */
|
|
83
|
-
channelNum: string;
|
|
84
|
-
/** 设备ID */
|
|
85
|
-
videoDeviceId: string;
|
|
86
|
-
/** 通道名称 */
|
|
87
|
-
channelName: string;
|
|
88
|
-
}
|
|
89
|
-
/** 获取视频信息Resp */
|
|
90
|
-
export
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
/** 云台控制命令 */
|
|
105
|
-
export
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
1
|
+
/** 获取预览地址Resp */
|
|
2
|
+
export interface GetPreviewUrlResp {
|
|
3
|
+
/** 对讲地址 */
|
|
4
|
+
apiUrl: string;
|
|
5
|
+
/** 地址 */
|
|
6
|
+
url: string;
|
|
7
|
+
/** 设备名称 */
|
|
8
|
+
deviceName: string;
|
|
9
|
+
/** 设备ID */
|
|
10
|
+
deviceId: string;
|
|
11
|
+
/** 通道名称 */
|
|
12
|
+
channelName: string;
|
|
13
|
+
/** 通道编号 */
|
|
14
|
+
channelNum: string;
|
|
15
|
+
/** 播放器 */
|
|
16
|
+
player: string | null;
|
|
17
|
+
/** 是否可以对讲,1为可以,0为不可以 */
|
|
18
|
+
beenHasVideo?: 1 | 0;
|
|
19
|
+
/** 云台类型,1全功能,2不能转动,3不能变焦,4无功能 */
|
|
20
|
+
ptzType?: 1 | 2 | 3 | 4;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** 获取预览地址Params */
|
|
24
|
+
export interface GetPreviewUrlParams {
|
|
25
|
+
/** 频道号 */
|
|
26
|
+
channelNum: string;
|
|
27
|
+
/** 设备ID */
|
|
28
|
+
deviceId: string;
|
|
29
|
+
/** 协议 */
|
|
30
|
+
protocol?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** 历史地址子项 */
|
|
34
|
+
export interface HistoryUrlItem {
|
|
35
|
+
/** 开始时间 */
|
|
36
|
+
beginTime: string;
|
|
37
|
+
/** 结束时间 */
|
|
38
|
+
endTime: string;
|
|
39
|
+
/** 回放地址 */
|
|
40
|
+
playbackUrl: string | null;
|
|
41
|
+
/** 大小 */
|
|
42
|
+
size: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** 获取历史地址Resp */
|
|
46
|
+
export interface GetHistoryUrlResp {
|
|
47
|
+
/** 设备名称 */
|
|
48
|
+
deviceName: string;
|
|
49
|
+
/** 通道名称 */
|
|
50
|
+
channelName: string;
|
|
51
|
+
/** url列表 */
|
|
52
|
+
list: HistoryUrlItem[];
|
|
53
|
+
/** 播放器 */
|
|
54
|
+
player: string | null;
|
|
55
|
+
/** 全时播放地址 */
|
|
56
|
+
totalTimeUrl: string;
|
|
57
|
+
/** 地址 */
|
|
58
|
+
url: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** 获取历史地址Params */
|
|
62
|
+
export interface GetHistoryUrlParams {
|
|
63
|
+
/** 频道号 */
|
|
64
|
+
channelNum: string;
|
|
65
|
+
/** 设备ID */
|
|
66
|
+
deviceId: string;
|
|
67
|
+
/** 协议 */
|
|
68
|
+
protocol?: string;
|
|
69
|
+
/** 开始时间,格式:2022-06-01 00:00:00 */
|
|
70
|
+
beginTime: string;
|
|
71
|
+
/** 结束时间,格式:2022-06-01 23:59:59 */
|
|
72
|
+
endTime: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** 获取视频信息Params */
|
|
76
|
+
export interface LoadVideoInfoParams {
|
|
77
|
+
/** 业务ID */
|
|
78
|
+
billId: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface LoadVideoInfo {
|
|
82
|
+
/** 频道号 */
|
|
83
|
+
channelNum: string;
|
|
84
|
+
/** 设备ID */
|
|
85
|
+
videoDeviceId: string;
|
|
86
|
+
/** 通道名称 */
|
|
87
|
+
channelName: string;
|
|
88
|
+
}
|
|
89
|
+
/** 获取视频信息Resp */
|
|
90
|
+
export type LoadVideoInfoResp = LoadVideoInfo[];
|
|
91
|
+
|
|
92
|
+
/** 云台控制Params */
|
|
93
|
+
export type CloudControlParams = {
|
|
94
|
+
/** 频道号 */
|
|
95
|
+
channelNum: string;
|
|
96
|
+
/** 设备ID */
|
|
97
|
+
deviceId: string;
|
|
98
|
+
/** 操作:1为按下,0为放开 */
|
|
99
|
+
action: 1 | 0;
|
|
100
|
+
/** 命令 */
|
|
101
|
+
command: CloudControlCommandType;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/** 云台控制命令 */
|
|
105
|
+
export type CloudControlCommandType =
|
|
106
|
+
| 'LEFT'
|
|
107
|
+
| 'RIGHT'
|
|
108
|
+
| 'UP'
|
|
109
|
+
| 'DOWN'
|
|
110
|
+
| 'LEFT_UP'
|
|
111
|
+
| 'LEFT_DOWN'
|
|
112
|
+
| 'RIGHT_UP'
|
|
113
|
+
| 'RIGHT_DOWN'
|
|
114
|
+
| 'ZOOM_IN'
|
|
115
|
+
| 'ZOOM_OUT'
|
|
116
|
+
| 'FOCUS_NEAR'
|
|
117
|
+
| 'FOCUS_FAR'
|
|
118
|
+
| 'IRIS_ENLARGE'
|
|
119
|
+
| 'IRIS_REDUCE';
|
|
120
|
+
|
|
121
|
+
export type LoadVideoChannelParams = {
|
|
122
|
+
/** 通道ID */
|
|
123
|
+
videoChannelId: string;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export type LoadVideoChannelResp = {
|
|
127
|
+
/** 通道号 */
|
|
128
|
+
channelNum: string;
|
|
129
|
+
/** 设备ID */
|
|
130
|
+
videoDeviceId: string;
|
|
131
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
.vtx-bill-player {
|
|
2
|
+
.bill-tabs {
|
|
3
|
+
height: 100%;
|
|
4
|
+
|
|
5
|
+
.ant-tabs-content-holder {
|
|
6
|
+
height: 100%;
|
|
7
|
+
|
|
8
|
+
.ant-tabs-content {
|
|
9
|
+
height: 100%;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.player-panel {
|
|
15
|
+
display: flex;
|
|
16
|
+
height: 100%;
|
|
17
|
+
|
|
18
|
+
> .player-container {
|
|
19
|
+
flex-grow: 1;
|
|
20
|
+
width: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.control-container {
|
|
24
|
+
width: 376px;
|
|
25
|
+
height: fit-content;
|
|
26
|
+
margin-left: 16px;
|
|
27
|
+
border: 1px solid #e8e8e8;
|
|
28
|
+
border-radius: 2px;
|
|
29
|
+
|
|
30
|
+
.header {
|
|
31
|
+
padding: 12px 24px;
|
|
32
|
+
font-weight: bold;
|
|
33
|
+
border-bottom: 1px solid #e8e8e8;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.list {
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
padding: 12px 24px;
|
|
40
|
+
|
|
41
|
+
.ant-checkbox-wrapper {
|
|
42
|
+
margin-bottom: 12px;
|
|
43
|
+
margin-left: 0;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.form {
|
|
48
|
+
padding: 12px 24px;
|
|
49
|
+
|
|
50
|
+
.time-radio-group {
|
|
51
|
+
.ant-radio-wrapper {
|
|
52
|
+
margin-right: 4px;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import BillPlayer from '.';
|
|
2
|
+
import { ArgsTable, Canvas, Meta, Story } from '@storybook/addon-docs';
|
|
3
|
+
|
|
4
|
+
import * as stories from './index.stories';
|
|
5
|
+
|
|
6
|
+
<Meta title="组件/业务播放器" component={BillPlayer} />
|
|
7
|
+
|
|
8
|
+
# 组件--按钮
|
|
9
|
+
|
|
10
|
+
### 如何使用
|
|
11
|
+
|
|
12
|
+
```js
|
|
13
|
+
import { BillPlayer } from '@vtx/player';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### 属性
|
|
17
|
+
|
|
18
|
+
<ArgsTable of={BillPlayer} />
|
|
19
|
+
|
|
20
|
+
### 例子
|
|
21
|
+
|
|
22
|
+
<Canvas>
|
|
23
|
+
<Story name="业务播放器" story={stories.Default} />
|
|
24
|
+
</Canvas>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import BillPlayer from '.';
|
|
2
|
+
import { ComponentStory } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
const Template: ComponentStory<typeof BillPlayer> = (args) => <BillPlayer {...args} />;
|
|
5
|
+
export const Default = Template.bind({});
|
|
6
|
+
Default.args = {
|
|
7
|
+
width: 1200,
|
|
8
|
+
height: 600,
|
|
9
|
+
params: {
|
|
10
|
+
billId: 'shxq_qqq',
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
export default Template;
|