@ezuikit/player-theme 3.1.5-beta.4 → 3.1.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/dist/style.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
- * @ezuikit/player-theme v3.1.5-beta.4
3
- * Copyright (c) 2026-09-15 13:35:29 Ezviz-OpenBiz
2
+ * @ezuikit/player-theme v3.1.6
3
+ * Copyright (c) 2026-09-18 12:22:27 Ezviz-OpenBiz
4
4
  * Released under the MIT License.
5
5
  */
6
6
  require("./style.css");
@@ -1,6 +1,6 @@
1
1
  import EventEmitter from 'eventemitter3';
2
2
  import Picker from '@skax/picker';
3
- import I18n, { I18nTranslation } from '@ezuikit/utils-i18n';
3
+ import I18n, { TranslateVariables, I18nTranslation } from '@ezuikit/utils-i18n';
4
4
  import { LoggerCls, LoggerOptions } from '@ezuikit/utils-logger';
5
5
  import { BasePtzOptions } from '@ezuikit/control-ptz';
6
6
  import { RecListModalOptions } from '@ezuikit/control-rec-list-modal';
@@ -219,6 +219,10 @@ declare const EVENTS: {
219
219
  readonly dateChange: "Control.dateChange";
220
220
  /** 日期改变 */
221
221
  readonly dateMonthChange: "Control.dateMonthChange";
222
+ /** 日期面板展示的月份变化 */
223
+ readonly datePanelMonthChange: "Control.datePanelMonthChange";
224
+ /** 日期面板展示的年份变化 */
225
+ readonly datePanelYearChange: "Control.datePanelYearChange";
222
226
  /** 日期销毁 */
223
227
  readonly dateDestroy: "Control.datePanelDestroy";
224
228
  /** 时间面板展示隐藏变换 */
@@ -1505,7 +1509,7 @@ declare class Theme extends EventEmitter {
1505
1509
  readonly fullscreen: "fullscreen";
1506
1510
  readonly exitFullscreen: "exitFullscreen";
1507
1511
  readonly fullscreenChange: "fullscreenChange";
1508
- readonly resize: "resize"; /** 所有控件列表, 所有控件名称规则(`${iconId}Control`), 如音量控件 this.controls["volumeControl"] @since 0.0.1 */
1512
+ readonly resize: "resize";
1509
1513
  readonly orientationChange: "orientationChange";
1510
1514
  readonly audioCodecUnsupported: "audioCodecUnsupported";
1511
1515
  readonly changeTheme: "changeTheme";
@@ -1524,12 +1528,11 @@ declare class Theme extends EventEmitter {
1524
1528
  readonly setLoggerOptions: "setLoggerOptions";
1525
1529
  readonly records: "records";
1526
1530
  readonly ptzSpeedChange: "ptzSpeedChange";
1527
- /** 回放底部时间轴 @since 0.0.1 @private */
1528
1531
  readonly setVideoLevelList: "setVideoLevelList";
1529
1532
  readonly currentVideoLevel: "currentVideoLevel";
1530
1533
  readonly currentVideoLevelAuto: "currentVideoLevelAuto";
1531
1534
  readonly setAllDayRecTimes: "setAllDayRecTimes";
1532
- readonly getOSDTime: "getOSDTime"; /** @since 0.0.1 @private */
1535
+ readonly getOSDTime: "getOSDTime"; /** 头部控件 @since 0.0.1 @private */
1533
1536
  readonly playbackEnd: "playbackEnd";
1534
1537
  readonly control: {
1535
1538
  readonly play: "Control.play";
@@ -1585,6 +1588,8 @@ declare class Theme extends EventEmitter {
1585
1588
  readonly datePanelOpenChange: "Control.datePanelOpenChange";
1586
1589
  readonly dateChange: "Control.dateChange";
1587
1590
  readonly dateMonthChange: "Control.dateMonthChange";
1591
+ readonly datePanelMonthChange: "Control.datePanelMonthChange";
1592
+ readonly datePanelYearChange: "Control.datePanelYearChange";
1588
1593
  readonly dateDestroy: "Control.datePanelDestroy";
1589
1594
  readonly timePanelOpenChange: "Control.timePanelOpenChange";
1590
1595
  readonly timeChange: "Control.timeChange";
@@ -1763,12 +1768,13 @@ declare class Theme extends EventEmitter {
1763
1768
  SPEED_CANCEL: string;
1764
1769
  GET_SPEED: string;
1765
1770
  MAX_SPEED_LIMIT: string;
1771
+ /** 版本号 @since 0.0.1 */
1766
1772
  MIN_SPEED_LIMIT: string;
1767
- SPEED_SWITCH_ERRROR: string;
1773
+ SPEED_SWITCH_ERRROR: string; /** 播放器配置项 */
1768
1774
  SPEED_SWITCH_NOT_SUPPORT: string;
1769
1775
  SEEK_CANNOT_CROSS_DAYS: string;
1770
1776
  SEEK_TIMEFORMAT_ERROR: string;
1771
- PAUSE: string;
1777
+ PAUSE: string; /** 多语言对象 https://www.npmjs.com/package/@ezuikit/utils-i18n @since 0.0.1 */
1772
1778
  PAUSE_FAILED: string;
1773
1779
  RESUME: string;
1774
1780
  RESUME_FAILED: string;
@@ -1777,7 +1783,7 @@ declare class Theme extends EventEmitter {
1777
1783
  NO_CLOUD_RECORD: string;
1778
1784
  CHANGE_VIDEO_LEVEL: string;
1779
1785
  CHANGE_VIDEO_LEVEL_FAIL: string;
1780
- GET_VIDEO_LEVEL_LIST: string; /** 消息提示控件 @since 0.0.1 @private */
1786
+ GET_VIDEO_LEVEL_LIST: string;
1781
1787
  PLEASE_INPUT_RIGHT_VIDEO_LEVEL: string;
1782
1788
  VIDEO_LEVEL_NOT_SUPPORT: string;
1783
1789
  VIDEO_LEVEL_AUTO: string;
@@ -1787,6 +1793,10 @@ declare class Theme extends EventEmitter {
1787
1793
  VIDEO_LEVEL_SUPER: string;
1788
1794
  VIDEO_LEVEL_EXTREME: string;
1789
1795
  VIDEO_LEVEL_3K: string;
1796
+ /**
1797
+ * @since 0.0.1
1798
+ * @private
1799
+ */
1790
1800
  VIDEO_LEVEL_4k: string;
1791
1801
  RESET_THEME: string;
1792
1802
  BTN_PLAY: string;
@@ -1807,10 +1817,7 @@ declare class Theme extends EventEmitter {
1807
1817
  BTN_ZOOM: string;
1808
1818
  BTN_3D_ZOOM: string;
1809
1819
  BTN_PTZ: string;
1810
- BTN_GLOBAL_FULLSCREEN: string; /**
1811
- * 移动端扩展容器, 扩展的控件渲染在指定容器以外, 仅只用端适用, 为了可以放置大的控件和方便开发接入
1812
- * @private
1813
- */
1820
+ BTN_GLOBAL_FULLSCREEN: string;
1814
1821
  BTN_EXIT_GLOBAL_FULLSCREEN: string;
1815
1822
  BTN_FULLSCREEN: string;
1816
1823
  BTN_EXIR_FULLSCREEN: string;
@@ -1834,10 +1841,9 @@ declare class Theme extends EventEmitter {
1834
1841
  RECORDS: string;
1835
1842
  OPEN_SOUND: string;
1836
1843
  CLOSE_SOUND: string;
1837
- SOUND_OPENED: string; /** 容器的宽 */
1844
+ SOUND_OPENED: string;
1838
1845
  ZOOM: string;
1839
1846
  START_ZOOM: string;
1840
- /** 容器的高 */
1841
1847
  CLOSE_ZOOM: string;
1842
1848
  ZOOM_ADD: string;
1843
1849
  ZOOM_SUB: string;
@@ -1847,7 +1853,7 @@ declare class Theme extends EventEmitter {
1847
1853
  ZOOM_LIMIT_MIN: string;
1848
1854
  ZOOM_NOT_ENABLED: string;
1849
1855
  '3D_ZOOM': string;
1850
- '3D_ZOOM_DISABLE': string;
1856
+ '3D_ZOOM_DISABLE': string; /** 屏幕旋转角度 0 | 90 | 180 | 270 */
1851
1857
  '3D_ZOOM_FAILED': string;
1852
1858
  START_3D_ZOOM: string;
1853
1859
  CLOSE_3D_ZOOM: string;
@@ -1862,25 +1868,18 @@ declare class Theme extends EventEmitter {
1862
1868
  WEB_FULLSCREEN: string;
1863
1869
  WEB_FULLSCREEN_EXIT: string;
1864
1870
  DESTROY: string;
1865
- /** 回放片段列表 */
1866
1871
  GET_CAPACITY: string;
1867
1872
  GET_PTZ_STATUS: string;
1868
1873
  GET_PTZ_STATUS_FAILED: string;
1869
1874
  MOBILE_HIDE_PTZ: string;
1870
1875
  OPTION_PTZ_FAILED: string;
1871
1876
  MOBILE_PTZ_TIPS: string;
1872
- PTZ_FAST: string; /** 窗口尺寸变化时,设置窗口超出隐藏,防止出现滚动条 */
1877
+ PTZ_FAST: string;
1873
1878
  PTZ_MID: string;
1874
1879
  PTZ_SLOW: string;
1875
1880
  PTZ_SPEED: string;
1876
1881
  DEVICE_ZOOM: string;
1877
- /**
1878
- * 录像回放的月份列表 @private
1879
- */
1880
1882
  DEVICE_FOCUS: string;
1881
- /**
1882
- * 录像回放的月份列表 @private
1883
- */
1884
1883
  NOT_SUPPORT_DEVICE_ZOOM: string;
1885
1884
  NOT_SUPPORT_FOCUS: string;
1886
1885
  MIRROR: string;
@@ -1894,13 +1893,19 @@ declare class Theme extends EventEmitter {
1894
1893
  GET_FEC_PARAMS: string;
1895
1894
  SET_FEC_PARAMS_FAILED: string;
1896
1895
  GET_FEC_PARAMS_FAILED: string;
1897
- GET_FEC_PARAMS_SUPPORT_VERSION: string;
1896
+ /**
1897
+ * 录像回放的月份列表 @private
1898
+ */
1899
+ GET_FEC_PARAMS_SUPPORT_VERSION: string; /**
1900
+ * 录像回放的月份列表 @private
1901
+ */
1898
1902
  SET_WATERMARK: string;
1899
- FETCH_THEME_FAILED: string;
1903
+ FETCH_THEME_FAILED: string; /** 清理 header/footer 动画 定时器 @private */
1900
1904
  cancel: string;
1901
1905
  ok: string;
1902
1906
  close: string;
1903
1907
  BTN_REC_LIST_TITLE: string;
1908
+ UNKOWN_ISSUE: string;
1904
1909
  };
1905
1910
  en: {
1906
1911
  391001: string;
@@ -1981,7 +1986,7 @@ declare class Theme extends EventEmitter {
1981
1986
  396506: string;
1982
1987
  396508: string;
1983
1988
  396509: string;
1984
- 396510: string; /** 静音 */
1989
+ 396510: string;
1985
1990
  396511: string;
1986
1991
  396512: string;
1987
1992
  396513: string;
@@ -1991,24 +1996,19 @@ declare class Theme extends EventEmitter {
1991
1996
  396517: string;
1992
1997
  396518: string;
1993
1998
  396519: string;
1994
- /**
1995
- * 录像回放的月份列表 @private
1996
- */
1997
1999
  396520: string;
1998
- /**
1999
- * 录像回放的月份列表 @private
2000
- */
2001
2000
  396700: string;
2002
- /**
2003
- * 录像回放的月份列表 @private
2004
- */
2005
2001
  396701: string;
2006
2002
  397001: string;
2007
2003
  397002: string;
2008
2004
  397003: string;
2009
2005
  397004: string;
2010
2006
  397005: string;
2011
- 397006: string;
2007
+ 397006: string; /**
2008
+ * 首帧同步 Live/RecDropdown 激活态的监听器引用。
2009
+ * 每次 `_renderTheme` 重新绑定前需先移除旧引用,避免 changeTheme 累积监听。
2010
+ * @private
2011
+ */
2012
2012
  397007: string;
2013
2013
  399000: string;
2014
2014
  399001: string;
@@ -2107,6 +2107,12 @@ declare class Theme extends EventEmitter {
2107
2107
  BTN_ZOOM: string;
2108
2108
  BTN_3D_ZOOM: string;
2109
2109
  BTN_PTZ: string;
2110
+ /**
2111
+ * 当前播放状态
2112
+ * ```ts
2113
+ * theme.playing // boolean
2114
+ * ```
2115
+ */
2110
2116
  BTN_GLOBAL_FULLSCREEN: string;
2111
2117
  BTN_EXIT_GLOBAL_FULLSCREEN: string;
2112
2118
  BTN_FULLSCREEN: string;
@@ -2166,9 +2172,7 @@ declare class Theme extends EventEmitter {
2166
2172
  MOBILE_HIDE_PTZ: string;
2167
2173
  OPTION_PTZ_FAILED: string;
2168
2174
  MOBILE_PTZ_TIPS: string;
2169
- PTZ_FAST: string; /**
2170
- * 是否在缩放中
2171
- */
2175
+ PTZ_FAST: string;
2172
2176
  PTZ_MID: string;
2173
2177
  PTZ_SLOW: string;
2174
2178
  PTZ_SPEED: string;
@@ -2194,6 +2198,7 @@ declare class Theme extends EventEmitter {
2194
2198
  ok: string;
2195
2199
  close: string;
2196
2200
  BTN_REC_LIST_TITLE: string;
2201
+ UNKOWN_ISSUE: string;
2197
2202
  };
2198
2203
  };
2199
2204
  /** 版本号 @since 0.0.1 */
@@ -2281,6 +2286,8 @@ declare class Theme extends EventEmitter {
2281
2286
  private _volume;
2282
2287
  /** 静音 */
2283
2288
  private _muted;
2289
+ /** 正在兜底的原始 scope,非 null 表示处于兜底取值中(用于避免 customizeMissing 无限递归) */
2290
+ private _missingScope;
2284
2291
  /** 电子放大倍数 @private */
2285
2292
  _zoom: number;
2286
2293
  /** 放大中 true: 可缩放状态,false: 禁止缩放状态(不能缩放) @private */
@@ -2622,6 +2629,37 @@ declare class Theme extends EventEmitter {
2622
2629
  * @param {0 | 1 | 2} scaleMode - 缩放模式, 0: 窗口铺满, 1: 等比缩放大边铺满, 2: 等比缩放小边铺满
2623
2630
  */
2624
2631
  setScaleMode(scaleMode: ThemeOptions['scaleMode']): void;
2632
+ /**
2633
+ * 获取多语言文案
2634
+ *
2635
+ * 相比直接用 `theme.i18n.t()`:返回类型收窄为 `string`(底层签名是 `string | number`,
2636
+ * 调用处不必再写 `as string`)。缺失 key 的兜底由 i18n 实例上的 `customizeMissing`
2637
+ * 统一处理,因此两者在兜底行为上一致。
2638
+ * @param scope 多语言 key
2639
+ * @param variables 插值变量,如 `{ zoom: 8 }`;传 `defaultvalue` 可指定自己的兜底文案
2640
+ * @returns 文案;scope 不存在时返回「未知问题 【scope】」
2641
+ * @example
2642
+ * ```ts
2643
+ * theme.t('ZOOM_LIMIT_MAX', { zoom: 8 });
2644
+ * theme.t('NOT_EXIST_KEY'); // 未知问题 【NOT_EXIST_KEY】
2645
+ * theme.t('NOT_EXIST_KEY', { defaultvalue: '自定义兜底' }); // 自定义兜底
2646
+ * ```
2647
+ */
2648
+ t(scope: string | number, variables?: TranslateVariables): string;
2649
+ /**
2650
+ * 语言包缺 key 时的兜底文案(`customizeMissing` 的实现)
2651
+ *
2652
+ * 注意底层是把本方法的返回值「原样返回」、不再做插值,所以这里借
2653
+ * `i18n.t(UNKOWN_ISSUE)` 完成插值。而这一次取值本身也可能缺失
2654
+ * (如 `language` 传了不存在的语言,当前语言包整体不存在),
2655
+ * 那会再次回调到这里造成无限递归,因此用重入标记兜住,退化为直接返回原始 scope。
2656
+ *
2657
+ * 注:`options.locales` 与内置语言包是深合并,无法移除内置的 UNKOWN_ISSUE,
2658
+ * 因此正常配置下不会走到退化分支。
2659
+ * @param scope 缺失的多语言 key
2660
+ * @param variables 原始插值变量
2661
+ */
2662
+ private _missingText;
2625
2663
  /**
2626
2664
  * 销毁包括事件、控件 ...
2627
2665
  *
@@ -3214,6 +3252,10 @@ interface ThemeEventMap {
3214
3252
  'Control.datePanelOpenChange': (open: boolean, date: Date) => void;
3215
3253
  'Control.dateChange': (date: Date) => void;
3216
3254
  'Control.dateMonthChange': (dates: string[]) => void;
3255
+ /** 日历面板展示的月份变化,`month` 格式 `YYYY-MM` */
3256
+ 'Control.datePanelMonthChange': (date: Date, month: string) => void;
3257
+ /** 日历面板展示的年份变化,`year` 格式 `YYYY` */
3258
+ 'Control.datePanelYearChange': (date: Date, year: string) => void;
3217
3259
  /** 日历控件销毁(注意其字符串值为 `Control.datePanelDestroy`) */
3218
3260
  'Control.datePanelDestroy': () => void;
3219
3261
  'Control.timePanelOpenChange': (open: boolean, time: string) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ezuikit/player-theme",
3
- "version": "3.1.5-beta.4",
3
+ "version": "3.1.6",
4
4
  "description": "player theme",
5
5
  "title": "theme",
6
6
  "main": "dist/index.cjs",
@@ -34,15 +34,15 @@
34
34
  "author": "Ezviz-OpenBiz",
35
35
  "license": "MIT",
36
36
  "dependencies": {
37
- "@ezuikit/utils-i18n": "^2.0.1",
38
- "@ezuikit/utils-logger": "^2.0.1",
39
- "@ezuikit/utils-tools": "^2.0.7",
40
37
  "@ezuikit/control-date-picker": "2.1.2-beta.1",
41
- "@ezuikit/control-time-line": "2.1.0",
42
38
  "@ezuikit/control-ptz": "1.0.0",
43
39
  "@ezuikit/control-rec-list-modal": "0.0.2",
44
40
  "@ezuikit/control-segment-progress": "0.0.1",
41
+ "@ezuikit/control-time-line": "2.1.0",
45
42
  "@ezuikit/control-zoom": "1.0.0-beta.4",
43
+ "@ezuikit/utils-i18n": "^2.0.1",
44
+ "@ezuikit/utils-logger": "^2.1.0",
45
+ "@ezuikit/utils-tools": "^2.0.7",
46
46
  "@juggle/resize-observer": "^3.4.0",
47
47
  "@skax/delegate": "4.0.2",
48
48
  "@skax/picker": "1.1.8",