ezuikit-flv 1.0.3-beta.2 → 2.0.0
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/CHANGELOG.md +7 -0
- package/README.md +82 -6
- package/decoder.js +22 -3
- package/index.js +25 -6
- package/package.json +2 -2
- package/types/_eventEmitter.d.ts +10 -0
- package/types/audio/audioContextLoader.d.ts +37 -18
- package/types/audio/index.d.ts +2 -2
- package/types/constant/index.d.ts +278 -268
- package/types/control/index.d.ts +1 -1
- package/types/control/observer.d.ts +1 -1
- package/types/index.d.ts +142 -84
- package/types/locales/en_US.d.ts +116 -0
- package/types/locales/zh_CN.d.ts +116 -0
- package/types/player/base-player.d.ts +38 -30
- package/types/player/commonLoader.d.ts +18 -4
- package/types/player/events.d.ts +4 -1
- package/types/player/hard-player/index.d.ts +3 -4
- package/types/player/hard-player/videoLoader.d.ts +3 -1
- package/types/player/index.d.ts +2 -2
- package/types/player/interface.d.ts +12 -8
- package/types/player/observer.d.ts +1 -1
- package/types/player/property.d.ts +1 -1
- package/types/player/soft-player/canvasLoader.d.ts +9 -13
- package/types/player/soft-player/index.d.ts +26 -27
- package/types/services/api.d.ts +1 -0
- package/types/services/constant.d.ts +1 -0
- package/types/services/index.d.ts +6 -0
- package/types/stream/fetchLoader.d.ts +3 -3
- package/types/typedefs.d.ts +10 -40
- package/types/utils/container.d.ts +1 -0
- package/types/utils/debug.d.ts +6 -6
|
@@ -1,11 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
import Emitter from '../utils/emitter';
|
|
2
|
+
import type BasePlayer from './base-player';
|
|
3
|
+
interface VideoInfo {
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
encType?: string;
|
|
7
|
+
encTypeCode?: number;
|
|
8
|
+
}
|
|
9
|
+
export default class CommonLoader<T extends HTMLCanvasElement | HTMLVideoElement> extends Emitter {
|
|
2
10
|
init: boolean;
|
|
11
|
+
protected _isFullScreen: boolean;
|
|
12
|
+
_orientation: any;
|
|
13
|
+
videoInfo: VideoInfo;
|
|
14
|
+
player: any;
|
|
15
|
+
$videoElement: T;
|
|
16
|
+
constructor(player: BasePlayer);
|
|
3
17
|
resetInit(): void;
|
|
4
|
-
videoInfo: any;
|
|
5
18
|
destroy(): void;
|
|
6
|
-
updateVideoInfo(data:
|
|
19
|
+
updateVideoInfo(data: VideoInfo): void;
|
|
20
|
+
_flvToMp4Codec(audioCodec: string | number): string;
|
|
7
21
|
play(): void;
|
|
8
22
|
pause(): void;
|
|
9
23
|
clearView(): void;
|
|
10
24
|
}
|
|
11
|
-
|
|
25
|
+
export {};
|
package/types/player/events.d.ts
CHANGED
|
@@ -13,14 +13,13 @@ export default class HardPlayer extends BasePlayer {
|
|
|
13
13
|
video: Video;
|
|
14
14
|
events: Events;
|
|
15
15
|
_playing: boolean;
|
|
16
|
-
_lastVolume: number;
|
|
17
16
|
_loading: any;
|
|
18
17
|
_audioTimestamp: number;
|
|
19
18
|
_videoTimestamp: number;
|
|
20
19
|
_times: any;
|
|
21
20
|
$container: HTMLElement;
|
|
22
21
|
_opt: RequiredFlvOptions;
|
|
23
|
-
_checkHeartTimeout: number;
|
|
22
|
+
_checkHeartTimeout: number | null;
|
|
24
23
|
_stats: any;
|
|
25
24
|
control: Control;
|
|
26
25
|
width: number;
|
|
@@ -52,9 +51,10 @@ export default class HardPlayer extends BasePlayer {
|
|
|
52
51
|
get loaded(): boolean;
|
|
53
52
|
set playing(value: boolean);
|
|
54
53
|
get playing(): boolean;
|
|
54
|
+
get muted(): boolean;
|
|
55
|
+
set muted(muted: boolean);
|
|
55
56
|
get volume(): number;
|
|
56
57
|
set volume(value: number);
|
|
57
|
-
get lastVolume(): number;
|
|
58
58
|
set loading(value: any);
|
|
59
59
|
get loading(): any;
|
|
60
60
|
set audioTimestamp(value: number);
|
|
@@ -101,5 +101,4 @@ export default class HardPlayer extends BasePlayer {
|
|
|
101
101
|
_close(): Promise<unknown>;
|
|
102
102
|
pause(): Promise<unknown>;
|
|
103
103
|
resumeAudioAfterPause(): void;
|
|
104
|
-
mute(flag: boolean): void;
|
|
105
104
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import CommonLoader from '../commonLoader';
|
|
2
2
|
import { type ScreenshotFormat } from '../interface';
|
|
3
3
|
import type HardPlayer from '.';
|
|
4
|
-
export default class VideoLoader extends CommonLoader {
|
|
4
|
+
export default class VideoLoader extends CommonLoader<HTMLVideoElement> {
|
|
5
5
|
_delayPlay: boolean;
|
|
6
6
|
$canvasElement: HTMLCanvasElement;
|
|
7
7
|
canvasContext: CanvasRenderingContext2D | null;
|
|
@@ -10,6 +10,7 @@ export default class VideoLoader extends CommonLoader {
|
|
|
10
10
|
$videoElement: HTMLVideoElement;
|
|
11
11
|
player: HardPlayer;
|
|
12
12
|
$posterElement: HTMLImageElement;
|
|
13
|
+
_videoMuted: boolean;
|
|
13
14
|
constructor(player: HardPlayer);
|
|
14
15
|
destroy(): void;
|
|
15
16
|
fixChromeVideoFlashBug(): void;
|
|
@@ -26,4 +27,5 @@ export default class VideoLoader extends CommonLoader {
|
|
|
26
27
|
_resizeElement($Element: HTMLVideoElement | HTMLImageElement): void;
|
|
27
28
|
isPlaying(): boolean;
|
|
28
29
|
get currentTime(): number;
|
|
30
|
+
_enableSoundOnUserInteraction(): void;
|
|
29
31
|
}
|
package/types/player/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default class PlayerLoader {
|
|
2
|
-
static getLoaderFactory(useMSE: any): typeof
|
|
2
|
+
static getLoaderFactory(useMSE: any): typeof HardPlayer | typeof SoftPlayer;
|
|
3
3
|
constructor(container: any, options: any);
|
|
4
4
|
_opt: any;
|
|
5
5
|
}
|
|
6
|
-
import SoftPlayer from './soft-player';
|
|
7
6
|
import HardPlayer from './hard-player';
|
|
7
|
+
import SoftPlayer from './soft-player';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Debug from '../utils/debug';
|
|
2
|
+
import { type IThemeData } from '@ezviz/player-theme';
|
|
2
3
|
export type TFlvOptions = {
|
|
3
4
|
container: string | HTMLElement;
|
|
4
5
|
videoBuffer: number;
|
|
@@ -12,14 +13,22 @@ export type TFlvOptions = {
|
|
|
12
13
|
loadingTimeoutDelay: number;
|
|
13
14
|
loadingTimeoutReplayTimes: number;
|
|
14
15
|
keepScreenOn: boolean;
|
|
15
|
-
|
|
16
|
+
muted: boolean;
|
|
16
17
|
useMSE: boolean;
|
|
17
|
-
autoWasm: boolean;
|
|
18
18
|
wasmDecodeErrorReplay: boolean;
|
|
19
|
-
useWebFullScreen: boolean;
|
|
20
19
|
width: number;
|
|
21
20
|
height: number;
|
|
22
21
|
isLive: boolean;
|
|
22
|
+
autoPlay: boolean;
|
|
23
|
+
heartTimeout?: number;
|
|
24
|
+
/**
|
|
25
|
+
* 控件配置项, 仅支持 play sound webExpend expend
|
|
26
|
+
*
|
|
27
|
+
* 当设置为 null 不展示控件
|
|
28
|
+
* {@link https://github.com/Ezviz-OpenBiz/EZUIKit-JavaScript-npm/blob/master/themeData.md}
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
themeData?: IThemeData;
|
|
23
32
|
};
|
|
24
33
|
export type RequiredFlvOptions = Required<TFlvOptions> & {
|
|
25
34
|
url: string;
|
|
@@ -73,11 +82,6 @@ export interface PlayerInterface {
|
|
|
73
82
|
* @description 暂停
|
|
74
83
|
*/
|
|
75
84
|
pause(flag?: boolean): Promise<unknown>;
|
|
76
|
-
/**
|
|
77
|
-
* @description 静音
|
|
78
|
-
* @param flag
|
|
79
|
-
*/
|
|
80
|
-
mute(flag?: boolean): void;
|
|
81
85
|
/**
|
|
82
86
|
* @description resize
|
|
83
87
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare const _default: (player: any) => void;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare const _default: (player: any) => void;
|
|
2
2
|
export default _default;
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
context2D: CanvasRenderingContext2D;
|
|
1
|
+
import type SoftPlayer from '.';
|
|
2
|
+
import CommonLoader from '../commonLoader';
|
|
3
|
+
export default class CanvasVideoLoader extends CommonLoader<HTMLCanvasElement> {
|
|
4
|
+
context2D: CanvasRenderingContext2D | null;
|
|
6
5
|
contextGl: any;
|
|
7
6
|
contextGlRender: (w: any, h: any, y: any, u: any, v: any) => void;
|
|
8
7
|
contextGlDestroy: () => void;
|
|
9
|
-
bitmaprenderer: ImageBitmapRenderingContext;
|
|
8
|
+
bitmaprenderer: ImageBitmapRenderingContext | null;
|
|
10
9
|
renderType: string;
|
|
11
|
-
videoInfo: {
|
|
12
|
-
width: string;
|
|
13
|
-
height: string;
|
|
14
|
-
encType: string;
|
|
15
|
-
};
|
|
16
10
|
_currentTime: number;
|
|
17
11
|
_contextmenuEvent: (e: any) => void;
|
|
12
|
+
constructor(player: SoftPlayer);
|
|
13
|
+
destroy(): void;
|
|
18
14
|
_initContextGl(): void;
|
|
19
15
|
_initContext2D(): void;
|
|
20
16
|
_initCanvasRender(): void;
|
|
@@ -22,11 +18,11 @@ export default class CanvasVideoLoader extends CommonLoader {
|
|
|
22
18
|
_bindOffscreen(): void;
|
|
23
19
|
initCanvasViewSize(): void;
|
|
24
20
|
render(msg: any): void;
|
|
25
|
-
screenshot(filename:
|
|
21
|
+
screenshot(filename: string, format: string, quality: number, type: string): string | File;
|
|
22
|
+
clearView(): void;
|
|
26
23
|
resize(): void;
|
|
27
24
|
/**
|
|
28
25
|
* 当前播放pts (单位秒)
|
|
29
26
|
*/
|
|
30
27
|
get currentTime(): number;
|
|
31
28
|
}
|
|
32
|
-
import CommonLoader from '../commonLoader';
|
|
@@ -1,25 +1,36 @@
|
|
|
1
|
+
import Audio from '../../audio';
|
|
2
|
+
import type FetchLoader from '../../stream/fetchLoader';
|
|
3
|
+
import DecoderWorker from '../../worker/index';
|
|
4
|
+
import Demux from '../../demux';
|
|
5
|
+
import NoSleep from '../../utils/noSleep';
|
|
6
|
+
import BasePlayer from '../base-player';
|
|
1
7
|
/**
|
|
2
8
|
* @description 软解
|
|
3
9
|
*/
|
|
4
10
|
export default class SoftPlayer extends BasePlayer {
|
|
5
|
-
|
|
6
|
-
_loadingTimeoutDelayTimer: any;
|
|
11
|
+
_loadingTimeoutDelayTimer: null;
|
|
7
12
|
audio: Audio;
|
|
8
13
|
decoderWorker: DecoderWorker;
|
|
9
|
-
stream:
|
|
14
|
+
stream: FetchLoader;
|
|
10
15
|
demux: Demux;
|
|
11
|
-
_lastVolume: number;
|
|
12
16
|
keepScreenOn: NoSleep;
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
_checkLoadingTimeout: number | null;
|
|
18
|
+
_checkHeartTimeout: number | null;
|
|
19
|
+
constructor(container: Element, options: any);
|
|
15
20
|
destroy(): void;
|
|
16
21
|
set loaded(value: boolean);
|
|
17
22
|
get loaded(): boolean;
|
|
18
23
|
set playing(value: boolean);
|
|
19
24
|
get playing(): boolean;
|
|
25
|
+
get muted(): any;
|
|
26
|
+
/**
|
|
27
|
+
* 静音
|
|
28
|
+
*/
|
|
29
|
+
set muted(muted: any);
|
|
30
|
+
get volume(): any;
|
|
31
|
+
set volume(value: any);
|
|
20
32
|
set loading(value: boolean);
|
|
21
33
|
get loading(): boolean;
|
|
22
|
-
get lastVolume(): number;
|
|
23
34
|
set audioTimestamp(value: number);
|
|
24
35
|
get audioTimestamp(): number;
|
|
25
36
|
set videoTimestamp(value: number);
|
|
@@ -29,31 +40,25 @@ export default class SoftPlayer extends BasePlayer {
|
|
|
29
40
|
*
|
|
30
41
|
* @returns {Promise<unknown>}
|
|
31
42
|
*/
|
|
32
|
-
_init(): Promise<
|
|
43
|
+
_init(): Promise<void>;
|
|
33
44
|
/**
|
|
34
45
|
*
|
|
35
46
|
* @param url
|
|
36
47
|
* @returns {Promise<unknown>}
|
|
37
48
|
*/
|
|
38
|
-
play(options: any): Promise<
|
|
49
|
+
play(options: any): Promise<void>;
|
|
39
50
|
/**
|
|
40
51
|
*
|
|
41
52
|
*/
|
|
42
|
-
close(): Promise<
|
|
53
|
+
close(): Promise<void>;
|
|
43
54
|
_resumeAudioAfterPause(): void;
|
|
44
|
-
_close(): Promise<
|
|
55
|
+
_close(): Promise<void>;
|
|
45
56
|
/**
|
|
46
57
|
*
|
|
47
58
|
* @param flag {boolean} 是否清除画面
|
|
48
59
|
* @returns {Promise<unknown>}
|
|
49
60
|
*/
|
|
50
|
-
pause(flag?: boolean): Promise<
|
|
51
|
-
/**
|
|
52
|
-
* @description 静音
|
|
53
|
-
* @param {boolean} flag
|
|
54
|
-
*/
|
|
55
|
-
mute(flag: boolean): void;
|
|
56
|
-
_onlyMseOrWcsVideo(): any;
|
|
61
|
+
pause(flag?: boolean): Promise<void>;
|
|
57
62
|
/**
|
|
58
63
|
* 心跳检查
|
|
59
64
|
*/
|
|
@@ -68,24 +73,18 @@ export default class SoftPlayer extends BasePlayer {
|
|
|
68
73
|
* @description 检查等待时间 (loading 等待时间)
|
|
69
74
|
*/
|
|
70
75
|
checkLoadingTimeout(): void;
|
|
71
|
-
_checkLoadingTimeout: NodeJS.Timeout;
|
|
72
76
|
/**
|
|
73
77
|
* @description 清除加载超时
|
|
74
78
|
*/
|
|
75
79
|
clearCheckLoadingTimeout(): void;
|
|
76
80
|
clearStatsInterval(): void;
|
|
77
81
|
handleRender(): void;
|
|
78
|
-
updateStats(options
|
|
82
|
+
updateStats(options?: any): void;
|
|
79
83
|
resetStats(): void;
|
|
80
84
|
enableWakeLock(): void;
|
|
81
85
|
releaseWakeLock(): void;
|
|
82
86
|
handlePlayToRenderTimes(): void;
|
|
83
87
|
getOption(): any;
|
|
84
|
-
emitError(errorType:
|
|
88
|
+
emitError(errorType: string, message?: string): void;
|
|
89
|
+
_enableSoundOnUserInteraction(): void;
|
|
85
90
|
}
|
|
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';
|
package/types/services/api.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const HTTP_BASE_URL = "https://open.ys7.com";
|
|
@@ -169,4 +169,10 @@ declare class Services {
|
|
|
169
169
|
startTime: string;
|
|
170
170
|
stopTime: string;
|
|
171
171
|
}): Promise<string>;
|
|
172
|
+
/**
|
|
173
|
+
* 查询中断信息 (仅支持萤石直播间地址)
|
|
174
|
+
* @param {string} streamId - 直播间流ID
|
|
175
|
+
* @returns
|
|
176
|
+
*/
|
|
177
|
+
getStreamInterreputInfo(streamId: string): Promise<any>;
|
|
172
178
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import Emitter from '../utils/emitter';
|
|
1
2
|
export default class FetchLoader extends Emitter {
|
|
2
|
-
constructor(player: any);
|
|
3
3
|
player: any;
|
|
4
4
|
playing: boolean;
|
|
5
5
|
abortController: AbortController;
|
|
6
6
|
streamRate: (size: any) => void;
|
|
7
7
|
_streamSuccess: boolean;
|
|
8
|
+
constructor(player: any);
|
|
8
9
|
destroy(): void;
|
|
9
10
|
/**
|
|
10
11
|
*
|
|
11
12
|
* @param url
|
|
12
13
|
* @param options
|
|
13
14
|
*/
|
|
14
|
-
fetchStream(url:
|
|
15
|
+
fetchStream(url: string, options?: any): void;
|
|
15
16
|
abort(): void;
|
|
16
17
|
}
|
|
17
|
-
import Emitter from '../utils/emitter';
|
package/types/typedefs.d.ts
CHANGED
|
@@ -10,14 +10,16 @@
|
|
|
10
10
|
* @property {string=} staticPath 静态资源的了路径
|
|
11
11
|
* @property {boolean=} autoPlay 自动播放 默认false
|
|
12
12
|
* @property {boolean=} hasAudio 是否有音频,如果设置false,则不对音频数据解码,提升性能。
|
|
13
|
-
* @property {number=} volume 音量大小, 默认 0.
|
|
13
|
+
* @property {number=} volume 音量大小, 默认 0.8。
|
|
14
14
|
* @property {(0 | 1 | 2)=} scaleMode 设置渲染模式, 默认 1 等比缩放,最大边填充, 取值 0 | 1 | 2。
|
|
15
15
|
* @property {boolean=} debug 是否开启控制台调试打印。默认 false
|
|
16
|
+
* @property {number=} heartTimeout 设置心态超时时长, 单位秒。默认 5 , @2.0.0
|
|
17
|
+
* @property {number=} heartTimeoutReplayTimes 重试次数。默认 5, -1 不限次数 @2.0.0
|
|
16
18
|
* @property {number=} timeout 设置超时时长, 单位秒, 在连接成功之前(loading)和播放中途(heart),如果超过设定时长无数据返回,则回调timeout事件。默认 10
|
|
17
19
|
* @property {number=} loadingTimeoutDelay 请求失败, 延时重试时长,单位秒。默认 3
|
|
18
20
|
* @property {number=} loadingTimeoutReplayTimes 重试次数。默认 5, -1 不限次数
|
|
19
21
|
* @property {boolean=} keepScreenOn 开启屏幕常亮,在手机浏览器上, canvas标签渲染视频并不会像video标签那样保持屏幕常。默认 false
|
|
20
|
-
* @property {boolean=}
|
|
22
|
+
* @property {boolean=} muted 是否静音,默认是关闭声音播放的。默认 true
|
|
21
23
|
* @property {boolean=} useMSE 是否开启MediaSource硬解码。视频编码只支持H.264视频(Safari on iOS不支持)。默认 false
|
|
22
24
|
* @property {boolean=} autoWasm 在使用MSE或者Webcodecs 播放H265的时候,是否自动降级到wasm模式。默认 true
|
|
23
25
|
* @property {boolean=} isLive 是否是直播。默认 true @1.0.3
|
|
@@ -26,6 +28,7 @@
|
|
|
26
28
|
* @property {Object=} env 环境变量, @1.0.3
|
|
27
29
|
* @property {string=} env.domain 开放平台 api domain, @1.0.3
|
|
28
30
|
* @property {string=} timeZone 时区 默认 0, @1.0.3
|
|
31
|
+
* @property {object=} themeData 控件配置项 @2.0.0, 仅支持 play sound webExpend expend, 当设置为 null 不展示控件 {@link https://github.com/Ezviz-OpenBiz/EZUIKit-JavaScript-npm/blob/master/themeData.md}
|
|
29
32
|
*/
|
|
30
33
|
/**
|
|
31
34
|
*
|
|
@@ -35,7 +38,6 @@
|
|
|
35
38
|
* @property {boolean} playing 是否正在播放
|
|
36
39
|
* @property {boolean} mute 是否静音
|
|
37
40
|
* @property {boolean} fullscreen 是否全屏
|
|
38
|
-
* @property {boolean} webFullscreen 是否web全屏
|
|
39
41
|
* @property {boolean} loaded 是否加载完成
|
|
40
42
|
* @property {string} volume 音量
|
|
41
43
|
* @property {boolean} isDebug 是否打印日志
|
|
@@ -49,7 +51,7 @@
|
|
|
49
51
|
* @property {number} streamTypeIn 1: 主码流,2:子码流
|
|
50
52
|
* @property {string} name 清晰度名称
|
|
51
53
|
* @property {string} url 播放地址
|
|
52
|
-
* @property {
|
|
54
|
+
* @property {string=} type 用来判断是否是默认主子码流清晰度 (compatible)
|
|
53
55
|
*/
|
|
54
56
|
export const Types: {};
|
|
55
57
|
export type FlvOptions = {
|
|
@@ -82,7 +84,7 @@ export type FlvOptions = {
|
|
|
82
84
|
*/
|
|
83
85
|
hasAudio?: boolean | undefined;
|
|
84
86
|
/**
|
|
85
|
-
* 音量大小, 默认 0.
|
|
87
|
+
* 音量大小, 默认 0.8。
|
|
86
88
|
*/
|
|
87
89
|
volume?: number | undefined;
|
|
88
90
|
/**
|
|
@@ -94,37 +96,9 @@ export type FlvOptions = {
|
|
|
94
96
|
*/
|
|
95
97
|
debug?: boolean | undefined;
|
|
96
98
|
/**
|
|
97
|
-
*
|
|
99
|
+
* 设置心态超时时长, 单位秒。默认 5 ,
|
|
98
100
|
*/
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* 请求失败, 延时重试时长,单位秒。默认 3
|
|
102
|
-
*/
|
|
103
|
-
loadingTimeoutDelay?: number | undefined;
|
|
104
|
-
/**
|
|
105
|
-
* 重试次数。默认 5, -1 不限次数
|
|
106
|
-
*/
|
|
107
|
-
loadingTimeoutReplayTimes?: number | undefined;
|
|
108
|
-
/**
|
|
109
|
-
* 开启屏幕常亮,在手机浏览器上, canvas标签渲染视频并不会像video标签那样保持屏幕常。默认 false
|
|
110
|
-
*/
|
|
111
|
-
keepScreenOn?: boolean | undefined;
|
|
112
|
-
/**
|
|
113
|
-
* 是否静音,默认是关闭声音播放的。默认 true
|
|
114
|
-
*/
|
|
115
|
-
isMute?: boolean | undefined;
|
|
116
|
-
/**
|
|
117
|
-
* 是否开启MediaSource硬解码。视频编码只支持H.264视频(Safari on iOS不支持)。默认 false
|
|
118
|
-
*/
|
|
119
|
-
useMSE?: boolean | undefined;
|
|
120
|
-
/**
|
|
121
|
-
* 在使用MSE或者Webcodecs 播放H265的时候,是否自动降级到wasm模式。默认 true
|
|
122
|
-
*/
|
|
123
|
-
autoWasm?: boolean | undefined;
|
|
124
|
-
/**
|
|
125
|
-
* 是否是直播。默认 true
|
|
126
|
-
*/
|
|
127
|
-
isLive?: boolean | undefined;
|
|
101
|
+
heartTimeout?: number | undefined;
|
|
128
102
|
};
|
|
129
103
|
export type PlayerState = {
|
|
130
104
|
/**
|
|
@@ -139,10 +113,6 @@ export type PlayerState = {
|
|
|
139
113
|
* 是否全屏
|
|
140
114
|
*/
|
|
141
115
|
fullscreen: boolean;
|
|
142
|
-
/**
|
|
143
|
-
* 是否web全屏
|
|
144
|
-
*/
|
|
145
|
-
webFullscreen: boolean;
|
|
146
116
|
/**
|
|
147
117
|
* 是否加载完成
|
|
148
118
|
*/
|
|
@@ -176,5 +146,5 @@ export type VideoLevel = {
|
|
|
176
146
|
/**
|
|
177
147
|
* 用来判断是否是默认主子码流清晰度 (compatible)
|
|
178
148
|
*/
|
|
179
|
-
type?:
|
|
149
|
+
type?: string | undefined;
|
|
180
150
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function getContainer(container: any): any;
|
package/types/utils/debug.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export default class Debug {
|
|
2
|
-
constructor(master: any);
|
|
3
2
|
master: any;
|
|
4
3
|
logger: any;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
constructor(master: any);
|
|
5
|
+
info(name: string, ...args: any[]): void;
|
|
6
|
+
log(name: string, ...args: any[]): void;
|
|
7
|
+
warn(name: string, ...args: any[]): void;
|
|
8
|
+
error(name: string, ...args: any[]): void;
|
|
9
|
+
_setLogger(): number;
|
|
10
10
|
}
|