@vtx/player 0.0.11 → 0.0.14
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/{dist/types → lib}/api/fetch.d.ts +0 -0
- package/lib/api/fetch.js +128 -0
- package/lib/api/fetch.js.map +1 -0
- package/{dist/types → lib}/api/index.d.ts +0 -0
- package/lib/api/index.js +124 -0
- package/lib/api/index.js.map +1 -0
- package/{dist/types → lib}/api/types.d.ts +0 -0
- package/lib/api/types.js +6 -0
- package/lib/api/types.js.map +1 -0
- package/{dist/types/components → lib}/bill-player/index.d.ts +1 -3
- package/lib/bill-player/index.js +410 -0
- package/lib/bill-player/index.js.map +1 -0
- package/lib/bill-player/style/css.js +22 -0
- package/lib/bill-player/style/css.js.map +1 -0
- package/lib/bill-player/style/index.css +55 -0
- package/lib/bill-player/style/index.d.ts +10 -0
- package/lib/bill-player/style/index.js +22 -0
- package/lib/bill-player/style/index.js.map +1 -0
- package/lib/bill-player/style/index.less +58 -0
- package/lib/components/live-control/images/empty.png +0 -0
- package/{dist/types → lib}/context/index.d.ts +0 -0
- package/lib/context/index.js +20 -0
- package/lib/context/index.js.map +1 -0
- package/lib/controls/images/arrow.png +0 -0
- package/lib/controls/images/error.png +0 -0
- package/{dist/types/components → lib}/controls/index.d.ts +9 -3
- package/lib/controls/index.js +474 -0
- package/lib/controls/index.js.map +1 -0
- package/lib/controls/style/css.js +4 -0
- package/lib/controls/style/css.js.map +1 -0
- package/lib/controls/style/index.css +185 -0
- package/lib/controls/style/index.d.ts +1 -0
- package/lib/controls/style/index.js +4 -0
- package/lib/controls/style/index.js.map +1 -0
- package/lib/controls/style/index.less +187 -0
- package/lib/history-control/images/collapse.png +0 -0
- package/lib/history-control/images/empty.png +0 -0
- package/{dist/types/components → lib}/history-control/index.d.ts +5 -2
- package/lib/history-control/index.js +506 -0
- package/lib/history-control/index.js.map +1 -0
- package/lib/history-control/style/css.js +6 -0
- package/lib/history-control/style/css.js.map +1 -0
- package/lib/history-control/style/index.css +195 -0
- package/lib/history-control/style/index.d.ts +2 -0
- package/lib/history-control/style/index.js +6 -0
- package/lib/history-control/style/index.js.map +1 -0
- package/lib/history-control/style/index.less +219 -0
- package/{dist/types/components → lib}/history-player/index.d.ts +7 -4
- package/lib/history-player/index.js +276 -0
- package/lib/history-player/index.js.map +1 -0
- package/lib/history-player/style/css.js +6 -0
- package/lib/history-player/style/css.js.map +1 -0
- package/lib/history-player/style/index.css +105 -0
- package/lib/history-player/style/index.d.ts +2 -0
- package/lib/history-player/style/index.js +6 -0
- package/lib/history-player/style/index.js.map +1 -0
- package/lib/history-player/style/index.less +98 -0
- package/{dist/types → lib}/hooks/useSettings.d.ts +0 -0
- package/lib/hooks/useSettings.js +28 -0
- package/lib/hooks/useSettings.js.map +1 -0
- package/lib/icons/index.css +28 -0
- package/{dist/types → lib}/icons/index.d.ts +0 -0
- package/lib/icons/index.js +788 -0
- package/lib/icons/index.js.map +1 -0
- package/lib/icons/index.less +27 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +64 -0
- package/lib/index.js.map +1 -0
- package/{dist/types/components → lib}/live-channel-player/index.d.ts +1 -2
- package/lib/live-channel-player/index.js +164 -0
- package/lib/live-channel-player/index.js.map +1 -0
- package/lib/live-channel-player/style/css.js +6 -0
- package/lib/live-channel-player/style/css.js.map +1 -0
- package/lib/live-channel-player/style/index.d.ts +2 -0
- package/lib/live-channel-player/style/index.js +6 -0
- package/lib/live-channel-player/style/index.js.map +1 -0
- package/lib/live-control/images/empty.png +0 -0
- package/{dist/types/components → lib}/live-control/index.d.ts +6 -3
- package/lib/live-control/index.js +381 -0
- package/lib/live-control/index.js.map +1 -0
- package/lib/live-control/style/css.js +6 -0
- package/lib/live-control/style/css.js.map +1 -0
- package/lib/live-control/style/index.css +73 -0
- package/lib/live-control/style/index.d.ts +2 -0
- package/lib/live-control/style/index.js +6 -0
- package/lib/live-control/style/index.js.map +1 -0
- package/lib/live-control/style/index.less +65 -0
- package/{dist/types/components → lib}/live-player/index.d.ts +6 -4
- package/lib/live-player/index.js +178 -0
- package/lib/live-player/index.js.map +1 -0
- package/lib/live-player/style/css.js +6 -0
- package/lib/live-player/style/css.js.map +1 -0
- package/lib/live-player/style/index.css +83 -0
- package/lib/live-player/style/index.d.ts +2 -0
- package/lib/live-player/style/index.js +6 -0
- package/lib/live-player/style/index.js.map +1 -0
- package/lib/live-player/style/index.less +70 -0
- package/{dist/types/components → lib}/player/index.d.ts +5 -0
- package/lib/player/index.js +476 -0
- package/lib/player/index.js.map +1 -0
- package/lib/player/style/css.js +2 -0
- package/lib/player/style/css.js.map +1 -0
- package/lib/player/style/index.d.ts +1 -0
- package/lib/player/style/index.js +2 -0
- package/lib/player/style/index.js.map +1 -0
- package/lib/typings/@vtx/utils/index.d.ts +27 -0
- package/lib/typings/h5player.d.ts +131 -0
- package/{dist/types → lib}/utils/index.d.ts +3 -3
- package/lib/utils/index.js +265 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/vite-env.d.ts +1 -0
- package/package.json +30 -10
- package/dist/index.d.ts +0 -221
- 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/main.d.ts +0 -8
package/dist/index.d.ts
DELETED
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import moment from 'moment';
|
|
3
|
-
import { CloudControlPanelProps } from '@/components/controls';
|
|
4
|
-
import { VideoType as VideoType$1 } from '@/components/player';
|
|
5
|
-
import * as react from 'react';
|
|
6
|
-
import { GetHistoryUrlParams, LoadVideoInfoParams } from '@/api/types';
|
|
7
|
-
|
|
8
|
-
/** 视频流格式 */
|
|
9
|
-
declare type VideoType = 'flv' | 'hls' | 'hk_ws';
|
|
10
|
-
interface ConstructorParams {
|
|
11
|
-
url: string;
|
|
12
|
-
/** 渲染容器 */
|
|
13
|
-
container: HTMLDivElement;
|
|
14
|
-
/** 是否直播,flv.js需要 */
|
|
15
|
-
live?: boolean;
|
|
16
|
-
/** 视频流格式 */
|
|
17
|
-
type?: VideoType;
|
|
18
|
-
/** 开始时间,历史回放需要 */
|
|
19
|
-
startTime?: moment.MomentInput;
|
|
20
|
-
/** 结束时间,历史回放需要 */
|
|
21
|
-
endTime?: moment.MomentInput;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* 视频播放核心类
|
|
25
|
-
*/
|
|
26
|
-
declare class Player {
|
|
27
|
-
/** 视频地址 */
|
|
28
|
-
url: string;
|
|
29
|
-
/** 视频流格式 */
|
|
30
|
-
type: VideoType;
|
|
31
|
-
private player;
|
|
32
|
-
private video;
|
|
33
|
-
/** 开始时间,历史回放需要 */
|
|
34
|
-
private startTime?;
|
|
35
|
-
/** 结束时间,历史回放需要 */
|
|
36
|
-
private endTime?;
|
|
37
|
-
/** 跳转时间,用于处理进度条位置 */
|
|
38
|
-
private seekTime?;
|
|
39
|
-
/** 之前的视频播放速度,用于处理海康音量控制 */
|
|
40
|
-
private preSpeed;
|
|
41
|
-
constructor(params: ConstructorParams);
|
|
42
|
-
/** 播放 */
|
|
43
|
-
play(): Promise<void>;
|
|
44
|
-
/** 回放 */
|
|
45
|
-
playBack(): Promise<void>;
|
|
46
|
-
/** 销毁 */
|
|
47
|
-
destroy(): void;
|
|
48
|
-
/** 截图 */
|
|
49
|
-
capture(captureName?: string, time?: boolean): void;
|
|
50
|
-
/** 尺寸重置 */
|
|
51
|
-
resize(): void;
|
|
52
|
-
/**
|
|
53
|
-
* 设置音量
|
|
54
|
-
* @param value
|
|
55
|
-
*/
|
|
56
|
-
setVolume(value: number): void;
|
|
57
|
-
/**
|
|
58
|
-
* 设置播放速度
|
|
59
|
-
* @param speed
|
|
60
|
-
*/
|
|
61
|
-
setSpeed(speed: 0.5 | 1 | 2 | 4 | 8): void;
|
|
62
|
-
/**
|
|
63
|
-
* 时间更新事件
|
|
64
|
-
* @param callback 回调函数
|
|
65
|
-
*/
|
|
66
|
-
onTimeUpdate(callback: (currentTime: number, speed: number) => void): void;
|
|
67
|
-
/** 跳转到 */
|
|
68
|
-
seekTo(time: number): Promise<void>;
|
|
69
|
-
/**
|
|
70
|
-
* 暂停播放
|
|
71
|
-
* @param callback 回调函数
|
|
72
|
-
*/
|
|
73
|
-
pause(callback?: () => void): void;
|
|
74
|
-
/**
|
|
75
|
-
* 恢复播放
|
|
76
|
-
* @param callback 回调函数
|
|
77
|
-
*/
|
|
78
|
-
resume(callback?: () => void): void;
|
|
79
|
-
/**
|
|
80
|
-
* 开始对讲
|
|
81
|
-
* @param url 对讲地址
|
|
82
|
-
*/
|
|
83
|
-
startTalk(url: string): Promise<void>;
|
|
84
|
-
/**
|
|
85
|
-
* 开始对讲
|
|
86
|
-
* @param state 状态
|
|
87
|
-
*/
|
|
88
|
-
stopTalk(): Promise<void>;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
interface VtxPlayerProps$1 {
|
|
92
|
-
/** 视频流地址 */
|
|
93
|
-
url: string;
|
|
94
|
-
/** 宽度 */
|
|
95
|
-
width?: number;
|
|
96
|
-
/** 高度 */
|
|
97
|
-
height?: number;
|
|
98
|
-
/** 视频流格式,如果为空则根据url自行判断 */
|
|
99
|
-
type?: VideoType$1;
|
|
100
|
-
/** 截图文件名 */
|
|
101
|
-
captureName?: string;
|
|
102
|
-
/** 对讲地址 */
|
|
103
|
-
talkUrl?: string;
|
|
104
|
-
/** 云台控制 */
|
|
105
|
-
cloudParams?: CloudControlPanelProps;
|
|
106
|
-
}
|
|
107
|
-
declare const LivePlayer: (props: VtxPlayerProps$1) => JSX.Element;
|
|
108
|
-
|
|
109
|
-
declare type HistoryPlayerHandle = {
|
|
110
|
-
/**
|
|
111
|
-
* 跳转,目前仅支持海康视频跳转
|
|
112
|
-
*/
|
|
113
|
-
seekTo: (time: string) => Promise<void>;
|
|
114
|
-
};
|
|
115
|
-
interface VtxPlayerProps {
|
|
116
|
-
/** 视频流地址 */
|
|
117
|
-
url: string;
|
|
118
|
-
/** 视频流格式,如果为空则根据url自行判断 */
|
|
119
|
-
type?: VideoType$1;
|
|
120
|
-
/** 开始时间,格式为:YYYY-MM-DD HH:mm:ss */
|
|
121
|
-
startTime: string;
|
|
122
|
-
/** 结束时间,格式为:YYYY-MM-DD HH:mm:ss */
|
|
123
|
-
endTime: string;
|
|
124
|
-
/** 宽度 */
|
|
125
|
-
width?: number;
|
|
126
|
-
/** 高度 */
|
|
127
|
-
height?: number;
|
|
128
|
-
/** 截图文件名 */
|
|
129
|
-
captureName?: string;
|
|
130
|
-
/** 控制条bottom */
|
|
131
|
-
controlBottom?: number;
|
|
132
|
-
/** 播放器进度回调,time:YYYY-MM-DD HH:mm:ss speed:播放速率 */
|
|
133
|
-
onTimeChange?: (time: string, speed: number) => void;
|
|
134
|
-
}
|
|
135
|
-
declare const HistoryPlayer: react.ForwardRefExoticComponent<VtxPlayerProps & react.RefAttributes<HistoryPlayerHandle>>;
|
|
136
|
-
|
|
137
|
-
declare type LiveControlHandle = {
|
|
138
|
-
/** 加载视频 */
|
|
139
|
-
load: (channel: ChannelType) => void;
|
|
140
|
-
/** 卸载视频,参数为通道编号 */
|
|
141
|
-
unLoad: (channelNum: string) => void;
|
|
142
|
-
/** 一次加载多个视频,适用于初始化 */
|
|
143
|
-
multiLoad: (channels: ChannelType[]) => void;
|
|
144
|
-
};
|
|
145
|
-
interface LiveControlProps {
|
|
146
|
-
/** 展开/收缩按钮回调 */
|
|
147
|
-
onExpandChange?: (expand: boolean) => void;
|
|
148
|
-
/** 视频关闭回调,参数为通道编号数组 */
|
|
149
|
-
onChannelChange?: (channelSNum: string[]) => void;
|
|
150
|
-
/** 宽度 */
|
|
151
|
-
width?: number | string;
|
|
152
|
-
/** 高度 */
|
|
153
|
-
height?: number | string;
|
|
154
|
-
/** 轮询频率 */
|
|
155
|
-
polling?: number | undefined;
|
|
156
|
-
}
|
|
157
|
-
declare type ChannelType = {
|
|
158
|
-
/** 通道号 */
|
|
159
|
-
channelNum: string;
|
|
160
|
-
/** 设备ID */
|
|
161
|
-
deviceId?: string;
|
|
162
|
-
/** 协议 */
|
|
163
|
-
protocol?: string;
|
|
164
|
-
};
|
|
165
|
-
/**
|
|
166
|
-
* 实时分屏组件
|
|
167
|
-
*/
|
|
168
|
-
declare const LiveControl: react.ForwardRefExoticComponent<LiveControlProps & react.RefAttributes<LiveControlHandle>>;
|
|
169
|
-
|
|
170
|
-
declare type HistoryControlHandle = {
|
|
171
|
-
load: (channel: GetHistoryUrlParams) => void;
|
|
172
|
-
};
|
|
173
|
-
interface HistoryControlProps {
|
|
174
|
-
/** 宽度 */
|
|
175
|
-
width?: number;
|
|
176
|
-
/** 高度 */
|
|
177
|
-
height?: number;
|
|
178
|
-
/** 展开/收缩按钮回调 */
|
|
179
|
-
onExpandChange?: (expand: boolean) => void;
|
|
180
|
-
/** 播放器进度回调,time:YYYY-MM-DD HH:mm:ss */
|
|
181
|
-
onTimeChange?: (time: string) => void;
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* 历史视频控制器
|
|
185
|
-
*/
|
|
186
|
-
declare const HistoryControl: react.ForwardRefExoticComponent<HistoryControlProps & react.RefAttributes<HistoryControlHandle>>;
|
|
187
|
-
|
|
188
|
-
interface BillPlayerProps {
|
|
189
|
-
/** 参数 */
|
|
190
|
-
params: LoadVideoInfoParams;
|
|
191
|
-
/** 宽度 */
|
|
192
|
-
width?: string | number;
|
|
193
|
-
/** 高度 */
|
|
194
|
-
height?: string | number;
|
|
195
|
-
/** 是否显示实时视频,默认为true */
|
|
196
|
-
live?: boolean;
|
|
197
|
-
/** 是否显示历史视频,默认为true */
|
|
198
|
-
history?: boolean;
|
|
199
|
-
/** 实时默认播放 */
|
|
200
|
-
defaultLivePlay?: boolean;
|
|
201
|
-
/** 历史默认播放 */
|
|
202
|
-
defaultHistoryPlay?: boolean;
|
|
203
|
-
}
|
|
204
|
-
declare const BillPlayer: (props: BillPlayerProps) => JSX.Element;
|
|
205
|
-
|
|
206
|
-
interface LiveChannelPlayerProps {
|
|
207
|
-
/** 通道ID */
|
|
208
|
-
channelId: string;
|
|
209
|
-
/** 宽度 */
|
|
210
|
-
width?: number;
|
|
211
|
-
/** 高度 */
|
|
212
|
-
height?: number;
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* 基于通道ID的实时播放器
|
|
216
|
-
* @param props
|
|
217
|
-
* @returns
|
|
218
|
-
*/
|
|
219
|
-
declare const LiveChannelPlayer: (props: LiveChannelPlayerProps) => JSX.Element | undefined;
|
|
220
|
-
|
|
221
|
-
export { BillPlayer, HistoryControl, HistoryPlayer, LiveChannelPlayer, LiveControl, LivePlayer, Player };
|