ezuikit-flv 1.0.3-alpha.16 → 1.0.3-alpha.18
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/decoder.js +2 -2
- package/index.js +5 -5
- package/package.json +1 -1
- package/types/constant/index.d.ts +5 -9
- package/types/index.d.ts +23 -4
- package/types/player/base-player.d.ts +0 -1
- package/types/player/hard-player/index.d.ts +11 -6
- package/types/player/interface.d.ts +2 -3
- package/types/player/soft-player/index.d.ts +5 -0
- package/types/typedefs.d.ts +6 -16
package/package.json
CHANGED
|
@@ -17,13 +17,10 @@ export namespace DEFAULT_PLAYER_OPTIONS {
|
|
|
17
17
|
export let videoBufferDelay: number;
|
|
18
18
|
export let scaleMode: number;
|
|
19
19
|
export let debug: boolean;
|
|
20
|
-
export let loadingTimeout: number;
|
|
21
|
-
export let heartTimeout: number;
|
|
22
20
|
export let timeout: number;
|
|
23
|
-
export let
|
|
24
|
-
export let
|
|
21
|
+
export let loadingTimeout: number;
|
|
22
|
+
export let loadingTimeoutDelay: number;
|
|
25
23
|
export let loadingTimeoutReplayTimes: number;
|
|
26
|
-
export let heartTimeoutReplayTimes: number;
|
|
27
24
|
export let keepScreenOn: boolean;
|
|
28
25
|
export let isMute: boolean;
|
|
29
26
|
export let hasAudio: boolean;
|
|
@@ -33,6 +30,7 @@ export namespace DEFAULT_PLAYER_OPTIONS {
|
|
|
33
30
|
export let staticPath: string;
|
|
34
31
|
export let url: string;
|
|
35
32
|
export let rotate: number;
|
|
33
|
+
export let isLive: boolean;
|
|
36
34
|
export let forceNoOffscreen: boolean;
|
|
37
35
|
import protocol = PLAYER_PLAY_PROTOCOL.fetch;
|
|
38
36
|
export { protocol };
|
|
@@ -44,6 +42,7 @@ export namespace DEFAULT_PLAYER_OPTIONS {
|
|
|
44
42
|
export let openWebglAlignment: boolean;
|
|
45
43
|
export let wasmDecodeAudioSyncVideo: boolean;
|
|
46
44
|
export let useWebFullScreen: boolean;
|
|
45
|
+
export let autoPlay: boolean;
|
|
47
46
|
export namespace loggerOptions {
|
|
48
47
|
let level: string;
|
|
49
48
|
}
|
|
@@ -107,6 +106,7 @@ export namespace EVENTS {
|
|
|
107
106
|
export let delayTimeout: string;
|
|
108
107
|
let loadingTimeout_1: string;
|
|
109
108
|
export { loadingTimeout_1 as loadingTimeout };
|
|
109
|
+
export let currentRetryTimes: string;
|
|
110
110
|
export let stats: string;
|
|
111
111
|
export let performance: string;
|
|
112
112
|
export let buffer: string;
|
|
@@ -155,10 +155,6 @@ export namespace FLV_EVENTS {
|
|
|
155
155
|
export { log_1 as log };
|
|
156
156
|
import start_1 = EVENTS.start;
|
|
157
157
|
export { start_1 as start };
|
|
158
|
-
import timeout_2 = EVENTS.timeout;
|
|
159
|
-
export { timeout_2 as timeout };
|
|
160
|
-
import loadingTimeout_2 = EVENTS.loadingTimeout;
|
|
161
|
-
export { loadingTimeout_2 as loadingTimeout };
|
|
162
158
|
import delayTimeout_1 = EVENTS.delayTimeout;
|
|
163
159
|
export { delayTimeout_1 as delayTimeout };
|
|
164
160
|
let fullscreen_1: string;
|
package/types/index.d.ts
CHANGED
|
@@ -44,7 +44,6 @@ declare class EzuikitFlv extends EventEmitter<string | symbol, any> {
|
|
|
44
44
|
static ROTATE: number[];
|
|
45
45
|
/** */
|
|
46
46
|
static TIMEOUT: {
|
|
47
|
-
loadingTimeout: string;
|
|
48
47
|
delayTimeout: string;
|
|
49
48
|
};
|
|
50
49
|
/**
|
|
@@ -79,10 +78,11 @@ declare class EzuikitFlv extends EventEmitter<string | symbol, any> {
|
|
|
79
78
|
urlInfo: {};
|
|
80
79
|
/** @type {Services} */
|
|
81
80
|
services: Services;
|
|
82
|
-
|
|
81
|
+
/** @private */
|
|
82
|
+
private _loadingTimeoutDelayTimer;
|
|
83
|
+
_opt: any;
|
|
83
84
|
$container: any;
|
|
84
85
|
_loadingTimeoutReplayTimes: number;
|
|
85
|
-
_heartTimeoutReplayTimes: number;
|
|
86
86
|
events: Events;
|
|
87
87
|
_videoInfo: {};
|
|
88
88
|
_currentPlayDate: string;
|
|
@@ -247,7 +247,6 @@ declare class EzuikitFlv extends EventEmitter<string | symbol, any> {
|
|
|
247
247
|
* @example
|
|
248
248
|
* flv.setTimeout(3)
|
|
249
249
|
*/
|
|
250
|
-
private setTimeout;
|
|
251
250
|
/**
|
|
252
251
|
* @description 设置渲染的模式 (video 不支持)
|
|
253
252
|
* @private
|
|
@@ -280,6 +279,10 @@ declare class EzuikitFlv extends EventEmitter<string | symbol, any> {
|
|
|
280
279
|
* flv.play()
|
|
281
280
|
*/
|
|
282
281
|
play(options?: (string | FlvOptions) | undefined): Promise<any>;
|
|
282
|
+
/**
|
|
283
|
+
* @private
|
|
284
|
+
*/
|
|
285
|
+
private __play;
|
|
283
286
|
/**
|
|
284
287
|
* @description 播放
|
|
285
288
|
* @private
|
|
@@ -288,6 +291,22 @@ declare class EzuikitFlv extends EventEmitter<string | symbol, any> {
|
|
|
288
291
|
* @returns {Promise<unknown>}
|
|
289
292
|
*/
|
|
290
293
|
private _play;
|
|
294
|
+
/**
|
|
295
|
+
* @private
|
|
296
|
+
*/
|
|
297
|
+
private _onDelayTimeout;
|
|
298
|
+
/**
|
|
299
|
+
* @private
|
|
300
|
+
*/
|
|
301
|
+
private _onLoadingTimeout;
|
|
302
|
+
/**
|
|
303
|
+
* @private
|
|
304
|
+
*/
|
|
305
|
+
private _onStreamSuccess;
|
|
306
|
+
/**
|
|
307
|
+
* @private
|
|
308
|
+
*/
|
|
309
|
+
private _onStreamError;
|
|
291
310
|
/**
|
|
292
311
|
* @description 重新调整视图大小
|
|
293
312
|
* @param {number=} width 宽
|
|
@@ -22,12 +22,12 @@ export default class HardPlayer extends BasePlayer {
|
|
|
22
22
|
_opt: RequiredFlvOptions;
|
|
23
23
|
_checkHeartTimeout: number;
|
|
24
24
|
_stats: any;
|
|
25
|
-
_checkLoadingTimeout: number;
|
|
26
25
|
control: Control;
|
|
27
26
|
width: number;
|
|
28
27
|
height: number;
|
|
29
28
|
_pause: boolean;
|
|
30
29
|
_decodedFrames: number;
|
|
30
|
+
_checkLoadingTimeout: number;
|
|
31
31
|
constructor(container: HTMLElement, options: RequiredFlvOptions);
|
|
32
32
|
close(): void;
|
|
33
33
|
_createPlayer(options: RequiredFlvOptions): void;
|
|
@@ -39,6 +39,8 @@ export default class HardPlayer extends BasePlayer {
|
|
|
39
39
|
* @private
|
|
40
40
|
*/
|
|
41
41
|
_flvEvents(): void;
|
|
42
|
+
_onVideoLoadstart(): void;
|
|
43
|
+
_onVideoStreamSuccess(): void;
|
|
42
44
|
getOption(): RequiredFlvOptions;
|
|
43
45
|
emitError(errorType: string, message?: string): void;
|
|
44
46
|
/**
|
|
@@ -60,6 +62,14 @@ export default class HardPlayer extends BasePlayer {
|
|
|
60
62
|
set videoTimestamp(value: number);
|
|
61
63
|
get videoTimestamp(): number;
|
|
62
64
|
get isDebug(): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* @description 检查等待时间 (loading 等待时间)
|
|
67
|
+
*/
|
|
68
|
+
checkLoadingTimeout(): void;
|
|
69
|
+
/**
|
|
70
|
+
* @description 清除加载超时
|
|
71
|
+
*/
|
|
72
|
+
clearCheckLoadingTimeout(): void;
|
|
63
73
|
/**
|
|
64
74
|
* 心跳检查
|
|
65
75
|
*/
|
|
@@ -69,12 +79,7 @@ export default class HardPlayer extends BasePlayer {
|
|
|
69
79
|
* @description 心跳检查,如果渲染间隔暂停了多少时间之后,就会抛出异常
|
|
70
80
|
*/
|
|
71
81
|
checkHeartTimeout(): void;
|
|
72
|
-
/**
|
|
73
|
-
* @description 检查等待时间 (loading 等待时间)
|
|
74
|
-
*/
|
|
75
|
-
checkLoadingTimeout(): void;
|
|
76
82
|
handleRender(): void;
|
|
77
|
-
clearCheckLoadingTimeout(): void;
|
|
78
83
|
/**
|
|
79
84
|
*
|
|
80
85
|
* @param options
|
|
@@ -8,10 +8,9 @@ export type TFlvOptions = {
|
|
|
8
8
|
scaleMode: 0 | 1 | 2;
|
|
9
9
|
debug: boolean;
|
|
10
10
|
timeout: number;
|
|
11
|
-
heartTimeout: number;
|
|
12
|
-
heartTimeoutReplayTimes: number;
|
|
13
11
|
loadingTimeout: number;
|
|
14
|
-
|
|
12
|
+
loadingTimeoutDelay: number;
|
|
13
|
+
loadingTimeoutReplayTimes: number;
|
|
15
14
|
keepScreenOn: boolean;
|
|
16
15
|
isMute: boolean;
|
|
17
16
|
useMSE: boolean;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export default class SoftPlayer extends BasePlayer {
|
|
5
5
|
constructor(container: any, options: any);
|
|
6
|
+
_loadingTimeoutDelayTimer: any;
|
|
6
7
|
audio: Audio;
|
|
7
8
|
decoderWorker: DecoderWorker;
|
|
8
9
|
stream: Stream;
|
|
@@ -67,6 +68,10 @@ export default class SoftPlayer extends BasePlayer {
|
|
|
67
68
|
* @description 检查等待时间 (loading 等待时间)
|
|
68
69
|
*/
|
|
69
70
|
checkLoadingTimeout(): void;
|
|
71
|
+
_checkLoadingTimeout: NodeJS.Timeout;
|
|
72
|
+
/**
|
|
73
|
+
* @description 清除加载超时
|
|
74
|
+
*/
|
|
70
75
|
clearCheckLoadingTimeout(): void;
|
|
71
76
|
clearStatsInterval(): void;
|
|
72
77
|
handleRender(): void;
|
package/types/typedefs.d.ts
CHANGED
|
@@ -14,10 +14,8 @@
|
|
|
14
14
|
* @property {(0 | 1 | 2)=} scaleMode 设置渲染模式, 默认 1 等比缩放,最大边填充, 取值 0 | 1 | 2。
|
|
15
15
|
* @property {boolean=} debug 是否开启控制台调试打印。默认 false
|
|
16
16
|
* @property {number=} timeout 设置超时时长, 单位秒, 在连接成功之前(loading)和播放中途(heart),如果超过设定时长无数据返回,则回调timeout事件。默认 10
|
|
17
|
-
* @property {number=}
|
|
18
|
-
* @property {number=}
|
|
19
|
-
* @property {number=} loadingTimeout 设置超时时长, 单位秒。默认 10
|
|
20
|
-
* @property {boolean=} loadingTimeoutReplay 是否开启loading超时之后自动再播放, 默认 true
|
|
17
|
+
* @property {number=} loadingTimeoutDelay 请求失败, 延时重试时长,单位秒。默认 3
|
|
18
|
+
* @property {number=} loadingTimeoutReplayTimes 重试次数。默认 5, -1 不限次数
|
|
21
19
|
* @property {boolean=} keepScreenOn 开启屏幕常亮,在手机浏览器上, canvas标签渲染视频并不会像video标签那样保持屏幕常。默认 false
|
|
22
20
|
* @property {boolean=} isMute 是否静音,默认是关闭声音播放的。默认 true
|
|
23
21
|
* @property {boolean=} useMSE 是否开启MediaSource硬解码。视频编码只支持H.264视频(Safari on iOS不支持)。默认 false
|
|
@@ -100,21 +98,13 @@ export type FlvOptions = {
|
|
|
100
98
|
*/
|
|
101
99
|
timeout?: number | undefined;
|
|
102
100
|
/**
|
|
103
|
-
*
|
|
101
|
+
* 请求失败, 延时重试时长,单位秒。默认 3
|
|
104
102
|
*/
|
|
105
|
-
|
|
103
|
+
loadingTimeoutDelay?: number | undefined;
|
|
106
104
|
/**
|
|
107
|
-
*
|
|
105
|
+
* 重试次数。默认 5, -1 不限次数
|
|
108
106
|
*/
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* 设置超时时长, 单位秒。默认 10
|
|
112
|
-
*/
|
|
113
|
-
loadingTimeout?: number | undefined;
|
|
114
|
-
/**
|
|
115
|
-
* 是否开启loading超时之后自动再播放, 默认 true
|
|
116
|
-
*/
|
|
117
|
-
loadingTimeoutReplay?: boolean | undefined;
|
|
107
|
+
loadingTimeoutReplayTimes?: number | undefined;
|
|
118
108
|
/**
|
|
119
109
|
* 开启屏幕常亮,在手机浏览器上, canvas标签渲染视频并不会像video标签那样保持屏幕常。默认 false
|
|
120
110
|
*/
|