ezuikit-flv 1.0.3-alpha.1 → 1.0.3-alpha.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ezuikit-flv",
3
- "version": "1.0.3-alpha.1",
3
+ "version": "1.0.3-alpha.3",
4
4
  "main": "./index.js",
5
5
  "types": "./types",
6
6
  "author": "Ezviz-OpenBiz",
@@ -17,10 +17,11 @@
17
17
  "@ezuikit/player-base": "0.1.0-alpha.1",
18
18
  "@ezuikit/utils-collect": "0.1.0-beta.1",
19
19
  "@ezuikit/utils-logger": "1.0.1",
20
- "browser-tool": "^1.0.5",
20
+ "browser-tool": "1.0.5",
21
21
  "eventemitter3": "^5.0.1",
22
22
  "recordrtc": "5.6.2",
23
- "screenfull": "5.1.0"
23
+ "screenfull": "5.1.0",
24
+ "js-md5": "0.8.3"
24
25
  },
25
26
  "bugs": {
26
27
  "url": "https://github.com/Ezviz-OpenBiz/EZUIKit-flv/issues"
@@ -25,7 +25,7 @@ export namespace DEFAULT_PLAYER_OPTIONS {
25
25
  export let loadingTimeoutReplayTimes: number;
26
26
  export let heartTimeoutReplayTimes: number;
27
27
  export let keepScreenOn: boolean;
28
- export let isNotMute: boolean;
28
+ export let isMute: boolean;
29
29
  export let hasAudio: boolean;
30
30
  export let volume: number;
31
31
  export let hasVideo: boolean;
@@ -93,8 +93,10 @@ export namespace EVENTS {
93
93
  export let mute: string;
94
94
  export let load: string;
95
95
  export let loading: string;
96
+ export let loaded: string;
96
97
  export let videoInfo: string;
97
98
  export let timeUpdate: string;
99
+ export let timeUpdateOSD: string;
98
100
  export let audioInfo: string;
99
101
  export let log: string;
100
102
  export let error: string;
@@ -127,6 +129,13 @@ export namespace EVENTS {
127
129
  export let videoTimeUpdate: string;
128
130
  export let videoSyncAudio: string;
129
131
  export let playToRenderTimes: string;
132
+ export let localVideoRecords: string;
133
+ export let getDefinitionListResult: string;
134
+ export let definitionChange: string;
135
+ export let definitionListChange: string;
136
+ export let playbackRateListChange: string;
137
+ export let playbackRateChange: string;
138
+ export let decoderLoaded: string;
130
139
  }
131
140
  export namespace FLV_EVENTS {
132
141
  import load_1 = EVENTS.load;
@@ -266,3 +275,7 @@ export namespace FETCH_ERROR {
266
275
  let abortError2: string;
267
276
  let abort: string;
268
277
  }
278
+ /**
279
+ * 开放平台https接口
280
+ */
281
+ export const HTTP_ENV_DOMAIN: "https://open.ys7.com/";
package/types/index.d.ts CHANGED
@@ -2,16 +2,14 @@ export default EzuikitFlv;
2
2
  /**
3
3
  * @classdesc EzuikitFlv.js 播放flv直播流, 支持播放h264/h265的直播视频流
4
4
  * @example
5
- * ```js
6
5
  * const flv = new EzuikitFlv({
7
6
  * id: "EleId",
8
7
  * url: "https://open.ys7.com/v3/openlive/E71992743_1_1.flv"
9
8
  * })
10
- * ```
11
9
  */
12
10
  declare class EzuikitFlv extends EventEmitter<string | symbol, any> {
13
11
  /**
14
- * @description ERROR
12
+ * @description EzuikitFlv error events
15
13
  * @static
16
14
  * @member
17
15
  * @example
@@ -33,6 +31,17 @@ declare class EzuikitFlv extends EventEmitter<string | symbol, any> {
33
31
  wasmDecodeError: string;
34
32
  webglAlignmentError: string;
35
33
  };
34
+ static QUALITY_ENUM: {
35
+ 0: string;
36
+ 1: string;
37
+ 2: string;
38
+ 3: string;
39
+ 4: string;
40
+ 5: string;
41
+ 6: string;
42
+ };
43
+ /** 旋转角度 */
44
+ static ROTATE: number[];
36
45
  /** */
37
46
  static TIMEOUT: {
38
47
  loadingTimeout: string;
@@ -44,6 +53,7 @@ declare class EzuikitFlv extends EventEmitter<string | symbol, any> {
44
53
  * @returns {FlvOptions}
45
54
  */
46
55
  private static _setOptions;
56
+ /** 版本号 EzuikitFlv.version */
47
57
  static version: string;
48
58
  /**
49
59
  * @description 静态方法 判断是否支持播放地址
@@ -54,9 +64,7 @@ declare class EzuikitFlv extends EventEmitter<string | symbol, any> {
54
64
  * @static
55
65
  *
56
66
  * @example
57
- * ```js
58
67
  * EzuikitFlv.supportType({url: "https://open.ys7.com/v3/openlive/E71992743_1_1.flv", type:'flv'})
59
- * ```
60
68
  */
61
69
  static supportType(options: {
62
70
  url?: string | undefined;
@@ -68,11 +76,83 @@ declare class EzuikitFlv extends EventEmitter<string | symbol, any> {
68
76
  */
69
77
  constructor(options: FlvOptions);
70
78
  event: EventEmitter<string | symbol, any>;
79
+ urlInfo: {};
80
+ /** @type {Services} */
81
+ services: Services;
82
+ seekTime: number;
71
83
  _opt: FlvOptions;
72
84
  $container: any;
73
85
  _loadingTimeoutReplayTimes: number;
74
86
  _heartTimeoutReplayTimes: number;
75
87
  events: Events;
88
+ _videoInfo: {};
89
+ definitionList: any[];
90
+ definition: {};
91
+ /**
92
+ * @private
93
+ */
94
+ private _playbackRate;
95
+ playbackRateList: number[];
96
+ playbackRecords: any[];
97
+ /**
98
+ * https 接口调用 仅针对萤石设备
99
+ * @since @1.0.3
100
+ * @private
101
+ */
102
+ private _httpServices;
103
+ /**
104
+ * @description 自定义设置清晰度列表, 仅对萤石设备预览生效, 需要第一次 definitionListChange 事件监听后调用, 不然会被接口覆盖
105
+ * @param {VideoLevel} list
106
+ * @since 1.0.3
107
+ * @returns {void}
108
+ */
109
+ setDefinitionList(list: VideoLevel): void;
110
+ /**
111
+ * @description 切换清晰度,仅对萤石设备预览生效
112
+ * @param {VideoLevel} definition 清晰
113
+ * @since 1.0.3
114
+ * @returns {void}
115
+ */
116
+ switchDefinition(definition: VideoLevel): void;
117
+ /**
118
+ * @description 自定义设置倍速列表, 仅对萤石设备回放生效
119
+ * @param {Array<number>} list
120
+ * @since 1.0.3
121
+ * @returns {void}
122
+ */
123
+ setPlaybackRateList(list: Array<number>): void;
124
+ set playbackRate(rate: number);
125
+ get playbackRate(): number;
126
+ /**
127
+ * @description 切换倍速,仅对萤石设备回放生效
128
+ * @param {number} rate
129
+ * @since 1.0.3
130
+ * @returns {void}
131
+ */
132
+ switchPlaybackRate(rate: number): void;
133
+ /**
134
+ * @description 获取回放地址
135
+ * @private
136
+ * @returns {Promise<number>} // 0 成功 1 失败
137
+ */
138
+ private _getNewPlaybackPlayUrl;
139
+ /**
140
+ * @description 跳转到指定时间 仅对萤石设备回放生效
141
+ * @param {stirng} time seekTime YYYYMMDDhhmmss
142
+ */
143
+ seek(seekTime: any): Promise<void>;
144
+ /**
145
+ * @description 是否是萤石开放平台回放
146
+ * @param {string} url
147
+ * @private
148
+ * @since @1.0.3
149
+ * @returns {boolean}
150
+ */
151
+ private _isEzvizPlayback;
152
+ /**
153
+ * 当前是否在播放中
154
+ */
155
+ get playing(): any;
76
156
  /**
77
157
  * @description 销毁
78
158
  * @example
@@ -176,14 +256,6 @@ declare class EzuikitFlv extends EventEmitter<string | symbol, any> {
176
256
  * flv.pause()
177
257
  */
178
258
  pause(): Promise<unknown>;
179
- /**
180
- * @description 关闭视频,不释放底层资源
181
- * @private
182
- * @returns {void}
183
- * @example
184
- * flv.close()
185
- */
186
- private close;
187
259
  /**
188
260
  * @description 清理画布为黑色背景
189
261
  * @private
@@ -213,6 +285,7 @@ declare class EzuikitFlv extends EventEmitter<string | symbol, any> {
213
285
  * @param {number=} width 宽
214
286
  * @param {number=} height 高
215
287
  * @example
288
+ *
216
289
  * flv.resize()
217
290
  */
218
291
  resize(width?: number | undefined, height?: number | undefined): void;
@@ -226,8 +299,8 @@ declare class EzuikitFlv extends EventEmitter<string | symbol, any> {
226
299
  private setBufferTime;
227
300
  /**
228
301
  * @description 设置旋转角度,支持,0(默认), 90, 180, 270 四个值。
302
+ * @param {number} deg 旋转角度取值 EzuikitFlv.ROTATE
229
303
  * @returns {Promise}
230
- * @param {number} deg
231
304
  * @example
232
305
  * flv.setRotate(90) // 旋转90度
233
306
  */
@@ -251,12 +324,27 @@ declare class EzuikitFlv extends EventEmitter<string | symbol, any> {
251
324
  * @param {Boolean} flag
252
325
  */
253
326
  private _setFullscreen;
327
+ /**
328
+ * 当前容器全屏中
329
+ * @returns {boolean}
330
+ */
331
+ get fullscreening(): boolean;
332
+ /**
333
+ * 当前视频的信息, 推荐使用监听 videoInfo 事件
334
+ * @returns {Object}
335
+ */
336
+ get videoInfo(): any;
337
+ /**
338
+ * 当前播放时间(从0 开始 单位秒)
339
+ * @returns {number}
340
+ */
341
+ get currentTime(): number;
254
342
  /**
255
343
  * @description 全屏播放视频(不支持移动端)
256
344
  * @returns {Promise}
345
+ * @deprecated
257
346
  * @example
258
347
  * flv.fullScreen() // 全屏
259
- *
260
348
  */
261
349
  fullScreen(): Promise<any>;
262
350
  /**
@@ -264,12 +352,12 @@ declare class EzuikitFlv extends EventEmitter<string | symbol, any> {
264
352
  * @returns {Promise}
265
353
  * @example
266
354
  * flv.fullscreen() // 全屏
267
- *
268
355
  */
269
356
  fullscreen(): Promise<any>;
270
357
  /**
271
358
  * @description 退出全屏播放视频
272
359
  * @returns {Promise}
360
+ * @deprecated
273
361
  * @example
274
362
  * flv.cancelFullScreen() // 退出全屏
275
363
  */
@@ -278,15 +366,9 @@ declare class EzuikitFlv extends EventEmitter<string | symbol, any> {
278
366
  * @description 取消全屏播放视频
279
367
  * @returns {Promise}
280
368
  * @example
281
- * flv.exitFullscreen() // 全屏
369
+ * flv.exitFullscreen() // 退出全屏
282
370
  */
283
371
  exitFullscreen(): Promise<any>;
284
- /**
285
- * @description 退出全屏播放视频
286
- * @private
287
- * @returns {Promise}
288
- */
289
- private _exitFullscreen;
290
372
  /**
291
373
  * @description 截图,调用后弹出下载框保存截图
292
374
  * @param {string=} filename 保存的文件名, 默认 时间戳
@@ -295,8 +377,10 @@ declare class EzuikitFlv extends EventEmitter<string | symbol, any> {
295
377
  * @param {("download" | "base64" | "blob")} type download,base64,blob, 默认download
296
378
  *
297
379
  * @returns {string | Blob | undefined}
380
+ * @since 1.0.3
298
381
  * @example
299
382
  * flv.screenshot()
383
+ * flv.screenshot("filename", "jpeg", 0.7, "download")
300
384
  */
301
385
  screenshot(filename?: string | undefined, format?: string | undefined, quality?: number | undefined, type?: ("download" | "base64" | "blob")): string | Blob | undefined;
302
386
  /**
@@ -309,14 +393,21 @@ declare class EzuikitFlv extends EventEmitter<string | symbol, any> {
309
393
  /**
310
394
  * @description 获取设置
311
395
  * @returns {object}
396
+ *
397
+ * @example
398
+ * player.getOptions()
312
399
  */
313
400
  getOptions(): object;
314
401
  /**
315
402
  * @description 获取版本
316
403
  * @returns {string}
404
+ *
405
+ * @example
406
+ * player.getVersion()
317
407
  */
318
408
  getVersion(): string;
319
409
  }
320
410
  import EventEmitter from 'eventemitter3';
411
+ import Services from './services';
321
412
  import Events from './utils/events';
322
413
  import Player from './player';
@@ -38,12 +38,21 @@ export default class BasePlayer extends Emitter {
38
38
  _audioTimestamp: number;
39
39
  events: Events;
40
40
  video: any;
41
+ _fullscreen: boolean;
41
42
  control: Control;
43
+ set fullscreen(value: any);
44
+ get fullscreen(): any;
45
+ set webFullscreen(value: any);
46
+ get webFullscreen(): any;
42
47
  /**
43
48
  *
44
49
  * @param options
45
50
  */
46
51
  updateOption(options: any): void;
52
+ /**
53
+ * @description 重置尺寸
54
+ */
55
+ resize(): void;
47
56
  }
48
57
  import Emitter from '../utils/emitter';
49
58
  import Debug from '../utils/debug';
@@ -30,8 +30,15 @@ export default class HardPlayer extends BasePlayer {
30
30
  _pause: boolean;
31
31
  _decodedFrames: number;
32
32
  constructor(container: HTMLElement, options: RequiredFlvOptions);
33
- close(): Promise<unknown>;
33
+ close(): void;
34
34
  _createPlayer(options: RequiredFlvOptions): void;
35
+ /**
36
+ * @private
37
+ */
38
+ _removeFlvEvents(): void;
39
+ /**
40
+ * @private
41
+ */
35
42
  _flvEvents(): void;
36
43
  getOption(): RequiredFlvOptions;
37
44
  emitError(errorType: string, message?: string): void;
@@ -40,10 +47,6 @@ export default class HardPlayer extends BasePlayer {
40
47
  */
41
48
  destroy(): void;
42
49
  resetStats(): void;
43
- set fullscreen(value: any);
44
- get fullscreen(): any;
45
- set webFullscreen(value: boolean);
46
- get webFullscreen(): boolean;
47
50
  set loaded(value: boolean);
48
51
  get loaded(): boolean;
49
52
  set playing(value: boolean);
@@ -81,14 +84,17 @@ export default class HardPlayer extends BasePlayer {
81
84
  /**
82
85
  * @description 播放
83
86
  * @param url
84
- * @param options
87
+ * @param {object} options
85
88
  * @returns {Promise}
86
89
  */
87
- play(): Promise<unknown>;
88
- _play(): Promise<void>;
90
+ play(options?: {
91
+ url?: string;
92
+ }): Promise<unknown>;
93
+ _play(options?: {
94
+ url?: string;
95
+ }): Promise<void>;
89
96
  _close(): Promise<unknown>;
90
97
  pause(): Promise<unknown>;
91
98
  resumeAudioAfterPause(): void;
92
99
  mute(flag: boolean): void;
93
- resize(): void;
94
100
  }
@@ -1,6 +1,6 @@
1
1
  import CommonLoader from '../commonLoader';
2
- import { ScreenshotFormat } from '../interface';
3
- import HardPlayer from '.';
2
+ import { type ScreenshotFormat } from '../interface';
3
+ import type HardPlayer from '.';
4
4
  export default class VideoLoader extends CommonLoader {
5
5
  _delayPlay: boolean;
6
6
  $canvasElement: HTMLCanvasElement;
@@ -25,4 +25,5 @@ export default class VideoLoader extends CommonLoader {
25
25
  resize(): void;
26
26
  _resizeElement($Element: HTMLVideoElement | HTMLImageElement): void;
27
27
  isPlaying(): boolean;
28
+ get currentTime(): number;
28
29
  }
@@ -1,7 +1,7 @@
1
1
  export default class PlayerLoader {
2
- static getLoaderFactory(useMSE: any): typeof SoftPlayer | typeof HardPalyer;
2
+ static getLoaderFactory(useMSE: any): typeof SoftPlayer | typeof HardPlayer;
3
3
  constructor(container: any, options: any);
4
4
  _opt: any;
5
5
  }
6
6
  import SoftPlayer from './soft-player';
7
- import HardPalyer from './hard-player';
7
+ import HardPlayer from './hard-player';
@@ -13,13 +13,14 @@ export type TFlvOptions = {
13
13
  loadingTimeout: number;
14
14
  loadingTimeoutReplay: boolean;
15
15
  keepScreenOn: boolean;
16
- isNotMute: boolean;
16
+ isMute: boolean;
17
17
  useMSE: boolean;
18
18
  autoWasm: boolean;
19
19
  wasmDecodeErrorReplay: boolean;
20
20
  useWebFullScreen: boolean;
21
21
  width: number;
22
22
  height: number;
23
+ isLive: boolean;
23
24
  };
24
25
  export type RequiredFlvOptions = Required<TFlvOptions> & {
25
26
  url: string;
@@ -13,6 +13,7 @@ export default class CanvasVideoLoader extends CommonLoader {
13
13
  height: string;
14
14
  encType: string;
15
15
  };
16
+ _currentTime: number;
16
17
  _contextmenuEvent: (e: any) => void;
17
18
  _initContextGl(): void;
18
19
  _initContext2D(): void;
@@ -23,5 +24,9 @@ export default class CanvasVideoLoader extends CommonLoader {
23
24
  render(msg: any): void;
24
25
  screenshot(filename: any, format: any, quality: any, type: any): string | File;
25
26
  resize(): void;
27
+ /**
28
+ * 当前播放pts (单位秒)
29
+ */
30
+ get currentTime(): number;
26
31
  }
27
32
  import CommonLoader from '../commonLoader';
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @description 软解
3
+ */
1
4
  export default class SoftPlayer extends BasePlayer {
2
5
  constructor(container: any, options: any);
3
6
  audio: Audio;
@@ -9,10 +12,6 @@ export default class SoftPlayer extends BasePlayer {
9
12
  set volume(value: number);
10
13
  get volume(): number;
11
14
  destroy(): void;
12
- set fullscreen(value: any);
13
- get fullscreen(): any;
14
- set webFullscreen(value: any);
15
- get webFullscreen(): any;
16
15
  set loaded(value: boolean);
17
16
  get loaded(): boolean;
18
17
  set playing(value: boolean);
@@ -29,7 +28,7 @@ export default class SoftPlayer extends BasePlayer {
29
28
  *
30
29
  * @returns {Promise<unknown>}
31
30
  */
32
- init(): Promise<unknown>;
31
+ _init(): Promise<unknown>;
33
32
  /**
34
33
  *
35
34
  * @param url
@@ -53,10 +52,6 @@ export default class SoftPlayer extends BasePlayer {
53
52
  * @param {boolean} flag
54
53
  */
55
54
  mute(flag: boolean): void;
56
- /**
57
- * @description 重置尺寸
58
- */
59
- resize(): void;
60
55
  _onlyMseOrWcsVideo(): any;
61
56
  /**
62
57
  * 心跳检查
@@ -0,0 +1,9 @@
1
+ export default API;
2
+ declare namespace API {
3
+ let getLocalVideoUnifyQuery: string;
4
+ let getVideoQuality: string;
5
+ let setVideoLevel: string;
6
+ let getAddress: string;
7
+ let getCDNLiveAddress: string;
8
+ let getCDNRecordAddress: string;
9
+ }
@@ -0,0 +1,172 @@
1
+ /**
2
+ * videoLevel 清晰度枚举
3
+ */
4
+ export const QUALITY_ENUM: {
5
+ 0: string;
6
+ 1: string;
7
+ 2: string;
8
+ 3: string;
9
+ 4: string;
10
+ 5: string;
11
+ 6: string;
12
+ };
13
+ export const DEFAULT_QUALITY: {
14
+ /**
15
+ * 0: 流畅
16
+ * 1: 标清
17
+ * 2: 高清
18
+ * 3: 超清
19
+ * 4: 极清
20
+ * 5: 3K
21
+ * 6: 4K
22
+ */
23
+ videoLevel: number;
24
+ name: string;
25
+ streamTypeIn: number;
26
+ /** 用来区分清晰度是否是默认值还是接口返回的 */
27
+ type: string;
28
+ }[];
29
+ export default Services;
30
+ /**
31
+ * @description http请求
32
+ */
33
+ declare class Services {
34
+ constructor(player: any, options: any);
35
+ _player: any;
36
+ baseURL: any;
37
+ accessToken: any;
38
+ deviceSerial: any;
39
+ channelNo: any;
40
+ appName: any;
41
+ v: any;
42
+ /**
43
+ * @description 请求
44
+ * @param {string} url 请求地址
45
+ * @param object} opions 请求参数
46
+ * @returns {Promise}
47
+ */
48
+ fetch(url: string, options?: {}): Promise<any>;
49
+ /**
50
+ * @description get请求
51
+ * @param {string} url 请求地址
52
+ */
53
+ get(url: string, options?: {}): Promise<any>;
54
+ /**
55
+ * @description post请求
56
+ * @param {string} url 请求地址
57
+ */
58
+ post(url: string, options?: {}): Promise<any>;
59
+ /**
60
+ * @description 获取设备视频质量查询接口 https://open.ys7.com/help/3922
61
+ * @param {string | number} videoLevel 设备视频清晰度等级 0-流畅 1-均衡 2-高清 3-超清 4 5 6
62
+ */
63
+ setVideoLevelService(videoLevel: string | number): Promise<any>;
64
+ /**
65
+ * @description 获取查询设备本地录像 (开始结束时间必须在同一天, 有时区问题) https://open.ys7.com/help/3922
66
+ * @param {Object} params
67
+ * @param {string | number} params.startTime 开始时间 (毫秒)
68
+ * @param {string | number} params.endTime 结束时间(毫秒)
69
+ * @param {(string | number)=} params.pageSize 每页个数 默认200, 最大200, 超出自动遍历下一页
70
+ *
71
+ * @returns {Array<{"startTime": number,"endTime": number,"type": string, "size":number }>}
72
+ */
73
+ getLocalVideoUnifyQueryService(params: {
74
+ startTime: string | number;
75
+ endTime: string | number;
76
+ pageSize?: (string | number) | undefined;
77
+ }): Array<{
78
+ "startTime": number;
79
+ "endTime": number;
80
+ "type": string;
81
+ "size": number;
82
+ }>;
83
+ /**
84
+ * @description 获取设备视频质量查询接口 https://open.ys7.com/help/3922
85
+ *
86
+ * @returns {Array<{"streamTypeIn": 1 | 2,"videoLevel": 0 | 1 | 2 | 3 | 4 | 5 |6, name: string }>}
87
+ */
88
+ getVideoQualityService(): Array<{
89
+ "streamTypeIn": 1 | 2;
90
+ "videoLevel": 0 | 1 | 2 | 3 | 4 | 5 | 6;
91
+ name: string;
92
+ }>;
93
+ /**
94
+ * @description 获取播放地址 https://open.ys7.com/help/1414
95
+ * @param {Object} params 获取地址参数
96
+ * @param {number=} params.expireTime 过期时长,单位秒;针对hls/rtmp/flv设置有效期,相对时间;30秒-720天
97
+ * @param {number=} params.type 地址的类型,1-预览,2-本地录像回放,3-云存储录像回放,非必选,默认为1;回放仅支持rtmp、ezopen、flv协议
98
+ * @param {number=} params.quality 视频清晰度,1-高清(主码流)、2-流畅(子码流)
99
+ * @param {string=} params.startTime 本地录像/云存储录像回放开始时间,云存储开始结束时间必须在同一天,示例:2019-12-01 00:00:00
100
+ * @param {string=} params.stopTime 本地录像/云存储录像回放结束时间,云存储开始结束时间必须在同一天,示例:2019-12-01 23:59:59
101
+ * @param {number=} params.playbackSpeed 回放倍速。倍速为 -1( 支持的最大倍速)、0.5、1、2、4、8、16; 仅支持protocol为4-flv 且 type为2-本地录像回放( 部分设备可能不支持16倍速) 或者 3-云存储录像回放
102
+ * @returns {Promise<string>}
103
+ */
104
+ getPlayAddressService(params?: {
105
+ expireTime?: number | undefined;
106
+ type?: number | undefined;
107
+ quality?: number | undefined;
108
+ startTime?: string | undefined;
109
+ stopTime?: string | undefined;
110
+ playbackSpeed?: number | undefined;
111
+ }): Promise<string>;
112
+ /**
113
+ * @description 获取本地录像回放播放地址 https://open.ys7.com/help/1414
114
+ * @param {Object} params 获取地址参数
115
+ * @param {number=} params.expireTime 过期时长,单位秒;针对hls/rtmp/flv设置有效期,相对时间;30秒-720天
116
+ * @param {number=} params.quality 视频清晰度,1-高清(主码流)、2-流畅(子码流)
117
+ * @param {string=} params.startTime 本地录像/云存储录像回放开始时间,云存储开始结束时间必须在同一天,示例:2019-12-01 00:00:00
118
+ * @param {string=} params.stopTime 本地录像/云存储录像回放结束时间,云存储开始结束时间必须在同一天,示例:2019-12-01 23:59:59
119
+ * @param {number=} params.playbackSpeed 回放倍速。倍速为 -1( 支持的最大倍速)、0.5、1、2、4、8、16; 仅支持protocol为4-flv 且 type为2-本地录像回放( 部分设备可能不支持16倍速) 或者 3-云存储录像回放
120
+ * @returns {Promise<string>}
121
+ */
122
+ getRecordAddressService(params?: {
123
+ expireTime?: number | undefined;
124
+ quality?: number | undefined;
125
+ startTime?: string | undefined;
126
+ stopTime?: string | undefined;
127
+ playbackSpeed?: number | undefined;
128
+ }): Promise<string>;
129
+ /**
130
+ * @description 获取直播地址 https://open.ys7.com/help/1414
131
+ * @param {Object} params 获取地址参数
132
+ * @param {number=} params.expireTime 过期时长,单位秒;针对hls/rtmp/flv设置有效期,相对时间;30秒-720天
133
+ * @param {1 | 2} params.quality 视频清晰度,1-高清(主码流)、2-流畅(子码流)
134
+ * @returns {Promise<string>}
135
+ * @returns
136
+ */
137
+ getLiveAddressService(params?: {
138
+ expireTime?: number | undefined;
139
+ quality: 1 | 2;
140
+ }): Promise<string>;
141
+ /**
142
+ * @description
143
+ * @param {Object} params 获取地址参数
144
+ * @param {number=} params.expireTime 过期时长,单位秒;针对hls/rtmp/flv设置有效期,相对时间;30秒-720天
145
+ * @param {number=} params.quality 视频清晰度,1-高清(主码流)、2-流畅(子码流)
146
+ * @param {number=} params.playbackSpeed 回放倍速。倍速为 -1( 支持的最大倍速)、0.5、1、2、4、8、16; 仅支持protocol为4-flv 且 type为2-本地录像回放( 部分设备可能不支持16倍速) 或者 3-云存储录像回放
147
+ * @returns {Promise<string>}
148
+ */
149
+ getCDNPlayAddressService(url: any, body?: {}): Promise<string>;
150
+ /**
151
+ * @description 获取CDN直播地址 (有效期时间是当天 00:00:00 - 23:59:59)
152
+ * @param {Object} body
153
+ * @param {1 | 2} body.quality 视频清晰度,1-高清(默认)、2-流畅
154
+ */
155
+ getCDNLiveAddressService(body: {
156
+ quality: 1 | 2;
157
+ }): Promise<string>;
158
+ /**
159
+ * @description 获取CDN直播地址 (有效期时间是当天 00:00:00 - 23:59:59)
160
+ * @param {Object} body
161
+ * @param {1 | 2} body.quality 视频清晰度,1-高清(默认)、2-流畅
162
+ * @param {1 | 2} body.type 1-本地录像回放,2-云存储录像回放 默认1
163
+ * @param {string} body.startTime 录制片段开始时间,例如:2024-01-01 09:10:56,开始时间和结束时间跨度最多7天
164
+ * @param {string} body.stopTime 录制片段结束时间,例如:2024-01-01 09:10:56,开始时间和结束时间跨度最多7天,结束时间不能小于等于当前时间,结束时间必须在30天内
165
+ */
166
+ getCDNRecordAddressService(body: {
167
+ quality: 1 | 2;
168
+ type: 1 | 2;
169
+ startTime: string;
170
+ stopTime: string;
171
+ }): Promise<string>;
172
+ }
@@ -1,6 +1,5 @@
1
1
  export default class Stream {
2
- static getLoaderFactory(protocol: any): typeof FetchLoader | typeof WebsocketLoader;
2
+ static getLoaderFactory(protocol: any): typeof FetchLoader;
3
3
  constructor(player: any);
4
4
  }
5
5
  import FetchLoader from './fetchLoader';
6
- import WebsocketLoader from './websocketLoader';