@vtx/player 0.0.5 → 0.0.8

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.
@@ -1,12 +1,12 @@
1
- interface VMFetchProps {
2
- /** 请求体 */
3
- data?: any;
4
- /** 请求头 */
5
- headersEx?: object;
6
- }
7
- /**
8
- * 数据fetch总入口
9
- * @param props
10
- */
11
- declare const Fetch: <T>(url: string, type?: 'GET' | 'POST', params?: VMFetchProps) => Promise<T>;
12
- export default Fetch;
1
+ interface VMFetchProps {
2
+ /** 请求体 */
3
+ data?: any;
4
+ /** 请求头 */
5
+ headersEx?: object;
6
+ }
7
+ /**
8
+ * 数据fetch总入口
9
+ * @param props
10
+ */
11
+ declare const Fetch: <T>(url: string, type?: 'GET' | 'POST', params?: VMFetchProps) => Promise<T>;
12
+ export default Fetch;
@@ -1,16 +1,15 @@
1
- import * as Types from './types';
2
- /** 获取预览地址 */
3
- export declare const getPreviewUrl: (data: Types.GetPreviewUrlParams) => Promise<Types.GetPreviewUrlResp>;
4
- /** 获取历史地址 */
5
- export declare const getHistoryUrl: (data: Types.GetHistoryUrlParams) => Promise<Types.GetHistoryUrlResp>;
6
- /** 获取视频信息 */
7
- export declare const loadVideoInfo: (data: Types.LoadVideoInfoParams) => Promise<Types.LoadVideoInfoResp>;
8
- /** 云台控制 */
9
- export declare const cloudControl: (data: Types.CloudControlParams) => Promise<unknown>;
10
- /**
11
- * 获取通道信息
12
- * @param channelId 通道ID
13
- * @param tenantId 租户ID
14
- * @returns
15
- */
16
- export declare const loadVideoChannel: (channelId: string, tenantId: string) => Promise<Types.LoadVideoChannelResp>;
1
+ import * as Types from './types';
2
+ /** 获取预览地址 */
3
+ export declare const getPreviewUrl: (data: Types.GetPreviewUrlParams) => Promise<Types.GetPreviewUrlResp>;
4
+ /** 获取历史地址 */
5
+ export declare const getHistoryUrl: (data: Types.GetHistoryUrlParams) => Promise<Types.GetHistoryUrlResp>;
6
+ /** 获取视频信息 */
7
+ export declare const loadVideoInfo: (data: Types.LoadVideoInfoParams) => Promise<Types.LoadVideoInfoResp>;
8
+ /** 云台控制 */
9
+ export declare const cloudControl: (data: Types.CloudControlParams) => Promise<unknown>;
10
+ /**
11
+ * 获取通道信息
12
+ * @param channelId 通道ID
13
+ * @returns
14
+ */
15
+ export declare const loadVideoChannel: (channelId: string) => Promise<Types.LoadVideoChannelResp>;
@@ -1,117 +1,107 @@
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
- /** 获取预览地址Params */
23
- export interface GetPreviewUrlParams {
24
- /** 租户ID */
25
- tenantId: string;
26
- /** 频道号 */
27
- channelNum: string;
28
- /** 设备ID */
29
- deviceId: string;
30
- /** 协议 */
31
- protocol?: string;
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
- /** 获取历史地址Resp */
45
- export interface GetHistoryUrlResp {
46
- /** 设备名称 */
47
- deviceName: string;
48
- /** 通道名称 */
49
- channelName: string;
50
- /** url列表 */
51
- list: HistoryUrlItem[];
52
- /** 播放器 */
53
- player: string | null;
54
- /** 全时播放地址 */
55
- totalTimeUrl: string;
56
- /** 地址 */
57
- url: string;
58
- }
59
- /** 获取历史地址Params */
60
- export interface GetHistoryUrlParams {
61
- /** 租户ID */
62
- tenantId: string;
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
- /** 获取视频信息Params */
75
- export interface LoadVideoInfoParams {
76
- /** 租户ID */
77
- tenantId: string;
78
- /** 业务ID */
79
- billId: string;
80
- }
81
- export interface LoadVideoInfo {
82
- /** 频道号 */
83
- channelNum: string;
84
- /** 设备ID */
85
- videoDeviceId: string;
86
- /** 通道名称 */
87
- channelName: string;
88
- }
89
- /** 获取视频信息Resp */
90
- export declare type LoadVideoInfoResp = LoadVideoInfo[];
91
- /** 云台控制Params */
92
- export declare type CloudControlParams = {
93
- /** 租户ID */
94
- tenantId: string;
95
- /** 频道号 */
96
- channelNum: string;
97
- /** 设备ID */
98
- deviceId: string;
99
- /** 操作:1为按下,0为放开 */
100
- action: 1 | 0;
101
- /** 命令 */
102
- command: CloudControlCommandType;
103
- };
104
- /** 云台控制命令 */
105
- export declare type CloudControlCommandType = 'LEFT' | 'RIGHT' | 'UP' | 'DOWN' | 'LEFT_UP' | 'LEFT_DOWN' | 'RIGHT_UP' | 'RIGHT_DOWN' | 'ZOOM_IN' | 'ZOOM_OUT' | 'FOCUS_NEAR' | 'FOCUS_FAR' | 'IRIS_ENLARGE' | 'IRIS_REDUCE';
106
- export declare type LoadVideoChannelParams = {
107
- /** 租户ID */
108
- tenantId: string;
109
- /** 通道ID */
110
- videoChannelId: string;
111
- };
112
- export declare type LoadVideoChannelResp = {
113
- /** 通道号 */
114
- channelNum: string;
115
- /** 设备ID */
116
- videoDeviceId: string;
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
+ /** 获取预览地址Params */
23
+ export interface GetPreviewUrlParams {
24
+ /** 频道号 */
25
+ channelNum: string;
26
+ /** 设备ID */
27
+ deviceId: string;
28
+ /** 协议 */
29
+ protocol?: string;
30
+ }
31
+ /** 历史地址子项 */
32
+ export interface HistoryUrlItem {
33
+ /** 开始时间 */
34
+ beginTime: string;
35
+ /** 结束时间 */
36
+ endTime: string;
37
+ /** 回放地址 */
38
+ playbackUrl: string | null;
39
+ /** 大小 */
40
+ size: number;
41
+ }
42
+ /** 获取历史地址Resp */
43
+ export interface GetHistoryUrlResp {
44
+ /** 设备名称 */
45
+ deviceName: string;
46
+ /** 通道名称 */
47
+ channelName: string;
48
+ /** url列表 */
49
+ list: HistoryUrlItem[];
50
+ /** 播放器 */
51
+ player: string | null;
52
+ /** 全时播放地址 */
53
+ totalTimeUrl: string;
54
+ /** 地址 */
55
+ url: string;
56
+ }
57
+ /** 获取历史地址Params */
58
+ export interface GetHistoryUrlParams {
59
+ /** 频道号 */
60
+ channelNum: string;
61
+ /** 设备ID */
62
+ deviceId: string;
63
+ /** 协议 */
64
+ protocol?: string;
65
+ /** 开始时间,格式:2022-06-01 00:00:00 */
66
+ beginTime: string;
67
+ /** 结束时间,格式:2022-06-01 23:59:59 */
68
+ endTime: string;
69
+ }
70
+ /** 获取视频信息Params */
71
+ export interface LoadVideoInfoParams {
72
+ /** 业务ID */
73
+ billId: string;
74
+ }
75
+ export interface LoadVideoInfo {
76
+ /** 频道号 */
77
+ channelNum: string;
78
+ /** 设备ID */
79
+ videoDeviceId: string;
80
+ /** 通道名称 */
81
+ channelName: string;
82
+ }
83
+ /** 获取视频信息Resp */
84
+ export declare type LoadVideoInfoResp = LoadVideoInfo[];
85
+ /** 云台控制Params */
86
+ export declare type CloudControlParams = {
87
+ /** 频道号 */
88
+ channelNum: string;
89
+ /** 设备ID */
90
+ deviceId: string;
91
+ /** 操作:1为按下,0为放开 */
92
+ action: 1 | 0;
93
+ /** 命令 */
94
+ command: CloudControlCommandType;
95
+ };
96
+ /** 云台控制命令 */
97
+ export declare type CloudControlCommandType = 'LEFT' | 'RIGHT' | 'UP' | 'DOWN' | 'LEFT_UP' | 'LEFT_DOWN' | 'RIGHT_UP' | 'RIGHT_DOWN' | 'ZOOM_IN' | 'ZOOM_OUT' | 'FOCUS_NEAR' | 'FOCUS_FAR' | 'IRIS_ENLARGE' | 'IRIS_REDUCE';
98
+ export declare type LoadVideoChannelParams = {
99
+ /** 通道ID */
100
+ videoChannelId: string;
101
+ };
102
+ export declare type LoadVideoChannelResp = {
103
+ /** 通道号 */
104
+ channelNum: string;
105
+ /** 设备ID */
106
+ videoDeviceId: string;
107
+ };
@@ -1,21 +1,21 @@
1
- /// <reference types="react" />
2
- import './index.less';
3
- import { LoadVideoInfoParams } from '@/api/types';
4
- interface BillPlayerProps {
5
- /** 参数 */
6
- params: LoadVideoInfoParams;
7
- /** 宽度 */
8
- width?: string | number;
9
- /** 高度 */
10
- height?: string | number;
11
- /** 是否显示实时视频,默认为true */
12
- live?: boolean;
13
- /** 是否显示历史视频,默认为true */
14
- history?: boolean;
15
- /** 实时默认播放 */
16
- defaultLivePlay?: boolean;
17
- /** 历史默认播放 */
18
- defaultHistoryPlay?: boolean;
19
- }
20
- export declare const BillPlayer: (props: BillPlayerProps) => JSX.Element;
21
- export default BillPlayer;
1
+ /// <reference types="react" />
2
+ import './index.less';
3
+ import { LoadVideoInfoParams } from '@/api/types';
4
+ interface BillPlayerProps {
5
+ /** 参数 */
6
+ params: LoadVideoInfoParams;
7
+ /** 宽度 */
8
+ width?: string | number;
9
+ /** 高度 */
10
+ height?: string | number;
11
+ /** 是否显示实时视频,默认为true */
12
+ live?: boolean;
13
+ /** 是否显示历史视频,默认为true */
14
+ history?: boolean;
15
+ /** 实时默认播放 */
16
+ defaultLivePlay?: boolean;
17
+ /** 历史默认播放 */
18
+ defaultHistoryPlay?: boolean;
19
+ }
20
+ export declare const BillPlayer: (props: BillPlayerProps) => JSX.Element;
21
+ export default BillPlayer;
@@ -1,52 +1,52 @@
1
- /// <reference types="react" />
2
- import './index.less';
3
- import Player from '../player';
4
- import { CloudControlParams } from '@/api/types';
5
- interface VolumeControlProps {
6
- container: HTMLDivElement | null;
7
- player?: Player;
8
- defaultValue?: number;
9
- }
10
- /** 音量控制 */
11
- export declare const VolumeControl: (props: VolumeControlProps) => JSX.Element;
12
- declare type SpeedValue = 0.5 | 1 | 2;
13
- interface SpeedControlProps {
14
- container: HTMLDivElement | null;
15
- player?: Player;
16
- defaultValue?: SpeedValue;
17
- }
18
- /** 速度控制 */
19
- export declare const SpeedControl: (props: SpeedControlProps) => JSX.Element;
20
- interface ErrorStateProps {
21
- /** 重试回调 */
22
- onClick?: () => void;
23
- }
24
- export declare const ErrorState: (props: ErrorStateProps) => JSX.Element;
25
- export declare const LoadingState: () => JSX.Element;
26
- interface PlayerHeaderProps {
27
- /** 名称 */
28
- name: string;
29
- /** 关闭回调 */
30
- onClose: () => void;
31
- }
32
- /** 播放器头部 */
33
- export declare const PlayerHeader: (props: PlayerHeaderProps) => JSX.Element;
34
- interface TalkControlProps {
35
- /** 播放器 */
36
- player?: Player;
37
- /** 对讲url */
38
- url: string;
39
- }
40
- /**
41
- * 对讲控制器
42
- * @returns
43
- */
44
- export declare const TalkControl: (props: TalkControlProps) => JSX.Element;
45
- export declare type CloudControlType = 'all' | 'onlyFocus' | 'onlyRotate' | 'none';
46
- export declare type CloudControlPanelProps = {
47
- query: Omit<CloudControlParams, 'action' | 'command'>;
48
- type: CloudControlType;
49
- };
50
- /** 云台控制面板 */
51
- export declare const CloudControlPanel: (props: CloudControlPanelProps) => JSX.Element;
52
- export {};
1
+ /// <reference types="react" />
2
+ import './index.less';
3
+ import Player from '../player';
4
+ import { CloudControlParams } from '@/api/types';
5
+ interface VolumeControlProps {
6
+ container: HTMLDivElement | null;
7
+ player?: Player;
8
+ defaultValue?: number;
9
+ }
10
+ /** 音量控制 */
11
+ export declare const VolumeControl: (props: VolumeControlProps) => JSX.Element;
12
+ declare type SpeedValue = 0.5 | 1 | 2 | 4 | 8;
13
+ interface SpeedControlProps {
14
+ container: HTMLDivElement | null;
15
+ player?: Player;
16
+ defaultValue?: SpeedValue;
17
+ }
18
+ /** 速度控制 */
19
+ export declare const SpeedControl: (props: SpeedControlProps) => JSX.Element;
20
+ interface ErrorStateProps {
21
+ /** 重试回调 */
22
+ onClick?: () => void;
23
+ }
24
+ export declare const ErrorState: (props: ErrorStateProps) => JSX.Element;
25
+ export declare const LoadingState: () => JSX.Element;
26
+ interface PlayerHeaderProps {
27
+ /** 名称 */
28
+ name: string;
29
+ /** 关闭回调 */
30
+ onClose: () => void;
31
+ }
32
+ /** 播放器头部 */
33
+ export declare const PlayerHeader: (props: PlayerHeaderProps) => JSX.Element;
34
+ interface TalkControlProps {
35
+ /** 播放器 */
36
+ player?: Player;
37
+ /** 对讲url */
38
+ url: string;
39
+ }
40
+ /**
41
+ * 对讲控制器
42
+ * @returns
43
+ */
44
+ export declare const TalkControl: (props: TalkControlProps) => JSX.Element;
45
+ export declare type CloudControlType = 'all' | 'onlyFocus' | 'onlyRotate' | 'none';
46
+ export declare type CloudControlPanelProps = {
47
+ query: Omit<CloudControlParams, 'action' | 'command'>;
48
+ type: CloudControlType;
49
+ };
50
+ /** 云台控制面板 */
51
+ export declare const CloudControlPanel: (props: CloudControlPanelProps) => JSX.Element;
52
+ export {};
@@ -1,39 +1,39 @@
1
- /// <reference types="react" />
2
- import './index.less';
3
- import { GetHistoryUrlParams } from '@/api/types';
4
- export declare type HistoryControlHandle = {
5
- load: (channel: GetHistoryUrlParams) => void;
6
- };
7
- interface HistoryControlProps {
8
- /** 宽度 */
9
- width?: number;
10
- /** 高度 */
11
- height?: number;
12
- /** 展开/收缩按钮回调 */
13
- onExpandChange?: (expand: boolean) => void;
14
- /** 播放器进度回调,time:YYYY-MM-DD HH:mm:ss */
15
- onTimeChange?: (time: string) => void;
16
- }
17
- /**
18
- * 历史视频控制器
19
- */
20
- export declare const HistoryControl: import("react").ForwardRefExoticComponent<HistoryControlProps & import("react").RefAttributes<HistoryControlHandle>>;
21
- export declare type UrlsTableItemType = {
22
- /** 序号 */
23
- index: number;
24
- /** 设备名称 */
25
- deviceName: string;
26
- /** 通道名称 */
27
- channelName: string;
28
- /** 开始时间 */
29
- beginTime: string;
30
- /** 结束时间 */
31
- endTime: string;
32
- /** 视频时长 */
33
- duration: string;
34
- /** 视频大小 */
35
- size: string;
36
- /** 地址 */
37
- url: string;
38
- };
39
- export default HistoryControl;
1
+ /// <reference types="react" />
2
+ import './index.less';
3
+ import { GetHistoryUrlParams } from '@/api/types';
4
+ export declare type HistoryControlHandle = {
5
+ load: (channel: GetHistoryUrlParams) => void;
6
+ };
7
+ interface HistoryControlProps {
8
+ /** 宽度 */
9
+ width?: number;
10
+ /** 高度 */
11
+ height?: number;
12
+ /** 展开/收缩按钮回调 */
13
+ onExpandChange?: (expand: boolean) => void;
14
+ /** 播放器进度回调,time:YYYY-MM-DD HH:mm:ss */
15
+ onTimeChange?: (time: string) => void;
16
+ }
17
+ /**
18
+ * 历史视频控制器
19
+ */
20
+ export declare const HistoryControl: import("react").ForwardRefExoticComponent<HistoryControlProps & import("react").RefAttributes<HistoryControlHandle>>;
21
+ export declare type UrlsTableItemType = {
22
+ /** 序号 */
23
+ index: number;
24
+ /** 设备名称 */
25
+ deviceName: string;
26
+ /** 通道名称 */
27
+ channelName: string;
28
+ /** 开始时间 */
29
+ beginTime: string;
30
+ /** 结束时间 */
31
+ endTime: string;
32
+ /** 视频时长 */
33
+ duration: string;
34
+ /** 视频大小 */
35
+ size: string;
36
+ /** 地址 */
37
+ url: string;
38
+ };
39
+ export default HistoryControl;
@@ -1,31 +1,31 @@
1
- /// <reference types="react" />
2
- import './index.less';
3
- import { VideoType } from '@/components/player';
4
- export declare type HistoryPlayerHandle = {
5
- /**
6
- * 跳转,目前仅支持海康视频跳转
7
- */
8
- seekTo: (time: string) => Promise<void>;
9
- };
10
- interface VtxPlayerProps {
11
- /** 视频流地址 */
12
- url: string;
13
- /** 视频流格式,如果为空则根据url自行判断 */
14
- type?: VideoType;
15
- /** 开始时间,格式为:YYYY-MM-DD HH:mm:ss */
16
- startTime: string;
17
- /** 结束时间,格式为:YYYY-MM-DD HH:mm:ss */
18
- endTime: string;
19
- /** 宽度 */
20
- width?: number;
21
- /** 高度 */
22
- height?: number;
23
- /** 截图文件名 */
24
- captureName?: string;
25
- /** 控制条bottom */
26
- controlBottom?: number;
27
- /** 播放器进度回调,time:YYYY-MM-DD HH:mm:ss */
28
- onTimeChange?: (time: string) => void;
29
- }
30
- export declare const HistoryPlayer: import("react").ForwardRefExoticComponent<VtxPlayerProps & import("react").RefAttributes<HistoryPlayerHandle>>;
31
- export default HistoryPlayer;
1
+ /// <reference types="react" />
2
+ import './index.less';
3
+ import { VideoType } from '@/components/player';
4
+ export declare type HistoryPlayerHandle = {
5
+ /**
6
+ * 跳转,目前仅支持海康视频跳转
7
+ */
8
+ seekTo: (time: string) => Promise<void>;
9
+ };
10
+ interface VtxPlayerProps {
11
+ /** 视频流地址 */
12
+ url: string;
13
+ /** 视频流格式,如果为空则根据url自行判断 */
14
+ type?: VideoType;
15
+ /** 开始时间,格式为:YYYY-MM-DD HH:mm:ss */
16
+ startTime: string;
17
+ /** 结束时间,格式为:YYYY-MM-DD HH:mm:ss */
18
+ endTime: string;
19
+ /** 宽度 */
20
+ width?: number;
21
+ /** 高度 */
22
+ height?: number;
23
+ /** 截图文件名 */
24
+ captureName?: string;
25
+ /** 控制条bottom */
26
+ controlBottom?: number;
27
+ /** 播放器进度回调,time:YYYY-MM-DD HH:mm:ss speed:播放速率 */
28
+ onTimeChange?: (time: string, speed: number) => void;
29
+ }
30
+ export declare const HistoryPlayer: import("react").ForwardRefExoticComponent<VtxPlayerProps & import("react").RefAttributes<HistoryPlayerHandle>>;
31
+ export default HistoryPlayer;
@@ -1,18 +1,16 @@
1
- /// <reference types="react" />
2
- interface LiveChannelPlayerProps {
3
- /** 通道ID */
4
- channelId: string;
5
- /** 租户ID */
6
- tenantId: string;
7
- /** 宽度 */
8
- width?: number;
9
- /** 高度 */
10
- height?: number;
11
- }
12
- /**
13
- * 基于通道ID的实时播放器
14
- * @param props
15
- * @returns
16
- */
17
- export declare const LiveChannelPlayer: (props: LiveChannelPlayerProps) => JSX.Element | undefined;
18
- export default LiveChannelPlayer;
1
+ /// <reference types="react" />
2
+ interface LiveChannelPlayerProps {
3
+ /** 通道ID */
4
+ channelId: string;
5
+ /** 宽度 */
6
+ width?: number;
7
+ /** 高度 */
8
+ height?: number;
9
+ }
10
+ /**
11
+ * 基于通道ID的实时播放器
12
+ * @param props
13
+ * @returns
14
+ */
15
+ export declare const LiveChannelPlayer: (props: LiveChannelPlayerProps) => JSX.Element | undefined;
16
+ export default LiveChannelPlayer;