@ezuikit/player-ezopen 8.2.2-beta.3 → 8.2.2-beta.4
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/adapter.js +3 -3
- package/dist/adapter.umd.js +4 -11
- package/dist/index.js +3 -3
- package/dist/index.umd.js +3 -10
- package/package.json +3 -4
- package/dist/adapter.esm.js +0 -8
- package/dist/index.esm.js +0 -8
- package/dist/types/adapter.d.ts +0 -1253
- package/dist/types/index.d.ts +0 -1203
package/dist/types/index.d.ts
DELETED
|
@@ -1,1203 +0,0 @@
|
|
|
1
|
-
import * as _ezuikit_utils_service_dist_types_fetch from '@ezuikit/utils-service/dist/types/fetch';
|
|
2
|
-
import { LoggerCls } from '@ezuikit/utils-logger/dist/types/logger';
|
|
3
|
-
import { LoggerOptions } from '@ezuikit/utils-logger';
|
|
4
|
-
import I18n from '@ezuikit/utils-i18n';
|
|
5
|
-
import Service, { DeviceCapacityRes, DeviceInfoRes } from '@ezuikit/utils-service';
|
|
6
|
-
import { EzopenURL } from '@ezuikit/utils-tools';
|
|
7
|
-
import EventEmitter from 'eventemitter3';
|
|
8
|
-
|
|
9
|
-
interface IResult$1<T> {
|
|
10
|
-
data?: T;
|
|
11
|
-
code?: number;
|
|
12
|
-
msg?: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* 播放器标准接口
|
|
16
|
-
*/
|
|
17
|
-
interface PlayerInterface extends EventEmitter {
|
|
18
|
-
playing: boolean;
|
|
19
|
-
volume: number;
|
|
20
|
-
playbackRate: number;
|
|
21
|
-
deviceCapacity: Record<string, any>;
|
|
22
|
-
i18n: any;
|
|
23
|
-
logger: any;
|
|
24
|
-
/**
|
|
25
|
-
* 播放
|
|
26
|
-
* @param options
|
|
27
|
-
* @returns {Promise}
|
|
28
|
-
*/
|
|
29
|
-
play: (options?: any) => Promise<unknown>;
|
|
30
|
-
/**
|
|
31
|
-
* 暂停播放
|
|
32
|
-
* @returns
|
|
33
|
-
*/
|
|
34
|
-
pause: (bool?: boolean) => Promise<unknown>;
|
|
35
|
-
/**
|
|
36
|
-
* 销毁并断流
|
|
37
|
-
* @returns
|
|
38
|
-
*/
|
|
39
|
-
destroy: () => Promise<unknown>;
|
|
40
|
-
/**
|
|
41
|
-
* 截图
|
|
42
|
-
* @param {string} name 文件名 默认时间戳(new Date().getTime())
|
|
43
|
-
* @param {"png" | "jpeg"} fmt 图片格式
|
|
44
|
-
* @param {"base64"} type 文件格式 默认base64
|
|
45
|
-
* @param {boolean} download 是否直接下载 默认不直接下载
|
|
46
|
-
* @returns 返回base64字符
|
|
47
|
-
*/
|
|
48
|
-
snapshot: (name?: string, fmt?: 'jpeg', type?: 'base64', download?: boolean) => Promise<IResult$1<{
|
|
49
|
-
fileName?: string;
|
|
50
|
-
base64?: string;
|
|
51
|
-
} | null>>;
|
|
52
|
-
/**
|
|
53
|
-
* 开始录制视频
|
|
54
|
-
* @param {string} name 文件名 默认时间戳(new Date().getTime())
|
|
55
|
-
* @param {"mp4"} fmt 图片格式 默认mp4
|
|
56
|
-
* @returns
|
|
57
|
-
*/
|
|
58
|
-
startRecord?: (name?: string, fmt?: 'mp4') => Promise<any>;
|
|
59
|
-
/**
|
|
60
|
-
* 停止录制
|
|
61
|
-
* @returns
|
|
62
|
-
*/
|
|
63
|
-
stopRecord?: () => Promise<any>;
|
|
64
|
-
/**
|
|
65
|
-
* 全屏
|
|
66
|
-
* @returns
|
|
67
|
-
*/
|
|
68
|
-
fullScreen: () => Promise<void>;
|
|
69
|
-
/**
|
|
70
|
-
* 退出全屏
|
|
71
|
-
* @returns
|
|
72
|
-
*/
|
|
73
|
-
exitScreen: () => Promise<void>;
|
|
74
|
-
/**
|
|
75
|
-
* 设置画布/视频的尺寸 不设置 默认使用容器的高宽(充满容器)
|
|
76
|
-
* @param {number=} width 画布的宽度
|
|
77
|
-
* @param {number=} height 画布的高度
|
|
78
|
-
* @returns
|
|
79
|
-
*/
|
|
80
|
-
resize: (width?: number, height?: number) => Promise<{
|
|
81
|
-
width: number;
|
|
82
|
-
height: number;
|
|
83
|
-
}>;
|
|
84
|
-
/**
|
|
85
|
-
* 设置音量
|
|
86
|
-
* @param volume 音量 [0-1], 0:表示静音
|
|
87
|
-
* @returns {void}
|
|
88
|
-
*/
|
|
89
|
-
setVolume: (volume: number) => void;
|
|
90
|
-
/**
|
|
91
|
-
* 设置封面
|
|
92
|
-
* @param url
|
|
93
|
-
* @returns
|
|
94
|
-
*/
|
|
95
|
-
setPoster?: (postUrl: string) => void;
|
|
96
|
-
/**
|
|
97
|
-
* 设置播放速度
|
|
98
|
-
* @param rate
|
|
99
|
-
* @returns
|
|
100
|
-
*/
|
|
101
|
-
setPlaybackRate?: (rate: number) => void;
|
|
102
|
-
/**
|
|
103
|
-
* 当前版本号
|
|
104
|
-
* @returns
|
|
105
|
-
*/
|
|
106
|
-
getVersion: () => object;
|
|
107
|
-
/**
|
|
108
|
-
* 设置日志打印的级别 INFO | LOG | WARN | ERROR
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* @param {string} level 日志级别 一次从大到小 3 -> 0 (为了更好的扩展)
|
|
112
|
-
* @returns
|
|
113
|
-
*/
|
|
114
|
-
setDebug?: (level: 'INFO' | 'LOG' | 'WARN' | 'ERROR') => void;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
interface PlayerPlugin {
|
|
118
|
-
name: string;
|
|
119
|
-
init?: (player?: PlayerInterface) => void;
|
|
120
|
-
beforeExec?: (player?: PlayerInterface) => boolean | Promise<boolean>;
|
|
121
|
-
exec: (player?: PlayerInterface) => void;
|
|
122
|
-
afterExec?: (player?: PlayerInterface) => void;
|
|
123
|
-
destroy?: (player?: PlayerInterface) => void;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* 环境
|
|
128
|
-
*/
|
|
129
|
-
interface PlayerEnv {
|
|
130
|
-
domain: string;
|
|
131
|
-
wsUrl?: string;
|
|
132
|
-
}
|
|
133
|
-
interface PlayerOptions {
|
|
134
|
-
/**
|
|
135
|
-
* dom id
|
|
136
|
-
*/
|
|
137
|
-
id: string;
|
|
138
|
-
/**
|
|
139
|
-
* 视频封面
|
|
140
|
-
*/
|
|
141
|
-
poster?: string;
|
|
142
|
-
/**
|
|
143
|
-
* 播放地址
|
|
144
|
-
*/
|
|
145
|
-
url: string;
|
|
146
|
-
/**
|
|
147
|
-
*
|
|
148
|
-
*/
|
|
149
|
-
accessToken?: string;
|
|
150
|
-
/**
|
|
151
|
-
* 自动播放
|
|
152
|
-
*/
|
|
153
|
-
autoPlay?: boolean;
|
|
154
|
-
/**
|
|
155
|
-
* 是否开启音频
|
|
156
|
-
*/
|
|
157
|
-
audio?: boolean;
|
|
158
|
-
/**
|
|
159
|
-
* 环境变量
|
|
160
|
-
*/
|
|
161
|
-
env?: PlayerEnv;
|
|
162
|
-
/**
|
|
163
|
-
* 打开流信息回调,监听 streamInfoCB 事件
|
|
164
|
-
* 0 : 每次都回调
|
|
165
|
-
* 1 : 只回调一次
|
|
166
|
-
* 注意:会影响性能
|
|
167
|
-
* 默认值 1
|
|
168
|
-
*/
|
|
169
|
-
streamInfoCBType: 0 | 1;
|
|
170
|
-
}
|
|
171
|
-
interface IResult<T> {
|
|
172
|
-
data?: T;
|
|
173
|
-
code?: number;
|
|
174
|
-
msg?: string;
|
|
175
|
-
}
|
|
176
|
-
interface IFrameInfo {
|
|
177
|
-
codecType: number;
|
|
178
|
-
videoFormatName?: string;
|
|
179
|
-
width: number;
|
|
180
|
-
height: number;
|
|
181
|
-
year: number;
|
|
182
|
-
month: number;
|
|
183
|
-
day: number;
|
|
184
|
-
hour: number;
|
|
185
|
-
minute: number;
|
|
186
|
-
second: number;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
interface IStreamClient {
|
|
190
|
-
/**
|
|
191
|
-
* @description 开流, 此时设备的流还没有发出来
|
|
192
|
-
* @param {string} szUrl 取流路径,如ws://hostname:port/channel
|
|
193
|
-
* @param {object} oParams 取流需要涉及的相关参数
|
|
194
|
-
* @param {function} cbMessage 消息回调函数
|
|
195
|
-
* @param {function} cbClose 关闭回调
|
|
196
|
-
* @returns {Promise<string>} 返回Promise对象 // 取流uuid,用于区分每条取流连接
|
|
197
|
-
*/
|
|
198
|
-
openStream: (szUrl: string, oParams: object, cbMessage: (msg: object) => void, cbClose: () => void) => Promise<string>;
|
|
199
|
-
/**
|
|
200
|
-
* @description 开始取流
|
|
201
|
-
*
|
|
202
|
-
* @param {string} id websocket id,在openStream的时候生成
|
|
203
|
-
* @param {string} szStartTime 开始时间
|
|
204
|
-
* @param {string} szStopTime 结束时间
|
|
205
|
-
* @param {function} cbMessage 码流回调函数
|
|
206
|
-
*
|
|
207
|
-
* @returns {Promise<unknown>} 返回Promise对象
|
|
208
|
-
*/
|
|
209
|
-
startPlay: (id: string, szStartTime?: string, szStopTime?: string) => Promise<unknown>;
|
|
210
|
-
singleFrame: () => void;
|
|
211
|
-
/**
|
|
212
|
-
* @description 设置倍率
|
|
213
|
-
*
|
|
214
|
-
* @param {string} id websocket id在openStream的时候生成
|
|
215
|
-
* @param {number} iRate 播放倍率
|
|
216
|
-
*
|
|
217
|
-
* @returns {Promise<unknown>} Promise
|
|
218
|
-
*/
|
|
219
|
-
setPlayRate: (id: string, iRate: number) => Promise<unknown>;
|
|
220
|
-
/**
|
|
221
|
-
* @description 定位回放
|
|
222
|
-
*
|
|
223
|
-
* @param {string} id websocket id在openStream的时候生成
|
|
224
|
-
* @param {string} szStartTime 开始时间
|
|
225
|
-
* @param {string} szStopTime 结束时间
|
|
226
|
-
*
|
|
227
|
-
* @returns {Promise<unknown>} Promise
|
|
228
|
-
*/
|
|
229
|
-
seek: (id: string, szStartTime: string, szStopTime: string) => Promise<unknown>;
|
|
230
|
-
/**
|
|
231
|
-
* @description 暂停取流
|
|
232
|
-
*
|
|
233
|
-
* @param {string} id websocket id,在openStream的时候生成
|
|
234
|
-
*
|
|
235
|
-
* @returns {Promise<unknown>} 返回Promise对象
|
|
236
|
-
*/
|
|
237
|
-
pause: (id: string) => Promise<unknown>;
|
|
238
|
-
/**
|
|
239
|
-
* @description 透传协议
|
|
240
|
-
*
|
|
241
|
-
* @param {string} id websocket id,在openStream的时候生成
|
|
242
|
-
* @param {string} szCmd, 透传的命令码
|
|
243
|
-
*
|
|
244
|
-
* @returns {Promise<unknown>} 返回Promise对象
|
|
245
|
-
*/
|
|
246
|
-
transmission: (id: string, szCmd: string) => Promise<unknown>;
|
|
247
|
-
/**
|
|
248
|
-
* @description 恢复取流
|
|
249
|
-
*
|
|
250
|
-
* @param {string} id websocket id,在openStream的时候生成
|
|
251
|
-
*
|
|
252
|
-
* @returns {Promise<unknown>} 返回Promise对象
|
|
253
|
-
*/
|
|
254
|
-
resume: (id: string) => Promise<unknown>;
|
|
255
|
-
/**
|
|
256
|
-
* @description 停止取流
|
|
257
|
-
*
|
|
258
|
-
* @param {string} id websocket id,在openStream的时候生成
|
|
259
|
-
*
|
|
260
|
-
* @returns {Promise<unknown>} 返回Promise对象
|
|
261
|
-
*/
|
|
262
|
-
stop: (id: string) => Promise<unknown>;
|
|
263
|
-
stopAll: () => Promise<unknown>;
|
|
264
|
-
}
|
|
265
|
-
declare class StreamClient {
|
|
266
|
-
private readonly _player;
|
|
267
|
-
private _streamClient;
|
|
268
|
-
_streamUUID: string;
|
|
269
|
-
constructor(player: EZopenPlayer);
|
|
270
|
-
/**
|
|
271
|
-
* @description 开流, 此时设备的流还没有发出来
|
|
272
|
-
* @param {string} szUrl 取流路径,如ws://hostname:port/channel
|
|
273
|
-
* @param {object} oParams 取流需要涉及的相关参数
|
|
274
|
-
* @param {function} cbMessage 消息回调函数
|
|
275
|
-
* @param {function} cbClose 关闭回调
|
|
276
|
-
* @param {function} cbError 错误回调
|
|
277
|
-
* @returns {Promise<string>} 返回Promise对象 // 取流uuid,用于区分每条取流连接
|
|
278
|
-
*/
|
|
279
|
-
openStream(szUrl: string, oParams: object, cbMessage: (msg: object) => void, cbClose: (id?: string) => void, cbError: (id?: string, msg?: any) => void): Promise<string>;
|
|
280
|
-
/**
|
|
281
|
-
* @description 开始取流
|
|
282
|
-
*
|
|
283
|
-
* @param {string} id websocket id,在openStream的时候生成
|
|
284
|
-
* @param {string} szStartTime 开始时间
|
|
285
|
-
* @param {string} szStopTime 结束时间
|
|
286
|
-
* @param {function} cbMessage 码流回调函数
|
|
287
|
-
*
|
|
288
|
-
* @returns {Promise<unknown>} 返回Promise对象
|
|
289
|
-
*/
|
|
290
|
-
startPlay(id?: string): Promise<void>;
|
|
291
|
-
/**
|
|
292
|
-
* @description 设置播放速度
|
|
293
|
-
* @param rate 播放速度
|
|
294
|
-
* @param uuid websocket id,在openStream的时候生成
|
|
295
|
-
* @returns
|
|
296
|
-
*/
|
|
297
|
-
setPlayRate(rate: number, id?: string): Promise<void>;
|
|
298
|
-
/**
|
|
299
|
-
* @description 定位回放
|
|
300
|
-
*
|
|
301
|
-
* @param {string} id websocket id在openStream的时候生成
|
|
302
|
-
* @param {string} startTime 开始时间
|
|
303
|
-
* @param {string} stopTime 结束时间
|
|
304
|
-
*
|
|
305
|
-
* @returns {Promise<unknown>} Promise
|
|
306
|
-
*/
|
|
307
|
-
seek(startTime: string, stopTime: string, id?: string): Promise<void>;
|
|
308
|
-
/**
|
|
309
|
-
* @description 停止所有流
|
|
310
|
-
* @returns
|
|
311
|
-
*/
|
|
312
|
-
stopAll(): Promise<void>;
|
|
313
|
-
/**
|
|
314
|
-
* @description 客户端销毁
|
|
315
|
-
*/
|
|
316
|
-
destroy(): void;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
declare class ESCanvas {
|
|
320
|
-
constructor(szCanvasId: any);
|
|
321
|
-
m_iCanvasWidth: any;
|
|
322
|
-
m_iCanvasHeight: any;
|
|
323
|
-
m_iHorizontalResolution: number;
|
|
324
|
-
m_iVerticalResolution: number;
|
|
325
|
-
m_szDisplayMode: string;
|
|
326
|
-
m_szVideoFormat: string;
|
|
327
|
-
setDrawMutiShapeOneTime(bDrawMuti: any): void;
|
|
328
|
-
setMaxShapeSupport(iMax: any): void;
|
|
329
|
-
getMaxShapeSupport(): number;
|
|
330
|
-
setDrawStatus(bDrawStatus: any, cbCallback?: any): void;
|
|
331
|
-
setShapeType(szType: any): void;
|
|
332
|
-
setCurrentShapeInfo(oShapeInfo: any): void;
|
|
333
|
-
getShapeType(): string;
|
|
334
|
-
getAllShapesInfo(): (
|
|
335
|
-
| {
|
|
336
|
-
szType: any;
|
|
337
|
-
szGridMap: any;
|
|
338
|
-
iGridColNum: any;
|
|
339
|
-
iGridRowNum: any;
|
|
340
|
-
szText?: undefined;
|
|
341
|
-
szEnabled?: undefined;
|
|
342
|
-
szOSDType?: undefined;
|
|
343
|
-
iPositionX?: undefined;
|
|
344
|
-
iPositionY?: undefined;
|
|
345
|
-
szDateStyle?: undefined;
|
|
346
|
-
szClockType?: undefined;
|
|
347
|
-
szDisplayWeek?: undefined;
|
|
348
|
-
szId?: undefined;
|
|
349
|
-
szAlignment?: undefined;
|
|
350
|
-
aPoint?: undefined;
|
|
351
|
-
bChoosed?: undefined;
|
|
352
|
-
}
|
|
353
|
-
| {
|
|
354
|
-
szType: any;
|
|
355
|
-
szText: any;
|
|
356
|
-
szEnabled: any;
|
|
357
|
-
szOSDType: any;
|
|
358
|
-
iPositionX: any;
|
|
359
|
-
iPositionY: any;
|
|
360
|
-
szDateStyle: any;
|
|
361
|
-
szClockType: any;
|
|
362
|
-
szDisplayWeek: any;
|
|
363
|
-
szId: any;
|
|
364
|
-
szAlignment: any;
|
|
365
|
-
szGridMap?: undefined;
|
|
366
|
-
iGridColNum?: undefined;
|
|
367
|
-
iGridRowNum?: undefined;
|
|
368
|
-
aPoint?: undefined;
|
|
369
|
-
bChoosed?: undefined;
|
|
370
|
-
}
|
|
371
|
-
| {
|
|
372
|
-
szType: any;
|
|
373
|
-
aPoint: any;
|
|
374
|
-
szId: any;
|
|
375
|
-
bChoosed: any;
|
|
376
|
-
szGridMap?: undefined;
|
|
377
|
-
iGridColNum?: undefined;
|
|
378
|
-
iGridRowNum?: undefined;
|
|
379
|
-
szText?: undefined;
|
|
380
|
-
szEnabled?: undefined;
|
|
381
|
-
szOSDType?: undefined;
|
|
382
|
-
iPositionX?: undefined;
|
|
383
|
-
iPositionY?: undefined;
|
|
384
|
-
szDateStyle?: undefined;
|
|
385
|
-
szClockType?: undefined;
|
|
386
|
-
szDisplayWeek?: undefined;
|
|
387
|
-
szAlignment?: undefined;
|
|
388
|
-
}
|
|
389
|
-
)[];
|
|
390
|
-
deleteRepeatPolyonById(id: any): void;
|
|
391
|
-
getShapesInfoByType(szType: any): (
|
|
392
|
-
| {
|
|
393
|
-
szType: any;
|
|
394
|
-
szGridMap: any;
|
|
395
|
-
iGridColNum: any;
|
|
396
|
-
iGridRowNum: any;
|
|
397
|
-
szText?: undefined;
|
|
398
|
-
szEnabled?: undefined;
|
|
399
|
-
szOSDType?: undefined;
|
|
400
|
-
iPositionX?: undefined;
|
|
401
|
-
iPositionY?: undefined;
|
|
402
|
-
szDateStyle?: undefined;
|
|
403
|
-
szClockType?: undefined;
|
|
404
|
-
szDisplayWeek?: undefined;
|
|
405
|
-
szId?: undefined;
|
|
406
|
-
szAlignment?: undefined;
|
|
407
|
-
iPolygonType?: undefined;
|
|
408
|
-
iMinClosed?: undefined;
|
|
409
|
-
iMaxPointNum?: undefined;
|
|
410
|
-
iEditType?: undefined;
|
|
411
|
-
aPoint?: undefined;
|
|
412
|
-
bClosed?: undefined;
|
|
413
|
-
szTips?: undefined;
|
|
414
|
-
szDrawColor?: undefined;
|
|
415
|
-
szFillColor?: undefined;
|
|
416
|
-
iTranslucent?: undefined;
|
|
417
|
-
iLineType?: undefined;
|
|
418
|
-
iDirection?: undefined;
|
|
419
|
-
iArrowType?: undefined;
|
|
420
|
-
aCrossArrowPoint?: undefined;
|
|
421
|
-
}
|
|
422
|
-
| {
|
|
423
|
-
szType: any;
|
|
424
|
-
szText: any;
|
|
425
|
-
szEnabled: any;
|
|
426
|
-
szOSDType: any;
|
|
427
|
-
iPositionX: any;
|
|
428
|
-
iPositionY: any;
|
|
429
|
-
szDateStyle: any;
|
|
430
|
-
szClockType: any;
|
|
431
|
-
szDisplayWeek: any;
|
|
432
|
-
szId: any;
|
|
433
|
-
szAlignment: any;
|
|
434
|
-
szGridMap?: undefined;
|
|
435
|
-
iGridColNum?: undefined;
|
|
436
|
-
iGridRowNum?: undefined;
|
|
437
|
-
iPolygonType?: undefined;
|
|
438
|
-
iMinClosed?: undefined;
|
|
439
|
-
iMaxPointNum?: undefined;
|
|
440
|
-
iEditType?: undefined;
|
|
441
|
-
aPoint?: undefined;
|
|
442
|
-
bClosed?: undefined;
|
|
443
|
-
szTips?: undefined;
|
|
444
|
-
szDrawColor?: undefined;
|
|
445
|
-
szFillColor?: undefined;
|
|
446
|
-
iTranslucent?: undefined;
|
|
447
|
-
iLineType?: undefined;
|
|
448
|
-
iDirection?: undefined;
|
|
449
|
-
iArrowType?: undefined;
|
|
450
|
-
aCrossArrowPoint?: undefined;
|
|
451
|
-
}
|
|
452
|
-
| {
|
|
453
|
-
szType: any;
|
|
454
|
-
szId: any;
|
|
455
|
-
iPolygonType: any;
|
|
456
|
-
iMinClosed: any;
|
|
457
|
-
iMaxPointNum: any;
|
|
458
|
-
iEditType: any;
|
|
459
|
-
aPoint: any;
|
|
460
|
-
bClosed: any;
|
|
461
|
-
szTips: any;
|
|
462
|
-
szDrawColor: any;
|
|
463
|
-
szFillColor: any;
|
|
464
|
-
iTranslucent: any;
|
|
465
|
-
szGridMap?: undefined;
|
|
466
|
-
iGridColNum?: undefined;
|
|
467
|
-
iGridRowNum?: undefined;
|
|
468
|
-
szText?: undefined;
|
|
469
|
-
szEnabled?: undefined;
|
|
470
|
-
szOSDType?: undefined;
|
|
471
|
-
iPositionX?: undefined;
|
|
472
|
-
iPositionY?: undefined;
|
|
473
|
-
szDateStyle?: undefined;
|
|
474
|
-
szClockType?: undefined;
|
|
475
|
-
szDisplayWeek?: undefined;
|
|
476
|
-
szAlignment?: undefined;
|
|
477
|
-
iLineType?: undefined;
|
|
478
|
-
iDirection?: undefined;
|
|
479
|
-
iArrowType?: undefined;
|
|
480
|
-
aCrossArrowPoint?: undefined;
|
|
481
|
-
}
|
|
482
|
-
| {
|
|
483
|
-
szType: any;
|
|
484
|
-
szId: any;
|
|
485
|
-
aPoint: any;
|
|
486
|
-
szTips: any;
|
|
487
|
-
iLineType: any;
|
|
488
|
-
iDirection: any;
|
|
489
|
-
iArrowType: any;
|
|
490
|
-
szDrawColor: any;
|
|
491
|
-
aCrossArrowPoint: any;
|
|
492
|
-
szGridMap?: undefined;
|
|
493
|
-
iGridColNum?: undefined;
|
|
494
|
-
iGridRowNum?: undefined;
|
|
495
|
-
szText?: undefined;
|
|
496
|
-
szEnabled?: undefined;
|
|
497
|
-
szOSDType?: undefined;
|
|
498
|
-
iPositionX?: undefined;
|
|
499
|
-
iPositionY?: undefined;
|
|
500
|
-
szDateStyle?: undefined;
|
|
501
|
-
szClockType?: undefined;
|
|
502
|
-
szDisplayWeek?: undefined;
|
|
503
|
-
szAlignment?: undefined;
|
|
504
|
-
iPolygonType?: undefined;
|
|
505
|
-
iMinClosed?: undefined;
|
|
506
|
-
iMaxPointNum?: undefined;
|
|
507
|
-
iEditType?: undefined;
|
|
508
|
-
bClosed?: undefined;
|
|
509
|
-
szFillColor?: undefined;
|
|
510
|
-
iTranslucent?: undefined;
|
|
511
|
-
}
|
|
512
|
-
| {
|
|
513
|
-
szType: any;
|
|
514
|
-
iEditType: any;
|
|
515
|
-
aPoint: any;
|
|
516
|
-
szTips: any;
|
|
517
|
-
szDrawColor: any;
|
|
518
|
-
szFillColor: any;
|
|
519
|
-
iTranslucent: any;
|
|
520
|
-
szGridMap?: undefined;
|
|
521
|
-
iGridColNum?: undefined;
|
|
522
|
-
iGridRowNum?: undefined;
|
|
523
|
-
szText?: undefined;
|
|
524
|
-
szEnabled?: undefined;
|
|
525
|
-
szOSDType?: undefined;
|
|
526
|
-
iPositionX?: undefined;
|
|
527
|
-
iPositionY?: undefined;
|
|
528
|
-
szDateStyle?: undefined;
|
|
529
|
-
szClockType?: undefined;
|
|
530
|
-
szDisplayWeek?: undefined;
|
|
531
|
-
szId?: undefined;
|
|
532
|
-
szAlignment?: undefined;
|
|
533
|
-
iPolygonType?: undefined;
|
|
534
|
-
iMinClosed?: undefined;
|
|
535
|
-
iMaxPointNum?: undefined;
|
|
536
|
-
bClosed?: undefined;
|
|
537
|
-
iLineType?: undefined;
|
|
538
|
-
iDirection?: undefined;
|
|
539
|
-
iArrowType?: undefined;
|
|
540
|
-
aCrossArrowPoint?: undefined;
|
|
541
|
-
}
|
|
542
|
-
| {
|
|
543
|
-
szType: any;
|
|
544
|
-
aPoint: any;
|
|
545
|
-
szGridMap?: undefined;
|
|
546
|
-
iGridColNum?: undefined;
|
|
547
|
-
iGridRowNum?: undefined;
|
|
548
|
-
szText?: undefined;
|
|
549
|
-
szEnabled?: undefined;
|
|
550
|
-
szOSDType?: undefined;
|
|
551
|
-
iPositionX?: undefined;
|
|
552
|
-
iPositionY?: undefined;
|
|
553
|
-
szDateStyle?: undefined;
|
|
554
|
-
szClockType?: undefined;
|
|
555
|
-
szDisplayWeek?: undefined;
|
|
556
|
-
szId?: undefined;
|
|
557
|
-
szAlignment?: undefined;
|
|
558
|
-
iPolygonType?: undefined;
|
|
559
|
-
iMinClosed?: undefined;
|
|
560
|
-
iMaxPointNum?: undefined;
|
|
561
|
-
iEditType?: undefined;
|
|
562
|
-
bClosed?: undefined;
|
|
563
|
-
szTips?: undefined;
|
|
564
|
-
szDrawColor?: undefined;
|
|
565
|
-
szFillColor?: undefined;
|
|
566
|
-
iTranslucent?: undefined;
|
|
567
|
-
iLineType?: undefined;
|
|
568
|
-
iDirection?: undefined;
|
|
569
|
-
iArrowType?: undefined;
|
|
570
|
-
aCrossArrowPoint?: undefined;
|
|
571
|
-
}
|
|
572
|
-
)[];
|
|
573
|
-
setShapesInfoByType(szType: any, aShapesInfo: any): void;
|
|
574
|
-
addOSDShape(szText: any, szEnabled: any, iStartX: any, iStartY: any, oExtend: any): void;
|
|
575
|
-
selectShapeById(szShapeType: any, szId: any): void;
|
|
576
|
-
setCanvasSize(iWidth: any, iHeight: any): void;
|
|
577
|
-
setDrawStyle(szBorderColor: any, szFillColor: any, iTranslucent: any): void;
|
|
578
|
-
clearAllShape(): void;
|
|
579
|
-
clearShapeByType(szType: any): void;
|
|
580
|
-
deleteShape(iShapeIndex: any): void;
|
|
581
|
-
updateCanvas(szCanvasId: any): void;
|
|
582
|
-
resizeCanvas(): void;
|
|
583
|
-
resize(width: number, height: number): void;
|
|
584
|
-
canvasRedraw(): void;
|
|
585
|
-
destroy(): void;
|
|
586
|
-
[CANVAS]: any;
|
|
587
|
-
[CONTEXT]: any;
|
|
588
|
-
[SHAPES]: any[];
|
|
589
|
-
[DRAWSTATUS]: boolean;
|
|
590
|
-
[SHAPETYPE]: string;
|
|
591
|
-
[MAXSHAPENUMSUPPORT]: number;
|
|
592
|
-
[DRAWSHAPEMULTIONETIME]: boolean;
|
|
593
|
-
[CURRENTSHAPEINFO]: {};
|
|
594
|
-
[EVENTCALLBACK]: any;
|
|
595
|
-
[SHAPESTYLE]: {
|
|
596
|
-
szDrawColor: string;
|
|
597
|
-
szFillColor: string;
|
|
598
|
-
iTranslucent: number;
|
|
599
|
-
};
|
|
600
|
-
[POLYGONDRAWING]: boolean;
|
|
601
|
-
}
|
|
602
|
-
declare const CANVAS: unique symbol;
|
|
603
|
-
declare const CONTEXT: unique symbol;
|
|
604
|
-
declare const SHAPES: unique symbol;
|
|
605
|
-
declare const DRAWSTATUS: unique symbol;
|
|
606
|
-
declare const SHAPETYPE: unique symbol;
|
|
607
|
-
declare const MAXSHAPENUMSUPPORT: unique symbol;
|
|
608
|
-
declare const DRAWSHAPEMULTIONETIME: unique symbol;
|
|
609
|
-
declare const CURRENTSHAPEINFO: unique symbol;
|
|
610
|
-
declare const EVENTCALLBACK: unique symbol;
|
|
611
|
-
declare const SHAPESTYLE: unique symbol;
|
|
612
|
-
declare const POLYGONDRAWING: unique symbol;
|
|
613
|
-
|
|
614
|
-
declare const JSPlayCtrl: any;
|
|
615
|
-
|
|
616
|
-
interface IPlayerWindowOptions {
|
|
617
|
-
container: HTMLElement;
|
|
618
|
-
id: string;
|
|
619
|
-
onCurrentFullScreenChange?: (event: Event) => void;
|
|
620
|
-
dpr?: number;
|
|
621
|
-
player: EZopenPlayer;
|
|
622
|
-
}
|
|
623
|
-
/**
|
|
624
|
-
* @description 播放器窗口
|
|
625
|
-
* @warn 后续会弱化 id
|
|
626
|
-
*/
|
|
627
|
-
declare class PlayerWindow {
|
|
628
|
-
id: string;
|
|
629
|
-
width: number;
|
|
630
|
-
height: number;
|
|
631
|
-
private _canvasWidth;
|
|
632
|
-
private _canvasHeight;
|
|
633
|
-
dpr: number;
|
|
634
|
-
canvasId: string;
|
|
635
|
-
$canvas: HTMLCanvasElement;
|
|
636
|
-
_options: IPlayerWindowOptions;
|
|
637
|
-
private readonly _$container;
|
|
638
|
-
private readonly _player;
|
|
639
|
-
constructor(options: IPlayerWindowOptions);
|
|
640
|
-
/**
|
|
641
|
-
* @description 渲染播放器窗口
|
|
642
|
-
* @returns
|
|
643
|
-
*/
|
|
644
|
-
private _render;
|
|
645
|
-
/**
|
|
646
|
-
* @description canvas 隐藏 (由于 v3 切换播放地址时 上个canvas 还在 页面resize canvas 会崩溃 变成白色, 使用改方法配合 reRenderCanvas)
|
|
647
|
-
*/
|
|
648
|
-
hide(): void;
|
|
649
|
-
/**
|
|
650
|
-
* @description 销毁播放器窗口
|
|
651
|
-
*/
|
|
652
|
-
destroy(): void;
|
|
653
|
-
private _removeCanvas;
|
|
654
|
-
/**
|
|
655
|
-
* 重置视频的分辨率
|
|
656
|
-
* @param {number} width 宽度
|
|
657
|
-
* @param {number} height 高度
|
|
658
|
-
*/
|
|
659
|
-
resize(width: number, height: number): void;
|
|
660
|
-
/**
|
|
661
|
-
*
|
|
662
|
-
* @param {boolean} remove 是否移除
|
|
663
|
-
* @returns
|
|
664
|
-
*/
|
|
665
|
-
reRenderCanvas(remove?: boolean): void;
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
interface WasmDecoderStatue {
|
|
669
|
-
bSupHardOrSoft: boolean;
|
|
670
|
-
bSupHardDecAVC: boolean;
|
|
671
|
-
bSupHardDecHEVC: boolean;
|
|
672
|
-
cmd: 'loaded' | 'onebyone';
|
|
673
|
-
errorCode: number;
|
|
674
|
-
status: any;
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
type Zoom3DCallback = (oRECT?: any) => void;
|
|
678
|
-
|
|
679
|
-
type SnapshotFmt = 'jpeg';
|
|
680
|
-
|
|
681
|
-
/**
|
|
682
|
-
* @description 插件管理系统
|
|
683
|
-
*/
|
|
684
|
-
declare class PluginManager {
|
|
685
|
-
context: EZopenPlayer;
|
|
686
|
-
plugins: Map<string, PlayerPlugin>;
|
|
687
|
-
constructor(player: EZopenPlayer);
|
|
688
|
-
/**
|
|
689
|
-
* @description 注册插件做个插件
|
|
690
|
-
* @param plugins
|
|
691
|
-
*/
|
|
692
|
-
usePlugins(plugins: PlayerPlugin[]): Promise<void>;
|
|
693
|
-
/**
|
|
694
|
-
* @description 注册插件
|
|
695
|
-
* @param plugins
|
|
696
|
-
*/
|
|
697
|
-
use(plugin: PlayerPlugin): Promise<void>;
|
|
698
|
-
/**
|
|
699
|
-
* @description 通过name销毁指定插件
|
|
700
|
-
* @param {string} name 插件名
|
|
701
|
-
*/
|
|
702
|
-
destroyByName(name: string): void;
|
|
703
|
-
/**
|
|
704
|
-
* @description 销毁插件
|
|
705
|
-
*/
|
|
706
|
-
destroy(): void;
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
/***
|
|
710
|
-
* 鱼眼矫正
|
|
711
|
-
*
|
|
712
|
-
*/
|
|
713
|
-
declare class FECCorrect {
|
|
714
|
-
_FECSplitIds: string | undefined;
|
|
715
|
-
_canvasFECSubPort: Map<any, any>;
|
|
716
|
-
_correctType: any;
|
|
717
|
-
private readonly _player;
|
|
718
|
-
constructor(player: EZopenPlayer);
|
|
719
|
-
_supportFEC(): boolean | undefined;
|
|
720
|
-
init(): void;
|
|
721
|
-
/**
|
|
722
|
-
* @description 设置矫正类型
|
|
723
|
-
* @param type
|
|
724
|
-
* @param ids
|
|
725
|
-
* @returns
|
|
726
|
-
*/
|
|
727
|
-
setFECCorrectType(type: any, ids?: string): Promise<unknown>;
|
|
728
|
-
/**
|
|
729
|
-
* @description 设置 2D 鱼眼矫正旋转参数
|
|
730
|
-
* @param {number} port 鱼眼端口 主屏默认为 0
|
|
731
|
-
* @param {Object} param2d
|
|
732
|
-
*/
|
|
733
|
-
setFEC2DParam(port: number, param2d: any): any;
|
|
734
|
-
/**
|
|
735
|
-
* @description 设置 3D 矫正视角参数
|
|
736
|
-
* @param {FECViewParam} param
|
|
737
|
-
* @returns {Promise<boolean>} true: 成功 false: 失败 undefined: 不支持
|
|
738
|
-
*/
|
|
739
|
-
setFEC3DViewParam(param: any): Promise<boolean>;
|
|
740
|
-
/**
|
|
741
|
-
* @description 获取 3D 矫正视角参数
|
|
742
|
-
* @param {FECGetViewParam} param
|
|
743
|
-
* @returns {Promise<object>}
|
|
744
|
-
*/
|
|
745
|
-
get3DViewParam(param: any): Promise<unknown>;
|
|
746
|
-
getFECSubPortMap(): Map<any, any>;
|
|
747
|
-
/**
|
|
748
|
-
* @description 创建分屏画面
|
|
749
|
-
* @returns
|
|
750
|
-
*/
|
|
751
|
-
private _createSplitCanvas;
|
|
752
|
-
private _matchUpDateType;
|
|
753
|
-
/**
|
|
754
|
-
* @description 给分屏添加mouse事件
|
|
755
|
-
* @param {string} canvasId
|
|
756
|
-
* @param {{correctType: string}} type
|
|
757
|
-
* @returns
|
|
758
|
-
*/
|
|
759
|
-
private _spliceCanvasMouseEvents;
|
|
760
|
-
/**
|
|
761
|
-
* @description 清空所有鱼眼子端口 不包括主窗口
|
|
762
|
-
*/
|
|
763
|
-
private _closeFECAllSubWnd;
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
/**
|
|
767
|
-
* 设置水印参数
|
|
768
|
-
*/
|
|
769
|
-
interface WaterMarkParams {
|
|
770
|
-
/** 文本信息(必填) */
|
|
771
|
-
fontString: string[];
|
|
772
|
-
/** 文本位置 字体的位置,fX 表示横坐标,fY 表示纵坐标,取值范围为[0,1],左上角是原点。 */
|
|
773
|
-
startPos?: {
|
|
774
|
-
fX: number;
|
|
775
|
-
fY: number;
|
|
776
|
-
};
|
|
777
|
-
/** 字体颜色信息,取值范围 [0,1] (number/255)。其中 fA 表示透明度,0 时完全透明不显示。 */
|
|
778
|
-
fontColor?: {
|
|
779
|
-
fR: number;
|
|
780
|
-
fG: number;
|
|
781
|
-
fB: number;
|
|
782
|
-
fA: number;
|
|
783
|
-
};
|
|
784
|
-
/** 字体大小,字体宽高设置不一样时,显示出来字体大小为宽高中较小值。建议取值 [0~canvasWidth */
|
|
785
|
-
fontSize?: {
|
|
786
|
-
nFontWidth: number;
|
|
787
|
-
nFontHeight: number;
|
|
788
|
-
};
|
|
789
|
-
/** 字体旋转角度 字体旋 转参数,①fRotateAngle 为旋转角度,单位度(0~360 度)。②fFillFullScreen 为 true 表示铺满全屏,会在 canvas 中斜体显示 n 个,false 表示只显示一行。 */
|
|
790
|
-
fontRotate?: {
|
|
791
|
-
fRotateAngle: number;
|
|
792
|
-
fFillFullScreen: boolean;
|
|
793
|
-
};
|
|
794
|
-
/** 字体 */
|
|
795
|
-
fontFamily?: string;
|
|
796
|
-
/** 当平铺斜体水印时,即 FontRotate. fFillFullScreen 为 true 时,需要用到此参数。nRowNumber 表示行数,nColNumber 列数。会显示 4 行 5 列的斜体水印。取值范围[3,13]。 */
|
|
797
|
-
fontNumber?: {
|
|
798
|
-
nRowNumber: number;
|
|
799
|
-
nColNumber: number;
|
|
800
|
-
};
|
|
801
|
-
/** 多行字间距:建议取值范围>1。 */
|
|
802
|
-
space?: number;
|
|
803
|
-
/** 多行字的对齐方式:0 表示居中对齐,1 表示左对齐 @since 8.2.2 */
|
|
804
|
-
fontAlign?: 0 | 1;
|
|
805
|
-
/** @since 8.0.8 8.2.2 开始不支持外部设置 */
|
|
806
|
-
pstCanvasAdapt: {
|
|
807
|
-
/**
|
|
808
|
-
* 自适应模式
|
|
809
|
-
* 0 表示水印行列数/水印大小均不需要随着窗口大小变化而变化。
|
|
810
|
-
* 1 表示字体行列数自适应。即窗口变大,水印字体大小不变,水印行列数变多。
|
|
811
|
-
* 2 表示字体大小自适应。即窗口变大,水印行列数不变,字体变大。
|
|
812
|
-
*/
|
|
813
|
-
nCanvasAdaptMode: 0 | 1 | 2;
|
|
814
|
-
/** 行间隔,nCanvasAdaptMode=1 时需要用到。 */
|
|
815
|
-
nRowSpace: number;
|
|
816
|
-
/** 列间隔,nCanvasAdaptMode=1 时需要用到。使用方法规则和 nRowSpace 行间隔一致。 */
|
|
817
|
-
nColSpace: number;
|
|
818
|
-
/** 基准窗口宽,nCanvasAdaptMode=2 时需要用到。
|
|
819
|
-
例: nBaseCanvasWidth=900, pFontParam.pstFontSize.nFontWidth=20
|
|
820
|
-
则字体宽为窗口宽的 20/900。当窗口宽变为 1200 时,字体的宽变
|
|
821
|
-
为 20/900*1200=26。
|
|
822
|
-
*/
|
|
823
|
-
nBaseCanvasWidth: number;
|
|
824
|
-
/** 基准窗口高,nCanvasAdaptMode=2 时需要用到。 使用方法和 nBaseCanvasWidth 基准窗口高一致。 */
|
|
825
|
-
nBaseCanvasHeight: number;
|
|
826
|
-
};
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
type MirrorFlipCommand = 0 | 1 | 2;
|
|
830
|
-
|
|
831
|
-
type StreamInfoCallBackFn = (info: any) => void;
|
|
832
|
-
|
|
833
|
-
interface EZopenPlayerOptions extends PlayerOptions {
|
|
834
|
-
logger?: LoggerOptions;
|
|
835
|
-
i18n?: any;
|
|
836
|
-
staticPath?: string;
|
|
837
|
-
width?: number;
|
|
838
|
-
height?: number;
|
|
839
|
-
dpr?: number;
|
|
840
|
-
container?: HTMLElement;
|
|
841
|
-
/** 全屏节点 */
|
|
842
|
-
fullScreenEle?: HTMLElement;
|
|
843
|
-
/** 指定解码类型, v1 软解 v3 包括硬解和多线程 */
|
|
844
|
-
decoderType?: 'auto' | 'v1' | 'v3';
|
|
845
|
-
/** 下载当前原始视频流,用于调试,不能动态设置,结束或销毁播放时自动保存成文件并下载 */
|
|
846
|
-
debugDownloadData?: boolean;
|
|
847
|
-
extraParams?: {
|
|
848
|
-
ezopenParams?: Record<string, any>;
|
|
849
|
-
wsParams?: string | Record<string, any>;
|
|
850
|
-
};
|
|
851
|
-
disableRenderPrivateData?: boolean | true;
|
|
852
|
-
decodeEngine?: number | 1;
|
|
853
|
-
}
|
|
854
|
-
declare class EZopenPlayer extends EventEmitter {
|
|
855
|
-
_options: EZopenPlayerOptions;
|
|
856
|
-
static EVENT_TYPE: {
|
|
857
|
-
initializing: string;
|
|
858
|
-
loadstart: string;
|
|
859
|
-
abort: string;
|
|
860
|
-
waiting: string;
|
|
861
|
-
canplay: string;
|
|
862
|
-
rateChange: string;
|
|
863
|
-
volumeChange: string;
|
|
864
|
-
debug: string;
|
|
865
|
-
error: string;
|
|
866
|
-
videoInfo: string;
|
|
867
|
-
audioInfo: string;
|
|
868
|
-
decoder: string;
|
|
869
|
-
urlChange: string;
|
|
870
|
-
API: {
|
|
871
|
-
play: string;
|
|
872
|
-
pause: string;
|
|
873
|
-
rateChange: string;
|
|
874
|
-
volumeChange: string;
|
|
875
|
-
destroy: string;
|
|
876
|
-
snapshot: string;
|
|
877
|
-
fullscreen: string;
|
|
878
|
-
exitFullscreen: string;
|
|
879
|
-
resize: string;
|
|
880
|
-
seek: string;
|
|
881
|
-
resume: string;
|
|
882
|
-
};
|
|
883
|
-
NETWORK: {
|
|
884
|
-
deviceCapacity: string;
|
|
885
|
-
deviceInfo: string;
|
|
886
|
-
videoFragmentFiles: string;
|
|
887
|
-
error: {
|
|
888
|
-
error: string;
|
|
889
|
-
deviceCapacity: string;
|
|
890
|
-
deviceInfo: string;
|
|
891
|
-
realPlayUrl: string;
|
|
892
|
-
videoFragmentFiles: string;
|
|
893
|
-
};
|
|
894
|
-
};
|
|
895
|
-
SOCKET: {
|
|
896
|
-
autoClose: string;
|
|
897
|
-
openStream: string;
|
|
898
|
-
startPlay: string;
|
|
899
|
-
stopAll: string;
|
|
900
|
-
setPlayRate: string;
|
|
901
|
-
seek: string;
|
|
902
|
-
close: string;
|
|
903
|
-
error: string;
|
|
904
|
-
};
|
|
905
|
-
CALLBACK: {
|
|
906
|
-
pluginErrorHandler: string;
|
|
907
|
-
getStreamHeaderCallback: string;
|
|
908
|
-
getVideoStreamCallback: string;
|
|
909
|
-
appearFirstFrameCallback: string;
|
|
910
|
-
firstFrameCallback: string;
|
|
911
|
-
averageStreamSuccessCallback: string;
|
|
912
|
-
setRunTimeInfoCallBack: string;
|
|
913
|
-
setAdditionDataCallBack: string;
|
|
914
|
-
openStreamCallback: string;
|
|
915
|
-
stutterDetectedCallback: string;
|
|
916
|
-
};
|
|
917
|
-
FECCorrect: {
|
|
918
|
-
setFEC2DParam: string;
|
|
919
|
-
};
|
|
920
|
-
streamInfoCB: string;
|
|
921
|
-
};
|
|
922
|
-
logger: LoggerCls;
|
|
923
|
-
i18n: I18n;
|
|
924
|
-
wasmplayer: typeof JSPlayCtrl;
|
|
925
|
-
/**
|
|
926
|
-
* @deprecated
|
|
927
|
-
* v9.x 中会移除, 请使用 player.on, emit.emit, player.off, player.once, player.removeAllListeners
|
|
928
|
-
*/
|
|
929
|
-
event: any;
|
|
930
|
-
initializing: boolean;
|
|
931
|
-
loading: boolean;
|
|
932
|
-
/** 播放速度 */
|
|
933
|
-
playbackRate: number;
|
|
934
|
-
/** 是否在播放中 */
|
|
935
|
-
playing: boolean;
|
|
936
|
-
/** 音量 [0-1] */
|
|
937
|
-
volume: number;
|
|
938
|
-
/** 已经销毁 */
|
|
939
|
-
destroyed: boolean;
|
|
940
|
-
/** 播放地址 query */
|
|
941
|
-
urlInfo: Partial<EzopenURL>;
|
|
942
|
-
/** 设备能力集 */
|
|
943
|
-
deviceCapacity: Partial<DeviceCapacityRes>;
|
|
944
|
-
deviceInfo: Partial<DeviceInfoRes>;
|
|
945
|
-
/** 当前播放出现的错误 */
|
|
946
|
-
error: object | null;
|
|
947
|
-
/** 服务端接口 */
|
|
948
|
-
service: Service;
|
|
949
|
-
$container: HTMLElement;
|
|
950
|
-
esCanvas: ESCanvas;
|
|
951
|
-
fECCorrect: FECCorrect;
|
|
952
|
-
_oStreamClient: StreamClient;
|
|
953
|
-
_aHead: Uint8Array;
|
|
954
|
-
/** @private */
|
|
955
|
-
_detectTimer: any;
|
|
956
|
-
private _wasmDecoderInfo;
|
|
957
|
-
_width: number;
|
|
958
|
-
_height: number;
|
|
959
|
-
_g_port: number | null;
|
|
960
|
-
_secretKey: string;
|
|
961
|
-
_tempPauseDate: number | null;
|
|
962
|
-
_tempPauseTime: string;
|
|
963
|
-
_validateCode: string;
|
|
964
|
-
_playbackRate: number;
|
|
965
|
-
/** 视频信息 */
|
|
966
|
-
__videoInfo: any;
|
|
967
|
-
/** 音频信息 */
|
|
968
|
-
__audioInfo: any;
|
|
969
|
-
_waterMarkParams: any;
|
|
970
|
-
_decoderStatus: Partial<WasmDecoderStatue>;
|
|
971
|
-
_wss_info: {
|
|
972
|
-
wssUrl: string;
|
|
973
|
-
oParams: {
|
|
974
|
-
playURL: string;
|
|
975
|
-
};
|
|
976
|
-
};
|
|
977
|
-
__fCallback: Zoom3DCallback;
|
|
978
|
-
__b3DZoom: boolean;
|
|
979
|
-
pluginManager: PluginManager;
|
|
980
|
-
_playerWindow: PlayerWindow;
|
|
981
|
-
constructor(options: EZopenPlayerOptions);
|
|
982
|
-
get width(): number;
|
|
983
|
-
get height(): number;
|
|
984
|
-
private _playerInit;
|
|
985
|
-
/**
|
|
986
|
-
* @description 播放
|
|
987
|
-
* @param options
|
|
988
|
-
* @returns
|
|
989
|
-
*/
|
|
990
|
-
play(options?: Partial<Pick<EZopenPlayerOptions, 'url' | 'accessToken'>>): Promise<unknown>;
|
|
991
|
-
_wss_play(szUrl: string, oParams?: {
|
|
992
|
-
playURL: string;
|
|
993
|
-
}, iWndNum?: number): Promise<unknown>;
|
|
994
|
-
/**
|
|
995
|
-
* 暂停播放 并断流???
|
|
996
|
-
* @param {boolean} bool 是否断流
|
|
997
|
-
* @returns
|
|
998
|
-
*/
|
|
999
|
-
pause(bool?: boolean): Promise<unknown>;
|
|
1000
|
-
/**
|
|
1001
|
-
* 恢复
|
|
1002
|
-
* @param time
|
|
1003
|
-
* @returns
|
|
1004
|
-
*/
|
|
1005
|
-
resume(time: string): Promise<unknown>;
|
|
1006
|
-
/**
|
|
1007
|
-
* @description 销毁并断流
|
|
1008
|
-
* @returns
|
|
1009
|
-
*/
|
|
1010
|
-
destroy(): Promise<void>;
|
|
1011
|
-
/**
|
|
1012
|
-
* @private
|
|
1013
|
-
*/
|
|
1014
|
-
_destroyed(): void;
|
|
1015
|
-
stop(flag?: boolean | number): Promise<unknown>;
|
|
1016
|
-
/**
|
|
1017
|
-
* @description 截图
|
|
1018
|
-
* @param {string} name 文件名 默认时间戳(new Date().getTime())
|
|
1019
|
-
* @param {"jpeg"} fmt 图片格式 只支持 jpeg
|
|
1020
|
-
* @param {"base64"} type 文件格式 默认base64
|
|
1021
|
-
* @param {boolean} download 是否直接下载 默认不直接下载
|
|
1022
|
-
* @returns 返回base64字符
|
|
1023
|
-
*/
|
|
1024
|
-
snapshot(name?: string, fmt?: SnapshotFmt, type?: 'base64', download?: boolean): Promise<IResult<{
|
|
1025
|
-
fileName?: string | undefined;
|
|
1026
|
-
base64?: string | undefined;
|
|
1027
|
-
} | null>>;
|
|
1028
|
-
/**
|
|
1029
|
-
* @description 通过canvas截图
|
|
1030
|
-
* @param {string} name 文件名 默认时间戳(new Date().getTime())
|
|
1031
|
-
* @param {"jpeg"} fmt 图片格式 只支持 jpeg
|
|
1032
|
-
* @param {boolean} download 是否直接下载 默认不直接下载 false
|
|
1033
|
-
* @returns 返回base64字符
|
|
1034
|
-
*/
|
|
1035
|
-
snapshotByCanvas(name?: string, fmt?: SnapshotFmt, download?: boolean): Promise<IResult<{
|
|
1036
|
-
fileName?: string | undefined;
|
|
1037
|
-
base64?: string | undefined;
|
|
1038
|
-
} | null>>;
|
|
1039
|
-
/**
|
|
1040
|
-
* 重新调整播放器窗口大小
|
|
1041
|
-
*
|
|
1042
|
-
* Adjust the player window size
|
|
1043
|
-
* @param {number | string} width 宽度(number 类型默认px, 支持字符串大小 "100%" | "50vw")
|
|
1044
|
-
* @param {number | string} height 高度(number 类型默认px, 支持字符串大小 "100%" | "50vh")
|
|
1045
|
-
* @since 0.0.1
|
|
1046
|
-
* @example
|
|
1047
|
-
* ```ts
|
|
1048
|
-
* player.resize(600, 400) // 600px * 400px
|
|
1049
|
-
* theme.resize("600px", "400px") // 600px * 400px
|
|
1050
|
-
* theme.resize("50%", "1vh")
|
|
1051
|
-
* theme.resize("2em", "2rem")
|
|
1052
|
-
* // 事件监听 event, 这里是具体的宽高(单位px)
|
|
1053
|
-
* theme.on(Theme.EVENTS.resize, (width: number, height: number) => {})
|
|
1054
|
-
* ```
|
|
1055
|
-
* @returns {void}
|
|
1056
|
-
*/
|
|
1057
|
-
resize(width?: number | string, height?: number | string): Promise<{
|
|
1058
|
-
width: string | number | undefined;
|
|
1059
|
-
height: string | number | undefined;
|
|
1060
|
-
}>;
|
|
1061
|
-
/**
|
|
1062
|
-
* 设置音量
|
|
1063
|
-
* @param {number} volume 音量[0-1], 0:表示静音
|
|
1064
|
-
* @returns {0 | 1} 1 成功 0 失败
|
|
1065
|
-
*/
|
|
1066
|
-
setVolume(volume: number): number;
|
|
1067
|
-
/**
|
|
1068
|
-
* @description 插件管理
|
|
1069
|
-
* @param plugin 插件
|
|
1070
|
-
*/
|
|
1071
|
-
use(plugin: PlayerPlugin): void;
|
|
1072
|
-
/**
|
|
1073
|
-
*
|
|
1074
|
-
* @param {Object} type 矫正类型 参考 src/ezopen/constants.js
|
|
1075
|
-
* @param {string=} ids 如果分屏矫正,需要传入分屏canvas的id字符串列表 如 canvas1,canvas2,canvas3
|
|
1076
|
-
* @returns {Array<{code: number, msg: string, port: number, id: string}>} // code= 0 成功, -1 失败
|
|
1077
|
-
* @returns
|
|
1078
|
-
*/
|
|
1079
|
-
setFECCorrectType(type: any, ids?: string): Promise<unknown>;
|
|
1080
|
-
/**
|
|
1081
|
-
* @description 设置 2D 鱼眼矫正旋转参数
|
|
1082
|
-
* @param {number} fishSubPort 鱼眼端口 主屏默认为 0
|
|
1083
|
-
* @param {Object} param2d
|
|
1084
|
-
*/
|
|
1085
|
-
setFEC2DParam(fishSubPort: number, param2d: object): any;
|
|
1086
|
-
/**
|
|
1087
|
-
* @description 设置 3D 矫正视角参数
|
|
1088
|
-
* @param {object} param
|
|
1089
|
-
* @returns {Promise<boolean>} true: 成功 false: 失败 undefined: 不支持
|
|
1090
|
-
*/
|
|
1091
|
-
setFEC3DViewParam(param: object): Promise<boolean>;
|
|
1092
|
-
/**
|
|
1093
|
-
* @description 获取 3D 矫正视角参数
|
|
1094
|
-
* @param {object} param
|
|
1095
|
-
* @returns {Promise<object>}
|
|
1096
|
-
*/
|
|
1097
|
-
get3DViewParam(param: object): Promise<unknown>;
|
|
1098
|
-
/**
|
|
1099
|
-
* 设置封面
|
|
1100
|
-
* @param {string} poster 封面封面地址
|
|
1101
|
-
* @returns {void}
|
|
1102
|
-
*/
|
|
1103
|
-
setPoster(poster: string): void;
|
|
1104
|
-
/**
|
|
1105
|
-
* 设置播放速度 (动态设置倍速画面效果有延时)
|
|
1106
|
-
* @param {0.5 | 1 | 2 | 4} rate 2的倍数
|
|
1107
|
-
* @returns
|
|
1108
|
-
*/
|
|
1109
|
-
setPlaybackRate(rate: number): void;
|
|
1110
|
-
/**
|
|
1111
|
-
* @description seek 新的位置 需要设备支持
|
|
1112
|
-
* @param {string} startTime 开始时间 YYYYMMDDThhmmssZ
|
|
1113
|
-
* @param {string} stopTime 结束时间 YYYYMMDDThhmmssZ
|
|
1114
|
-
* @returns {Promise<void>}
|
|
1115
|
-
*/
|
|
1116
|
-
seek(startTime: string, stopTime: string): Promise<void>;
|
|
1117
|
-
private _setOptions;
|
|
1118
|
-
/**
|
|
1119
|
-
* @description 开启3D定位 依赖能力集[ort_zoomOut_maxTime]
|
|
1120
|
-
* @param cb
|
|
1121
|
-
* @returns
|
|
1122
|
-
*/
|
|
1123
|
-
enable3DZoom(cb: Zoom3DCallback): -1 | 0;
|
|
1124
|
-
/**
|
|
1125
|
-
* @description 关闭3D定位 依赖能力集[ort_zoomOut_maxTime]
|
|
1126
|
-
* @returns
|
|
1127
|
-
*/
|
|
1128
|
-
disable3DZoom(): number;
|
|
1129
|
-
/**
|
|
1130
|
-
* @description 获取当前osd, 当获取失败返回 0
|
|
1131
|
-
* @returns {number}
|
|
1132
|
-
*/
|
|
1133
|
-
getOSDTime(): number;
|
|
1134
|
-
/**
|
|
1135
|
-
* @description 获取帧信息,当获帧接口失败,返回空对象, 软解部分信息没有
|
|
1136
|
-
* @returns {IFrameInfo}
|
|
1137
|
-
*/
|
|
1138
|
-
getFrameInfo(): IFrameInfo;
|
|
1139
|
-
/**
|
|
1140
|
-
* @description 设置播放视频区域 (仅视频不是画布)
|
|
1141
|
-
* @param {number} left 视频展示区域 x轴开始位置
|
|
1142
|
-
* @param {number} right 视频展示区域 x轴结束位置
|
|
1143
|
-
* @param {number} top 视频展示区域 y轴开始位置
|
|
1144
|
-
* @param {number} bottom 视频展示区域 y轴结束位置
|
|
1145
|
-
* @param {boolean} flag
|
|
1146
|
-
* @param {boolean} isFullscreen 当页面旋转 90° 时 需要宽高互换 需要 设置为true
|
|
1147
|
-
* @returns {boolean}
|
|
1148
|
-
*/
|
|
1149
|
-
setDisplayRegion(left: number, right: number, top: number, bottom: number, flag?: boolean, isFullscreen?: boolean): boolean;
|
|
1150
|
-
/**
|
|
1151
|
-
* @description 设置解密密钥 (如果在封装时设置了密钥,那么在播放之前需要调用该接口设置密钥才能正常解码。)
|
|
1152
|
-
* @param secretKey 密钥
|
|
1153
|
-
* @returns {number} 1 成功 0 失败
|
|
1154
|
-
*/
|
|
1155
|
-
setSecretKey(secretKey: string): void;
|
|
1156
|
-
/**
|
|
1157
|
-
*
|
|
1158
|
-
* @returns
|
|
1159
|
-
*/
|
|
1160
|
-
getOptions(): EZopenPlayerOptions;
|
|
1161
|
-
/**
|
|
1162
|
-
* @description 切换调试日志等级
|
|
1163
|
-
* @param {LoggerOptions} loggerOptions 日志等级
|
|
1164
|
-
* @returns {void}
|
|
1165
|
-
*/
|
|
1166
|
-
setLogger(options: LoggerOptions): void;
|
|
1167
|
-
/** @since 8.1.9 */
|
|
1168
|
-
static version: string;
|
|
1169
|
-
/**
|
|
1170
|
-
* @description 获取版本号
|
|
1171
|
-
* @returns
|
|
1172
|
-
*/
|
|
1173
|
-
getVersion(): {
|
|
1174
|
-
version: string;
|
|
1175
|
-
decoder: string;
|
|
1176
|
-
decoderVersion: any;
|
|
1177
|
-
};
|
|
1178
|
-
/**
|
|
1179
|
-
* @description 设置水印
|
|
1180
|
-
* @param {WaterMarkParams} params
|
|
1181
|
-
* @returns {Promise<any>}
|
|
1182
|
-
*/
|
|
1183
|
-
setWaterMark(params: WaterMarkParams): Promise<unknown>;
|
|
1184
|
-
/**
|
|
1185
|
-
* @description 镜像翻转 (需要设备本身支持, 可以重能力集中获取)
|
|
1186
|
-
* @link https://open.ys7.com/help/59?h=%E9%95%9C%E5%83%8F%E7%BF%BB%E8%BD%AC#device_ptz-api3
|
|
1187
|
-
* @param {0 | 1 | 2} command 0-上下, 1-左右, 2-中心
|
|
1188
|
-
*
|
|
1189
|
-
* @returns {Promise}
|
|
1190
|
-
*/
|
|
1191
|
-
setMirrorFlip(command: MirrorFlipCommand): Promise<_ezuikit_utils_service_dist_types_fetch.Response<any, undefined>>;
|
|
1192
|
-
/**
|
|
1193
|
-
* @description 设置流信息回调类型
|
|
1194
|
-
* @param {0 | 1} type 回调类型 1 可能只会触发一两次(一般是两次), 0:才会每帧都触发, 从 0 切到 1 是 不会回调
|
|
1195
|
-
* @param { StreamInfoCallBackFn } cb 回调函数
|
|
1196
|
-
* @since 8.1.9
|
|
1197
|
-
* @returns {void}
|
|
1198
|
-
*/
|
|
1199
|
-
setStreamInfoCallBackType(type: 0 | 1, cb?: StreamInfoCallBackFn): void;
|
|
1200
|
-
_addEventListener(): void;
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
export { type EZopenPlayerOptions, FECCorrect, type IFrameInfo, type IResult, type IStreamClient, type MirrorFlipCommand, type PlayerEnv, PluginManager, StreamClient, type WasmDecoderStatue, type WaterMarkParams, EZopenPlayer as default };
|