ezuikit-flv 1.0.2-alpha.5 → 1.0.2-alpha.6
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 +83 -18
- package/decoder.js +0 -6
- package/decoder.wasm +0 -0
- package/index.js +0 -18
- package/types/audio/audioContextLoader.d.ts +0 -42
- package/types/audio/index.d.ts +0 -5
- package/types/constant/index.d.ts +0 -264
- package/types/control/index.d.ts +0 -4
- package/types/control/observer.d.ts +0 -2
- package/types/demux/commonLoader.d.ts +0 -19
- package/types/demux/flvLoader.d.ts +0 -15
- package/types/demux/index.d.ts +0 -5
- package/types/demux/m7sLoader.d.ts +0 -4
- package/types/flv-mse/flv.min.d.ts +0 -3
- package/types/index.d.ts +0 -292
- package/types/player/base-player.d.ts +0 -51
- package/types/player/commonLoader.d.ts +0 -16
- package/types/player/events.d.ts +0 -2
- package/types/player/hard-player/index.d.ts +0 -94
- package/types/player/hard-player/videoLoader.d.ts +0 -28
- package/types/player/index.d.ts +0 -7
- package/types/player/interface.d.ts +0 -100
- package/types/player/observer.d.ts +0 -2
- package/types/player/property.d.ts +0 -2
- package/types/player/soft-player/canvasLoader.d.ts +0 -27
- package/types/player/soft-player/index.d.ts +0 -91
- package/types/stream/fetchLoader.d.ts +0 -16
- package/types/stream/index.d.ts +0 -6
- package/types/stream/websocketLoader.d.ts +0 -18
- package/types/typedefs.d.ts +0 -138
- package/types/utils/debug.d.ts +0 -8
- package/types/utils/emitter.d.ts +0 -7
- package/types/utils/events.d.ts +0 -7
- package/types/utils/file-save.d.ts +0 -2
- package/types/utils/index.d.ts +0 -70
- package/types/utils/monitor.d.ts +0 -13
- package/types/utils/noSleep.d.ts +0 -12
- package/types/utils/parse-url.d.ts +0 -5
- package/types/utils/webgl.d.ts +0 -5
- package/types/worker/index.d.ts +0 -13
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
export default class BasePlayer extends Emitter {
|
|
2
|
-
constructor(container: any, options: any, Video: any);
|
|
3
|
-
$container: any;
|
|
4
|
-
_opt: any;
|
|
5
|
-
debug: Debug;
|
|
6
|
-
_loading: boolean;
|
|
7
|
-
_playing: boolean;
|
|
8
|
-
_hasLoaded: boolean;
|
|
9
|
-
_checkHeartTimeout: any;
|
|
10
|
-
_checkLoadingTimeout: any;
|
|
11
|
-
_checkStatsInterval: any;
|
|
12
|
-
_startBpsTime: any;
|
|
13
|
-
_isPlayingBeforePageHidden: boolean;
|
|
14
|
-
_stats: {
|
|
15
|
-
buf: number;
|
|
16
|
-
fps: number;
|
|
17
|
-
abps: number;
|
|
18
|
-
vbps: number;
|
|
19
|
-
ts: number;
|
|
20
|
-
};
|
|
21
|
-
_times: {
|
|
22
|
-
playInitStart: string;
|
|
23
|
-
playStart: string;
|
|
24
|
-
streamStart: string;
|
|
25
|
-
streamResponse: string;
|
|
26
|
-
demuxStart: string;
|
|
27
|
-
decodeStart: string;
|
|
28
|
-
videoStart: string;
|
|
29
|
-
playTimestamp: string;
|
|
30
|
-
streamTimestamp: string;
|
|
31
|
-
streamResponseTimestamp: string;
|
|
32
|
-
demuxTimestamp: string;
|
|
33
|
-
decodeTimestamp: string;
|
|
34
|
-
videoTimestamp: string;
|
|
35
|
-
allTimestamp: string;
|
|
36
|
-
};
|
|
37
|
-
_videoTimestamp: number;
|
|
38
|
-
_audioTimestamp: number;
|
|
39
|
-
events: Events;
|
|
40
|
-
video: any;
|
|
41
|
-
control: Control;
|
|
42
|
-
/**
|
|
43
|
-
*
|
|
44
|
-
* @param options
|
|
45
|
-
*/
|
|
46
|
-
updateOption(options: any): void;
|
|
47
|
-
}
|
|
48
|
-
import Emitter from '../utils/emitter';
|
|
49
|
-
import Debug from '../utils/debug';
|
|
50
|
-
import Events from '../utils/events';
|
|
51
|
-
import Control from '../control';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export default class CommonLoader extends Emitter {
|
|
2
|
-
init: boolean;
|
|
3
|
-
resetInit(): void;
|
|
4
|
-
videoInfo: {
|
|
5
|
-
width: string;
|
|
6
|
-
height: string;
|
|
7
|
-
encType: string;
|
|
8
|
-
encTypeCode: string;
|
|
9
|
-
};
|
|
10
|
-
destroy(): void;
|
|
11
|
-
updateVideoInfo(data: any): void;
|
|
12
|
-
play(): void;
|
|
13
|
-
pause(): void;
|
|
14
|
-
clearView(): void;
|
|
15
|
-
}
|
|
16
|
-
import Emitter from '../utils/emitter';
|
package/types/player/events.d.ts
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { type PlayerInterface, type RequiredFlvOptions } from '../interface';
|
|
2
|
-
import Events from '../../utils/events';
|
|
3
|
-
import Video from './videoLoader';
|
|
4
|
-
import type Control from '../../control';
|
|
5
|
-
import BasePlayer from '../base-player';
|
|
6
|
-
/**
|
|
7
|
-
* @class
|
|
8
|
-
*
|
|
9
|
-
* @interface {PlayerInterface}
|
|
10
|
-
*/
|
|
11
|
-
export default class HardPlayer extends BasePlayer implements PlayerInterface {
|
|
12
|
-
player: any;
|
|
13
|
-
video: Video;
|
|
14
|
-
events: Events;
|
|
15
|
-
_playing: any;
|
|
16
|
-
_lastVolume: any;
|
|
17
|
-
_loading: any;
|
|
18
|
-
_audioTimestamp: any;
|
|
19
|
-
_videoTimestamp: any;
|
|
20
|
-
_times: any;
|
|
21
|
-
$container: HTMLElement;
|
|
22
|
-
_opt: RequiredFlvOptions;
|
|
23
|
-
_hasLoaded: boolean;
|
|
24
|
-
_checkHeartTimeout: number;
|
|
25
|
-
_stats: any;
|
|
26
|
-
_checkLoadingTimeout: number;
|
|
27
|
-
control: Control;
|
|
28
|
-
width: number;
|
|
29
|
-
height: number;
|
|
30
|
-
_pause: boolean;
|
|
31
|
-
_decodedFrames: number;
|
|
32
|
-
constructor(container: HTMLElement, options: RequiredFlvOptions);
|
|
33
|
-
close(): Promise<unknown>;
|
|
34
|
-
_createPlayer(options: RequiredFlvOptions): void;
|
|
35
|
-
_flvEvents(): void;
|
|
36
|
-
getOption(): RequiredFlvOptions;
|
|
37
|
-
emitError(errorType: string, message?: string): void;
|
|
38
|
-
/**
|
|
39
|
-
* @description 销毁实例
|
|
40
|
-
*/
|
|
41
|
-
destroy(): void;
|
|
42
|
-
resetStats(): void;
|
|
43
|
-
set fullscreen(value: any);
|
|
44
|
-
get fullscreen(): any;
|
|
45
|
-
set webFullscreen(value: boolean);
|
|
46
|
-
get webFullscreen(): boolean;
|
|
47
|
-
set loaded(value: boolean);
|
|
48
|
-
get loaded(): boolean;
|
|
49
|
-
set playing(value: any);
|
|
50
|
-
get playing(): any;
|
|
51
|
-
get volume(): number;
|
|
52
|
-
set volume(value: number);
|
|
53
|
-
get lastVolume(): any;
|
|
54
|
-
set loading(value: any);
|
|
55
|
-
get loading(): any;
|
|
56
|
-
set audioTimestamp(value: any);
|
|
57
|
-
get audioTimestamp(): any;
|
|
58
|
-
set videoTimestamp(value: any);
|
|
59
|
-
get videoTimestamp(): any;
|
|
60
|
-
get isDebug(): boolean;
|
|
61
|
-
/**
|
|
62
|
-
* 心跳检查
|
|
63
|
-
*/
|
|
64
|
-
checkHeart(): void;
|
|
65
|
-
clearCheckHeartTimeout(): void;
|
|
66
|
-
/**
|
|
67
|
-
* @description 心跳检查,如果渲染间隔暂停了多少时间之后,就会抛出异常
|
|
68
|
-
*/
|
|
69
|
-
checkHeartTimeout(): void;
|
|
70
|
-
/**
|
|
71
|
-
* @description 检查等待时间 (loading 等待时间)
|
|
72
|
-
*/
|
|
73
|
-
checkLoadingTimeout(): void;
|
|
74
|
-
handleRender(): void;
|
|
75
|
-
clearCheckLoadingTimeout(): void;
|
|
76
|
-
/**
|
|
77
|
-
*
|
|
78
|
-
* @param options
|
|
79
|
-
*/
|
|
80
|
-
updateOption(options: Partial<RequiredFlvOptions>): void;
|
|
81
|
-
/**
|
|
82
|
-
* @description 播放
|
|
83
|
-
* @param url
|
|
84
|
-
* @param options
|
|
85
|
-
* @returns {Promise}
|
|
86
|
-
*/
|
|
87
|
-
play(): Promise<unknown>;
|
|
88
|
-
_play(): Promise<void>;
|
|
89
|
-
_close(): Promise<unknown>;
|
|
90
|
-
pause(): Promise<unknown>;
|
|
91
|
-
resumeAudioAfterPause(): void;
|
|
92
|
-
mute(flag: boolean): void;
|
|
93
|
-
resize(): void;
|
|
94
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import CommonLoader from '../commonLoader';
|
|
2
|
-
import { ScreenshotFormat } from '../interface';
|
|
3
|
-
import HardPlayer from '.';
|
|
4
|
-
export default class VideoLoader extends CommonLoader {
|
|
5
|
-
_delayPlay: boolean;
|
|
6
|
-
$canvasElement: HTMLCanvasElement;
|
|
7
|
-
canvasContext: CanvasRenderingContext2D | null;
|
|
8
|
-
trackGenerator: any;
|
|
9
|
-
vwriter: any;
|
|
10
|
-
$videoElement: HTMLVideoElement;
|
|
11
|
-
player: HardPlayer;
|
|
12
|
-
$posterElement: HTMLImageElement;
|
|
13
|
-
constructor(player: HardPlayer);
|
|
14
|
-
destroy(): void;
|
|
15
|
-
fixChromeVideoFlashBug(): void;
|
|
16
|
-
play(): void;
|
|
17
|
-
_getVideoReadyState(): number;
|
|
18
|
-
_play(): void;
|
|
19
|
-
pause(isNow?: boolean): void;
|
|
20
|
-
clearView(): void;
|
|
21
|
-
screenshot(filename: string, format?: keyof ScreenshotFormat, quality?: number, type?: string): string | File;
|
|
22
|
-
initCanvasViewSize(): void;
|
|
23
|
-
_poster(): void;
|
|
24
|
-
render(msg: any): void;
|
|
25
|
-
resize(): void;
|
|
26
|
-
_resizeElement($Element: HTMLVideoElement | HTMLImageElement): void;
|
|
27
|
-
isPlaying(): boolean;
|
|
28
|
-
}
|
package/types/player/index.d.ts
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import Debug from '../utils/debug';
|
|
2
|
-
export type TFlvOptions = {
|
|
3
|
-
container: string | HTMLElement;
|
|
4
|
-
videoBuffer: number;
|
|
5
|
-
decoder?: string;
|
|
6
|
-
forceNoOffscreen?: boolean;
|
|
7
|
-
hasAudio?: boolean;
|
|
8
|
-
scaleMode: 0 | 1 | 2;
|
|
9
|
-
debug: boolean;
|
|
10
|
-
timeout: number;
|
|
11
|
-
heartTimeout: number;
|
|
12
|
-
heartTimeoutReplayTimes: number;
|
|
13
|
-
loadingTimeout: number;
|
|
14
|
-
loadingTimeoutReplay: boolean;
|
|
15
|
-
keepScreenOn: boolean;
|
|
16
|
-
isNotMute: boolean;
|
|
17
|
-
useMSE: boolean;
|
|
18
|
-
autoWasm: boolean;
|
|
19
|
-
wasmDecodeErrorReplay: boolean;
|
|
20
|
-
useWebFullScreen: boolean;
|
|
21
|
-
width: number;
|
|
22
|
-
height: number;
|
|
23
|
-
};
|
|
24
|
-
export type RequiredFlvOptions = Required<TFlvOptions> & {
|
|
25
|
-
url: string;
|
|
26
|
-
rotate?: 0 | 90 | 180 | 270;
|
|
27
|
-
hasControl: any;
|
|
28
|
-
openWebglAlignment?: boolean;
|
|
29
|
-
};
|
|
30
|
-
export type TPlayerTimes = {
|
|
31
|
-
playInitStart: number;
|
|
32
|
-
playStart: number;
|
|
33
|
-
streamStart: number;
|
|
34
|
-
streamResponse: number;
|
|
35
|
-
demuxStart: number;
|
|
36
|
-
decodeStart: number;
|
|
37
|
-
videoStart: number;
|
|
38
|
-
playTimestamp: number;
|
|
39
|
-
streamTimestamp: number;
|
|
40
|
-
streamResponseTimestamp: number;
|
|
41
|
-
demuxTimestamp: number;
|
|
42
|
-
decodeTimestamp: number;
|
|
43
|
-
videoTimestamp: number;
|
|
44
|
-
allTimestamp: number;
|
|
45
|
-
};
|
|
46
|
-
export type TPlayerStats = {
|
|
47
|
-
buf: number;
|
|
48
|
-
fps: number;
|
|
49
|
-
abps: number;
|
|
50
|
-
vbps: number;
|
|
51
|
-
ts: number;
|
|
52
|
-
};
|
|
53
|
-
export interface VideoInterface {
|
|
54
|
-
player: any;
|
|
55
|
-
destroy(): void;
|
|
56
|
-
initCanvasViewSize(): void;
|
|
57
|
-
render(msg: any): void;
|
|
58
|
-
screenshot(filename?: string, format?: string, quality?: number, type?: string): void;
|
|
59
|
-
clearView(): void;
|
|
60
|
-
resize(): void;
|
|
61
|
-
}
|
|
62
|
-
export interface PlayerInterface {
|
|
63
|
-
$container: any;
|
|
64
|
-
debug: Debug;
|
|
65
|
-
_opt: RequiredFlvOptions;
|
|
66
|
-
/**
|
|
67
|
-
* @description 播放
|
|
68
|
-
* @param url
|
|
69
|
-
* @param options
|
|
70
|
-
*/
|
|
71
|
-
play(options?: TFlvOptions): Promise<unknown>;
|
|
72
|
-
/**
|
|
73
|
-
* @description 暂停
|
|
74
|
-
*/
|
|
75
|
-
pause(flag?: boolean): Promise<unknown>;
|
|
76
|
-
/**
|
|
77
|
-
* @description 静音
|
|
78
|
-
* @param flag
|
|
79
|
-
*/
|
|
80
|
-
mute(flag?: boolean): void;
|
|
81
|
-
/**
|
|
82
|
-
* @description resize
|
|
83
|
-
*/
|
|
84
|
-
resize(): void;
|
|
85
|
-
/**
|
|
86
|
-
* @description 关闭
|
|
87
|
-
*/
|
|
88
|
-
close(): Promise<unknown>;
|
|
89
|
-
/**
|
|
90
|
-
* @description 销毁实例
|
|
91
|
-
*/
|
|
92
|
-
destroy(): void;
|
|
93
|
-
}
|
|
94
|
-
export type VideoInfo = {
|
|
95
|
-
width: string;
|
|
96
|
-
height: string;
|
|
97
|
-
encType: string;
|
|
98
|
-
encTypeCode?: 7 | 12 | '';
|
|
99
|
-
};
|
|
100
|
-
export type ScreenshotFormat = Record<'png' | 'jpeg' | 'webp', string>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export default class CanvasVideoLoader extends CommonLoader {
|
|
2
|
-
constructor(player: any);
|
|
3
|
-
player: any;
|
|
4
|
-
$videoElement: HTMLCanvasElement;
|
|
5
|
-
context2D: CanvasRenderingContext2D;
|
|
6
|
-
contextGl: any;
|
|
7
|
-
contextGlRender: (w: any, h: any, y: any, u: any, v: any) => void;
|
|
8
|
-
contextGlDestroy: () => void;
|
|
9
|
-
bitmaprenderer: ImageBitmapRenderingContext;
|
|
10
|
-
renderType: string;
|
|
11
|
-
videoInfo: {
|
|
12
|
-
width: string;
|
|
13
|
-
height: string;
|
|
14
|
-
encType: string;
|
|
15
|
-
};
|
|
16
|
-
_contextmenuEvent: (e: any) => void;
|
|
17
|
-
_initContextGl(): void;
|
|
18
|
-
_initContext2D(): void;
|
|
19
|
-
_initCanvasRender(): void;
|
|
20
|
-
_supportOffscreen(): any;
|
|
21
|
-
_bindOffscreen(): void;
|
|
22
|
-
initCanvasViewSize(): void;
|
|
23
|
-
render(msg: any): void;
|
|
24
|
-
screenshot(filename: any, format: any, quality: any, type: any): string | File;
|
|
25
|
-
resize(): void;
|
|
26
|
-
}
|
|
27
|
-
import CommonLoader from '../commonLoader';
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
export default class SoftPlayer extends BasePlayer {
|
|
2
|
-
constructor(container: any, options: any);
|
|
3
|
-
audio: Audio;
|
|
4
|
-
decoderWorker: DecoderWorker;
|
|
5
|
-
stream: Stream;
|
|
6
|
-
demux: Demux;
|
|
7
|
-
_lastVolume: any;
|
|
8
|
-
keepScreenOn: NoSleep;
|
|
9
|
-
destroy(): void;
|
|
10
|
-
set fullscreen(value: any);
|
|
11
|
-
get fullscreen(): any;
|
|
12
|
-
set webFullscreen(value: any);
|
|
13
|
-
get webFullscreen(): any;
|
|
14
|
-
set loaded(value: boolean);
|
|
15
|
-
get loaded(): boolean;
|
|
16
|
-
set playing(value: boolean);
|
|
17
|
-
get playing(): boolean;
|
|
18
|
-
set loading(value: boolean);
|
|
19
|
-
get loading(): boolean;
|
|
20
|
-
set volume(value: any);
|
|
21
|
-
get volume(): any;
|
|
22
|
-
get lastVolume(): any;
|
|
23
|
-
set audioTimestamp(value: number);
|
|
24
|
-
get audioTimestamp(): number;
|
|
25
|
-
set videoTimestamp(value: number);
|
|
26
|
-
get videoTimestamp(): number;
|
|
27
|
-
get isDebug(): boolean;
|
|
28
|
-
/**
|
|
29
|
-
*
|
|
30
|
-
* @returns {Promise<unknown>}
|
|
31
|
-
*/
|
|
32
|
-
init(): Promise<unknown>;
|
|
33
|
-
/**
|
|
34
|
-
*
|
|
35
|
-
* @param url
|
|
36
|
-
* @returns {Promise<unknown>}
|
|
37
|
-
*/
|
|
38
|
-
play(options: any): Promise<unknown>;
|
|
39
|
-
/**
|
|
40
|
-
*
|
|
41
|
-
*/
|
|
42
|
-
close(): Promise<any>;
|
|
43
|
-
_resumeAudioAfterPause(): void;
|
|
44
|
-
_close(): Promise<any>;
|
|
45
|
-
/**
|
|
46
|
-
*
|
|
47
|
-
* @param flag {boolean} 是否清除画面
|
|
48
|
-
* @returns {Promise<unknown>}
|
|
49
|
-
*/
|
|
50
|
-
pause(flag?: boolean): Promise<unknown>;
|
|
51
|
-
/**
|
|
52
|
-
* @description 静音
|
|
53
|
-
* @param {boolean} flag
|
|
54
|
-
*/
|
|
55
|
-
mute(flag: boolean): void;
|
|
56
|
-
/**
|
|
57
|
-
* @description 重置尺寸
|
|
58
|
-
*/
|
|
59
|
-
resize(): void;
|
|
60
|
-
_onlyMseOrWcsVideo(): any;
|
|
61
|
-
/**
|
|
62
|
-
* 心跳检查
|
|
63
|
-
*/
|
|
64
|
-
checkHeart(): void;
|
|
65
|
-
/**
|
|
66
|
-
* @description 心跳检查,如果渲染间隔暂停了多少时间之后,就会抛出异常
|
|
67
|
-
*/
|
|
68
|
-
checkHeartTimeout(): void;
|
|
69
|
-
checkStatsInterval(): void;
|
|
70
|
-
clearCheckHeartTimeout(): void;
|
|
71
|
-
/**
|
|
72
|
-
* @description 检查等待时间 (loading 等待时间)
|
|
73
|
-
*/
|
|
74
|
-
checkLoadingTimeout(): void;
|
|
75
|
-
clearCheckLoadingTimeout(): void;
|
|
76
|
-
clearStatsInterval(): void;
|
|
77
|
-
handleRender(): void;
|
|
78
|
-
updateStats(options: any): void;
|
|
79
|
-
resetStats(): void;
|
|
80
|
-
enableWakeLock(): void;
|
|
81
|
-
releaseWakeLock(): void;
|
|
82
|
-
handlePlayToRenderTimes(): void;
|
|
83
|
-
getOption(): any;
|
|
84
|
-
emitError(errorType: any, message?: string): void;
|
|
85
|
-
}
|
|
86
|
-
import BasePlayer from '../base-player';
|
|
87
|
-
import Audio from '../../audio';
|
|
88
|
-
import DecoderWorker from '../../worker/index';
|
|
89
|
-
import Stream from '../../stream';
|
|
90
|
-
import Demux from '../../demux';
|
|
91
|
-
import NoSleep from '../../utils/noSleep';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export default class FetchLoader extends Emitter {
|
|
2
|
-
constructor(player: any);
|
|
3
|
-
player: any;
|
|
4
|
-
playing: boolean;
|
|
5
|
-
abortController: AbortController;
|
|
6
|
-
streamRate: (size: any) => void;
|
|
7
|
-
destroy(): void;
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @param url
|
|
11
|
-
* @param options
|
|
12
|
-
*/
|
|
13
|
-
fetchStream(url: any, options?: {}): void;
|
|
14
|
-
abort(): void;
|
|
15
|
-
}
|
|
16
|
-
import Emitter from '../utils/emitter';
|
package/types/stream/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export default class WebsocketLoader extends Emitter {
|
|
2
|
-
constructor(player: any);
|
|
3
|
-
player: any;
|
|
4
|
-
socket: WebSocket;
|
|
5
|
-
socketStatus: string;
|
|
6
|
-
wsUrl: any;
|
|
7
|
-
streamRate: (size: any) => void;
|
|
8
|
-
destroy(): void;
|
|
9
|
-
_createWebSocket(): void;
|
|
10
|
-
_handleMessage(message: any): void;
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* @param url
|
|
14
|
-
* @param options
|
|
15
|
-
*/
|
|
16
|
-
fetchStream(url: any, options: any): void;
|
|
17
|
-
}
|
|
18
|
-
import Emitter from '../utils/emitter';
|
package/types/typedefs.d.ts
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @description Flv 配置项
|
|
4
|
-
* @typedef FlvOptions
|
|
5
|
-
*
|
|
6
|
-
* @property {string | HTMLElement} container 渲染容器
|
|
7
|
-
* @property {string } id 渲染容器id 优先级比 container 高
|
|
8
|
-
* @property {number=} videoBuffer 设置最大缓冲时长,单位秒,播放器会自动消除延迟。
|
|
9
|
-
* @property {string=} decoder 解码库worker地址 默认 `decoder.js`, wasm 文件要和decoder在同一个文件夹中
|
|
10
|
-
* @property {string=} staticPath 静态资源的了路径
|
|
11
|
-
* @property {boolean=} hasAudio 是否有音频,如果设置false,则不对音频数据解码,提升性能。
|
|
12
|
-
* @property {(0 | 1 | 2)=} scaleMode 设置渲染模式, 默认 1, 取值 0 | 1 | 2。
|
|
13
|
-
* @property {boolean=} debug 是否开启控制台调试打印。默认 false
|
|
14
|
-
* @property {number=} timeout 设置超时时长, 单位秒, 在连接成功之前(loading)和播放中途(heart),如果超过设定时长无数据返回,则回调timeout事件。默认 10
|
|
15
|
-
* @property {number=} heartTimeout 设置超时时长, 单位秒, 播放中途,如果超过设定时长无数据返回,则回调timeout事件。默认 5
|
|
16
|
-
* @property {number=} heartTimeoutReplayTimes `heartTimeoutReplay` 重试次数。默认 3
|
|
17
|
-
* @property {number=} loadingTimeout 设置超时时长, 单位秒。默认 10
|
|
18
|
-
* @property {boolean=} loadingTimeoutReplay 是否开启loading超时之后自动再播放, 默认 true
|
|
19
|
-
* @property {boolean=} keepScreenOn 开启屏幕常亮,在手机浏览器上, canvas标签渲染视频并不会像video标签那样保持屏幕常。默认 false
|
|
20
|
-
* @property {boolean=} isNotMute 是否开启声音,默认是关闭声音播放的。默认 false
|
|
21
|
-
* @property {boolean=} useMSE 是否开启MediaSource硬解码。视频编码只支持H.264视频(Safari on iOS不支持)。默认 false
|
|
22
|
-
* @property {boolean=} autoWasm 在使用MSE或者Webcodecs 播放H265的时候,是否自动降级到wasm模式。默认 true
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @description 播放器的状态 (getState() api)
|
|
28
|
-
* @typedef PlayerState
|
|
29
|
-
*
|
|
30
|
-
* @property {boolean} playing 是否正在播放
|
|
31
|
-
* @property {boolean} mute 是否静音
|
|
32
|
-
* @property {boolean} fullscreen 是否全屏
|
|
33
|
-
* @property {boolean} webFullscreen 是否web全屏
|
|
34
|
-
* @property {boolean} loaded 是否加载完成
|
|
35
|
-
* @property {string} volume 音量
|
|
36
|
-
* @property {boolean} isDebug 是否打印日志
|
|
37
|
-
*/
|
|
38
|
-
export const Types: {};
|
|
39
|
-
export type FlvOptions = {
|
|
40
|
-
/**
|
|
41
|
-
* 渲染容器
|
|
42
|
-
*/
|
|
43
|
-
container: string | HTMLElement;
|
|
44
|
-
/**
|
|
45
|
-
* 渲染容器id 优先级比 container 高
|
|
46
|
-
*/
|
|
47
|
-
id: string;
|
|
48
|
-
/**
|
|
49
|
-
* 设置最大缓冲时长,单位秒,播放器会自动消除延迟。
|
|
50
|
-
*/
|
|
51
|
-
videoBuffer?: number | undefined;
|
|
52
|
-
/**
|
|
53
|
-
* 解码库worker地址 默认 `decoder.js`, wasm 文件要和decoder在同一个文件夹中
|
|
54
|
-
*/
|
|
55
|
-
decoder?: string | undefined;
|
|
56
|
-
/**
|
|
57
|
-
* 静态资源的了路径
|
|
58
|
-
*/
|
|
59
|
-
staticPath?: string | undefined;
|
|
60
|
-
/**
|
|
61
|
-
* 是否有音频,如果设置false,则不对音频数据解码,提升性能。
|
|
62
|
-
*/
|
|
63
|
-
hasAudio?: boolean | undefined;
|
|
64
|
-
/**
|
|
65
|
-
* 设置渲染模式, 默认 1, 取值 0 | 1 | 2。
|
|
66
|
-
*/
|
|
67
|
-
scaleMode?: (0 | 1 | 2) | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* 是否开启控制台调试打印。默认 false
|
|
70
|
-
*/
|
|
71
|
-
debug?: boolean | undefined;
|
|
72
|
-
/**
|
|
73
|
-
* 设置超时时长, 单位秒, 在连接成功之前(loading)和播放中途(heart),如果超过设定时长无数据返回,则回调timeout事件。默认 10
|
|
74
|
-
*/
|
|
75
|
-
timeout?: number | undefined;
|
|
76
|
-
/**
|
|
77
|
-
* 设置超时时长, 单位秒, 播放中途,如果超过设定时长无数据返回,则回调timeout事件。默认 5
|
|
78
|
-
*/
|
|
79
|
-
heartTimeout?: number | undefined;
|
|
80
|
-
/**
|
|
81
|
-
* `heartTimeoutReplay` 重试次数。默认 3
|
|
82
|
-
*/
|
|
83
|
-
heartTimeoutReplayTimes?: number | undefined;
|
|
84
|
-
/**
|
|
85
|
-
* 设置超时时长, 单位秒。默认 10
|
|
86
|
-
*/
|
|
87
|
-
loadingTimeout?: number | undefined;
|
|
88
|
-
/**
|
|
89
|
-
* 是否开启loading超时之后自动再播放, 默认 true
|
|
90
|
-
*/
|
|
91
|
-
loadingTimeoutReplay?: boolean | undefined;
|
|
92
|
-
/**
|
|
93
|
-
* 开启屏幕常亮,在手机浏览器上, canvas标签渲染视频并不会像video标签那样保持屏幕常。默认 false
|
|
94
|
-
*/
|
|
95
|
-
keepScreenOn?: boolean | undefined;
|
|
96
|
-
/**
|
|
97
|
-
* 是否开启声音,默认是关闭声音播放的。默认 false
|
|
98
|
-
*/
|
|
99
|
-
isNotMute?: boolean | undefined;
|
|
100
|
-
/**
|
|
101
|
-
* 是否开启MediaSource硬解码。视频编码只支持H.264视频(Safari on iOS不支持)。默认 false
|
|
102
|
-
*/
|
|
103
|
-
useMSE?: boolean | undefined;
|
|
104
|
-
/**
|
|
105
|
-
* 在使用MSE或者Webcodecs 播放H265的时候,是否自动降级到wasm模式。默认 true
|
|
106
|
-
*/
|
|
107
|
-
autoWasm?: boolean | undefined;
|
|
108
|
-
};
|
|
109
|
-
export type PlayerState = {
|
|
110
|
-
/**
|
|
111
|
-
* 是否正在播放
|
|
112
|
-
*/
|
|
113
|
-
playing: boolean;
|
|
114
|
-
/**
|
|
115
|
-
* 是否静音
|
|
116
|
-
*/
|
|
117
|
-
mute: boolean;
|
|
118
|
-
/**
|
|
119
|
-
* 是否全屏
|
|
120
|
-
*/
|
|
121
|
-
fullscreen: boolean;
|
|
122
|
-
/**
|
|
123
|
-
* 是否web全屏
|
|
124
|
-
*/
|
|
125
|
-
webFullscreen: boolean;
|
|
126
|
-
/**
|
|
127
|
-
* 是否加载完成
|
|
128
|
-
*/
|
|
129
|
-
loaded: boolean;
|
|
130
|
-
/**
|
|
131
|
-
* 音量
|
|
132
|
-
*/
|
|
133
|
-
volume: string;
|
|
134
|
-
/**
|
|
135
|
-
* 是否打印日志
|
|
136
|
-
*/
|
|
137
|
-
isDebug: boolean;
|
|
138
|
-
};
|
package/types/utils/debug.d.ts
DELETED
package/types/utils/emitter.d.ts
DELETED
package/types/utils/events.d.ts
DELETED