@ezuikit/player-theme 3.1.0-beta.5 → 3.1.1-beta.2
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/constant.js +2 -2
- package/dist/index.cjs +171 -80
- package/dist/index.esm.js +171 -80
- package/dist/index.umd.js +210 -184
- package/dist/style.js +2 -2
- package/dist/types/index.d.ts +76 -41
- package/package.json +12 -15
package/dist/style.js
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -293,6 +293,7 @@ interface ControlOptions {
|
|
|
293
293
|
* 所有语言数据
|
|
294
294
|
*/
|
|
295
295
|
locales?: Record<string, Record<string | number, string | number>>;
|
|
296
|
+
/** 点击控件时的回调 */
|
|
296
297
|
onClick?: (e: Event) => void;
|
|
297
298
|
/**
|
|
298
299
|
* ----- 播放器状态 -------
|
|
@@ -499,6 +500,11 @@ declare class Message extends Control {
|
|
|
499
500
|
* @param {number} duration 认自动关闭延时,单位秒, 默认 2s后 关闭, 需手动 调用 hide()
|
|
500
501
|
*/
|
|
501
502
|
warn(msg: string, duration?: number): void;
|
|
503
|
+
/**
|
|
504
|
+
* toast 错误消息(渲染在 rootContainer 上的浮层)
|
|
505
|
+
* @param {string} msg 消息内容
|
|
506
|
+
* @param {number} duration 自动关闭延时,单位秒, 默认 2s 后关闭
|
|
507
|
+
*/
|
|
502
508
|
toastError(msg: string, duration?: number): void;
|
|
503
509
|
/**
|
|
504
510
|
* error 错误消息, 内容默认字体红色
|
|
@@ -531,10 +537,15 @@ declare class Message extends Control {
|
|
|
531
537
|
interface ComponentOptions {
|
|
532
538
|
/** 挂载节点 player id, 默认挂载 body 上 */
|
|
533
539
|
getPopupContainer?: () => HTMLElement;
|
|
540
|
+
/** 自定义类名 */
|
|
534
541
|
className?: string;
|
|
542
|
+
/** 文字/图标默认颜色(兼容老版本和平台配置) */
|
|
535
543
|
color?: string;
|
|
544
|
+
/** 文字/图标激活态颜色(兼容老版本和平台配置) */
|
|
536
545
|
activeColor?: string;
|
|
546
|
+
/** 背景色,支持 Hex / rgb / rgba,会自动转换为渐变背景(兼容老版本和平台配置) */
|
|
537
547
|
backgroundColor?: string;
|
|
548
|
+
/** 组件类型, header 或 footer */
|
|
538
549
|
cType: 'header' | 'footer';
|
|
539
550
|
}
|
|
540
551
|
/**
|
|
@@ -555,7 +566,7 @@ declare class Component {
|
|
|
555
566
|
}
|
|
556
567
|
|
|
557
568
|
/**
|
|
558
|
-
*
|
|
569
|
+
* Footer options
|
|
559
570
|
*/
|
|
560
571
|
type FooterOptions = ComponentOptions;
|
|
561
572
|
declare class Footer extends Component {
|
|
@@ -808,7 +819,9 @@ declare class Volume extends Control {
|
|
|
808
819
|
private _volume;
|
|
809
820
|
/** 用来记录静音前的音量 */
|
|
810
821
|
private _lastVolume;
|
|
822
|
+
/** 音量调节弹出面板实例(移动端及 ezopen/ezhls 私有流下为 null) */
|
|
811
823
|
picker: Picker | null;
|
|
824
|
+
/** 音量进度条实例 @private */
|
|
812
825
|
_progress: Progress | null;
|
|
813
826
|
constructor(options?: VolumeOptions);
|
|
814
827
|
/**
|
|
@@ -931,6 +944,9 @@ declare class Fullscreen$1 {
|
|
|
931
944
|
private _fullscreenchange;
|
|
932
945
|
}
|
|
933
946
|
|
|
947
|
+
/**
|
|
948
|
+
* 全屏控件配置项
|
|
949
|
+
*/
|
|
934
950
|
interface FullscreenOptions extends Omit<ControlOptions, 'tagName'> {
|
|
935
951
|
/**
|
|
936
952
|
* 全屏改变
|
|
@@ -944,6 +960,7 @@ interface FullscreenOptions extends Omit<ControlOptions, 'tagName'> {
|
|
|
944
960
|
*/
|
|
945
961
|
declare class Fullscreen extends Control {
|
|
946
962
|
protected readonly options: FullscreenOptions;
|
|
963
|
+
/** 当前是否处于全屏状态 */
|
|
947
964
|
isCurrentFullscreen: boolean;
|
|
948
965
|
protected _fullscreenUtil: Fullscreen$1 | null;
|
|
949
966
|
protected readonly _$rootContainer: HTMLElement;
|
|
@@ -1483,12 +1500,10 @@ declare class Theme extends EventEmitter {
|
|
|
1483
1500
|
readonly changeTheme: "changeTheme";
|
|
1484
1501
|
readonly recTypeChange: "recTypeChange";
|
|
1485
1502
|
readonly definitionChange: "definitionChange";
|
|
1486
|
-
readonly speedChange: "speedChange";
|
|
1487
|
-
* @since 0.0.1
|
|
1488
|
-
* @private
|
|
1489
|
-
*/
|
|
1503
|
+
readonly speedChange: "speedChange";
|
|
1490
1504
|
readonly recordingChange: "recordingChange";
|
|
1491
1505
|
readonly talkingChange: "talkingChange";
|
|
1506
|
+
/** 封面控件 @since 0.0.1 @private */
|
|
1492
1507
|
readonly talkVolumeChange: "talkVolumeChange";
|
|
1493
1508
|
readonly broadcastChange: "broadcastChange";
|
|
1494
1509
|
readonly aichatChange: "aichatChange";
|
|
@@ -1508,7 +1523,6 @@ declare class Theme extends EventEmitter {
|
|
|
1508
1523
|
readonly play: "Control.play";
|
|
1509
1524
|
readonly playDestroy: "Control.playDestroy";
|
|
1510
1525
|
readonly capturePicture: "Control.capturePicture";
|
|
1511
|
-
/** 清除屏幕旋转 */
|
|
1512
1526
|
readonly capturePictureResult: "Control.capturePictureResult";
|
|
1513
1527
|
readonly capturePictureDestroy: "Control.capturePictureDestroy";
|
|
1514
1528
|
readonly volumechange: "Control.volumechange";
|
|
@@ -1521,12 +1535,12 @@ declare class Theme extends EventEmitter {
|
|
|
1521
1535
|
readonly footerMorePanelOpenChange: "Control.footerMorePanelOpenChange";
|
|
1522
1536
|
readonly deviceDestroy: "Control.deviceDestroy";
|
|
1523
1537
|
readonly recTypeChange: "Control.recTypeChange";
|
|
1524
|
-
/**
|
|
1525
|
-
* 录像回放的月份列表 @private
|
|
1526
|
-
*/
|
|
1527
1538
|
readonly recDestroy: "Control.recDestroy";
|
|
1528
1539
|
readonly definitionChange: "Control.definitionChange";
|
|
1529
1540
|
readonly definitionList: "Control.definitionList";
|
|
1541
|
+
/**
|
|
1542
|
+
* 录像回放的月份列表 @private
|
|
1543
|
+
*/
|
|
1530
1544
|
readonly definitionPanelOpenChange: "Control.definitionPanelOpenChange";
|
|
1531
1545
|
readonly definitionDestroy: "Control.definitionDestroy";
|
|
1532
1546
|
readonly speedChange: "Control.speedChange";
|
|
@@ -1736,14 +1750,14 @@ declare class Theme extends EventEmitter {
|
|
|
1736
1750
|
SET_POSTER: string;
|
|
1737
1751
|
RESIZE: string;
|
|
1738
1752
|
SPEED: string;
|
|
1739
|
-
SPEED_RATE: string;
|
|
1753
|
+
SPEED_RATE: string; /** 多语言对象 https://www.npmjs.com/package/@ezuikit/utils-i18n @since 0.0.1 */
|
|
1740
1754
|
SPEED_CANCEL: string;
|
|
1741
1755
|
GET_SPEED: string;
|
|
1742
1756
|
MAX_SPEED_LIMIT: string;
|
|
1743
1757
|
MIN_SPEED_LIMIT: string;
|
|
1744
1758
|
SEEK_CANNOT_CROSS_DAYS: string;
|
|
1745
1759
|
SEEK_TIMEFORMAT_ERROR: string;
|
|
1746
|
-
PAUSE: string;
|
|
1760
|
+
PAUSE: string;
|
|
1747
1761
|
PAUSE_FAILED: string;
|
|
1748
1762
|
RESUME: string;
|
|
1749
1763
|
RESUME_FAILED: string;
|
|
@@ -1757,6 +1771,12 @@ declare class Theme extends EventEmitter {
|
|
|
1757
1771
|
VIDEO_LEVEL_NOT_SUPPORT: string;
|
|
1758
1772
|
VIDEO_LEVEL_AUTO: string;
|
|
1759
1773
|
VIDEO_LEVEL_FLUENT: string;
|
|
1774
|
+
/**
|
|
1775
|
+
* @type { "rec" | "cloudRec" | "cloudRecord" } recType 回放类型
|
|
1776
|
+
* ```ts
|
|
1777
|
+
* theme.recType // 回放类型
|
|
1778
|
+
* ```
|
|
1779
|
+
*/
|
|
1760
1780
|
VIDEO_LEVEL_STANDARD: string;
|
|
1761
1781
|
VIDEO_LEVEL_HEIGH: string;
|
|
1762
1782
|
VIDEO_LEVEL_SUPER: string;
|
|
@@ -1792,15 +1812,15 @@ declare class Theme extends EventEmitter {
|
|
|
1792
1812
|
BTN_CLOUDRECORD: string;
|
|
1793
1813
|
BTN_REC: string;
|
|
1794
1814
|
BTN_CALENDAR: string;
|
|
1795
|
-
/** resizeObserver 监听销毁 */
|
|
1796
1815
|
BTN_TIME: string;
|
|
1797
1816
|
BTN_MORE: string;
|
|
1798
1817
|
DEVICE_NAME: string;
|
|
1799
|
-
DEVICE_ID: string;
|
|
1818
|
+
DEVICE_ID: string; /** 清除屏幕旋转 */
|
|
1800
1819
|
CAPTURE_SUCCESS: string;
|
|
1801
1820
|
CAPTURE_FAILED: string;
|
|
1802
1821
|
START_RECORD_SUCCESS: string;
|
|
1803
|
-
|
|
1822
|
+
/** resizeObserver 监听销毁 */
|
|
1823
|
+
START_RECORD_FAILED: string;
|
|
1804
1824
|
STOP_RECORD_SUCCESS: string;
|
|
1805
1825
|
STOP_RECORD_FAILED: string;
|
|
1806
1826
|
RECORD_TIPS: string;
|
|
@@ -1821,7 +1841,7 @@ declare class Theme extends EventEmitter {
|
|
|
1821
1841
|
'3D_ZOOM': string;
|
|
1822
1842
|
'3D_ZOOM_DISABLE': string;
|
|
1823
1843
|
'3D_ZOOM_FAILED': string;
|
|
1824
|
-
START_3D_ZOOM: string;
|
|
1844
|
+
START_3D_ZOOM: string;
|
|
1825
1845
|
CLOSE_3D_ZOOM: string;
|
|
1826
1846
|
DEVICE_NOT_SUPPORT_3D_ZOOM: string;
|
|
1827
1847
|
'3D_ZOOM_ACTIVED': string;
|
|
@@ -1831,29 +1851,26 @@ declare class Theme extends EventEmitter {
|
|
|
1831
1851
|
FULLSCREEN: string;
|
|
1832
1852
|
FULLSCREEN_EXIT: string;
|
|
1833
1853
|
GET_WEB_FULLSCREEN_STATUS: string;
|
|
1834
|
-
/**
|
|
1835
|
-
* 录像回放的月份列表 @private
|
|
1836
|
-
*/
|
|
1837
1854
|
WEB_FULLSCREEN: string;
|
|
1838
|
-
WEB_FULLSCREEN_EXIT: string;
|
|
1855
|
+
WEB_FULLSCREEN_EXIT: string; /** 窗口尺寸变化时,设置窗口超出隐藏,防止出现滚动条 */
|
|
1839
1856
|
DESTROY: string;
|
|
1840
1857
|
GET_CAPACITY: string;
|
|
1841
1858
|
GET_PTZ_STATUS: string;
|
|
1842
1859
|
GET_PTZ_STATUS_FAILED: string;
|
|
1843
|
-
/**
|
|
1844
|
-
* 录像回放的月份列表 @private
|
|
1845
|
-
*/
|
|
1846
1860
|
MOBILE_HIDE_PTZ: string;
|
|
1847
|
-
OPTION_PTZ_FAILED: string;
|
|
1861
|
+
OPTION_PTZ_FAILED: string;
|
|
1862
|
+
MOBILE_PTZ_TIPS: string;
|
|
1863
|
+
/**
|
|
1848
1864
|
* 录像回放的月份列表 @private
|
|
1849
1865
|
*/
|
|
1850
|
-
MOBILE_PTZ_TIPS: string;
|
|
1851
1866
|
PTZ_FAST: string;
|
|
1852
1867
|
PTZ_MID: string;
|
|
1853
1868
|
PTZ_SLOW: string;
|
|
1854
1869
|
PTZ_SPEED: string;
|
|
1855
1870
|
DEVICE_ZOOM: string;
|
|
1856
|
-
DEVICE_FOCUS: string; /**
|
|
1871
|
+
DEVICE_FOCUS: string; /**
|
|
1872
|
+
* 录像回放的月份列表 @private
|
|
1873
|
+
*/
|
|
1857
1874
|
NOT_SUPPORT_DEVICE_ZOOM: string;
|
|
1858
1875
|
NOT_SUPPORT_FOCUS: string;
|
|
1859
1876
|
MIRROR: string;
|
|
@@ -1935,8 +1952,12 @@ declare class Theme extends EventEmitter {
|
|
|
1935
1952
|
395702: string;
|
|
1936
1953
|
395703: string;
|
|
1937
1954
|
396001: string;
|
|
1938
|
-
396099: string;
|
|
1939
|
-
|
|
1955
|
+
396099: string; /**
|
|
1956
|
+
* 更多控件(footer more)
|
|
1957
|
+
* @since 0.0.1
|
|
1958
|
+
* @private
|
|
1959
|
+
*/
|
|
1960
|
+
396101: string;
|
|
1940
1961
|
396102: string;
|
|
1941
1962
|
396103: string;
|
|
1942
1963
|
396104: string;
|
|
@@ -1949,7 +1970,6 @@ declare class Theme extends EventEmitter {
|
|
|
1949
1970
|
396501: string;
|
|
1950
1971
|
396502: string;
|
|
1951
1972
|
396503: string;
|
|
1952
|
-
/** 是否播放中 @private */
|
|
1953
1973
|
396504: string;
|
|
1954
1974
|
396505: string;
|
|
1955
1975
|
396506: string;
|
|
@@ -1961,6 +1981,9 @@ declare class Theme extends EventEmitter {
|
|
|
1961
1981
|
396513: string;
|
|
1962
1982
|
396514: string;
|
|
1963
1983
|
396515: string;
|
|
1984
|
+
/**
|
|
1985
|
+
* 录像回放的月份列表 @private
|
|
1986
|
+
*/
|
|
1964
1987
|
396516: string;
|
|
1965
1988
|
396517: string;
|
|
1966
1989
|
396518: string;
|
|
@@ -2006,23 +2029,11 @@ declare class Theme extends EventEmitter {
|
|
|
2006
2029
|
LOADING: string;
|
|
2007
2030
|
TIMEFORMAT_ERROR: string;
|
|
2008
2031
|
USE_MULTITHREADING_WARING: string;
|
|
2009
|
-
/**
|
|
2010
|
-
* 容器的高(单位 px)
|
|
2011
|
-
* ```ts
|
|
2012
|
-
* theme.height // number
|
|
2013
|
-
* ```
|
|
2014
|
-
*/
|
|
2015
2032
|
OPEN_INSTRUCTIONS: string;
|
|
2016
2033
|
INIT_FINSHED: string;
|
|
2017
2034
|
INIT_SUCCESS: string;
|
|
2018
2035
|
GET_PLAYURL_FAILED: string;
|
|
2019
|
-
VIDEO_LOADING: string;
|
|
2020
|
-
* 播放状态
|
|
2021
|
-
* ```ts
|
|
2022
|
-
* // 事件监听
|
|
2023
|
-
* theme.on(Theme.EVENTS.play, (playing: boolean) => {})
|
|
2024
|
-
* ```
|
|
2025
|
-
*/
|
|
2036
|
+
VIDEO_LOADING: string;
|
|
2026
2037
|
DISCONNECT: string;
|
|
2027
2038
|
DEVICE_ENCRYPTED: string;
|
|
2028
2039
|
NO_RECORD: string;
|
|
@@ -2159,6 +2170,19 @@ declare class Theme extends EventEmitter {
|
|
|
2159
2170
|
SET_FEC_PARAMS: string;
|
|
2160
2171
|
GET_FEC_PARAMS: string;
|
|
2161
2172
|
SET_FEC_PARAMS_FAILED: string;
|
|
2173
|
+
/**
|
|
2174
|
+
* 对讲增益(音量), 仅 ezopen 支持
|
|
2175
|
+
*
|
|
2176
|
+
* {@link https://mdn.org.cn/en-US/docs/Web/API/Web_Audio_API/Using_Web_Audio_API}
|
|
2177
|
+
*
|
|
2178
|
+
* @since 0.0.1
|
|
2179
|
+
* @example
|
|
2180
|
+
* ```ts
|
|
2181
|
+
* theme.talkGain // 对讲音量
|
|
2182
|
+
* // 事件监听 event
|
|
2183
|
+
* theme.on(Theme.EVENTS.talk, (gain: number) => {})
|
|
2184
|
+
* ```
|
|
2185
|
+
*/
|
|
2162
2186
|
GET_FEC_PARAMS_FAILED: string;
|
|
2163
2187
|
GET_FEC_PARAMS_SUPPORT_VERSION: string;
|
|
2164
2188
|
SET_WATERMARK: string;
|
|
@@ -2664,6 +2688,7 @@ interface TimePickerControlOptions extends Omit<ControlOptions, 'tagName'>, Part
|
|
|
2664
2688
|
interface ThemeOptions {
|
|
2665
2689
|
/** 容器 @since 0.0.1 */
|
|
2666
2690
|
container: HTMLElement | (() => HTMLElement);
|
|
2691
|
+
/** 播放地址 */
|
|
2667
2692
|
url?: string;
|
|
2668
2693
|
/**
|
|
2669
2694
|
* 主题数据, 当值为 null 时不展示主题。
|
|
@@ -2792,8 +2817,11 @@ type ThemeRecType = 'rec' | 'cloudRec' | 'cloudRecord';
|
|
|
2792
2817
|
* 回放控件配置项
|
|
2793
2818
|
*/
|
|
2794
2819
|
interface RecOptions extends Omit<ControlOptions, 'tagName'> {
|
|
2820
|
+
/** 点击控件时的回调 */
|
|
2795
2821
|
onClick?: (e: Event) => void;
|
|
2822
|
+
/** 回放类型切换时的回调 */
|
|
2796
2823
|
onChange?: (type: ThemeRecType) => void;
|
|
2824
|
+
/** 默认回放类型, 默认 'rec' */
|
|
2797
2825
|
recType?: ThemeRecType;
|
|
2798
2826
|
}
|
|
2799
2827
|
/**
|
|
@@ -2805,7 +2833,14 @@ declare class Rec extends Control {
|
|
|
2805
2833
|
private _delegation;
|
|
2806
2834
|
private recType;
|
|
2807
2835
|
constructor(options: RecOptions);
|
|
2836
|
+
/**
|
|
2837
|
+
* 销毁
|
|
2838
|
+
*/
|
|
2808
2839
|
destroy(): void;
|
|
2840
|
+
/**
|
|
2841
|
+
* 添加回放类型图标
|
|
2842
|
+
* @param {string} id 回放类型 'rec' | 'cloudRec' | 'cloudRecord'
|
|
2843
|
+
*/
|
|
2809
2844
|
addRecType(id: string): void;
|
|
2810
2845
|
private _activeIcon;
|
|
2811
2846
|
private _onClickIcon;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ezuikit/player-theme",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.1-beta.2",
|
|
4
4
|
"description": "player theme",
|
|
5
5
|
"title": "theme",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -19,13 +19,6 @@
|
|
|
19
19
|
"./dist/constant.js": "./dist/constant.js",
|
|
20
20
|
"./dist/constant": "./dist/constant.js"
|
|
21
21
|
},
|
|
22
|
-
"scripts": {
|
|
23
|
-
"dev": "cross-env NODE_ENV=development rollup --config rollup.config.mjs --watch",
|
|
24
|
-
"build": "npm run clean && cross-env NODE_ENV=production rollup --config rollup.config.mjs",
|
|
25
|
-
"clean": "rimraf docs dist coverage",
|
|
26
|
-
"types": "tsc src/index.ts --emitDeclarationOnly --declaration --declarationDir dist/types --esModuleInterop",
|
|
27
|
-
"docs": "typedoc --tsconfig typedoc.config.js"
|
|
28
|
-
},
|
|
29
22
|
"files": [
|
|
30
23
|
"dist"
|
|
31
24
|
],
|
|
@@ -39,14 +32,14 @@
|
|
|
39
32
|
"author": "Ezviz-OpenBiz",
|
|
40
33
|
"license": "MIT",
|
|
41
34
|
"dependencies": {
|
|
42
|
-
"@ezuikit/utils-i18n": "2.0.1",
|
|
43
|
-
"@ezuikit/utils-logger": "2.0.1",
|
|
44
|
-
"@ezuikit/utils-tools": "2.0.
|
|
35
|
+
"@ezuikit/utils-i18n": "^2.0.1",
|
|
36
|
+
"@ezuikit/utils-logger": "^2.0.1",
|
|
37
|
+
"@ezuikit/utils-tools": "^2.0.5",
|
|
45
38
|
"@ezuikit/control-date-picker": "2.1.0-beta.1",
|
|
46
|
-
"@ezuikit/control-time-line": "2.1.0-beta.
|
|
47
|
-
"@ezuikit/control-ptz": "^1.0.0-beta.
|
|
48
|
-
"@ezuikit/control-rec-list-modal": "0.0.1-beta.
|
|
49
|
-
"@ezuikit/control-zoom": "^1.0.0-beta.
|
|
39
|
+
"@ezuikit/control-time-line": "2.1.0-beta.9",
|
|
40
|
+
"@ezuikit/control-ptz": "^1.0.0-beta.6",
|
|
41
|
+
"@ezuikit/control-rec-list-modal": "0.0.1-beta.7",
|
|
42
|
+
"@ezuikit/control-zoom": "^1.0.0-beta.4",
|
|
50
43
|
"@juggle/resize-observer": "^3.4.0",
|
|
51
44
|
"@skax/delegate": "4.0.2",
|
|
52
45
|
"@skax/picker": "1.1.8",
|
|
@@ -54,6 +47,10 @@
|
|
|
54
47
|
"eventemitter3": "^5.0.1",
|
|
55
48
|
"screenfull": "5.2.0"
|
|
56
49
|
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public",
|
|
52
|
+
"registry": "https://registry.npmjs.org/"
|
|
53
|
+
},
|
|
57
54
|
"repository": {
|
|
58
55
|
"type": "git",
|
|
59
56
|
"url": "git+https://github.com/Ezviz-OpenBiz/EZUIKit-player-theme.git"
|