@ezuikit/player-theme 0.0.1-alpha.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/README.md +40 -0
- package/dist/index.js +10606 -0
- package/dist/index.mjs +10592 -0
- package/dist/index.umd.js +13844 -0
- package/dist/style.css +30 -0
- package/dist/style.js +6 -0
- package/dist/types/index.d.ts +2556 -0
- package/package.json +48 -0
|
@@ -0,0 +1,2556 @@
|
|
|
1
|
+
import EventEmitter from 'eventemitter3';
|
|
2
|
+
import Picker from '@skax/picker';
|
|
3
|
+
import I18n, { I18nTranslation } from '@ezuikit/utils-i18n';
|
|
4
|
+
import { LoggerCls, LoggerOptions } from '@ezuikit/utils-logger';
|
|
5
|
+
import { BasePtzOptions } from '@ezuikit/control-ptz';
|
|
6
|
+
import Zoom from '@ezuikit/control-zoom';
|
|
7
|
+
import { TimeLineTimeSection } from '@ezuikit/control-time-line';
|
|
8
|
+
|
|
9
|
+
declare const THEME_PROPS: readonly ["width", "height", "playing", "volume", "muted", "loading", "recType", "isCurrentFullscreen", "orientationAngle", "zooming", "zoom", "recording", "recordList", "speed", "urlInfo", "videoLevelList", "videoLevel"];
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 控件基类配置项
|
|
13
|
+
*/
|
|
14
|
+
interface ControlOptions {
|
|
15
|
+
/** 播放器窗口节点 */
|
|
16
|
+
rootContainer?: HTMLElement;
|
|
17
|
+
/** 挂载节点 player id, 默认挂载 body 上 */
|
|
18
|
+
getPopupContainer?: () => HTMLElement;
|
|
19
|
+
/** 给控件新增自定义类名 */
|
|
20
|
+
className?: string;
|
|
21
|
+
/** 语言数据 */
|
|
22
|
+
locale?: Record<string, string>;
|
|
23
|
+
/** 样式类后缀 */
|
|
24
|
+
classNameSuffix?: string;
|
|
25
|
+
/**
|
|
26
|
+
* 渲染节点标签
|
|
27
|
+
*/
|
|
28
|
+
tagName?: 'div' | 'span';
|
|
29
|
+
/**
|
|
30
|
+
* 控件类型, 默认 button
|
|
31
|
+
*/
|
|
32
|
+
controlType?: 'button' | 'text' | 'block';
|
|
33
|
+
/**
|
|
34
|
+
* 当前语言
|
|
35
|
+
*/
|
|
36
|
+
language?: 'zh' | 'en' | string;
|
|
37
|
+
/**
|
|
38
|
+
* 所有语言数据
|
|
39
|
+
*/
|
|
40
|
+
locales?: Record<string, Record<string | number, string | number>>;
|
|
41
|
+
onClick?: (e: Event) => void;
|
|
42
|
+
/**
|
|
43
|
+
* ----- 播放器状态 -------
|
|
44
|
+
* 窗口宽度 width?: number;
|
|
45
|
+
* 窗口高度 height?: number;
|
|
46
|
+
* 窗口是否全屏 isCurrentFullscreen?: boolean;
|
|
47
|
+
* 播放器是否播放中 playing?: boolean;
|
|
48
|
+
* 音量大小 0-1 volume?: number;
|
|
49
|
+
* 是否静音 muted?: boolean;
|
|
50
|
+
* 浏览器选择角度 0 | 90 | 180 | 270 orientationAngle?: number;
|
|
51
|
+
*/
|
|
52
|
+
props?: Record<(typeof THEME_PROPS)[number], number | string | Record<string, unknown>>;
|
|
53
|
+
[key: string]: any;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* 不允许控件自定义的参数
|
|
57
|
+
* @typeParam T - 控件配置项
|
|
58
|
+
*/
|
|
59
|
+
type OmitControlOptions<T extends ControlOptions> = Omit<T, 'rootContainer' | 'getPopupContainer' | 'classNameSuffix' | 'type' | 'tagName' | 'controlType'>;
|
|
60
|
+
/**
|
|
61
|
+
* 控件基类
|
|
62
|
+
* @category Control
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* // 创建控件
|
|
66
|
+
* class MyControl extends Control {}
|
|
67
|
+
*
|
|
68
|
+
* // 使用控件
|
|
69
|
+
* const myControl = new MyControl({})
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
declare class Control extends EventEmitter {
|
|
73
|
+
/**
|
|
74
|
+
* 控件内容
|
|
75
|
+
*/
|
|
76
|
+
$container: HTMLDivElement | HTMLSpanElement;
|
|
77
|
+
/**
|
|
78
|
+
* 控件挂载的节点
|
|
79
|
+
*/
|
|
80
|
+
$popupContainer: HTMLElement;
|
|
81
|
+
/** 具体语言对应的值 */
|
|
82
|
+
locale: Record<string | number, string> | null;
|
|
83
|
+
protected __options: ControlOptions;
|
|
84
|
+
protected _disabled: boolean;
|
|
85
|
+
protected _active: boolean;
|
|
86
|
+
constructor(options: Partial<ControlOptions>);
|
|
87
|
+
/**
|
|
88
|
+
* 是否激活
|
|
89
|
+
*/
|
|
90
|
+
get active(): boolean;
|
|
91
|
+
set active(active: boolean);
|
|
92
|
+
/**
|
|
93
|
+
* 是否禁用
|
|
94
|
+
*/
|
|
95
|
+
get disabled(): boolean;
|
|
96
|
+
set disabled(disabled: boolean);
|
|
97
|
+
/**
|
|
98
|
+
* 重置整个控件
|
|
99
|
+
*/
|
|
100
|
+
reset(hide?: boolean): void;
|
|
101
|
+
/**
|
|
102
|
+
* 重置控件挂载节点
|
|
103
|
+
* @param popupContainer 重新挂载的节点
|
|
104
|
+
* @param append 添加的方式, 默认 append
|
|
105
|
+
* @param element 当 append = before 时 需要 element, 插入 element 前
|
|
106
|
+
*
|
|
107
|
+
* | prepend | append |
|
|
108
|
+
* |:-------------:|:---------------:|
|
|
109
|
+
* | 插入第一个位置 | 追加在末尾 |
|
|
110
|
+
*/
|
|
111
|
+
resetPopupContainer(popupContainer: Element, append?: 'prepend' | 'append' | 'before', element?: Element): void;
|
|
112
|
+
/**
|
|
113
|
+
* 隐藏整个控件
|
|
114
|
+
*/
|
|
115
|
+
hide(): void;
|
|
116
|
+
/**
|
|
117
|
+
* 销毁控件
|
|
118
|
+
*/
|
|
119
|
+
destroy(): void;
|
|
120
|
+
private get _camelCaseName();
|
|
121
|
+
protected _updateDisabledState(disabled: boolean): void;
|
|
122
|
+
protected _updateActiveState(active: boolean): void;
|
|
123
|
+
/**
|
|
124
|
+
* 当点击 Control 时 触发子类的 _onControlClick
|
|
125
|
+
*/
|
|
126
|
+
protected _onClick(): void;
|
|
127
|
+
protected _onDBlClick(e: Event): void;
|
|
128
|
+
/**
|
|
129
|
+
* 点击 Control 控件触发
|
|
130
|
+
* @param {Event} e
|
|
131
|
+
* @returns {void}
|
|
132
|
+
*/
|
|
133
|
+
protected _onControlClick(e: Event): void;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* 加载动画控件配置项
|
|
138
|
+
*/
|
|
139
|
+
interface LoadingOptions extends Omit<ControlOptions, 'tagName' | 'controlType'> {
|
|
140
|
+
/**
|
|
141
|
+
* 自定义加载动画的 HTML 结构, 当 theme.loading = true 时展示
|
|
142
|
+
* @returns HTML 字符串
|
|
143
|
+
*/
|
|
144
|
+
render?: () => string;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* 加载动画控件
|
|
148
|
+
* @category Control
|
|
149
|
+
*/
|
|
150
|
+
declare class Loading extends Control {
|
|
151
|
+
private readonly _options;
|
|
152
|
+
constructor(options?: Partial<LoadingOptions>);
|
|
153
|
+
private _html;
|
|
154
|
+
/**
|
|
155
|
+
* 动画展示
|
|
156
|
+
* @param html 自定义动画内容, 如果不存在则使用默认动画
|
|
157
|
+
*/
|
|
158
|
+
show(html?: string): void;
|
|
159
|
+
/**
|
|
160
|
+
* 隐藏动画
|
|
161
|
+
*/
|
|
162
|
+
hide(): void;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* 封面控件配置项
|
|
167
|
+
*/
|
|
168
|
+
interface PosterOptions extends Omit<ControlOptions, 'tagName'> {
|
|
169
|
+
/** 默认封面 */
|
|
170
|
+
poster?: string;
|
|
171
|
+
/** 封面加载失败回调 */
|
|
172
|
+
onLoadImgError?: (src: string) => void;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* 封面控件
|
|
176
|
+
* @category Control
|
|
177
|
+
*/
|
|
178
|
+
declare class Poster extends Control {
|
|
179
|
+
private readonly _options;
|
|
180
|
+
constructor(options?: Partial<PosterOptions>);
|
|
181
|
+
/**
|
|
182
|
+
* 封面图片加载失败
|
|
183
|
+
* @param error
|
|
184
|
+
*/
|
|
185
|
+
private _imgLoadErrorEvent;
|
|
186
|
+
/**
|
|
187
|
+
* 设置封面 这里不对 poster 进行缓存,如果有值优先使用,如果没有值优先使用 初始化传入的值
|
|
188
|
+
* @param {string} poster 封面地址或 base64 数据
|
|
189
|
+
*/
|
|
190
|
+
setPoster(poster?: string): void;
|
|
191
|
+
/**
|
|
192
|
+
* 展示封面 这里不对 poster 进行缓存, 如果有值优先使用, 如果没有值优先使用 初始化传入的值
|
|
193
|
+
*/
|
|
194
|
+
show(): void;
|
|
195
|
+
/**
|
|
196
|
+
* 隐藏封面
|
|
197
|
+
*/
|
|
198
|
+
hide(): void;
|
|
199
|
+
/**
|
|
200
|
+
* 销毁
|
|
201
|
+
*/
|
|
202
|
+
destroy(): void;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* 消息类型
|
|
207
|
+
* info 普通消息, 内容默认字体白色
|
|
208
|
+
* warn 警告消息, 内容默认字体白色
|
|
209
|
+
* error 错误消息, 内容默认字体白色
|
|
210
|
+
*/
|
|
211
|
+
type MessageType = 'info' | 'warn' | 'error';
|
|
212
|
+
/**
|
|
213
|
+
* 消息控件配置项
|
|
214
|
+
*/
|
|
215
|
+
interface MessageOptions extends Omit<ControlOptions, 'tagName' | 'controlType'> {
|
|
216
|
+
/** 自定义消息内容渲染函数, 默认使用内置的渲染函数
|
|
217
|
+
* @param {string} msg 消息内容
|
|
218
|
+
* @param {number} duration 认自动关闭延时,单位秒, 默认 0 不关闭, 需手动调用 hide()
|
|
219
|
+
* @param {MessageType} type 消息类型
|
|
220
|
+
* @returns {string} html
|
|
221
|
+
*/
|
|
222
|
+
render?: (msg: string, duration: number, type: MessageType) => string;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* 消息控件
|
|
226
|
+
* @category Control
|
|
227
|
+
*/
|
|
228
|
+
declare class Message extends Control {
|
|
229
|
+
private readonly options;
|
|
230
|
+
private _timer;
|
|
231
|
+
private _toastTimer;
|
|
232
|
+
private _$toast;
|
|
233
|
+
constructor(options?: Partial<MessageOptions>);
|
|
234
|
+
/**
|
|
235
|
+
* info 普通消息, 内容默认字体白色
|
|
236
|
+
* @param {string} msg 消息内容
|
|
237
|
+
* @param {number} duration 认自动关闭延时,单位秒, 默认 2s后 关闭, 需手动 调用 hide()
|
|
238
|
+
*/
|
|
239
|
+
info(msg: string, duration?: number): void;
|
|
240
|
+
/**
|
|
241
|
+
* warn 警告消息, 内容默认字体黄色
|
|
242
|
+
* @param {string} msg 消息内容
|
|
243
|
+
* @param {number} duration 认自动关闭延时,单位秒, 默认 2s后 关闭, 需手动 调用 hide()
|
|
244
|
+
*/
|
|
245
|
+
warn(msg: string, duration?: number): void;
|
|
246
|
+
toastError(msg: string, duration?: number): void;
|
|
247
|
+
/**
|
|
248
|
+
* error 错误消息, 内容默认字体红色
|
|
249
|
+
* @param {string} msg 消息内容
|
|
250
|
+
* @param {number=} duration 认自动关闭延时,单位秒, 默认 0 不关闭, 需手动 调用 hide()
|
|
251
|
+
*/
|
|
252
|
+
error(msg: string, duration?: number): void;
|
|
253
|
+
private _toast;
|
|
254
|
+
/**
|
|
255
|
+
* 展示消息,如果同时调用多次只展示最后一次的消息
|
|
256
|
+
* @param {string} msg 消息内容, 支持 html dom 字符串
|
|
257
|
+
* @param {number} duration 认自动关闭延时,单位秒, 默认 0 不关闭 需手动 调用 hide()
|
|
258
|
+
* @param {MessageType} type 消息类型
|
|
259
|
+
*/
|
|
260
|
+
private _show;
|
|
261
|
+
/**
|
|
262
|
+
* 销毁
|
|
263
|
+
*/
|
|
264
|
+
destroy(): void;
|
|
265
|
+
/**
|
|
266
|
+
* 隐藏消息, 并清空消息内容
|
|
267
|
+
*/
|
|
268
|
+
hide(): void;
|
|
269
|
+
private _getIcon;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Header/Footer 的父组件
|
|
274
|
+
*/
|
|
275
|
+
interface ComponentOptions {
|
|
276
|
+
/** 挂载节点 player id, 默认挂载 body 上 */
|
|
277
|
+
getPopupContainer?: () => HTMLElement;
|
|
278
|
+
className?: string;
|
|
279
|
+
color?: string;
|
|
280
|
+
activeColor?: string;
|
|
281
|
+
backgroundColor?: string;
|
|
282
|
+
cType: 'header' | 'footer';
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Header
|
|
286
|
+
*/
|
|
287
|
+
declare class Component {
|
|
288
|
+
$container: HTMLDivElement;
|
|
289
|
+
$popupContainer: HTMLElement;
|
|
290
|
+
private readonly _options;
|
|
291
|
+
private readonly _defaultClass;
|
|
292
|
+
$left: HTMLDivElement;
|
|
293
|
+
$right: HTMLDivElement;
|
|
294
|
+
constructor(options?: Partial<ComponentOptions>);
|
|
295
|
+
/**
|
|
296
|
+
* 销毁 header
|
|
297
|
+
*/
|
|
298
|
+
destroy(): void;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Header options
|
|
303
|
+
*/
|
|
304
|
+
type FooterOptions = ComponentOptions;
|
|
305
|
+
declare class Footer extends Component {
|
|
306
|
+
constructor(options?: Partial<FooterOptions>);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Header options
|
|
311
|
+
*/
|
|
312
|
+
type HeaderOptions = ComponentOptions;
|
|
313
|
+
declare class Header extends Component {
|
|
314
|
+
constructor(options?: Partial<HeaderOptions>);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* 播放/暂停控件配置项
|
|
319
|
+
*/
|
|
320
|
+
interface PlayOptions extends Omit<ControlOptions, 'tagName'> {
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* 播放/暂停控件
|
|
324
|
+
* @category Control
|
|
325
|
+
*/
|
|
326
|
+
declare class Play extends Control {
|
|
327
|
+
private readonly _options;
|
|
328
|
+
private _playing;
|
|
329
|
+
constructor(options: PlayOptions);
|
|
330
|
+
/**
|
|
331
|
+
* 播放状态
|
|
332
|
+
*/
|
|
333
|
+
get playing(): boolean;
|
|
334
|
+
/**
|
|
335
|
+
* 点击 Control 会触发
|
|
336
|
+
*/
|
|
337
|
+
protected _onControlClick(e: Event): void;
|
|
338
|
+
private _render;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* 进度条配置项
|
|
343
|
+
* @category Control
|
|
344
|
+
*/
|
|
345
|
+
interface ProgressOptions {
|
|
346
|
+
/**
|
|
347
|
+
* 进度条容器
|
|
348
|
+
* @throws
|
|
349
|
+
* Error('container is required')
|
|
350
|
+
*/
|
|
351
|
+
container: HTMLElement;
|
|
352
|
+
/**
|
|
353
|
+
* 进度条容器的样式类名
|
|
354
|
+
*/
|
|
355
|
+
className?: string;
|
|
356
|
+
/**
|
|
357
|
+
* 进度条的步长
|
|
358
|
+
* @default 0.01
|
|
359
|
+
* @example
|
|
360
|
+
* ```ts
|
|
361
|
+
* step: 0.01
|
|
362
|
+
* ```
|
|
363
|
+
*/
|
|
364
|
+
step?: number;
|
|
365
|
+
/**
|
|
366
|
+
* 区间, 默认 [0, 1]
|
|
367
|
+
* @default [0, 1]
|
|
368
|
+
* @throws
|
|
369
|
+
* Error('Progress range must be an array with two elements.')
|
|
370
|
+
* @throws
|
|
371
|
+
* Error('Progress range first element must be less than the second element.')
|
|
372
|
+
*/
|
|
373
|
+
range?: [number, number];
|
|
374
|
+
/**
|
|
375
|
+
* 展示百分比
|
|
376
|
+
* @default true
|
|
377
|
+
*/
|
|
378
|
+
showPercent?: boolean;
|
|
379
|
+
/**
|
|
380
|
+
* 显示加号按钮
|
|
381
|
+
* @default false
|
|
382
|
+
*/
|
|
383
|
+
showPlus?: boolean;
|
|
384
|
+
/**
|
|
385
|
+
* 显示减号按钮
|
|
386
|
+
* @default false
|
|
387
|
+
*/
|
|
388
|
+
showMinus?: boolean;
|
|
389
|
+
/**
|
|
390
|
+
* 默认进度条值
|
|
391
|
+
* @default range[0]
|
|
392
|
+
*/
|
|
393
|
+
defaultValue?: number;
|
|
394
|
+
/**
|
|
395
|
+
* 是否可拖拽
|
|
396
|
+
* @default true
|
|
397
|
+
*/
|
|
398
|
+
draggable?: boolean;
|
|
399
|
+
/**
|
|
400
|
+
* 是否禁用
|
|
401
|
+
* @default false
|
|
402
|
+
*/
|
|
403
|
+
disabled?: boolean;
|
|
404
|
+
/**
|
|
405
|
+
* 旋转状态, 默认 false (垂直方向)。 true (水平方向)
|
|
406
|
+
*/
|
|
407
|
+
isRotated?: boolean;
|
|
408
|
+
/**
|
|
409
|
+
* 进度条百分比变化
|
|
410
|
+
* @param value - 值
|
|
411
|
+
* @param percent - 进度条百分比
|
|
412
|
+
* @param range - 区间
|
|
413
|
+
*/
|
|
414
|
+
onChange?: (value: number, percent: number, range: [number, number]) => void;
|
|
415
|
+
/**
|
|
416
|
+
* 点击加号按钮
|
|
417
|
+
* @param value - 值
|
|
418
|
+
* @param percent - 进度条百分比
|
|
419
|
+
* @param range - 区间
|
|
420
|
+
*/
|
|
421
|
+
onPlusClick?: (value: number, percent: number, range: [number, number]) => void;
|
|
422
|
+
/**
|
|
423
|
+
* 点击减号按钮
|
|
424
|
+
* @param value - 值
|
|
425
|
+
* @param percent - 进度条百分比
|
|
426
|
+
* @param range - 区间
|
|
427
|
+
*/
|
|
428
|
+
onMinusClick?: (value: number, percent: number, range: [number, number]) => void;
|
|
429
|
+
/**
|
|
430
|
+
* 点击进度条
|
|
431
|
+
* @param value - 值
|
|
432
|
+
* @param percent - 进度条百分比
|
|
433
|
+
* @param range - 区间
|
|
434
|
+
*/
|
|
435
|
+
onProgressClick?: (value: number, percent: number, range: [number, number]) => void;
|
|
436
|
+
/**
|
|
437
|
+
*
|
|
438
|
+
* @param value - 值
|
|
439
|
+
* @param percent - 进度条百分比
|
|
440
|
+
* @param range 区间
|
|
441
|
+
* @returns
|
|
442
|
+
*/
|
|
443
|
+
renderText?: (value: number, percent: number, range: [number, number]) => string;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* 进度条
|
|
447
|
+
*
|
|
448
|
+
* @category Control
|
|
449
|
+
* @example
|
|
450
|
+
* ```ts
|
|
451
|
+
* const progress = new Progress({
|
|
452
|
+
* container: document.getElementById('progress-container'),
|
|
453
|
+
* step: 0.01,
|
|
454
|
+
* range: [0, 1],
|
|
455
|
+
* onChange: (value, range) => {
|
|
456
|
+
* console.log(`Progress changed: ${value}, Range: ${range}`);
|
|
457
|
+
* },
|
|
458
|
+
* defaultValue: 0.5,
|
|
459
|
+
* draggable: true,
|
|
460
|
+
* disabled: false,
|
|
461
|
+
* })
|
|
462
|
+
*/
|
|
463
|
+
declare class Progress {
|
|
464
|
+
options: Required<ProgressOptions>;
|
|
465
|
+
$container: HTMLElement;
|
|
466
|
+
$content: HTMLElement;
|
|
467
|
+
_percent: number;
|
|
468
|
+
_value: number;
|
|
469
|
+
_disabled: boolean;
|
|
470
|
+
private _delegateSliderMouseDown;
|
|
471
|
+
private _delegateSliderHandleMouseDown;
|
|
472
|
+
private _delegateProgressMouseDown;
|
|
473
|
+
private _delegatePlusClick;
|
|
474
|
+
private _delegateMinusClick;
|
|
475
|
+
private _isRotated;
|
|
476
|
+
constructor(options: ProgressOptions);
|
|
477
|
+
get disabled(): boolean;
|
|
478
|
+
set disabled(disabled: boolean);
|
|
479
|
+
/**
|
|
480
|
+
* 获取进度条值
|
|
481
|
+
* @returns {number} 当前进度条值
|
|
482
|
+
* @example
|
|
483
|
+
* ```ts
|
|
484
|
+
* const value = progress.value; // 获取当前进度条值
|
|
485
|
+
* console.log(value); // 输出值
|
|
486
|
+
* ```
|
|
487
|
+
*/
|
|
488
|
+
get value(): number;
|
|
489
|
+
set value(value: number);
|
|
490
|
+
/**
|
|
491
|
+
* 获取进度百分比
|
|
492
|
+
* @returns {number} 当前进度条百分比
|
|
493
|
+
* @example
|
|
494
|
+
* ```ts
|
|
495
|
+
* const percent = progress.percent; // 获取当前进度条百分比
|
|
496
|
+
* console.log(percent); // 输出百分比
|
|
497
|
+
* ```
|
|
498
|
+
*/
|
|
499
|
+
get percent(): number;
|
|
500
|
+
set percent(percent: number);
|
|
501
|
+
/**
|
|
502
|
+
* 是否旋转了
|
|
503
|
+
* @param rotated
|
|
504
|
+
*/
|
|
505
|
+
isRotate(rotated: boolean): void;
|
|
506
|
+
/**
|
|
507
|
+
* 销毁 Progress 实例,移除事件监听器
|
|
508
|
+
* @returns {void}
|
|
509
|
+
* @memberof Progress
|
|
510
|
+
* @example
|
|
511
|
+
* ```ts
|
|
512
|
+
* progress.destroy();
|
|
513
|
+
* ```
|
|
514
|
+
*/
|
|
515
|
+
destroy(): void;
|
|
516
|
+
private _updateValuePercent;
|
|
517
|
+
private _convertPercentToValue;
|
|
518
|
+
private _convertValueToPercent;
|
|
519
|
+
private _render;
|
|
520
|
+
private _updateUI;
|
|
521
|
+
private _eventListeners;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* 音量调节控件配置
|
|
526
|
+
*/
|
|
527
|
+
interface VolumeOptions extends Omit<ControlOptions, 'tagName'> {
|
|
528
|
+
/** 是否静音, 默认false */
|
|
529
|
+
muted?: boolean;
|
|
530
|
+
/** 初始化音量大小, 默认 0.8 */
|
|
531
|
+
volume?: number;
|
|
532
|
+
/** 音量控制面板是否默认展示, 默认 false, (移动端不生效) */
|
|
533
|
+
open?: boolean;
|
|
534
|
+
/** 调节音量面板展开或隐藏变换触发 */
|
|
535
|
+
onOpenChange?: (open: boolean, volume: number, muted: boolean) => void;
|
|
536
|
+
/** 静音或音量变化时触发 (静音时音量返回静音前的音量) */
|
|
537
|
+
onChange?: (volume: number, muted: boolean) => void;
|
|
538
|
+
/**
|
|
539
|
+
* picker 弹出方式, 默认 hover
|
|
540
|
+
* - hover: 鼠标悬停时弹出
|
|
541
|
+
* - click: 点击时弹出
|
|
542
|
+
*/
|
|
543
|
+
trigger?: 'hover' | 'click';
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* 音量调节控件
|
|
547
|
+
* @category Control
|
|
548
|
+
*/
|
|
549
|
+
declare class Volume extends Control {
|
|
550
|
+
private readonly _options;
|
|
551
|
+
private _muted;
|
|
552
|
+
private _volume;
|
|
553
|
+
/** 用来记录静音前的音量 */
|
|
554
|
+
private _lastVolume;
|
|
555
|
+
picker: Picker | null;
|
|
556
|
+
_progress: Progress | null;
|
|
557
|
+
constructor(options?: VolumeOptions);
|
|
558
|
+
/**
|
|
559
|
+
* 是否静音
|
|
560
|
+
*/
|
|
561
|
+
get muted(): boolean;
|
|
562
|
+
set muted(muted: boolean);
|
|
563
|
+
/**
|
|
564
|
+
* 当前音量值(真实值 即使静音)
|
|
565
|
+
*/
|
|
566
|
+
get volume(): number;
|
|
567
|
+
set volume(volume: number);
|
|
568
|
+
/**
|
|
569
|
+
* 是否禁用
|
|
570
|
+
*/
|
|
571
|
+
get disabled(): boolean;
|
|
572
|
+
set disabled(disabled: boolean);
|
|
573
|
+
/**
|
|
574
|
+
* 销毁
|
|
575
|
+
*/
|
|
576
|
+
destroy(): void;
|
|
577
|
+
private _toggleMute;
|
|
578
|
+
private _updateUI;
|
|
579
|
+
get _$content(): HTMLDivElement;
|
|
580
|
+
private _render;
|
|
581
|
+
/**
|
|
582
|
+
* 点击 Control 会触发
|
|
583
|
+
*/
|
|
584
|
+
protected _onControlClick(): void;
|
|
585
|
+
private _addEventListener;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* 全屏信息
|
|
590
|
+
*/
|
|
591
|
+
interface FullscreenChangeInfo {
|
|
592
|
+
/** 当前窗口是否处于全屏 */
|
|
593
|
+
isCurrentFullscreen: boolean;
|
|
594
|
+
/** 浏览器中是否有全屏 (移动端中永远是 false) */
|
|
595
|
+
isFullscreen: boolean;
|
|
596
|
+
/** 是否是移动端 */
|
|
597
|
+
isMobile: boolean;
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* 全屏变化回调
|
|
601
|
+
*/
|
|
602
|
+
type FullscreenChange = (info: FullscreenChangeInfo) => void;
|
|
603
|
+
/**
|
|
604
|
+
* 全屏配置项
|
|
605
|
+
*/
|
|
606
|
+
interface FullscreenOptions$1 {
|
|
607
|
+
prefix?: string;
|
|
608
|
+
isFullscreen?: boolean;
|
|
609
|
+
onChange?: FullscreenChange;
|
|
610
|
+
onError?: () => void;
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
*
|
|
614
|
+
* 全屏控制 {@link https://developer.mozilla.org/zh-CN/docs/Web/API/Fullscreen_API | 全屏 API}
|
|
615
|
+
*
|
|
616
|
+
* 依赖 screenfull {@link https://github.com/sindresorhus/screenfull}
|
|
617
|
+
*
|
|
618
|
+
* 移动端限制与注意:
|
|
619
|
+
* 微信、支付宝等内置浏览器通常不支持标准全屏 API。
|
|
620
|
+
* Safari(iOS)对全屏支持有限,只能视频元素全屏。
|
|
621
|
+
* 建议:在支持的浏览器使用标准 API,其余可用“模拟全屏”方式(如遮罩、固定定位等)
|
|
622
|
+
* 当前库仅支持 PC 端全屏,不支持移动端全屏(模拟全屏)
|
|
623
|
+
*
|
|
624
|
+
* ios 中浏览器横屏(旋转 90度 或 -90度)时,左右有有留白(空隙) 系统限制没法解决
|
|
625
|
+
*
|
|
626
|
+
* 部分 safari 浏览器在全屏状态下 再次调用全屏 screenfull.element 为 undefined, 避免同一个节点多次调用全屏操作
|
|
627
|
+
*
|
|
628
|
+
* 注意:不要让当前节点全屏后,在不取消的情况下,再去全屏其他节点
|
|
629
|
+
*
|
|
630
|
+
* @example
|
|
631
|
+
* ```ts
|
|
632
|
+
* const fullscreen = new Fullscreen(document.getElementById('container'),
|
|
633
|
+
* {
|
|
634
|
+
* onChange: () => {}
|
|
635
|
+
* }
|
|
636
|
+
* )
|
|
637
|
+
*
|
|
638
|
+
* fullscreen.fullscreen()
|
|
639
|
+
* fullscreen.exitFullscreen()
|
|
640
|
+
* fullscreen.toggle()
|
|
641
|
+
* fullscreen.destroy()
|
|
642
|
+
* ```
|
|
643
|
+
*/
|
|
644
|
+
declare class Fullscreen$1 {
|
|
645
|
+
$container: HTMLElement;
|
|
646
|
+
private readonly _options;
|
|
647
|
+
private _isCurrentFullscreen;
|
|
648
|
+
private _isFullscreen;
|
|
649
|
+
/** safari 浏览器在全屏状态下 再次调用全屏 screenfull.element 为 undefined, 记录上一次的全屏节点, 避免同一个节点多次调用全屏操作 */
|
|
650
|
+
private _currentFullscreenElementList;
|
|
651
|
+
constructor(container: HTMLElement, options?: FullscreenOptions$1);
|
|
652
|
+
/**
|
|
653
|
+
* 全屏
|
|
654
|
+
* @returns Promise<void>
|
|
655
|
+
*/
|
|
656
|
+
fullscreen(): Promise<void>;
|
|
657
|
+
/**
|
|
658
|
+
* 退出全屏
|
|
659
|
+
* @returns Promise<void>
|
|
660
|
+
*/
|
|
661
|
+
exitFullscreen(): Promise<void>;
|
|
662
|
+
/**
|
|
663
|
+
* 全屏切换
|
|
664
|
+
* @returns Promise<void>
|
|
665
|
+
*/
|
|
666
|
+
toggle(): Promise<void>;
|
|
667
|
+
/**
|
|
668
|
+
* 全屏监听销毁
|
|
669
|
+
*/
|
|
670
|
+
destroy(): void;
|
|
671
|
+
/**
|
|
672
|
+
* screenfull change event
|
|
673
|
+
*/
|
|
674
|
+
private _fullscreenchange2;
|
|
675
|
+
private _fullscreenchange;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
interface FullscreenOptions extends Omit<ControlOptions, 'tagName'> {
|
|
679
|
+
/**
|
|
680
|
+
* 全屏改变
|
|
681
|
+
* @param info FullscreenChangeInfo 全屏信息
|
|
682
|
+
*/
|
|
683
|
+
onChange?: (info: FullscreenChangeInfo) => void;
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* 全屏控件
|
|
687
|
+
* @category Control
|
|
688
|
+
*/
|
|
689
|
+
declare class Fullscreen extends Control {
|
|
690
|
+
protected readonly options: FullscreenOptions;
|
|
691
|
+
isCurrentFullscreen: boolean;
|
|
692
|
+
protected _fullscreenUtil: Fullscreen$1 | null;
|
|
693
|
+
protected readonly _$rootContainer: HTMLElement;
|
|
694
|
+
constructor(options: FullscreenOptions);
|
|
695
|
+
/**
|
|
696
|
+
* 销毁
|
|
697
|
+
*/
|
|
698
|
+
destroy(): void;
|
|
699
|
+
protected _render(): void;
|
|
700
|
+
protected _fullscreenChange(info: FullscreenChangeInfo): void;
|
|
701
|
+
/**
|
|
702
|
+
* 点击 Control 会触发
|
|
703
|
+
*/
|
|
704
|
+
protected _onControlClick(): void;
|
|
705
|
+
private _event;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* 控件类型(iconId)不可以重复
|
|
710
|
+
*/
|
|
711
|
+
type ControlType =
|
|
712
|
+
/** 播放/暂停 */
|
|
713
|
+
'play'
|
|
714
|
+
/** 音量, 兼容 sound */
|
|
715
|
+
| 'volume'
|
|
716
|
+
/** 截图 */
|
|
717
|
+
| 'capturePicture'
|
|
718
|
+
/** ptz 云台, 兼容 pantile */
|
|
719
|
+
| 'ptz'
|
|
720
|
+
/** 录制, 兼容 recordvideo */
|
|
721
|
+
| 'record'
|
|
722
|
+
/** 对讲 */
|
|
723
|
+
| 'talk'
|
|
724
|
+
/** 电子放大 */
|
|
725
|
+
| 'zoom'
|
|
726
|
+
/** 清晰度, 兼容 hd */
|
|
727
|
+
| 'definition'
|
|
728
|
+
/** web 全屏, 兼容 webExtend */
|
|
729
|
+
| 'fullscreen'
|
|
730
|
+
/** 全局全屏, 兼容 extend */
|
|
731
|
+
| 'globalFullscreen'
|
|
732
|
+
/** 倍速 */
|
|
733
|
+
| 'speed'
|
|
734
|
+
/** 日期选择 */
|
|
735
|
+
| 'date'
|
|
736
|
+
/** 时间轴 */
|
|
737
|
+
| 'timeLine';
|
|
738
|
+
type MergeControlType =
|
|
739
|
+
/** 设备序列号 */
|
|
740
|
+
'deviceID'
|
|
741
|
+
/** 设备名称 */
|
|
742
|
+
| 'deviceName'
|
|
743
|
+
/** 云存储 */
|
|
744
|
+
| 'cloudRec'
|
|
745
|
+
/** 云录制 */
|
|
746
|
+
| 'cloudRecord'
|
|
747
|
+
/** 本地存储 sdk */
|
|
748
|
+
| 'rec';
|
|
749
|
+
/**
|
|
750
|
+
* 控件
|
|
751
|
+
*/
|
|
752
|
+
interface ControlItem {
|
|
753
|
+
/**
|
|
754
|
+
* 控件id
|
|
755
|
+
*/
|
|
756
|
+
iconId: ControlType | MergeControlType;
|
|
757
|
+
/**
|
|
758
|
+
* 控件位置
|
|
759
|
+
* | left | right |
|
|
760
|
+
* |:-----------:|:------------:|
|
|
761
|
+
* | 控件栏的左部 | 控件栏的右部 |
|
|
762
|
+
*/
|
|
763
|
+
part: 'left' | 'right';
|
|
764
|
+
/** 是否激活 0 否 1 是 默认是 0 */
|
|
765
|
+
/**
|
|
766
|
+
* 是否渲染 0 否 1 是 默认是 0
|
|
767
|
+
*/
|
|
768
|
+
isrender: 0 | 1;
|
|
769
|
+
}
|
|
770
|
+
interface IThemeDataItem {
|
|
771
|
+
/**
|
|
772
|
+
* 控件按钮或文本颜色
|
|
773
|
+
* @since 0.0.1
|
|
774
|
+
* @deprecated 从 0.0.1 开始不再推荐, 字体和图标颜色, 推荐 css 变量 --ezplayer-default-color
|
|
775
|
+
*/
|
|
776
|
+
color?: string;
|
|
777
|
+
/**
|
|
778
|
+
* 控件栏(header/footer)背景颜色
|
|
779
|
+
* @since 0.0.1
|
|
780
|
+
* @deprecated 由于header/footer高度变化, 从 0.0.1 开始不再推荐, 可以通过 className 覆盖样式
|
|
781
|
+
*/
|
|
782
|
+
backgroundColor?: string;
|
|
783
|
+
/**
|
|
784
|
+
* 控件激活后的颜色
|
|
785
|
+
* @since 0.0.1
|
|
786
|
+
* @deprecated 从 0.0.1 开始不再推荐,可以通过 className 覆盖样式,推荐 css 变量 --ezplayer-active-color
|
|
787
|
+
*/
|
|
788
|
+
activeColor?: string;
|
|
789
|
+
/**
|
|
790
|
+
* 控件列表
|
|
791
|
+
* @remarks
|
|
792
|
+
* 控件列表, 按照 iconId 顺序渲染, 需要注意的是, 控件类型(iconId)不可以重复;
|
|
793
|
+
* 注意 ⚠️: deviceID, deviceName, rec, cloudRec, cloudRecord 这五个控件特殊处理, deviceID 和 deviceName 是一组, rec、 cloudRec 和 cloudRecord 是一组
|
|
794
|
+
*
|
|
795
|
+
* @since 0.0.1
|
|
796
|
+
*/
|
|
797
|
+
btnList?: ControlItem[];
|
|
798
|
+
}
|
|
799
|
+
/**
|
|
800
|
+
* 主题数据, 优先级最高, 支持用户自定义
|
|
801
|
+
*/
|
|
802
|
+
interface IThemeData {
|
|
803
|
+
/** 控件展示时长,默认自动聚焦持续 3s , 单位秒 0 表示一直展示 */
|
|
804
|
+
autoFocus?: number;
|
|
805
|
+
/** 优先级高于初始化 posterOptions.poster */
|
|
806
|
+
poster?: string;
|
|
807
|
+
themeType?: 'webLive' | 'webRec' | 'mobileLive' | 'mobileRec';
|
|
808
|
+
/**
|
|
809
|
+
* 头部工具栏
|
|
810
|
+
*/
|
|
811
|
+
header?: Partial<IThemeDataItem> | null;
|
|
812
|
+
/**
|
|
813
|
+
* 底部工具栏
|
|
814
|
+
*/
|
|
815
|
+
footer?: Partial<IThemeDataItem> | null;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* 全屏控件配置
|
|
820
|
+
*/
|
|
821
|
+
interface GlobalFullscreenOptions extends FullscreenOptions {
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* 截图类型, "download" | "base64" | "blob", 分别表示下载图片、返回 base64 字符串、返回 blob 对象
|
|
826
|
+
*/
|
|
827
|
+
type CapturePictureType = 'download' | 'base64' | 'blob';
|
|
828
|
+
/**
|
|
829
|
+
* 截图控件配置项, 仅对控件有效, 对单独调用api截图时无效
|
|
830
|
+
*/
|
|
831
|
+
interface CapturePictureOptions extends Omit<ControlOptions, 'tagName'> {
|
|
832
|
+
/**
|
|
833
|
+
* 截图类型,可选值有 "download" | "base64" | "blob", 分别表示下载图片、返回 base64 字符串、返回 blob 对象, 对单独调用api截图时无效
|
|
834
|
+
* @default "download"
|
|
835
|
+
*/
|
|
836
|
+
type?: CapturePictureType;
|
|
837
|
+
/**
|
|
838
|
+
* 截图质量, 取值范围 0 - 1, 仅对 type 为 "download" 或 "base64" 有效, 对单独调用api截图时无效
|
|
839
|
+
* @default 0.9
|
|
840
|
+
*/
|
|
841
|
+
quality?: number;
|
|
842
|
+
/**
|
|
843
|
+
* 云录制上传, 默认true
|
|
844
|
+
*/
|
|
845
|
+
cloudRecUpload?: boolean;
|
|
846
|
+
/**
|
|
847
|
+
* 截图回调函数,仅对 type 为 "base64" 或 "blob" 有效, 对单独调用api截图时无效
|
|
848
|
+
* @param data 截图数据,类型由 type 决定
|
|
849
|
+
* @param type 截图数据类型
|
|
850
|
+
* @returns {void}
|
|
851
|
+
*/
|
|
852
|
+
onCapture?: (data: string | Blob, type: CapturePictureType) => void;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
/**
|
|
856
|
+
* 选择器项
|
|
857
|
+
*/
|
|
858
|
+
interface SelectItem {
|
|
859
|
+
/** 标签 */
|
|
860
|
+
label?: string;
|
|
861
|
+
/** 值 */
|
|
862
|
+
value?: number | string;
|
|
863
|
+
[key: string]: any;
|
|
864
|
+
}
|
|
865
|
+
/**
|
|
866
|
+
* 选择器控件配置, PC 和 Mobile 都支持
|
|
867
|
+
*/
|
|
868
|
+
interface SelectOptions extends Omit<ControlOptions, 'tagName'> {
|
|
869
|
+
/** 选中项 */
|
|
870
|
+
value?: SelectItem['value'];
|
|
871
|
+
/** 选项列表 */
|
|
872
|
+
list?: SelectItem[];
|
|
873
|
+
/** 列表项的 label 和 value 的字段名 */
|
|
874
|
+
fieldNames?: {
|
|
875
|
+
/** 标签字段名 */
|
|
876
|
+
label?: string;
|
|
877
|
+
/** 值字段名 */
|
|
878
|
+
value?: string;
|
|
879
|
+
};
|
|
880
|
+
/** dom节点 title 属性值 */
|
|
881
|
+
title?: string;
|
|
882
|
+
/** 自定义当前选中的 label 内容 render */
|
|
883
|
+
renderLabel?: (label: string, item: SelectItem, list: SelectItem[]) => string;
|
|
884
|
+
/**
|
|
885
|
+
* 选中项变化回调
|
|
886
|
+
* @param value - 选中项的 value
|
|
887
|
+
* @param item - 选中项
|
|
888
|
+
* @returns {void}
|
|
889
|
+
*/
|
|
890
|
+
onChange?: (value: SelectItem['value'], item: SelectItem) => void;
|
|
891
|
+
/**
|
|
892
|
+
* 选择是否打开面板
|
|
893
|
+
* @param open - 是否打开
|
|
894
|
+
* @param value - 选中项的 value
|
|
895
|
+
* @param item - 选中项
|
|
896
|
+
* @returns
|
|
897
|
+
*/
|
|
898
|
+
onOpenChange?: (open: boolean, value: SelectItem['value'], item: SelectItem) => void;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
/**
|
|
902
|
+
* 清晰度项
|
|
903
|
+
*/
|
|
904
|
+
interface DefinitionItem {
|
|
905
|
+
/** 清晰度 0: 流畅; 1: 标清; 2: 高清; 3: 超清; 4: 极清; 5: 3K; 6: 4K */
|
|
906
|
+
level: number;
|
|
907
|
+
/**
|
|
908
|
+
* 清晰度名称, 默认为 level 对应的语言值, 也可以自定义名称
|
|
909
|
+
* 如果传入的值是 ['VIDEO_LEVEL_FLUENT', 'VIDEO_LEVEL_STANDARD', 'VIDEO_LEVEL_HEIGH', 'VIDEO_LEVEL_SUPER', 'VIDEO_LEVEL_EXTREME', 'VIDEO_LEVEL_3K', 'VIDEO_LEVEL_4k'] 等值会使用 locale 进行转换
|
|
910
|
+
*/
|
|
911
|
+
name?: string;
|
|
912
|
+
/** 1: 主码流, 2: 子码流 (仅支持这两种) */
|
|
913
|
+
streamTypeIn: 1 | 2;
|
|
914
|
+
/** 如果 type === 'compatible' 代表兼容模式(没有查到清晰度列表),兼容模式下 streamTypeIn 默认为 1, 因为有可能没有子码流, 如果开发者已知设备支持子码流可以设置 streamTypeIn: 2 */
|
|
915
|
+
type?: 'compatible' | undefined;
|
|
916
|
+
}
|
|
917
|
+
type DefinitionOptions = Omit<SelectOptions, 'list' | 'fieldNames'> & {
|
|
918
|
+
/** 清晰度列表, 默认值 [], 如果没有传 list,则使用接口(查询设备清晰度)查询的结果,如果有 list,则使用 list 内部不再请求接口(查询设备清晰度)查询 */
|
|
919
|
+
list?: DefinitionItem[];
|
|
920
|
+
};
|
|
921
|
+
|
|
922
|
+
/**
|
|
923
|
+
* 云台控件配置项
|
|
924
|
+
*/
|
|
925
|
+
interface PtzOptions extends Omit<ControlOptions, 'tagName'>, BasePtzOptions {
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
/**
|
|
929
|
+
* 录制控件配置项
|
|
930
|
+
*/
|
|
931
|
+
interface RecordOptions extends Omit<ControlOptions, 'tagName'> {
|
|
932
|
+
/**
|
|
933
|
+
* 最长录制时长, 单位秒, 默认 3600 秒 (1 小时), 注意录制过程中会占用浏览器内存, 请根据实际情况进行配置
|
|
934
|
+
* @default 3600
|
|
935
|
+
*/
|
|
936
|
+
maxDuration?: number;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
type SpeedOptions = SelectOptions;
|
|
940
|
+
|
|
941
|
+
/**
|
|
942
|
+
* 对讲控件配置项
|
|
943
|
+
*/
|
|
944
|
+
interface TalkOptions extends Omit<ControlOptions, 'tagName'> {
|
|
945
|
+
/**
|
|
946
|
+
* 对讲音量改变
|
|
947
|
+
* @param value 音量 [0, 1]
|
|
948
|
+
* @returns
|
|
949
|
+
*/
|
|
950
|
+
onChange: (value: number) => void;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
/**
|
|
954
|
+
* 电子放大控件配置项
|
|
955
|
+
*/
|
|
956
|
+
interface ZoomOptions extends Exclude<ControlOptions, 'tagName'> {
|
|
957
|
+
onChange?: (value: number, percent: number, range: [number, number]) => void;
|
|
958
|
+
open?: boolean;
|
|
959
|
+
max?: number;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
/**
|
|
963
|
+
* 封面控件配置项
|
|
964
|
+
*/
|
|
965
|
+
interface PauseOptions extends Omit<ControlOptions, 'tagName'> {
|
|
966
|
+
}
|
|
967
|
+
/**
|
|
968
|
+
* 暂停控件(仅在第一次非自动播放时可以点击播放), 防止和放大有冲突
|
|
969
|
+
* @category Control
|
|
970
|
+
*/
|
|
971
|
+
declare class Pause extends Control {
|
|
972
|
+
private readonly _options;
|
|
973
|
+
private _timer;
|
|
974
|
+
private _timer2;
|
|
975
|
+
private _timer3;
|
|
976
|
+
private _firstFlag;
|
|
977
|
+
constructor(options?: Partial<PauseOptions>);
|
|
978
|
+
/**
|
|
979
|
+
* 展示封面 这里不对 poster 进行缓存, 如果有值优先使用, 如果没有值优先使用 初始化传入的值
|
|
980
|
+
*/
|
|
981
|
+
show(playing?: boolean, always?: boolean): void;
|
|
982
|
+
/**
|
|
983
|
+
* 销毁
|
|
984
|
+
*/
|
|
985
|
+
destroy(): void;
|
|
986
|
+
protected _onControlClick(e: Event): void;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
/**
|
|
990
|
+
* 截图控件配置项
|
|
991
|
+
*/
|
|
992
|
+
interface ContentOptions {
|
|
993
|
+
getContainer: () => HTMLElement;
|
|
994
|
+
}
|
|
995
|
+
/**
|
|
996
|
+
* 截图控件
|
|
997
|
+
* @category Content
|
|
998
|
+
*/
|
|
999
|
+
declare class Content extends EventEmitter {
|
|
1000
|
+
/**
|
|
1001
|
+
* 容器为了兼容放大、封面和视频渲染超出容器, 最外层容器($wrapper)设置 overflow: hidden;
|
|
1002
|
+
*/
|
|
1003
|
+
$wrapper: HTMLDivElement;
|
|
1004
|
+
/** 渲染区域 */
|
|
1005
|
+
$content: HTMLDivElement;
|
|
1006
|
+
options: ContentOptions;
|
|
1007
|
+
constructor(options: ContentOptions);
|
|
1008
|
+
destroy(): void;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
/**
|
|
1012
|
+
* 移动端扩展
|
|
1013
|
+
*/
|
|
1014
|
+
declare class MobileExtend extends EventEmitter {
|
|
1015
|
+
$container: HTMLElement;
|
|
1016
|
+
/**
|
|
1017
|
+
* 移动端扩展面板容器, 仅控件有面板的才会渲染在这里
|
|
1018
|
+
*/
|
|
1019
|
+
$controlPanel: HTMLElement;
|
|
1020
|
+
/**
|
|
1021
|
+
* 移动端扩展控件容器
|
|
1022
|
+
*/
|
|
1023
|
+
$header: HTMLElement;
|
|
1024
|
+
/**
|
|
1025
|
+
* 移动端扩展控件容器
|
|
1026
|
+
*/
|
|
1027
|
+
$content: HTMLElement;
|
|
1028
|
+
$topLeft: HTMLElement;
|
|
1029
|
+
$topRight: HTMLElement;
|
|
1030
|
+
$top: HTMLElement;
|
|
1031
|
+
private readonly _$siblingContainer;
|
|
1032
|
+
constructor($siblingContainer: HTMLElement);
|
|
1033
|
+
render(): void;
|
|
1034
|
+
destroy(): void;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
interface RecFooterOptions {
|
|
1038
|
+
hasDatePicker?: boolean;
|
|
1039
|
+
}
|
|
1040
|
+
declare class RecFooter extends EventEmitter {
|
|
1041
|
+
$container: HTMLElement;
|
|
1042
|
+
$popupContainer: HTMLElement;
|
|
1043
|
+
$timeLineContainer: HTMLElement;
|
|
1044
|
+
$datePickerContainer: HTMLElement;
|
|
1045
|
+
options: RecFooterOptions;
|
|
1046
|
+
constructor(container: HTMLElement, options?: RecFooterOptions);
|
|
1047
|
+
destroy(): void;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
/**
|
|
1051
|
+
* 更多控件配置项
|
|
1052
|
+
*/
|
|
1053
|
+
interface MoreOptions extends Omit<ControlOptions, 'tagName'> {
|
|
1054
|
+
/**
|
|
1055
|
+
* 弹出位置, 默认右上角 'tr' 'br' 右下角
|
|
1056
|
+
*/
|
|
1057
|
+
placement?: 'tr' | 'br';
|
|
1058
|
+
/** 打开状态 */
|
|
1059
|
+
open?: boolean;
|
|
1060
|
+
/**
|
|
1061
|
+
* 弹出位置偏移量
|
|
1062
|
+
*/
|
|
1063
|
+
offset?: [number, number];
|
|
1064
|
+
/**
|
|
1065
|
+
* 弹出容器自定义类名
|
|
1066
|
+
*/
|
|
1067
|
+
wrapClassName?: string;
|
|
1068
|
+
/**
|
|
1069
|
+
* 打开状态变化回调
|
|
1070
|
+
* @param open 状态
|
|
1071
|
+
*/
|
|
1072
|
+
onOpenChange?: (open: boolean) => void;
|
|
1073
|
+
}
|
|
1074
|
+
/**
|
|
1075
|
+
* 更多控件
|
|
1076
|
+
* @category Control
|
|
1077
|
+
*/
|
|
1078
|
+
declare class More extends Control {
|
|
1079
|
+
private readonly options;
|
|
1080
|
+
picker: Picker;
|
|
1081
|
+
$panel: HTMLDivElement;
|
|
1082
|
+
list: Array<{
|
|
1083
|
+
key: string;
|
|
1084
|
+
part: 'left' | 'right';
|
|
1085
|
+
control: Control;
|
|
1086
|
+
}>;
|
|
1087
|
+
constructor(options: MoreOptions);
|
|
1088
|
+
private _render;
|
|
1089
|
+
/**
|
|
1090
|
+
* 添加
|
|
1091
|
+
* @param control
|
|
1092
|
+
*/
|
|
1093
|
+
add(key: string, part: 'left' | 'right', control: Control): void;
|
|
1094
|
+
/**
|
|
1095
|
+
* 移除
|
|
1096
|
+
* @param control
|
|
1097
|
+
*/
|
|
1098
|
+
remove(control: Control): void;
|
|
1099
|
+
destroy(): void;
|
|
1100
|
+
/**
|
|
1101
|
+
* 点击 Control 会触发
|
|
1102
|
+
*/
|
|
1103
|
+
protected _onControlClick(e: Event): void;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
type IMouseFunc = (e?: MouseEvent | TouchEvent | PointerEvent) => void;
|
|
1107
|
+
type ICleanupFunc = () => void;
|
|
1108
|
+
/**
|
|
1109
|
+
* 监听鼠标移动返回结果
|
|
1110
|
+
*/
|
|
1111
|
+
interface InteractiveHFResult {
|
|
1112
|
+
cleanup: ICleanupFunc;
|
|
1113
|
+
clearTimeout: ((e?: MouseEvent | TouchEvent) => void) | null;
|
|
1114
|
+
setTimeoutShow: IMouseFunc;
|
|
1115
|
+
hide: IMouseFunc;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
/**
|
|
1119
|
+
* 播放器主题
|
|
1120
|
+
* @class Theme
|
|
1121
|
+
* @category Theme
|
|
1122
|
+
* @remarks
|
|
1123
|
+
* 萤石播放器主题,主要用于播放器的 UI 展示和交互,支持 flv, hls, mp4, ezopen 等流类型。
|
|
1124
|
+
* 提供了丰富的控件和配置选项,支持多语言和自定义样式。
|
|
1125
|
+
*
|
|
1126
|
+
* @example
|
|
1127
|
+
* ```ts
|
|
1128
|
+
* // import css file
|
|
1129
|
+
* import "@ezuikit/player-theme/dist/style.js"
|
|
1130
|
+
* import Theme from '@ezuikit/player-theme';
|
|
1131
|
+
*
|
|
1132
|
+
* // class Player extends Theme {}
|
|
1133
|
+
*
|
|
1134
|
+
* const theme = new Theme({
|
|
1135
|
+
* container: () => document.querySelector('.player'),
|
|
1136
|
+
* type: 'flv',
|
|
1137
|
+
* });
|
|
1138
|
+
* ```
|
|
1139
|
+
*
|
|
1140
|
+
* ```html
|
|
1141
|
+
* <!-- html script, static in `@ezuikit/player-theme/dist` -->
|
|
1142
|
+
* <link rel="stylesheet" href="./assets/@ezuikit/player-theme/dist/style.css" />
|
|
1143
|
+
* <script src="./assets/@ezuikit/player-theme/dist/index.umd.js"></script>
|
|
1144
|
+
* <script>
|
|
1145
|
+
* const theme = new Theme({
|
|
1146
|
+
* container: () => document.querySelector('.player'),
|
|
1147
|
+
* type: 'flv',
|
|
1148
|
+
* });
|
|
1149
|
+
* </script>
|
|
1150
|
+
* ```
|
|
1151
|
+
*/
|
|
1152
|
+
declare class Theme extends EventEmitter {
|
|
1153
|
+
/** 所有私有流的模板 @since 0.0.1 */
|
|
1154
|
+
static TEMPLATES: {
|
|
1155
|
+
readonly pcLive: IThemeData;
|
|
1156
|
+
readonly pcRec: IThemeData;
|
|
1157
|
+
readonly mobileLive: IThemeData;
|
|
1158
|
+
readonly mobileRec: IThemeData;
|
|
1159
|
+
readonly security: IThemeData;
|
|
1160
|
+
readonly voice: IThemeData;
|
|
1161
|
+
};
|
|
1162
|
+
/** 事件名称 @since 0.0.1 */
|
|
1163
|
+
static EVENTS: {
|
|
1164
|
+
readonly loading: "loading";
|
|
1165
|
+
readonly play: "play";
|
|
1166
|
+
readonly capturePicture: "capturePicture";
|
|
1167
|
+
readonly volumechange: "volumechange";
|
|
1168
|
+
readonly zoomChange: "zoomChange";
|
|
1169
|
+
readonly zoomingChange: "zoomingChange";
|
|
1170
|
+
readonly zoomTranslateChange: "zoomTranslateChange";
|
|
1171
|
+
readonly audioInfo: "audioInfo";
|
|
1172
|
+
readonly videoInfo: "videoInfo";
|
|
1173
|
+
readonly firstFrameDisplay: "firstFrameDisplay";
|
|
1174
|
+
readonly fullscreen: "fullscreen";
|
|
1175
|
+
readonly exitFullscreen: "exitFullscreen";
|
|
1176
|
+
readonly fullscreenChange: "fullscreenChange";
|
|
1177
|
+
readonly resize: "resize";
|
|
1178
|
+
readonly orientationChange: "orientationChange";
|
|
1179
|
+
readonly audioCodecUnsupported: "audioCodecUnsupported";
|
|
1180
|
+
readonly changeTheme: "changeTheme";
|
|
1181
|
+
readonly recTypeChange: "recTypeChange";
|
|
1182
|
+
readonly definitionChange: "definitionChange";
|
|
1183
|
+
readonly speedChange: "speedChange";
|
|
1184
|
+
readonly recordingChange: "recordingChange";
|
|
1185
|
+
readonly talkingChange: "talkingChange";
|
|
1186
|
+
readonly talkVolumeChange: "talkVolumeChange";
|
|
1187
|
+
readonly setLoggerOptions: "setLoggerOptions";
|
|
1188
|
+
readonly records: "records";
|
|
1189
|
+
readonly ptzSpeedChange: "ptzSpeedChange";
|
|
1190
|
+
readonly setVideoLevelList: "setVideoLevelList";
|
|
1191
|
+
readonly currentVideoLevel: "currentVideoLevel";
|
|
1192
|
+
readonly currentVideoLevelAuto: "currentVideoLevelAuto";
|
|
1193
|
+
readonly setAllDayRecTimes: "setAllDayRecTimes";
|
|
1194
|
+
readonly getOSDTime: "getOSDTime";
|
|
1195
|
+
readonly control: {
|
|
1196
|
+
readonly play: "Control.play";
|
|
1197
|
+
readonly playDestroy: "Control.playDestroy";
|
|
1198
|
+
readonly capturePicture: "Control.capturePicture";
|
|
1199
|
+
readonly capturePictureResult: "Control.capturePictureResult";
|
|
1200
|
+
readonly capturePictureDestroy: "Control.capturePictureDestroy";
|
|
1201
|
+
readonly volumechange: "Control.volumechange";
|
|
1202
|
+
readonly volumePanelOpenChange: "Control.volumePanelOpenChange";
|
|
1203
|
+
readonly volumeDestroy: "Control.volumeDestroy";
|
|
1204
|
+
readonly controlsBarOpenChange: "Control.controlsBarOpenChange";
|
|
1205
|
+
readonly headerMoreShowControlsChange: "Control.headerMoreShowControlsChange";
|
|
1206
|
+
readonly headerMorePanelOpenChange: "Control.headerMorePanelOpenChange";
|
|
1207
|
+
readonly footerMoreShowControlsChange: "Control.footerMoreShowControlsChange";
|
|
1208
|
+
readonly footerMorePanelOpenChange: "Control.footerMorePanelOpenChange";
|
|
1209
|
+
readonly deviceDestroy: "Control.deviceDestroy";
|
|
1210
|
+
readonly recTypeChange: "Control.recTypeChange";
|
|
1211
|
+
readonly recDestroy: "Control.recDestroy";
|
|
1212
|
+
readonly definitionChange: "Control.definitionChange";
|
|
1213
|
+
readonly definitionList: "Control.definitionList";
|
|
1214
|
+
readonly definitionPanelOpenChange: "Control.definitionPanelOpenChange";
|
|
1215
|
+
readonly definitionDestroy: "Control.definitionDestroy";
|
|
1216
|
+
readonly speedChange: "Control.speedChange";
|
|
1217
|
+
readonly speedPanelOpenChange: "Control.speedPanelOpenChange";
|
|
1218
|
+
readonly speedDestroy: "Control.speedDestroy";
|
|
1219
|
+
readonly ptzPanelOpenChange: "Control.ptzPanelOpenChange";
|
|
1220
|
+
readonly ptzSpeedChange: "Control.ptzSpeedChange";
|
|
1221
|
+
readonly ptzError: "Control.ptzError";
|
|
1222
|
+
readonly ptzDestroy: "Control.ptzDestroy";
|
|
1223
|
+
readonly recordingChange: "Control.recordingChange";
|
|
1224
|
+
readonly recordDestroy: "Control.recordDestroy";
|
|
1225
|
+
readonly talkingChange: "Control.talkingChange";
|
|
1226
|
+
readonly talkError: "Control.talkError";
|
|
1227
|
+
readonly talkDestroy: "Control.talkDestroy";
|
|
1228
|
+
readonly zoomChange: "Control.zoomChange";
|
|
1229
|
+
readonly zoomPanelOpenChange: "Control.zoomPanelOpenChange";
|
|
1230
|
+
readonly zoomDestroy: "Control.zoomDestroy";
|
|
1231
|
+
readonly fullscreenDestroy: "Control.fullscreenDestroy";
|
|
1232
|
+
readonly globalFullscreenDestroy: "Control.globalFullscreenDestroy";
|
|
1233
|
+
readonly datePanelOpenChange: "Control.datePanelOpenChange";
|
|
1234
|
+
readonly dateChange: "Control.dateChange";
|
|
1235
|
+
readonly dateDestroy: "Control.datePanelDestroy";
|
|
1236
|
+
readonly timeLineChange: "Control.timeLineChange";
|
|
1237
|
+
readonly timeLineDestroy: "Control.timeLineDestroy";
|
|
1238
|
+
readonly beforeMountControls: "Control.beforeMountControls";
|
|
1239
|
+
readonly mountedControls: "Control.mountedControls";
|
|
1240
|
+
readonly beforeUnmountControls: "Control.beforeUnmountControls";
|
|
1241
|
+
readonly unmountedControls: "Control.unmountedControls";
|
|
1242
|
+
readonly posterDestroy: "Control.posterDestroy";
|
|
1243
|
+
readonly loadingDestroy: "Control.loadingDestroy";
|
|
1244
|
+
readonly messageDestroy: "Control.messageDestroy";
|
|
1245
|
+
readonly contentDestroy: "Control.contentDestroy";
|
|
1246
|
+
};
|
|
1247
|
+
readonly theme: {
|
|
1248
|
+
readonly beforeDestroy: "Theme.beforeDestroy";
|
|
1249
|
+
readonly destroyed: "Theme.destroyed";
|
|
1250
|
+
readonly mobileExtendDestroy: "Theme.mobileExtendDestroy";
|
|
1251
|
+
readonly recFooterDestroy: "Theme.recFooterDestroy";
|
|
1252
|
+
};
|
|
1253
|
+
readonly message: "message";
|
|
1254
|
+
};
|
|
1255
|
+
/** 语言包 @since 0.0.1 */
|
|
1256
|
+
static LOCALES: {
|
|
1257
|
+
zh: {
|
|
1258
|
+
391001: string;
|
|
1259
|
+
395000: string;
|
|
1260
|
+
395400: string;
|
|
1261
|
+
395402: string;
|
|
1262
|
+
395403: string;
|
|
1263
|
+
395404: string;
|
|
1264
|
+
395405: string;
|
|
1265
|
+
395406: string;
|
|
1266
|
+
395407: string;
|
|
1267
|
+
395409: string;
|
|
1268
|
+
395410: string;
|
|
1269
|
+
395411: string;
|
|
1270
|
+
395412: string;
|
|
1271
|
+
395413: string;
|
|
1272
|
+
395415: string;
|
|
1273
|
+
395416: string;
|
|
1274
|
+
395451: string;
|
|
1275
|
+
395452: string;
|
|
1276
|
+
395454: string;
|
|
1277
|
+
395455: string;
|
|
1278
|
+
395456: string;
|
|
1279
|
+
395457: string;
|
|
1280
|
+
395458: string;
|
|
1281
|
+
395459: string;
|
|
1282
|
+
395460: string;
|
|
1283
|
+
395492: string;
|
|
1284
|
+
395500: string;
|
|
1285
|
+
395501: string;
|
|
1286
|
+
395503: string;
|
|
1287
|
+
395504: string;
|
|
1288
|
+
395505: string;
|
|
1289
|
+
395506: string;
|
|
1290
|
+
395507: string;
|
|
1291
|
+
395530: string;
|
|
1292
|
+
395544: string;
|
|
1293
|
+
395545: string;
|
|
1294
|
+
395546: string;
|
|
1295
|
+
395547: string;
|
|
1296
|
+
395556: string;
|
|
1297
|
+
395557: string;
|
|
1298
|
+
395558: string;
|
|
1299
|
+
395560: string;
|
|
1300
|
+
395561: string;
|
|
1301
|
+
395562: string;
|
|
1302
|
+
395563: string;
|
|
1303
|
+
395564: string;
|
|
1304
|
+
395566: string;
|
|
1305
|
+
395567: string;
|
|
1306
|
+
395568: string;
|
|
1307
|
+
395569: string;
|
|
1308
|
+
395600: string;
|
|
1309
|
+
395601: string;
|
|
1310
|
+
395602: string;
|
|
1311
|
+
395610: string;
|
|
1312
|
+
395620: string;
|
|
1313
|
+
395701: string;
|
|
1314
|
+
395702: string;
|
|
1315
|
+
395703: string;
|
|
1316
|
+
396001: string;
|
|
1317
|
+
396099: string;
|
|
1318
|
+
396101: string;
|
|
1319
|
+
396102: string;
|
|
1320
|
+
396103: string;
|
|
1321
|
+
396104: string;
|
|
1322
|
+
396105: string;
|
|
1323
|
+
396106: string;
|
|
1324
|
+
396107: string;
|
|
1325
|
+
396108: string;
|
|
1326
|
+
396109: string;
|
|
1327
|
+
396110: string;
|
|
1328
|
+
396501: string;
|
|
1329
|
+
396502: string;
|
|
1330
|
+
396503: string;
|
|
1331
|
+
396504: string;
|
|
1332
|
+
396505: string;
|
|
1333
|
+
396506: string;
|
|
1334
|
+
396508: string;
|
|
1335
|
+
396509: string;
|
|
1336
|
+
396510: string;
|
|
1337
|
+
396511: string;
|
|
1338
|
+
396512: string;
|
|
1339
|
+
396513: string;
|
|
1340
|
+
396514: string;
|
|
1341
|
+
396515: string;
|
|
1342
|
+
396516: string;
|
|
1343
|
+
396517: string;
|
|
1344
|
+
396518: string;
|
|
1345
|
+
396519: string;
|
|
1346
|
+
/** 移动端竖屏, 全屏情况下不展示扩张,放置在 footer 中 */
|
|
1347
|
+
396520: string;
|
|
1348
|
+
396700: string;
|
|
1349
|
+
396701: string;
|
|
1350
|
+
397001: string;
|
|
1351
|
+
397002: string;
|
|
1352
|
+
397003: string;
|
|
1353
|
+
397004: string;
|
|
1354
|
+
397005: string;
|
|
1355
|
+
397006: string;
|
|
1356
|
+
397007: string;
|
|
1357
|
+
399000: string;
|
|
1358
|
+
399001: string;
|
|
1359
|
+
399002: string;
|
|
1360
|
+
399016: string;
|
|
1361
|
+
399048: string;
|
|
1362
|
+
399049: string;
|
|
1363
|
+
399030: string;
|
|
1364
|
+
3810001: string;
|
|
1365
|
+
3810002: string;
|
|
1366
|
+
3810005: string;
|
|
1367
|
+
3820002: string;
|
|
1368
|
+
3820006: string;
|
|
1369
|
+
3820007: string;
|
|
1370
|
+
3820008: string;
|
|
1371
|
+
3820014: string;
|
|
1372
|
+
3820032: string;
|
|
1373
|
+
3849999: string;
|
|
1374
|
+
3860000: string;
|
|
1375
|
+
3860001: string;
|
|
1376
|
+
3860002: string;
|
|
1377
|
+
3860003: string;
|
|
1378
|
+
3860004: string;
|
|
1379
|
+
3860005: string;
|
|
1380
|
+
3860006: string;
|
|
1381
|
+
3860009: string;
|
|
1382
|
+
3860020: string;
|
|
1383
|
+
BTN_RETRY: string;
|
|
1384
|
+
BTN_RELOAD: string;
|
|
1385
|
+
/** 所有私有流的模板 @since 0.0.1 */
|
|
1386
|
+
LOADING: string;
|
|
1387
|
+
TIMEFORMAT_ERROR: string;
|
|
1388
|
+
USE_MULTITHREADING_WARING: string;
|
|
1389
|
+
OPEN_INSTRUCTIONS: string;
|
|
1390
|
+
INIT_FINSHED: string;
|
|
1391
|
+
INIT_SUCCESS: string;
|
|
1392
|
+
GET_PLAYURL_FAILED: string; /** 播放器配置项 */
|
|
1393
|
+
VIDEO_LOADING: string;
|
|
1394
|
+
DISCONNECT: string;
|
|
1395
|
+
DEVICE_ENCRYPTED: string; /** 主题挂载节点 */
|
|
1396
|
+
NO_RECORD: string;
|
|
1397
|
+
PLAY_FAILED: string;
|
|
1398
|
+
PLAY_SUCCESS: string;
|
|
1399
|
+
STOP_SUCCESS: string;
|
|
1400
|
+
CHANGE_PLAYURL_SUCCESS: string;
|
|
1401
|
+
CHANGE_PLAYURL_FAILED: string;
|
|
1402
|
+
GET_OSD_TIME: string;
|
|
1403
|
+
GET_OSD_TIME_FAILED: string;
|
|
1404
|
+
SET_POSTER: string;
|
|
1405
|
+
RESIZE: string;
|
|
1406
|
+
SPEED: string;
|
|
1407
|
+
SPEED_RATE: string;
|
|
1408
|
+
SPEED_CANCEL: string;
|
|
1409
|
+
GET_SPEED: string;
|
|
1410
|
+
MAX_SPEED_LIMIT: string;
|
|
1411
|
+
MIN_SPEED_LIMIT: string;
|
|
1412
|
+
SEEK_CANNOT_CROSS_DAYS: string;
|
|
1413
|
+
SEEK_TIMEFORMAT_ERROR: string;
|
|
1414
|
+
PAUSE: string;
|
|
1415
|
+
PAUSE_FAILED: string;
|
|
1416
|
+
RESUME: string;
|
|
1417
|
+
RESUME_FAILED: string;
|
|
1418
|
+
CALL_END: string;
|
|
1419
|
+
USER_DO_NOT_OWN_DEVICE: string;
|
|
1420
|
+
NO_CLOUD_RECORD: string;
|
|
1421
|
+
CHANGE_VIDEO_LEVEL: string;
|
|
1422
|
+
CHANGE_VIDEO_LEVEL_FAIL: string;
|
|
1423
|
+
GET_VIDEO_LEVEL_LIST: string;
|
|
1424
|
+
PLEASE_INPUT_RIGHT_VIDEO_LEVEL: string;
|
|
1425
|
+
VIDEO_LEVEL_NOT_SUPPORT: string;
|
|
1426
|
+
VIDEO_LEVEL_AUTO: string;
|
|
1427
|
+
VIDEO_LEVEL_FLUENT: string; /**
|
|
1428
|
+
* 更多控件(footer more)
|
|
1429
|
+
* @since 0.0.1
|
|
1430
|
+
* @private
|
|
1431
|
+
*/
|
|
1432
|
+
VIDEO_LEVEL_STANDARD: string;
|
|
1433
|
+
VIDEO_LEVEL_HEIGH: string;
|
|
1434
|
+
VIDEO_LEVEL_SUPER: string;
|
|
1435
|
+
VIDEO_LEVEL_EXTREME: string;
|
|
1436
|
+
VIDEO_LEVEL_3K: string;
|
|
1437
|
+
VIDEO_LEVEL_4k: string;
|
|
1438
|
+
RESET_THEME: string;
|
|
1439
|
+
BTN_PLAY: string;
|
|
1440
|
+
BTN_PAUSE: string;
|
|
1441
|
+
BTN_VOLUME: string;
|
|
1442
|
+
/** 回放底部时间轴 @since 0.0.1 @private */
|
|
1443
|
+
BTN_MUTED: string;
|
|
1444
|
+
BTN_RECORDVIDEO: string;
|
|
1445
|
+
BTN_CAPTURE: string;
|
|
1446
|
+
BTN_TALK: string;
|
|
1447
|
+
BTN_ZOOM: string;
|
|
1448
|
+
BTN_3D_ZOOM: string;
|
|
1449
|
+
BTN_PTZ: string;
|
|
1450
|
+
BTN_GLOBAL_FULLSCREEN: string;
|
|
1451
|
+
BTN_EXIT_GLOBAL_FULLSCREEN: string;
|
|
1452
|
+
BTN_FULLSCREEN: string;
|
|
1453
|
+
BTN_EXIR_FULLSCREEN: string;
|
|
1454
|
+
BTN_HD: string;
|
|
1455
|
+
BTN_SPEED: string;
|
|
1456
|
+
BTN_CLOUDREC: string;
|
|
1457
|
+
BTN_CLOUDRECORD: string;
|
|
1458
|
+
BTN_REC: string;
|
|
1459
|
+
BTN_CALENDAR: string;
|
|
1460
|
+
BTN_MORE: string;
|
|
1461
|
+
DEVICE_NAME: string;
|
|
1462
|
+
/** 清除屏幕旋转 */
|
|
1463
|
+
DEVICE_ID: string;
|
|
1464
|
+
CAPTURE_SUCCESS: string;
|
|
1465
|
+
CAPTURE_FAILED: string;
|
|
1466
|
+
START_RECORD_SUCCESS: string;
|
|
1467
|
+
START_RECORD_FAILED: string;
|
|
1468
|
+
STOP_RECORD_SUCCESS: string;
|
|
1469
|
+
STOP_RECORD_FAILED: string;
|
|
1470
|
+
RECORD_TIPS: string;
|
|
1471
|
+
RECORDS: string; /** 容器的宽 */
|
|
1472
|
+
OPEN_SOUND: string;
|
|
1473
|
+
CLOSE_SOUND: string;
|
|
1474
|
+
SOUND_OPENED: string;
|
|
1475
|
+
ZOOM: string;
|
|
1476
|
+
START_ZOOM: string;
|
|
1477
|
+
CLOSE_ZOOM: string;
|
|
1478
|
+
ZOOM_ADD: string;
|
|
1479
|
+
ZOOM_SUB: string; /** 屏幕旋转角度 0 | 90 | 180 | 270 */
|
|
1480
|
+
ZOOM_ADD_MAX: string;
|
|
1481
|
+
ZOOM_SUB_MIN: string; /** 是否播放中 @private */
|
|
1482
|
+
ZOOM_LIMIT_MAX: string;
|
|
1483
|
+
ZOOM_LIMIT_MIN: string;
|
|
1484
|
+
ZOOM_NOT_ENABLED: string;
|
|
1485
|
+
'3D_ZOOM': string;
|
|
1486
|
+
'3D_ZOOM_DISABLE': string;
|
|
1487
|
+
'3D_ZOOM_FAILED': string;
|
|
1488
|
+
START_3D_ZOOM: string;
|
|
1489
|
+
CLOSE_3D_ZOOM: string;
|
|
1490
|
+
DEVICE_NOT_SUPPORT_3D_ZOOM: string;
|
|
1491
|
+
'3D_ZOOM_ACTIVED': string;
|
|
1492
|
+
'3D_ZOOM_NOT_ACTIVED': string; /** 倍速 @private */
|
|
1493
|
+
'3D_ZOOM_CLOSED': string; /** 清晰度列表 */
|
|
1494
|
+
CHANGE_ZOOM_TYPE: string;
|
|
1495
|
+
FULLSCREEN: string;
|
|
1496
|
+
/** 回放片段列表 */
|
|
1497
|
+
FULLSCREEN_EXIT: string;
|
|
1498
|
+
GET_WEB_FULLSCREEN_STATUS: string;
|
|
1499
|
+
WEB_FULLSCREEN: string;
|
|
1500
|
+
WEB_FULLSCREEN_EXIT: string;
|
|
1501
|
+
DESTROY: string;
|
|
1502
|
+
GET_CAPACITY: string;
|
|
1503
|
+
GET_PTZ_STATUS: string;
|
|
1504
|
+
GET_PTZ_STATUS_FAILED: string;
|
|
1505
|
+
MOBILE_HIDE_PTZ: string;
|
|
1506
|
+
OPTION_PTZ_FAILED: string;
|
|
1507
|
+
MOBILE_PTZ_TIPS: string;
|
|
1508
|
+
PTZ_FAST: string;
|
|
1509
|
+
PTZ_MID: string;
|
|
1510
|
+
PTZ_SLOW: string;
|
|
1511
|
+
PTZ_SPEED: string;
|
|
1512
|
+
DEVICE_ZOOM: string;
|
|
1513
|
+
DEVICE_FOCUS: string;
|
|
1514
|
+
NOT_SUPPORT_DEVICE_ZOOM: string;
|
|
1515
|
+
NOT_SUPPORT_FOCUS: string;
|
|
1516
|
+
MIRROR: string;
|
|
1517
|
+
MIRROR_TYPE_ERROR: string;
|
|
1518
|
+
CHANGE_FEC_TYPE: string;
|
|
1519
|
+
DEVICE_NOT_SUPPORT: string;
|
|
1520
|
+
TYPE_NOT_SUPPORT: string;
|
|
1521
|
+
FEC_SUPPORT_VERSION: string;
|
|
1522
|
+
NO_CANVAS_ID: string;
|
|
1523
|
+
SET_FEC_PARAMS: string;
|
|
1524
|
+
GET_FEC_PARAMS: string;
|
|
1525
|
+
SET_FEC_PARAMS_FAILED: string;
|
|
1526
|
+
GET_FEC_PARAMS_FAILED: string;
|
|
1527
|
+
GET_FEC_PARAMS_SUPPORT_VERSION: string;
|
|
1528
|
+
SET_WATERMARK: string;
|
|
1529
|
+
FETCH_THEME_FAILED: string;
|
|
1530
|
+
cancel: string;
|
|
1531
|
+
ok: string;
|
|
1532
|
+
close: string;
|
|
1533
|
+
};
|
|
1534
|
+
en: {
|
|
1535
|
+
391001: string;
|
|
1536
|
+
395000: string;
|
|
1537
|
+
395400: string;
|
|
1538
|
+
395402: string;
|
|
1539
|
+
395403: string;
|
|
1540
|
+
395404: string;
|
|
1541
|
+
395405: string;
|
|
1542
|
+
395406: string;
|
|
1543
|
+
395407: string;
|
|
1544
|
+
395409: string;
|
|
1545
|
+
395410: string;
|
|
1546
|
+
395411: string;
|
|
1547
|
+
395412: string;
|
|
1548
|
+
395413: string;
|
|
1549
|
+
395415: string;
|
|
1550
|
+
395416: string;
|
|
1551
|
+
395451: string;
|
|
1552
|
+
395452: string;
|
|
1553
|
+
395454: string;
|
|
1554
|
+
395455: string;
|
|
1555
|
+
395456: string;
|
|
1556
|
+
395457: string;
|
|
1557
|
+
395458: string;
|
|
1558
|
+
395459: string;
|
|
1559
|
+
395460: string;
|
|
1560
|
+
395492: string;
|
|
1561
|
+
395500: string;
|
|
1562
|
+
395501: string;
|
|
1563
|
+
395503: string;
|
|
1564
|
+
395504: string;
|
|
1565
|
+
395505: string;
|
|
1566
|
+
/**
|
|
1567
|
+
* 播放器主题
|
|
1568
|
+
* @class Theme
|
|
1569
|
+
* @category Theme
|
|
1570
|
+
* @remarks
|
|
1571
|
+
* 萤石播放器主题,主要用于播放器的 UI 展示和交互,支持 flv, hls, mp4, ezopen 等流类型。
|
|
1572
|
+
* 提供了丰富的控件和配置选项,支持多语言和自定义样式。
|
|
1573
|
+
*
|
|
1574
|
+
* @example
|
|
1575
|
+
* ```ts
|
|
1576
|
+
* // import css file
|
|
1577
|
+
* import "@ezuikit/player-theme/dist/style.js"
|
|
1578
|
+
* import Theme from '@ezuikit/player-theme';
|
|
1579
|
+
*
|
|
1580
|
+
* // class Player extends Theme {}
|
|
1581
|
+
*
|
|
1582
|
+
* const theme = new Theme({
|
|
1583
|
+
* container: () => document.querySelector('.player'),
|
|
1584
|
+
* type: 'flv',
|
|
1585
|
+
* });
|
|
1586
|
+
* ```
|
|
1587
|
+
*
|
|
1588
|
+
* ```html
|
|
1589
|
+
* <!-- html script, static in `@ezuikit/player-theme/dist` -->
|
|
1590
|
+
* <link rel="stylesheet" href="./assets/@ezuikit/player-theme/dist/style.css" />
|
|
1591
|
+
* <script src="./assets/@ezuikit/player-theme/dist/index.umd.js"></script>
|
|
1592
|
+
* <script>
|
|
1593
|
+
* const theme = new Theme({
|
|
1594
|
+
* container: () => document.querySelector('.player'),
|
|
1595
|
+
* type: 'flv',
|
|
1596
|
+
* });
|
|
1597
|
+
* </script>
|
|
1598
|
+
* ```
|
|
1599
|
+
*/
|
|
1600
|
+
395506: string;
|
|
1601
|
+
395507: string;
|
|
1602
|
+
395530: string;
|
|
1603
|
+
395544: string;
|
|
1604
|
+
395545: string;
|
|
1605
|
+
395546: string;
|
|
1606
|
+
395547: string;
|
|
1607
|
+
395556: string;
|
|
1608
|
+
395557: string;
|
|
1609
|
+
395558: string;
|
|
1610
|
+
395560: string;
|
|
1611
|
+
395561: string;
|
|
1612
|
+
395562: string;
|
|
1613
|
+
395563: string;
|
|
1614
|
+
395564: string;
|
|
1615
|
+
395566: string;
|
|
1616
|
+
395567: string;
|
|
1617
|
+
395568: string; /** 加载控件 @since 0.0.1 @private */
|
|
1618
|
+
395569: string;
|
|
1619
|
+
395600: string;
|
|
1620
|
+
395601: string;
|
|
1621
|
+
395602: string;
|
|
1622
|
+
395610: string;
|
|
1623
|
+
395620: string;
|
|
1624
|
+
395701: string;
|
|
1625
|
+
395702: string;
|
|
1626
|
+
395703: string;
|
|
1627
|
+
396001: string;
|
|
1628
|
+
396099: string;
|
|
1629
|
+
396101: string;
|
|
1630
|
+
396102: string;
|
|
1631
|
+
396103: string;
|
|
1632
|
+
396104: string;
|
|
1633
|
+
396105: string;
|
|
1634
|
+
396106: string;
|
|
1635
|
+
396107: string;
|
|
1636
|
+
396108: string;
|
|
1637
|
+
396109: string;
|
|
1638
|
+
396110: string;
|
|
1639
|
+
396501: string;
|
|
1640
|
+
396502: string;
|
|
1641
|
+
396503: string;
|
|
1642
|
+
396504: string;
|
|
1643
|
+
/** 电子放大倍数 @private */
|
|
1644
|
+
396505: string;
|
|
1645
|
+
396506: string;
|
|
1646
|
+
396508: string;
|
|
1647
|
+
/** 清晰度列表 */
|
|
1648
|
+
396509: string;
|
|
1649
|
+
396510: string;
|
|
1650
|
+
396511: string;
|
|
1651
|
+
396512: string; /** 销毁标识 @readonly */
|
|
1652
|
+
396513: string;
|
|
1653
|
+
396514: string;
|
|
1654
|
+
396515: string;
|
|
1655
|
+
396516: string;
|
|
1656
|
+
396517: string;
|
|
1657
|
+
396518: string;
|
|
1658
|
+
396519: string;
|
|
1659
|
+
396520: string;
|
|
1660
|
+
396700: string;
|
|
1661
|
+
396701: string;
|
|
1662
|
+
397001: string;
|
|
1663
|
+
397002: string;
|
|
1664
|
+
397003: string;
|
|
1665
|
+
397004: string;
|
|
1666
|
+
397005: string;
|
|
1667
|
+
397006: string;
|
|
1668
|
+
397007: string;
|
|
1669
|
+
399000: string;
|
|
1670
|
+
399001: string;
|
|
1671
|
+
399002: string;
|
|
1672
|
+
399016: string;
|
|
1673
|
+
399048: string;
|
|
1674
|
+
399049: string;
|
|
1675
|
+
399030: string;
|
|
1676
|
+
3810001: string;
|
|
1677
|
+
3810002: string;
|
|
1678
|
+
3810005: string;
|
|
1679
|
+
3820002: string;
|
|
1680
|
+
3820006: string;
|
|
1681
|
+
3820007: string;
|
|
1682
|
+
3820008: string;
|
|
1683
|
+
3820014: string; /**
|
|
1684
|
+
* 容器的高(单位 px)
|
|
1685
|
+
* ```ts
|
|
1686
|
+
* theme.height // number
|
|
1687
|
+
* ```
|
|
1688
|
+
*/
|
|
1689
|
+
3820032: string;
|
|
1690
|
+
3849999: string;
|
|
1691
|
+
3860000: string;
|
|
1692
|
+
3860001: string;
|
|
1693
|
+
3860002: string;
|
|
1694
|
+
3860003: string;
|
|
1695
|
+
3860004: string;
|
|
1696
|
+
3860005: string;
|
|
1697
|
+
3860006: string;
|
|
1698
|
+
3860009: string;
|
|
1699
|
+
3860020: string;
|
|
1700
|
+
BTN_RETRY: string;
|
|
1701
|
+
BTN_RELOAD: string;
|
|
1702
|
+
LOADING: string;
|
|
1703
|
+
TIMEFORMAT_ERROR: string;
|
|
1704
|
+
USE_MULTITHREADING_WARING: string;
|
|
1705
|
+
OPEN_INSTRUCTIONS: string;
|
|
1706
|
+
/**
|
|
1707
|
+
* 加载中
|
|
1708
|
+
* ```ts
|
|
1709
|
+
* theme.loading // boolean
|
|
1710
|
+
* ```
|
|
1711
|
+
*/
|
|
1712
|
+
INIT_FINSHED: string;
|
|
1713
|
+
INIT_SUCCESS: string;
|
|
1714
|
+
GET_PLAYURL_FAILED: string;
|
|
1715
|
+
VIDEO_LOADING: string;
|
|
1716
|
+
DISCONNECT: string;
|
|
1717
|
+
DEVICE_ENCRYPTED: string;
|
|
1718
|
+
NO_RECORD: string;
|
|
1719
|
+
PLAY_FAILED: string;
|
|
1720
|
+
PLAY_SUCCESS: string;
|
|
1721
|
+
STOP_SUCCESS: string;
|
|
1722
|
+
CHANGE_PLAYURL_SUCCESS: string;
|
|
1723
|
+
CHANGE_PLAYURL_FAILED: string;
|
|
1724
|
+
GET_OSD_TIME: string;
|
|
1725
|
+
GET_OSD_TIME_FAILED: string;
|
|
1726
|
+
SET_POSTER: string;
|
|
1727
|
+
RESIZE: string;
|
|
1728
|
+
SPEED: string;
|
|
1729
|
+
SPEED_RATE: string;
|
|
1730
|
+
SPEED_CANCEL: string;
|
|
1731
|
+
GET_SPEED: string;
|
|
1732
|
+
MAX_SPEED_LIMIT: string;
|
|
1733
|
+
MIN_SPEED_LIMIT: string;
|
|
1734
|
+
SEEK_CANNOT_CROSS_DAYS: string;
|
|
1735
|
+
SEEK_TIMEFORMAT_ERROR: string;
|
|
1736
|
+
PAUSE: string;
|
|
1737
|
+
PAUSE_FAILED: string;
|
|
1738
|
+
RESUME: string;
|
|
1739
|
+
RESUME_FAILED: string;
|
|
1740
|
+
CALL_END: string;
|
|
1741
|
+
USER_DO_NOT_OWN_DEVICE: string;
|
|
1742
|
+
NO_CLOUD_RECORD: string;
|
|
1743
|
+
CHANGE_VIDEO_LEVEL: string;
|
|
1744
|
+
CHANGE_VIDEO_LEVEL_FAIL: string;
|
|
1745
|
+
GET_VIDEO_LEVEL_LIST: string;
|
|
1746
|
+
PLEASE_INPUT_RIGHT_VIDEO_LEVEL: string;
|
|
1747
|
+
VIDEO_LEVEL_NOT_SUPPORT: string;
|
|
1748
|
+
VIDEO_LEVEL_AUTO: string;
|
|
1749
|
+
VIDEO_LEVEL_FLUENT: string;
|
|
1750
|
+
VIDEO_LEVEL_STANDARD: string;
|
|
1751
|
+
VIDEO_LEVEL_HEIGH: string;
|
|
1752
|
+
VIDEO_LEVEL_SUPER: string;
|
|
1753
|
+
VIDEO_LEVEL_EXTREME: string;
|
|
1754
|
+
VIDEO_LEVEL_3K: string; /**
|
|
1755
|
+
* 是否在缩放中
|
|
1756
|
+
*/
|
|
1757
|
+
VIDEO_LEVEL_4k: string;
|
|
1758
|
+
RESET_THEME: string;
|
|
1759
|
+
BTN_PLAY: string;
|
|
1760
|
+
BTN_PAUSE: string;
|
|
1761
|
+
BTN_VOLUME: string;
|
|
1762
|
+
BTN_MUTED: string;
|
|
1763
|
+
BTN_RECORDVIDEO: string;
|
|
1764
|
+
BTN_CAPTURE: string;
|
|
1765
|
+
BTN_TALK: string;
|
|
1766
|
+
BTN_ZOOM: string;
|
|
1767
|
+
BTN_3D_ZOOM: string;
|
|
1768
|
+
BTN_PTZ: string;
|
|
1769
|
+
BTN_GLOBAL_FULLSCREEN: string;
|
|
1770
|
+
BTN_EXIT_GLOBAL_FULLSCREEN: string;
|
|
1771
|
+
BTN_FULLSCREEN: string;
|
|
1772
|
+
BTN_EXIR_FULLSCREEN: string; /**
|
|
1773
|
+
* 电子放大倍数, 仅 ezopen 支持
|
|
1774
|
+
* @since 0.0.1
|
|
1775
|
+
* @example
|
|
1776
|
+
* ```ts
|
|
1777
|
+
* theme.zoom // 放大倍数
|
|
1778
|
+
* // 事件监听
|
|
1779
|
+
* theme.on(Theme.EVENTS.zoom, (zoom: number) => {})
|
|
1780
|
+
* ```
|
|
1781
|
+
*/
|
|
1782
|
+
BTN_EXPEND: string;
|
|
1783
|
+
BTN_WEBEXPEND: string;
|
|
1784
|
+
BTN_HD: string;
|
|
1785
|
+
BTN_SPEED: string;
|
|
1786
|
+
BTN_CLOUDREC: string;
|
|
1787
|
+
BTN_CLOUDRECORD: string;
|
|
1788
|
+
BTN_REC: string;
|
|
1789
|
+
BTN_CALENDAR: string;
|
|
1790
|
+
BTN_MORE: string;
|
|
1791
|
+
DEVICE_NAME: string;
|
|
1792
|
+
DEVICE_ID: string;
|
|
1793
|
+
CAPTURE_SUCCESS: string;
|
|
1794
|
+
CAPTURE_FAILED: string;
|
|
1795
|
+
START_RECORD_SUCCESS: string;
|
|
1796
|
+
START_RECORD_FAILED: string;
|
|
1797
|
+
STOP_RECORD_SUCCESS: string;
|
|
1798
|
+
STOP_RECORD_FAILED: string;
|
|
1799
|
+
RECORD_TIPS: string;
|
|
1800
|
+
RECORDS: string;
|
|
1801
|
+
OPEN_SOUND: string;
|
|
1802
|
+
CLOSE_SOUND: string;
|
|
1803
|
+
SOUND_OPENED: string;
|
|
1804
|
+
ZOOM: string;
|
|
1805
|
+
START_ZOOM: string;
|
|
1806
|
+
CLOSE_ZOOM: string;
|
|
1807
|
+
ZOOM_ADD: string;
|
|
1808
|
+
ZOOM_SUB: string;
|
|
1809
|
+
ZOOM_ADD_MAX: string;
|
|
1810
|
+
ZOOM_SUB_MIN: string;
|
|
1811
|
+
ZOOM_LIMIT_MAX: string;
|
|
1812
|
+
ZOOM_LIMIT_MIN: string;
|
|
1813
|
+
ZOOM_NOT_ENABLED: string;
|
|
1814
|
+
'3D_ZOOM': string;
|
|
1815
|
+
'3D_ZOOM_DISABLE': string;
|
|
1816
|
+
'3D_ZOOM_FAILED': string;
|
|
1817
|
+
START_3D_ZOOM: string;
|
|
1818
|
+
CLOSE_3D_ZOOM: string;
|
|
1819
|
+
DEVICE_NOT_SUPPORT_3D_ZOOM: string;
|
|
1820
|
+
'3D_ZOOM_ACTIVED': string;
|
|
1821
|
+
'3D_ZOOM_NOT_ACTIVED': string;
|
|
1822
|
+
'3D_ZOOM_CLOSED': string;
|
|
1823
|
+
CHANGE_ZOOM_TYPE: string;
|
|
1824
|
+
FULLSCREEN: string;
|
|
1825
|
+
FULLSCREEN_EXIT: string;
|
|
1826
|
+
GET_WEB_FULLSCREEN_STATUS: string;
|
|
1827
|
+
WEB_FULLSCREEN: string;
|
|
1828
|
+
WEB_FULLSCREEN_EXIT: string;
|
|
1829
|
+
DESTROY: string;
|
|
1830
|
+
GET_CAPACITY: string;
|
|
1831
|
+
GET_PTZ_STATUS: string;
|
|
1832
|
+
GET_PTZ_STATUS_FAILED: string;
|
|
1833
|
+
MOBILE_HIDE_PTZ: string;
|
|
1834
|
+
OPTION_PTZ_FAILED: string;
|
|
1835
|
+
MOBILE_PTZ_TIPS: string;
|
|
1836
|
+
PTZ_FAST: string;
|
|
1837
|
+
PTZ_MID: string;
|
|
1838
|
+
PTZ_SLOW: string;
|
|
1839
|
+
PTZ_SPEED: string;
|
|
1840
|
+
DEVICE_ZOOM: string;
|
|
1841
|
+
DEVICE_FOCUS: string;
|
|
1842
|
+
NOT_SUPPORT_DEVICE_ZOOM: string;
|
|
1843
|
+
NOT_SUPPORT_FOCUS: string;
|
|
1844
|
+
MIRROR: string;
|
|
1845
|
+
MIRROR_TYPE_ERROR: string;
|
|
1846
|
+
CHANGE_FEC_TYPE: string;
|
|
1847
|
+
DEVICE_NOT_SUPPORT: string;
|
|
1848
|
+
TYPE_NOT_SUPPORT: string;
|
|
1849
|
+
FEC_SUPPORT_VERSION: string;
|
|
1850
|
+
NO_CANVAS_ID: string;
|
|
1851
|
+
SET_FEC_PARAMS: string;
|
|
1852
|
+
GET_FEC_PARAMS: string;
|
|
1853
|
+
SET_FEC_PARAMS_FAILED: string;
|
|
1854
|
+
GET_FEC_PARAMS_FAILED: string;
|
|
1855
|
+
GET_FEC_PARAMS_SUPPORT_VERSION: string;
|
|
1856
|
+
SET_WATERMARK: string;
|
|
1857
|
+
FETCH_THEME_FAILED: string;
|
|
1858
|
+
cancel: string;
|
|
1859
|
+
ok: string;
|
|
1860
|
+
close: string;
|
|
1861
|
+
};
|
|
1862
|
+
};
|
|
1863
|
+
/** 版本号 @since 0.0.1 */
|
|
1864
|
+
static THEME_VERSION: string;
|
|
1865
|
+
/** 播放器配置项 */
|
|
1866
|
+
options: ThemeOptions;
|
|
1867
|
+
/** 主题挂载节点 */
|
|
1868
|
+
$container: HTMLElement;
|
|
1869
|
+
logger: LoggerCls;
|
|
1870
|
+
/** 多语言对象 https://www.npmjs.com/package/@ezuikit/utils-i18n @since 0.0.1 */
|
|
1871
|
+
i18n: I18n;
|
|
1872
|
+
staticPath: string;
|
|
1873
|
+
/** 所有控件列表, 所有控件名称规则(`${iconId}Control`), 如音量控件 this.controls["volumeControl"] @since 0.0.1 */
|
|
1874
|
+
controls: Record<string, Control>;
|
|
1875
|
+
/** 内容控件 @since 0.0.1 */
|
|
1876
|
+
contentControl: Content;
|
|
1877
|
+
/** 加载控件 @since 0.0.1 @private */
|
|
1878
|
+
_loadingControl: Loading;
|
|
1879
|
+
/** 暂停控件 @since 0.0.1 @private */
|
|
1880
|
+
_pauseControl: Pause;
|
|
1881
|
+
/** 消息提示控件 @since 0.0.1 @private */
|
|
1882
|
+
messageControl: Message;
|
|
1883
|
+
/** 封面控件 @since 0.0.1 @private */
|
|
1884
|
+
posterControl: Poster;
|
|
1885
|
+
/**
|
|
1886
|
+
* @since 0.0.1
|
|
1887
|
+
* @private
|
|
1888
|
+
*/
|
|
1889
|
+
_seekDate: Date | null;
|
|
1890
|
+
/**
|
|
1891
|
+
* @type { "rec" | "cloudRec" | "cloudRecord" } recType 回放类型
|
|
1892
|
+
* ```ts
|
|
1893
|
+
* theme.recType // 回放类型
|
|
1894
|
+
* ```
|
|
1895
|
+
*/
|
|
1896
|
+
recType: string;
|
|
1897
|
+
/**
|
|
1898
|
+
* 更多控件(header more)
|
|
1899
|
+
* @since 0.0.1
|
|
1900
|
+
* @private
|
|
1901
|
+
*/
|
|
1902
|
+
_headerMoreControl: More | null;
|
|
1903
|
+
/**
|
|
1904
|
+
* 更多控件(footer more)
|
|
1905
|
+
* @since 0.0.1
|
|
1906
|
+
* @private
|
|
1907
|
+
*/
|
|
1908
|
+
_footerMoreControl: More | null;
|
|
1909
|
+
/** 头部控件 @since 0.0.1 @private */
|
|
1910
|
+
_header: Header | null;
|
|
1911
|
+
/** 低部控件 @since 0.0.1 @private */
|
|
1912
|
+
_footer: Footer | null;
|
|
1913
|
+
/** 回放底部时间轴 @since 0.0.1 @private */
|
|
1914
|
+
_recFooter: RecFooter | null;
|
|
1915
|
+
/**
|
|
1916
|
+
* 移动端扩展容器, 扩展的控件渲染在指定容器以外, 仅只用端适用, 为了可以放置大的控件和方便开发接入
|
|
1917
|
+
* @private
|
|
1918
|
+
*/
|
|
1919
|
+
_mobileExtend: MobileExtend | null;
|
|
1920
|
+
/** @since 0.0.1 @private */
|
|
1921
|
+
_interactiveResult: InteractiveHFResult | null;
|
|
1922
|
+
/** @since 0.0.1 @private */
|
|
1923
|
+
_themeData: IThemeData | null;
|
|
1924
|
+
private _fullscreen;
|
|
1925
|
+
zoomUtil: Zoom | null;
|
|
1926
|
+
/** 清除屏幕旋转 */
|
|
1927
|
+
private _cleanupOrientation;
|
|
1928
|
+
/** resizeObserver 监听销毁 */
|
|
1929
|
+
private _cleanUpResizeObserver;
|
|
1930
|
+
private _throttleMobileInnerWidthHeight;
|
|
1931
|
+
/** 容器的宽 */
|
|
1932
|
+
private _width;
|
|
1933
|
+
/** 容器的高 */
|
|
1934
|
+
private _height;
|
|
1935
|
+
/** 当前容器的全屏状态 true: 全屏, false: 非全屏 */
|
|
1936
|
+
private _isCurrentFullscreen;
|
|
1937
|
+
/** 屏幕旋转角度 0 | 90 | 180 | 270 */
|
|
1938
|
+
private _orientationAngle;
|
|
1939
|
+
/** 是否播放中 @private */
|
|
1940
|
+
_playing: boolean;
|
|
1941
|
+
/** 加载中 */
|
|
1942
|
+
private _loading;
|
|
1943
|
+
/** 音量 */
|
|
1944
|
+
private _volume;
|
|
1945
|
+
/** 静音 */
|
|
1946
|
+
private _muted;
|
|
1947
|
+
/** 电子放大倍数 @private */
|
|
1948
|
+
_zoom: number;
|
|
1949
|
+
/** 放大中 true: 可缩放状态,false: 禁止缩放状态(不能缩放) @private */
|
|
1950
|
+
_zooming: boolean;
|
|
1951
|
+
/** 录制中 @private */
|
|
1952
|
+
_recording: boolean;
|
|
1953
|
+
/** 对讲中 @private */
|
|
1954
|
+
_talking: boolean;
|
|
1955
|
+
/** 倍速 @private */
|
|
1956
|
+
_speed: number;
|
|
1957
|
+
/** 清晰度列表 */
|
|
1958
|
+
videoLevelList: DefinitionItem[];
|
|
1959
|
+
/** 回放片段列表 */
|
|
1960
|
+
recordList: TimeLineTimeSection[];
|
|
1961
|
+
/** 窗口尺寸变化时,设置窗口超出隐藏,防止出现滚动条 */
|
|
1962
|
+
private _resizeOverflowTimer;
|
|
1963
|
+
/** 清理 header/footer 动画 定时器 @private */
|
|
1964
|
+
_onPauseTimingFunc: ((open: boolean) => void) | null;
|
|
1965
|
+
/** 销毁标识 @readonly */
|
|
1966
|
+
destroyed: boolean;
|
|
1967
|
+
/** 播放地址信息 */
|
|
1968
|
+
urlInfo: any | null;
|
|
1969
|
+
constructor(options: ThemeOptions);
|
|
1970
|
+
/**
|
|
1971
|
+
* 容器的宽(单位 px)
|
|
1972
|
+
* ```ts
|
|
1973
|
+
* theme.width // number
|
|
1974
|
+
* ```
|
|
1975
|
+
*/
|
|
1976
|
+
get width(): number;
|
|
1977
|
+
/**
|
|
1978
|
+
* 容器的高(单位 px)
|
|
1979
|
+
* ```ts
|
|
1980
|
+
* theme.height // number
|
|
1981
|
+
* ```
|
|
1982
|
+
*/
|
|
1983
|
+
get height(): number;
|
|
1984
|
+
/**
|
|
1985
|
+
* 当前播放状态
|
|
1986
|
+
* ```ts
|
|
1987
|
+
* theme.playing // boolean
|
|
1988
|
+
* ```
|
|
1989
|
+
*/
|
|
1990
|
+
get playing(): boolean;
|
|
1991
|
+
/**
|
|
1992
|
+
* 播放状态
|
|
1993
|
+
* ```ts
|
|
1994
|
+
* // 事件监听
|
|
1995
|
+
* theme.on(Theme.EVENTS.play, (playing: boolean) => {})
|
|
1996
|
+
* ```
|
|
1997
|
+
*/
|
|
1998
|
+
set playing(playing: boolean);
|
|
1999
|
+
/**
|
|
2000
|
+
* 加载中
|
|
2001
|
+
* ```ts
|
|
2002
|
+
* theme.loading // boolean
|
|
2003
|
+
* ```
|
|
2004
|
+
*/
|
|
2005
|
+
get loading(): boolean;
|
|
2006
|
+
/**
|
|
2007
|
+
* 加载状态
|
|
2008
|
+
* ```ts
|
|
2009
|
+
* // 事件监听
|
|
2010
|
+
* theme.on(Theme.EVENTS.loading, (loading: boolean) => {})
|
|
2011
|
+
* ```
|
|
2012
|
+
*/
|
|
2013
|
+
set loading(loading: boolean);
|
|
2014
|
+
/**
|
|
2015
|
+
* 音量值
|
|
2016
|
+
*/
|
|
2017
|
+
get volume(): number;
|
|
2018
|
+
/**
|
|
2019
|
+
* 音量值
|
|
2020
|
+
* ```ts
|
|
2021
|
+
* // 事件监听
|
|
2022
|
+
* theme.on(Theme.EVENTS.volumechange, (volume: number, muted: boolean) => {})
|
|
2023
|
+
* ```
|
|
2024
|
+
*/
|
|
2025
|
+
set volume(volume: number);
|
|
2026
|
+
/**
|
|
2027
|
+
* 静音
|
|
2028
|
+
*
|
|
2029
|
+
*/
|
|
2030
|
+
get muted(): boolean;
|
|
2031
|
+
/**
|
|
2032
|
+
* 静音
|
|
2033
|
+
* @example
|
|
2034
|
+
* ```ts
|
|
2035
|
+
* // 事件监听
|
|
2036
|
+
* theme.on(Theme.EVENTS.volumechange, (volume: number, muted: boolean) => {})
|
|
2037
|
+
* ```
|
|
2038
|
+
*/
|
|
2039
|
+
set muted(muted: boolean);
|
|
2040
|
+
/**
|
|
2041
|
+
* 是否在缩放中
|
|
2042
|
+
*/
|
|
2043
|
+
get zooming(): boolean;
|
|
2044
|
+
/**
|
|
2045
|
+
* 是否在缩放中
|
|
2046
|
+
*/
|
|
2047
|
+
set zooming(zooming: boolean);
|
|
2048
|
+
/**
|
|
2049
|
+
* 电子放大倍数, 仅 ezopen 支持
|
|
2050
|
+
* @since 0.0.1
|
|
2051
|
+
* @example
|
|
2052
|
+
* ```ts
|
|
2053
|
+
* theme.zoom // 放大倍数
|
|
2054
|
+
* // 事件监听
|
|
2055
|
+
* theme.on(Theme.EVENTS.zoom, (zoom: number) => {})
|
|
2056
|
+
* ```
|
|
2057
|
+
*/
|
|
2058
|
+
get zoom(): number;
|
|
2059
|
+
/**
|
|
2060
|
+
* 电子放大倍数,最多保留一位小数 (需要 zooming = true 才能进行缩放)
|
|
2061
|
+
* @example
|
|
2062
|
+
* ```ts
|
|
2063
|
+
* theme.zoom = 2 // 放大倍数
|
|
2064
|
+
* theme.zoom = 2.5 // 放大倍数
|
|
2065
|
+
* // 事件监听
|
|
2066
|
+
* theme.on(Theme.EVENTS.zoomChange, (zoom: number) => {})
|
|
2067
|
+
* ```
|
|
2068
|
+
*/
|
|
2069
|
+
set zoom(zoom: number);
|
|
2070
|
+
/**
|
|
2071
|
+
* 对讲中
|
|
2072
|
+
*/
|
|
2073
|
+
get talking(): boolean;
|
|
2074
|
+
get speed(): number;
|
|
2075
|
+
/**
|
|
2076
|
+
* 倍速
|
|
2077
|
+
*/
|
|
2078
|
+
set speed(speed: number);
|
|
2079
|
+
/**
|
|
2080
|
+
* 对讲增益(音量), 仅 ezopen 支持
|
|
2081
|
+
*
|
|
2082
|
+
* {@link https://mdn.org.cn/en-US/docs/Web/API/Web_Audio_API/Using_Web_Audio_API}
|
|
2083
|
+
*
|
|
2084
|
+
* @since 0.0.1
|
|
2085
|
+
* @example
|
|
2086
|
+
* ```ts
|
|
2087
|
+
* theme.talkGain // 对讲音量
|
|
2088
|
+
* // 事件监听 event
|
|
2089
|
+
* theme.on(Theme.EVENTS.talk, (gain: number) => {})
|
|
2090
|
+
* ```
|
|
2091
|
+
*/
|
|
2092
|
+
get talkGain(): any;
|
|
2093
|
+
/**
|
|
2094
|
+
* 录制中, 仅 ezopen 支持
|
|
2095
|
+
* @since 0.0.1
|
|
2096
|
+
*/
|
|
2097
|
+
get recording(): boolean;
|
|
2098
|
+
/**
|
|
2099
|
+
* 云台开启中
|
|
2100
|
+
*/
|
|
2101
|
+
get ptzing(): boolean;
|
|
2102
|
+
/**
|
|
2103
|
+
* 清晰度自动
|
|
2104
|
+
*/
|
|
2105
|
+
get videoLevelAuto(): any;
|
|
2106
|
+
/**
|
|
2107
|
+
* 当前容器的全屏状态 true: 全屏, false: 非全屏 , 如果想获取当前浏览器是否全屏,请使用 document.fullscreenElement 判断
|
|
2108
|
+
* @since 0.0.1
|
|
2109
|
+
* @example
|
|
2110
|
+
* ```ts
|
|
2111
|
+
* theme.isCurrentFullscreen // 当前容器的全屏状态
|
|
2112
|
+
* ```
|
|
2113
|
+
*/
|
|
2114
|
+
get isCurrentFullscreen(): boolean;
|
|
2115
|
+
/**
|
|
2116
|
+
* 屏幕旋转角度(0 | 90 | 180 | 270)
|
|
2117
|
+
* @example
|
|
2118
|
+
* ```ts
|
|
2119
|
+
* theme.orientationAngle // 0 | 90 | 180 | 270
|
|
2120
|
+
* // 事件监听
|
|
2121
|
+
* theme.on(Theme.EVENTS.orientationChange, (angle: 0 | 90 | 180 | 270) => {})
|
|
2122
|
+
* ```
|
|
2123
|
+
*/
|
|
2124
|
+
get orientationAngle(): number;
|
|
2125
|
+
/**
|
|
2126
|
+
* 重新调整播放器窗口大小
|
|
2127
|
+
*
|
|
2128
|
+
* Adjust the player window size
|
|
2129
|
+
* @param {number | string} width 宽度(number 类型默认px, 支持字符串大小 "100%" | "50vw")
|
|
2130
|
+
* @param {number | string} height 高度(number 类型默认px, 支持字符串大小 "100%" | "50vh")
|
|
2131
|
+
* @since 0.0.1
|
|
2132
|
+
* @example
|
|
2133
|
+
* ```ts
|
|
2134
|
+
* theme.resize(600, 400) // 600px * 400px
|
|
2135
|
+
* theme.resize("600px", "400px") // 600px * 400px
|
|
2136
|
+
* theme.resize("50%", "1vh")
|
|
2137
|
+
* theme.resize("2em", "2rem")
|
|
2138
|
+
* // 事件监听 event, 这里是具体的宽高(单位px)
|
|
2139
|
+
* theme.on(Theme.EVENTS.resize, (width: number, height: number) => {})
|
|
2140
|
+
* ```
|
|
2141
|
+
*/
|
|
2142
|
+
resize(width?: number | string, height?: number | string): void;
|
|
2143
|
+
/**
|
|
2144
|
+
* 全屏(支持PC/Mobile, 移动端默认 $container 旋转 90 度充满全屏, 层级 9999);
|
|
2145
|
+
* 如果移动端屏幕已系统级别旋转 90° 或 270°,默认充满全屏(节点不旋转)
|
|
2146
|
+
* @since 0.0.1
|
|
2147
|
+
* @example
|
|
2148
|
+
* ```ts
|
|
2149
|
+
* theme.fullscreen()
|
|
2150
|
+
* // 事件监听
|
|
2151
|
+
* theme.on(Theme.EVENTS.fullscreenChange,
|
|
2152
|
+
* ({isCurrentFullscreen, isFullscreen, isMobile}: {isCurrentFullscreen: boolean, isFullscreen: boolean, isMobile: boolean}) => {}
|
|
2153
|
+
* )
|
|
2154
|
+
* ```
|
|
2155
|
+
* @returns {Promise<void>}
|
|
2156
|
+
*/
|
|
2157
|
+
fullscreen(): Promise<void>;
|
|
2158
|
+
/**
|
|
2159
|
+
* 退出全屏(支持PC/Mobile),移动端不支持系统级别全屏
|
|
2160
|
+
*
|
|
2161
|
+
* Exits fullscreen mode (cross-platform support). Note: Mobile platforms are limited to application-level fullscreen only.
|
|
2162
|
+
* @since 0.0.1
|
|
2163
|
+
* @example
|
|
2164
|
+
* ```ts
|
|
2165
|
+
* theme.exitFullscreen()
|
|
2166
|
+
* // 事件监听 event
|
|
2167
|
+
* theme.on(Theme.EVENTS.fullscreenChange,
|
|
2168
|
+
* ({isCurrentFullscreen, isFullscreen, isMobile}: {isCurrentFullscreen: boolean, isFullscreen: boolean, isMobile: boolean}) => {}
|
|
2169
|
+
* )
|
|
2170
|
+
* ```
|
|
2171
|
+
* @returns {Promise<void>}
|
|
2172
|
+
*/
|
|
2173
|
+
exitFullscreen(): Promise<void>;
|
|
2174
|
+
/**
|
|
2175
|
+
* 切换主题(不会改变播放器的状态, 但是会打断其他操作如录制、对讲和云台控制等), 如果传空值,则清空主题
|
|
2176
|
+
*
|
|
2177
|
+
* Change theme (does not affect player state but may disrupt ongoing operations like recording, talk, or PTZ control). Passing an `null` value clears the theme.
|
|
2178
|
+
* @param {IThemeData} themeData IThemeData
|
|
2179
|
+
* @since 0.0.1
|
|
2180
|
+
* @example
|
|
2181
|
+
* ```ts
|
|
2182
|
+
* theme.changeTheme({...})
|
|
2183
|
+
* // 事件监听 event
|
|
2184
|
+
* theme.on(Theme.EVENTS.changeTheme)
|
|
2185
|
+
* ```
|
|
2186
|
+
* @returns {void}
|
|
2187
|
+
*/
|
|
2188
|
+
changeTheme(themeData: IThemeData): void;
|
|
2189
|
+
/**
|
|
2190
|
+
* 设置封面(仅设置,不会默认展示出来)
|
|
2191
|
+
* @param {string=} poster 封面地址, 当 poster = '' 不展示
|
|
2192
|
+
* @since 0.0.1
|
|
2193
|
+
* @example
|
|
2194
|
+
* ```ts
|
|
2195
|
+
* theme.setPoster("https://...................")
|
|
2196
|
+
* theme.setPoster("data:image/jpeg;base64,/............")
|
|
2197
|
+
* ```
|
|
2198
|
+
* @returns {void}
|
|
2199
|
+
*/
|
|
2200
|
+
setPoster(poster?: string): void;
|
|
2201
|
+
/**
|
|
2202
|
+
* 主题Header中展示更多按钮控件
|
|
2203
|
+
* @since 0.0.1
|
|
2204
|
+
* @example
|
|
2205
|
+
* ```ts
|
|
2206
|
+
* theme.hasHeaderMoreControl // boolean
|
|
2207
|
+
* ```
|
|
2208
|
+
*/
|
|
2209
|
+
get hasHeaderMoreControl(): boolean;
|
|
2210
|
+
/**
|
|
2211
|
+
* 主题Footer中展示更多按钮控件
|
|
2212
|
+
* @since 0.0.1
|
|
2213
|
+
* @example
|
|
2214
|
+
* ```ts
|
|
2215
|
+
* theme.hasFooterMoreControl // boolean
|
|
2216
|
+
* ```
|
|
2217
|
+
*/
|
|
2218
|
+
get hasFooterMoreControl(): boolean;
|
|
2219
|
+
/**
|
|
2220
|
+
* @description 设置日志配置
|
|
2221
|
+
* @since 0.0.1
|
|
2222
|
+
* @param {LoggerOptions} options - 日志配置
|
|
2223
|
+
*/
|
|
2224
|
+
setLoggerOptions(options?: LoggerOptions): void;
|
|
2225
|
+
/**
|
|
2226
|
+
* 销毁包括事件、控件 ...
|
|
2227
|
+
*
|
|
2228
|
+
* Destroy (including events, controls...)
|
|
2229
|
+
* @since 0.0.1
|
|
2230
|
+
* @returns {void}
|
|
2231
|
+
* @example
|
|
2232
|
+
* ```ts
|
|
2233
|
+
* theme.destroy()
|
|
2234
|
+
* // 事件监听
|
|
2235
|
+
* theme.on(Theme.EVENTS.theme.beforeDestroy, () => {}) // 主题销毁前
|
|
2236
|
+
* theme.on(Theme.EVENTS.theme.destroyed, () => {}) // // 主题销毁后
|
|
2237
|
+
* ```
|
|
2238
|
+
*/
|
|
2239
|
+
destroy(): void;
|
|
2240
|
+
/** 初始化配置项 */
|
|
2241
|
+
private _initOptions;
|
|
2242
|
+
/**
|
|
2243
|
+
* 初始化设置类名和设置宽高
|
|
2244
|
+
*/
|
|
2245
|
+
private _initClassName;
|
|
2246
|
+
/**
|
|
2247
|
+
* 渲染主题
|
|
2248
|
+
* @param themeData - 主题数据
|
|
2249
|
+
* @returns
|
|
2250
|
+
*/
|
|
2251
|
+
private _renderTheme;
|
|
2252
|
+
/**
|
|
2253
|
+
* 移动端resize 获取屏幕宽高(innerHeight 和 innerWidth)。
|
|
2254
|
+
*
|
|
2255
|
+
* 不做 dpr 的计算;
|
|
2256
|
+
* 不做 dpr 的计算;
|
|
2257
|
+
* 不做 dpr 的计算;
|
|
2258
|
+
*/
|
|
2259
|
+
private _mobileInnerWidthHeight;
|
|
2260
|
+
/**
|
|
2261
|
+
* 添加事件监听 (全屏,旋转方向 )
|
|
2262
|
+
*/
|
|
2263
|
+
private _addEventListener;
|
|
2264
|
+
/**
|
|
2265
|
+
* 窗口尺寸变化判断头部是否需要隐藏控件展示在更多中
|
|
2266
|
+
* 尺寸变化结束时 进行判断,为了节省开销
|
|
2267
|
+
*/
|
|
2268
|
+
private _headerMoreControlShow;
|
|
2269
|
+
/**
|
|
2270
|
+
* 窗口尺寸变化判断底部是否需要隐藏控件展示在更多中(递归判断)
|
|
2271
|
+
* 尺寸变化结束时 进行判断,为了节省开销
|
|
2272
|
+
* @WARN:这里会闪一下, 原因:需要控件渲染后才知是否需要放置到 More 中,
|
|
2273
|
+
*/
|
|
2274
|
+
private _footerMoreControlShow;
|
|
2275
|
+
/**
|
|
2276
|
+
* 移除事件
|
|
2277
|
+
*/
|
|
2278
|
+
private _removeEventListener;
|
|
2279
|
+
/**
|
|
2280
|
+
* 设置清晰度列表(临时方案,后期会有改动)
|
|
2281
|
+
*/
|
|
2282
|
+
protected _setVideoLevelList(list: DefinitionItem[]): void;
|
|
2283
|
+
/**
|
|
2284
|
+
* 禁用按钮
|
|
2285
|
+
* @private
|
|
2286
|
+
*/
|
|
2287
|
+
_disabled(disabled?: boolean): void;
|
|
2288
|
+
private _onDblClickFullscreen;
|
|
2289
|
+
protected _getRecType(url: string): "" | "rec" | "cloudRec" | "cloudRecord";
|
|
2290
|
+
private resetControl;
|
|
2291
|
+
/**
|
|
2292
|
+
* 窗口全屏后旋转 90度判断, 然后设置控件已经旋转 90度, 为了解决控件交互问题
|
|
2293
|
+
*/
|
|
2294
|
+
private _isRotated;
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
/**
|
|
2298
|
+
* standard 做特殊处理
|
|
2299
|
+
*
|
|
2300
|
+
* WARN: 除了 'deviceID', 'deviceName', 'rec', 'cloudRec', 'cloudRecord' 做特殊处理, 只能放置在顶部, 其它不做处理,如果配置渲染的有问题需要开发者自行修改
|
|
2301
|
+
* FIXME: 暂时不去重, 让开发者自己去修改
|
|
2302
|
+
*/
|
|
2303
|
+
declare const TEMPLATES: {
|
|
2304
|
+
readonly pcLive: IThemeData;
|
|
2305
|
+
readonly pcRec: IThemeData;
|
|
2306
|
+
readonly mobileLive: IThemeData;
|
|
2307
|
+
readonly mobileRec: IThemeData;
|
|
2308
|
+
readonly security: IThemeData;
|
|
2309
|
+
readonly voice: IThemeData;
|
|
2310
|
+
};
|
|
2311
|
+
/**
|
|
2312
|
+
* 模板类型名
|
|
2313
|
+
*/
|
|
2314
|
+
type ThemeTemplateType = keyof typeof TEMPLATES;
|
|
2315
|
+
|
|
2316
|
+
/**
|
|
2317
|
+
* 设备序列号控件配置项
|
|
2318
|
+
*/
|
|
2319
|
+
interface DeviceOptions extends Omit<ControlOptions, 'tagName'> {
|
|
2320
|
+
deviceName?: string;
|
|
2321
|
+
}
|
|
2322
|
+
|
|
2323
|
+
/**
|
|
2324
|
+
* 主题配置项
|
|
2325
|
+
*
|
|
2326
|
+
* Theme configuration options
|
|
2327
|
+
* @since 0.0.1
|
|
2328
|
+
*/
|
|
2329
|
+
interface ThemeOptions {
|
|
2330
|
+
/** 容器 @since 0.0.1 */
|
|
2331
|
+
container: HTMLElement | (() => HTMLElement);
|
|
2332
|
+
url?: '';
|
|
2333
|
+
/**
|
|
2334
|
+
* 主题数据, 当值为 null 时不展示主题。
|
|
2335
|
+
* 优先级低于 template, 不推荐同时使用
|
|
2336
|
+
* @since 0.0.1
|
|
2337
|
+
*/
|
|
2338
|
+
themeData?: IThemeData | null;
|
|
2339
|
+
/**
|
|
2340
|
+
* 播放器模板,支持开放平台官方和自定义的模板(https://open.ys7.com/console/ezuikit/template.html)
|
|
2341
|
+
* 优先级高于 themeData, 不推荐同时使用
|
|
2342
|
+
* @since 0.0.1
|
|
2343
|
+
*/
|
|
2344
|
+
template?: ThemeTemplateType | string;
|
|
2345
|
+
/** 主题样式类 @since 0.0.1 */
|
|
2346
|
+
className?: string;
|
|
2347
|
+
/** 是否自动播放 @since 0.0.1 */
|
|
2348
|
+
autoPlay?: boolean;
|
|
2349
|
+
/**
|
|
2350
|
+
* 播放器类型
|
|
2351
|
+
*
|
|
2352
|
+
* | ezopen | flv | hls | mp4 |
|
|
2353
|
+
* |:------:|:----------:|:--------:|:-------:|
|
|
2354
|
+
* | 私有流 | flv 标准流 | hls标准流 | mp4 |
|
|
2355
|
+
* @since 0.0.1
|
|
2356
|
+
*/
|
|
2357
|
+
type: 'ezopen' | 'flv' | 'hls' | 'mp4';
|
|
2358
|
+
/** 播放器容器宽度,默认容器宽度,不要设置为 0 @since 0.0.1 */
|
|
2359
|
+
width?: number | string;
|
|
2360
|
+
/** 播放器容器高度,默认容器宽度, 不要设置为 0 @since 0.0.1 */
|
|
2361
|
+
height?: number | string;
|
|
2362
|
+
/** 语言包 'zh' | 'en' @since 0.0.1 */
|
|
2363
|
+
language?: 'zh' | 'en' | string;
|
|
2364
|
+
/** 指定回放的空间ID @since 0.0.1, 优先级小于 url 中的 spaceId */
|
|
2365
|
+
spaceId?: string | number;
|
|
2366
|
+
/** 静音, 优先级小于 volumeOptions.muted */
|
|
2367
|
+
muted?: false;
|
|
2368
|
+
/** 音量大小, 优先级小于 volumeOptions.volume */
|
|
2369
|
+
volume?: number;
|
|
2370
|
+
/**
|
|
2371
|
+
* 语言包
|
|
2372
|
+
* {
|
|
2373
|
+
* zh: {},
|
|
2374
|
+
* en: {}
|
|
2375
|
+
* }
|
|
2376
|
+
* @since 0.0.1
|
|
2377
|
+
*/
|
|
2378
|
+
locales?: Record<string, I18nTranslation>;
|
|
2379
|
+
/** 日志配置 @since 0.0.1 */
|
|
2380
|
+
loggerOptions?: LoggerOptions;
|
|
2381
|
+
/** 双击全屏, 默认true, 仅 PC 支持 @since 0.0.1 */
|
|
2382
|
+
dblClickFullscreen?: boolean;
|
|
2383
|
+
/** 加载动画控件配置, 默认 undefined, 初始化 null 不渲染控件 @since 0.0.1 */
|
|
2384
|
+
loadingOptions?: OmitControlOptions<LoadingOptions> | null;
|
|
2385
|
+
/** 暂停控件配置, 默认 undefined, 初始化 null 不渲染控件 @since 0.0.1 */
|
|
2386
|
+
pauseOptions?: OmitControlOptions<PauseOptions> | null;
|
|
2387
|
+
/** 消息控件配置,默认 undefined, 初始化 null 不渲染控件@since 0.0.1 */
|
|
2388
|
+
messageOptions?: OmitControlOptions<MessageOptions> | null;
|
|
2389
|
+
/** 封面控件配置, 默认 undefined, 初始化 null 不渲染控件 @since 0.0.1 */
|
|
2390
|
+
posterOptions?: OmitControlOptions<PosterOptions> | null;
|
|
2391
|
+
/** 设备信息控件配置,默认 undefined, 初始化 null 不渲染控件 @since 0.0.1 */
|
|
2392
|
+
deviceOptions?: OmitControlOptions<DeviceOptions> | null;
|
|
2393
|
+
/** 播放控件配置,默认 undefined, 初始化 null 不渲染控件 @since 0.0.1 */
|
|
2394
|
+
playOptions?: OmitControlOptions<PlayOptions> | null;
|
|
2395
|
+
/** 音量控件配置 @since 0.0.1 */
|
|
2396
|
+
volumeOptions?: OmitControlOptions<VolumeOptions>;
|
|
2397
|
+
/** 截图控件配置 @since 0.0.1 */
|
|
2398
|
+
capturePictureOptions?: OmitControlOptions<CapturePictureOptions>;
|
|
2399
|
+
/** 清晰度控件配置 @since 0.0.1 */
|
|
2400
|
+
definitionOptions?: OmitControlOptions<DefinitionOptions>;
|
|
2401
|
+
/** 云台控件配置 @since 0.0.1 */
|
|
2402
|
+
ptzOptions?: OmitControlOptions<PtzOptions>;
|
|
2403
|
+
/** 回放类型控件配置 @since 0.0.1 */
|
|
2404
|
+
recOptions?: OmitControlOptions<RecOptions>;
|
|
2405
|
+
/** 录制控件配置 @since 0.0.1 */
|
|
2406
|
+
recordOptions?: OmitControlOptions<RecordOptions>;
|
|
2407
|
+
/** 倍速控件配置 @since 0.0.1 */
|
|
2408
|
+
speedOptions?: OmitControlOptions<SpeedOptions>;
|
|
2409
|
+
/** 对讲控件配置 @since 0.0.1 */
|
|
2410
|
+
talkOptions?: OmitControlOptions<TalkOptions>;
|
|
2411
|
+
/** 缩放控件配置 @since 0.0.1 */
|
|
2412
|
+
zoomOptions?: OmitControlOptions<ZoomOptions>;
|
|
2413
|
+
/** 全屏控件配置 @since 0.0.1 */
|
|
2414
|
+
fullscreenOptions?: OmitControlOptions<FullscreenOptions>;
|
|
2415
|
+
/** 全局全屏控件配置 @since 0.0.1 */
|
|
2416
|
+
globalFullscreenOptions?: OmitControlOptions<GlobalFullscreenOptions>;
|
|
2417
|
+
/** 日历控件配置 @since 0.0.1 */
|
|
2418
|
+
dateOptions?: any;
|
|
2419
|
+
/** 时间轴控件配置 @since 0.0.1 */
|
|
2420
|
+
timeLineOptions?: any;
|
|
2421
|
+
/** 初始化开始回调, 在内部可以添加事件(Control.beforeMountControls, Control.mountedControls)监听 @since 0.0.1 */
|
|
2422
|
+
onInitializing?: (theme: Theme) => void;
|
|
2423
|
+
/**
|
|
2424
|
+
* 移动端扩展 仅针对 ezopen 有效 @since 0.0.1 (2025-08-01), 默认 true, 当值为 null 不展示扩展
|
|
2425
|
+
* 意味着在移动端 header/footer 仅展示部分控件, 由扩展区域显示更多按钮
|
|
2426
|
+
*
|
|
2427
|
+
* 注意⚠️:当支持扩展配置时。每一个页面最多只支持一个实例, 不然会有冲突, 如果想要多播放器窗口需要 设置 `mobileExtendConfig` 为 null
|
|
2428
|
+
*/
|
|
2429
|
+
mobileExtendOptions?: {
|
|
2430
|
+
/**
|
|
2431
|
+
* 在扩展中展示的控件,(在扩展中展示, 就不会在 header/footer 中展示, 全屏除外)
|
|
2432
|
+
* 默认值: ["timeLine", "date"])
|
|
2433
|
+
*/
|
|
2434
|
+
controls: string[] | null;
|
|
2435
|
+
} | null;
|
|
2436
|
+
/**
|
|
2437
|
+
* 默认 false
|
|
2438
|
+
* @deprecated
|
|
2439
|
+
* 9.x 开始弃用 请使用 timeLineOptions: null来关闭时间轴
|
|
2440
|
+
*/
|
|
2441
|
+
disabledTimeLine?: boolean;
|
|
2442
|
+
/**
|
|
2443
|
+
* 默认 false
|
|
2444
|
+
* @deprecated
|
|
2445
|
+
* 9.x 开始弃用 请使用 ptzOptions: null来关闭云台
|
|
2446
|
+
*/
|
|
2447
|
+
disabledPTZ?: boolean;
|
|
2448
|
+
[kye: string]: any;
|
|
2449
|
+
}
|
|
2450
|
+
/**
|
|
2451
|
+
* 回放控件类型
|
|
2452
|
+
* @since 0.0.1
|
|
2453
|
+
*/
|
|
2454
|
+
type ThemeRecType = 'rec' | 'cloudRec' | 'cloudRecord';
|
|
2455
|
+
|
|
2456
|
+
/**
|
|
2457
|
+
* 回放控件配置项
|
|
2458
|
+
*/
|
|
2459
|
+
interface RecOptions extends Omit<ControlOptions, 'tagName'> {
|
|
2460
|
+
onClick?: (e: Event) => void;
|
|
2461
|
+
onChange?: (type: ThemeRecType) => void;
|
|
2462
|
+
recType?: ThemeRecType;
|
|
2463
|
+
}
|
|
2464
|
+
/**
|
|
2465
|
+
* 回放类型切换(本地回放(sdk 卡), 云存储回放, 云录制回放)控件
|
|
2466
|
+
* @category Control
|
|
2467
|
+
*/
|
|
2468
|
+
declare class Rec extends Control {
|
|
2469
|
+
private readonly _options;
|
|
2470
|
+
private _delegation;
|
|
2471
|
+
private recType;
|
|
2472
|
+
constructor(options: RecOptions);
|
|
2473
|
+
destroy(): void;
|
|
2474
|
+
addRecType(id: string): void;
|
|
2475
|
+
private _activeIcon;
|
|
2476
|
+
private _onClickIcon;
|
|
2477
|
+
/**
|
|
2478
|
+
* 点击 Control 会触发
|
|
2479
|
+
*/
|
|
2480
|
+
protected _onControlClick(e: Event): void;
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
/**
|
|
2484
|
+
* 屏幕旋转方向
|
|
2485
|
+
*/
|
|
2486
|
+
interface ScreenOrientation {
|
|
2487
|
+
/** 旋转角度 0 | 90 | 180 | 270, 浏览器不支持 screen.orientation 或 window.orientation 时,仅支持 0 | 90 */
|
|
2488
|
+
angle: number;
|
|
2489
|
+
/** */
|
|
2490
|
+
type: 'landscape' | 'landscape-primary' | 'landscape-secondary' | 'portrait' | 'portrait-primary' | 'portrait-secondary' | 'unknow';
|
|
2491
|
+
}
|
|
2492
|
+
/**
|
|
2493
|
+
* 屏幕旋转方向变化回调
|
|
2494
|
+
*/
|
|
2495
|
+
type OrientationChangeCallback = (orientation: ScreenOrientation) => void;
|
|
2496
|
+
/**
|
|
2497
|
+
* 清除屏幕旋转监听
|
|
2498
|
+
*/
|
|
2499
|
+
type CleanUpScreenOrientationFun = () => void;
|
|
2500
|
+
/**
|
|
2501
|
+
* 清除resize 监听
|
|
2502
|
+
*/
|
|
2503
|
+
interface CleanUpResizeObserver {
|
|
2504
|
+
/** 取消 */
|
|
2505
|
+
unobserve: () => void;
|
|
2506
|
+
/** 断开 */
|
|
2507
|
+
disconnect: () => void;
|
|
2508
|
+
}
|
|
2509
|
+
/**
|
|
2510
|
+
* 工具类
|
|
2511
|
+
* @category Util
|
|
2512
|
+
*/
|
|
2513
|
+
declare class Utils {
|
|
2514
|
+
/**
|
|
2515
|
+
* 判断是否是移动端, (iPadOS 13+ 移除了 "iPad" 标识)
|
|
2516
|
+
* @example
|
|
2517
|
+
* ```ts
|
|
2518
|
+
* Utils.isMobile // true | false
|
|
2519
|
+
* ```
|
|
2520
|
+
*/
|
|
2521
|
+
static isMobile: any;
|
|
2522
|
+
/**
|
|
2523
|
+
* 监听手机旋转, 参考 {@link https://developer.mozilla.org/zh-CN/docs/Web/API/Screen/orientation}
|
|
2524
|
+
* @param {OrientationChangeCallback} change 手机旋转回调
|
|
2525
|
+
* @returns {[ScreenOrientation, CleanUpScreenOrientationFun]} [第一次的结果, 事件移除]
|
|
2526
|
+
*
|
|
2527
|
+
* @example
|
|
2528
|
+
* ```ts
|
|
2529
|
+
* const [orientation, cleanUp] = Utils.orientationEventListener((orientation) => {
|
|
2530
|
+
* console.log("orientation", orientation)
|
|
2531
|
+
* })
|
|
2532
|
+
*
|
|
2533
|
+
* console.log("orientation", orientation)
|
|
2534
|
+
* // 清除监听
|
|
2535
|
+
* cleanUp()
|
|
2536
|
+
* ```
|
|
2537
|
+
*/
|
|
2538
|
+
static orientationEventListener(change?: OrientationChangeCallback): [ScreenOrientation, CleanUpScreenOrientationFun];
|
|
2539
|
+
/**
|
|
2540
|
+
* 监听节点尺寸变化, 参考 {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver}
|
|
2541
|
+
* @param {Element} node
|
|
2542
|
+
* @param callback
|
|
2543
|
+
* @returns {CleanUpResizeObserver}
|
|
2544
|
+
* @example
|
|
2545
|
+
* ```ts
|
|
2546
|
+
* const [unobserve, disconnect] = Utils.resizeObserver(node, (entries, observer) => {});
|
|
2547
|
+
*
|
|
2548
|
+
* // 移除监听
|
|
2549
|
+
* unobserve()
|
|
2550
|
+
* ```
|
|
2551
|
+
*/
|
|
2552
|
+
static resizeObserver(node: Element, callback?: (entries: ResizeObserverEntry[], observer: ResizeObserver) => void): CleanUpResizeObserver;
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
export { Control, Fullscreen, Loading, Message, Play, Poster, Rec, Theme, Utils, Volume, Theme as default };
|
|
2556
|
+
export type { CleanUpResizeObserver, CleanUpScreenOrientationFun, ControlItem, ControlOptions, FooterOptions, FullscreenOptions, HeaderOptions, IThemeData, IThemeDataItem, LoadingOptions, MessageOptions, PlayOptions, PosterOptions, RecOptions, ScreenOrientation, ThemeOptions, VolumeOptions };
|