@ezuikit/player-theme 3.1.6-beta.1 → 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/constant.js +2 -2
- package/dist/index.cjs +65 -7
- package/dist/index.esm.js +65 -7
- package/dist/index.umd.js +65 -7
- package/dist/style.js +2 -2
- package/dist/types/index.d.ts +70 -41
- package/package.json +5 -5
package/dist/constant.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @ezuikit/player-theme v3.1.6
|
|
3
|
-
* Copyright (c) 2026-09-
|
|
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
|
'use strict';
|
|
@@ -2968,7 +2968,8 @@ var zh = {
|
|
|
2968
2968
|
cancel: '取消',
|
|
2969
2969
|
ok: '确定',
|
|
2970
2970
|
close: '关闭',
|
|
2971
|
-
BTN_REC_LIST_TITLE: '录像片段'
|
|
2971
|
+
BTN_REC_LIST_TITLE: '录像片段',
|
|
2972
|
+
UNKOWN_ISSUE: '未知问题 【{{scope}}】'
|
|
2972
2973
|
};
|
|
2973
2974
|
|
|
2974
2975
|
// 不要出现多层的的数据, 数据铺平
|
|
@@ -3252,7 +3253,8 @@ var en = {
|
|
|
3252
3253
|
cancel: 'Cancel',
|
|
3253
3254
|
ok: 'Ok',
|
|
3254
3255
|
close: 'Close',
|
|
3255
|
-
BTN_REC_LIST_TITLE: 'Records'
|
|
3256
|
+
BTN_REC_LIST_TITLE: 'Records',
|
|
3257
|
+
UNKOWN_ISSUE: 'Unknown issue [{{scope}}]'
|
|
3256
3258
|
};
|
|
3257
3259
|
|
|
3258
3260
|
/**
|
|
@@ -10459,6 +10461,11 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
10459
10461
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
10460
10462
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
10461
10463
|
}
|
|
10464
|
+
/**
|
|
10465
|
+
* 语言包缺 key 时的兜底文案 key
|
|
10466
|
+
*
|
|
10467
|
+
* 拼写沿用语言包中既有的 `UNKOWN_ISSUE`(少了一个 N),改名属破坏性变更,故保持原样。
|
|
10468
|
+
*/ var UNKOWN_ISSUE_KEY = 'UNKOWN_ISSUE';
|
|
10462
10469
|
var THEME_DEFAULT_OPTIONS = {
|
|
10463
10470
|
dblClickFullscreen: true,
|
|
10464
10471
|
language: 'zh',
|
|
@@ -10534,7 +10541,7 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10534
10541
|
*/ _this._footerMoreControl = null, /** 头部控件 @since 0.0.1 @private */ _this._header = null, /** 低部控件 @since 0.0.1 @private */ _this._footer = null, /** 回放底部时间轴 @since 0.0.1 @private */ _this._recFooter = null, /**
|
|
10535
10542
|
* 移动端扩展容器, 扩展的控件渲染在指定容器以外, 仅只用端适用, 为了可以放置大的控件和方便开发接入
|
|
10536
10543
|
* @private
|
|
10537
|
-
*/ _this._mobileExtend = null, /** @since 0.0.1 @private */ _this._interactiveResult = null, /** @since 0.0.1 @private */ _this._themeData = null, _this._fullscreen = null, _this.zoomUtil = null, /** 清除屏幕旋转 */ _this._cleanupOrientation = null, /** resizeObserver 监听销毁 */ _this._cleanUpResizeObserver = null, /** 容器的宽 */ _this._width = 0, /** 容器的高 */ _this._height = 0, /** 当前容器的全屏状态 true: 全屏, false: 非全屏 */ _this._isCurrentFullscreen = false, /** 屏幕旋转角度 0 | 90 | 180 | 270 */ _this._orientationAngle = 0, _this._url = '', /** 是否播放中 @private */ _this._playing = false, /** @private 加载中 */ _this._loading = false, /** 音量 */ _this._volume = 0, /** 静音 */ _this._muted = false, /** 电子放大倍数 @private */ _this._zoom = 1, /** 放大中 true: 可缩放状态,false: 禁止缩放状态(不能缩放) @private */ _this._zooming = false, /** 录制中 @private */ _this._recording = false, /** 对讲中 @private */ _this._talking = false, /** 倍速 @private */ _this._speed = 1, /** 自定清晰度 @private */ _this._videoLevelAuto = false, /** 清晰度列表 */ _this.videoLevelList = [], /** 回放片段列表 */ _this.recordList = [], /**
|
|
10544
|
+
*/ _this._mobileExtend = null, /** @since 0.0.1 @private */ _this._interactiveResult = null, /** @since 0.0.1 @private */ _this._themeData = null, _this._fullscreen = null, _this.zoomUtil = null, /** 清除屏幕旋转 */ _this._cleanupOrientation = null, /** resizeObserver 监听销毁 */ _this._cleanUpResizeObserver = null, /** 容器的宽 */ _this._width = 0, /** 容器的高 */ _this._height = 0, /** 当前容器的全屏状态 true: 全屏, false: 非全屏 */ _this._isCurrentFullscreen = false, /** 屏幕旋转角度 0 | 90 | 180 | 270 */ _this._orientationAngle = 0, _this._url = '', /** 是否播放中 @private */ _this._playing = false, /** @private 加载中 */ _this._loading = false, /** 音量 */ _this._volume = 0, /** 静音 */ _this._muted = false, /** 正在兜底的原始 scope,非 null 表示处于兜底取值中(用于避免 customizeMissing 无限递归) */ _this._missingScope = null, /** 电子放大倍数 @private */ _this._zoom = 1, /** 放大中 true: 可缩放状态,false: 禁止缩放状态(不能缩放) @private */ _this._zooming = false, /** 录制中 @private */ _this._recording = false, /** 对讲中 @private */ _this._talking = false, /** 倍速 @private */ _this._speed = 1, /** 自定清晰度 @private */ _this._videoLevelAuto = false, /** 清晰度列表 */ _this.videoLevelList = [], /** 回放片段列表 */ _this.recordList = [], /**
|
|
10538
10545
|
* 播放区间(片段分享),null 表示不约束。
|
|
10539
10546
|
* 由 SDK 层在初始化时通过 props 下发,主题层据此决定日历/回放类型按钮
|
|
10540
10547
|
* 是否渲染、片段进度条是否渲染。区间没有运行时变更入口。
|
|
@@ -10797,6 +10804,50 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10797
10804
|
}
|
|
10798
10805
|
};
|
|
10799
10806
|
/**
|
|
10807
|
+
* 获取多语言文案
|
|
10808
|
+
*
|
|
10809
|
+
* 相比直接用 `theme.i18n.t()`:返回类型收窄为 `string`(底层签名是 `string | number`,
|
|
10810
|
+
* 调用处不必再写 `as string`)。缺失 key 的兜底由 i18n 实例上的 `customizeMissing`
|
|
10811
|
+
* 统一处理,因此两者在兜底行为上一致。
|
|
10812
|
+
* @param scope 多语言 key
|
|
10813
|
+
* @param variables 插值变量,如 `{ zoom: 8 }`;传 `defaultvalue` 可指定自己的兜底文案
|
|
10814
|
+
* @returns 文案;scope 不存在时返回「未知问题 【scope】」
|
|
10815
|
+
* @example
|
|
10816
|
+
* ```ts
|
|
10817
|
+
* theme.t('ZOOM_LIMIT_MAX', { zoom: 8 });
|
|
10818
|
+
* theme.t('NOT_EXIST_KEY'); // 未知问题 【NOT_EXIST_KEY】
|
|
10819
|
+
* theme.t('NOT_EXIST_KEY', { defaultvalue: '自定义兜底' }); // 自定义兜底
|
|
10820
|
+
* ```
|
|
10821
|
+
*/ _proto.t = function t(scope, variables) {
|
|
10822
|
+
return this.i18n.t(scope, variables);
|
|
10823
|
+
};
|
|
10824
|
+
/**
|
|
10825
|
+
* 语言包缺 key 时的兜底文案(`customizeMissing` 的实现)
|
|
10826
|
+
*
|
|
10827
|
+
* 注意底层是把本方法的返回值「原样返回」、不再做插值,所以这里借
|
|
10828
|
+
* `i18n.t(UNKOWN_ISSUE)` 完成插值。而这一次取值本身也可能缺失
|
|
10829
|
+
* (如 `language` 传了不存在的语言,当前语言包整体不存在),
|
|
10830
|
+
* 那会再次回调到这里造成无限递归,因此用重入标记兜住,退化为直接返回原始 scope。
|
|
10831
|
+
*
|
|
10832
|
+
* 注:`options.locales` 与内置语言包是深合并,无法移除内置的 UNKOWN_ISSUE,
|
|
10833
|
+
* 因此正常配置下不会走到退化分支。
|
|
10834
|
+
* @param scope 缺失的多语言 key
|
|
10835
|
+
* @param variables 原始插值变量
|
|
10836
|
+
*/ _proto._missingText = function _missingText(scope, variables) {
|
|
10837
|
+
// 兜底文案自身也缺失(如当前语言的语言包不存在):直接返回最初的 scope,
|
|
10838
|
+
// 而不是兜底 key 本身,否则用户看到的是 'UNKOWN_ISSUE' 这种无意义内容
|
|
10839
|
+
if (this._missingScope !== null) return "" + this._missingScope;
|
|
10840
|
+
this._missingScope = scope;
|
|
10841
|
+
try {
|
|
10842
|
+
// scope 放在最后,避免调用方传入同名变量把它覆盖掉
|
|
10843
|
+
return this.i18n.t(UNKOWN_ISSUE_KEY, _extends({}, variables, {
|
|
10844
|
+
scope: scope
|
|
10845
|
+
}));
|
|
10846
|
+
} finally{
|
|
10847
|
+
this._missingScope = null;
|
|
10848
|
+
}
|
|
10849
|
+
};
|
|
10850
|
+
/**
|
|
10800
10851
|
* 销毁包括事件、控件 ...
|
|
10801
10852
|
*
|
|
10802
10853
|
* Destroy (including events, controls...)
|
|
@@ -10852,6 +10903,7 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10852
10903
|
// 私有方法
|
|
10853
10904
|
// ==============================================================================================
|
|
10854
10905
|
/** 初始化配置项 */ _proto._initOptions = function _initOptions(options) {
|
|
10906
|
+
var _this = this;
|
|
10855
10907
|
if (options === void 0) options = {};
|
|
10856
10908
|
var _this_options_loggerOptions, _this_options_definitionOptions_list, _this_options_definitionOptions, _this_options_videoLevelList;
|
|
10857
10909
|
// 先对模块级默认配置做一次深拷贝,得到全新的嵌套对象/数组,
|
|
@@ -10904,7 +10956,13 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10904
10956
|
});
|
|
10905
10957
|
// prettier-ignore
|
|
10906
10958
|
this.i18n = new I18n(locales, {
|
|
10907
|
-
defaultLocale: language
|
|
10959
|
+
defaultLocale: language,
|
|
10960
|
+
// 语言包缺 key 时,底层默认返回 `[missing "zh.XXX" translation]`,
|
|
10961
|
+
// 这种占位串一旦透到 UI 上对用户毫无意义。挂在 i18n 实例上统一兜底,
|
|
10962
|
+
// 这样控件内直接调用 `i18n.t()` 的地方也能受益,无需逐处改造。
|
|
10963
|
+
customizeMissing: function customizeMissing(scope, variables) {
|
|
10964
|
+
return _this._missingText(scope, variables);
|
|
10965
|
+
}
|
|
10908
10966
|
});
|
|
10909
10967
|
// 默认清晰度列表
|
|
10910
10968
|
if (((_this_options_definitionOptions = this.options.definitionOptions) == null ? void 0 : (_this_options_definitionOptions_list = _this_options_definitionOptions.list) == null ? void 0 : _this_options_definitionOptions_list.length) > 0 || ((_this_options_videoLevelList = this.options.videoLevelList) == null ? void 0 : _this_options_videoLevelList.length) > 0) {
|
|
@@ -11929,7 +11987,7 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
11929
11987
|
zh: zh,
|
|
11930
11988
|
en: en
|
|
11931
11989
|
};
|
|
11932
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.6
|
|
11990
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.6';
|
|
11933
11991
|
|
|
11934
11992
|
exports.Control = Control;
|
|
11935
11993
|
exports.EVENTS = EVENTS;
|
package/dist/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @ezuikit/player-theme v3.1.6
|
|
3
|
-
* Copyright (c) 2026-09-
|
|
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
|
import EventEmitter from 'eventemitter3';
|
|
@@ -2966,7 +2966,8 @@ var zh = {
|
|
|
2966
2966
|
cancel: '取消',
|
|
2967
2967
|
ok: '确定',
|
|
2968
2968
|
close: '关闭',
|
|
2969
|
-
BTN_REC_LIST_TITLE: '录像片段'
|
|
2969
|
+
BTN_REC_LIST_TITLE: '录像片段',
|
|
2970
|
+
UNKOWN_ISSUE: '未知问题 【{{scope}}】'
|
|
2970
2971
|
};
|
|
2971
2972
|
|
|
2972
2973
|
// 不要出现多层的的数据, 数据铺平
|
|
@@ -3250,7 +3251,8 @@ var en = {
|
|
|
3250
3251
|
cancel: 'Cancel',
|
|
3251
3252
|
ok: 'Ok',
|
|
3252
3253
|
close: 'Close',
|
|
3253
|
-
BTN_REC_LIST_TITLE: 'Records'
|
|
3254
|
+
BTN_REC_LIST_TITLE: 'Records',
|
|
3255
|
+
UNKOWN_ISSUE: 'Unknown issue [{{scope}}]'
|
|
3254
3256
|
};
|
|
3255
3257
|
|
|
3256
3258
|
/**
|
|
@@ -10457,6 +10459,11 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
10457
10459
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
10458
10460
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
10459
10461
|
}
|
|
10462
|
+
/**
|
|
10463
|
+
* 语言包缺 key 时的兜底文案 key
|
|
10464
|
+
*
|
|
10465
|
+
* 拼写沿用语言包中既有的 `UNKOWN_ISSUE`(少了一个 N),改名属破坏性变更,故保持原样。
|
|
10466
|
+
*/ var UNKOWN_ISSUE_KEY = 'UNKOWN_ISSUE';
|
|
10460
10467
|
var THEME_DEFAULT_OPTIONS = {
|
|
10461
10468
|
dblClickFullscreen: true,
|
|
10462
10469
|
language: 'zh',
|
|
@@ -10532,7 +10539,7 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10532
10539
|
*/ _this._footerMoreControl = null, /** 头部控件 @since 0.0.1 @private */ _this._header = null, /** 低部控件 @since 0.0.1 @private */ _this._footer = null, /** 回放底部时间轴 @since 0.0.1 @private */ _this._recFooter = null, /**
|
|
10533
10540
|
* 移动端扩展容器, 扩展的控件渲染在指定容器以外, 仅只用端适用, 为了可以放置大的控件和方便开发接入
|
|
10534
10541
|
* @private
|
|
10535
|
-
*/ _this._mobileExtend = null, /** @since 0.0.1 @private */ _this._interactiveResult = null, /** @since 0.0.1 @private */ _this._themeData = null, _this._fullscreen = null, _this.zoomUtil = null, /** 清除屏幕旋转 */ _this._cleanupOrientation = null, /** resizeObserver 监听销毁 */ _this._cleanUpResizeObserver = null, /** 容器的宽 */ _this._width = 0, /** 容器的高 */ _this._height = 0, /** 当前容器的全屏状态 true: 全屏, false: 非全屏 */ _this._isCurrentFullscreen = false, /** 屏幕旋转角度 0 | 90 | 180 | 270 */ _this._orientationAngle = 0, _this._url = '', /** 是否播放中 @private */ _this._playing = false, /** @private 加载中 */ _this._loading = false, /** 音量 */ _this._volume = 0, /** 静音 */ _this._muted = false, /** 电子放大倍数 @private */ _this._zoom = 1, /** 放大中 true: 可缩放状态,false: 禁止缩放状态(不能缩放) @private */ _this._zooming = false, /** 录制中 @private */ _this._recording = false, /** 对讲中 @private */ _this._talking = false, /** 倍速 @private */ _this._speed = 1, /** 自定清晰度 @private */ _this._videoLevelAuto = false, /** 清晰度列表 */ _this.videoLevelList = [], /** 回放片段列表 */ _this.recordList = [], /**
|
|
10542
|
+
*/ _this._mobileExtend = null, /** @since 0.0.1 @private */ _this._interactiveResult = null, /** @since 0.0.1 @private */ _this._themeData = null, _this._fullscreen = null, _this.zoomUtil = null, /** 清除屏幕旋转 */ _this._cleanupOrientation = null, /** resizeObserver 监听销毁 */ _this._cleanUpResizeObserver = null, /** 容器的宽 */ _this._width = 0, /** 容器的高 */ _this._height = 0, /** 当前容器的全屏状态 true: 全屏, false: 非全屏 */ _this._isCurrentFullscreen = false, /** 屏幕旋转角度 0 | 90 | 180 | 270 */ _this._orientationAngle = 0, _this._url = '', /** 是否播放中 @private */ _this._playing = false, /** @private 加载中 */ _this._loading = false, /** 音量 */ _this._volume = 0, /** 静音 */ _this._muted = false, /** 正在兜底的原始 scope,非 null 表示处于兜底取值中(用于避免 customizeMissing 无限递归) */ _this._missingScope = null, /** 电子放大倍数 @private */ _this._zoom = 1, /** 放大中 true: 可缩放状态,false: 禁止缩放状态(不能缩放) @private */ _this._zooming = false, /** 录制中 @private */ _this._recording = false, /** 对讲中 @private */ _this._talking = false, /** 倍速 @private */ _this._speed = 1, /** 自定清晰度 @private */ _this._videoLevelAuto = false, /** 清晰度列表 */ _this.videoLevelList = [], /** 回放片段列表 */ _this.recordList = [], /**
|
|
10536
10543
|
* 播放区间(片段分享),null 表示不约束。
|
|
10537
10544
|
* 由 SDK 层在初始化时通过 props 下发,主题层据此决定日历/回放类型按钮
|
|
10538
10545
|
* 是否渲染、片段进度条是否渲染。区间没有运行时变更入口。
|
|
@@ -10795,6 +10802,50 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10795
10802
|
}
|
|
10796
10803
|
};
|
|
10797
10804
|
/**
|
|
10805
|
+
* 获取多语言文案
|
|
10806
|
+
*
|
|
10807
|
+
* 相比直接用 `theme.i18n.t()`:返回类型收窄为 `string`(底层签名是 `string | number`,
|
|
10808
|
+
* 调用处不必再写 `as string`)。缺失 key 的兜底由 i18n 实例上的 `customizeMissing`
|
|
10809
|
+
* 统一处理,因此两者在兜底行为上一致。
|
|
10810
|
+
* @param scope 多语言 key
|
|
10811
|
+
* @param variables 插值变量,如 `{ zoom: 8 }`;传 `defaultvalue` 可指定自己的兜底文案
|
|
10812
|
+
* @returns 文案;scope 不存在时返回「未知问题 【scope】」
|
|
10813
|
+
* @example
|
|
10814
|
+
* ```ts
|
|
10815
|
+
* theme.t('ZOOM_LIMIT_MAX', { zoom: 8 });
|
|
10816
|
+
* theme.t('NOT_EXIST_KEY'); // 未知问题 【NOT_EXIST_KEY】
|
|
10817
|
+
* theme.t('NOT_EXIST_KEY', { defaultvalue: '自定义兜底' }); // 自定义兜底
|
|
10818
|
+
* ```
|
|
10819
|
+
*/ _proto.t = function t(scope, variables) {
|
|
10820
|
+
return this.i18n.t(scope, variables);
|
|
10821
|
+
};
|
|
10822
|
+
/**
|
|
10823
|
+
* 语言包缺 key 时的兜底文案(`customizeMissing` 的实现)
|
|
10824
|
+
*
|
|
10825
|
+
* 注意底层是把本方法的返回值「原样返回」、不再做插值,所以这里借
|
|
10826
|
+
* `i18n.t(UNKOWN_ISSUE)` 完成插值。而这一次取值本身也可能缺失
|
|
10827
|
+
* (如 `language` 传了不存在的语言,当前语言包整体不存在),
|
|
10828
|
+
* 那会再次回调到这里造成无限递归,因此用重入标记兜住,退化为直接返回原始 scope。
|
|
10829
|
+
*
|
|
10830
|
+
* 注:`options.locales` 与内置语言包是深合并,无法移除内置的 UNKOWN_ISSUE,
|
|
10831
|
+
* 因此正常配置下不会走到退化分支。
|
|
10832
|
+
* @param scope 缺失的多语言 key
|
|
10833
|
+
* @param variables 原始插值变量
|
|
10834
|
+
*/ _proto._missingText = function _missingText(scope, variables) {
|
|
10835
|
+
// 兜底文案自身也缺失(如当前语言的语言包不存在):直接返回最初的 scope,
|
|
10836
|
+
// 而不是兜底 key 本身,否则用户看到的是 'UNKOWN_ISSUE' 这种无意义内容
|
|
10837
|
+
if (this._missingScope !== null) return "" + this._missingScope;
|
|
10838
|
+
this._missingScope = scope;
|
|
10839
|
+
try {
|
|
10840
|
+
// scope 放在最后,避免调用方传入同名变量把它覆盖掉
|
|
10841
|
+
return this.i18n.t(UNKOWN_ISSUE_KEY, _extends({}, variables, {
|
|
10842
|
+
scope: scope
|
|
10843
|
+
}));
|
|
10844
|
+
} finally{
|
|
10845
|
+
this._missingScope = null;
|
|
10846
|
+
}
|
|
10847
|
+
};
|
|
10848
|
+
/**
|
|
10798
10849
|
* 销毁包括事件、控件 ...
|
|
10799
10850
|
*
|
|
10800
10851
|
* Destroy (including events, controls...)
|
|
@@ -10850,6 +10901,7 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10850
10901
|
// 私有方法
|
|
10851
10902
|
// ==============================================================================================
|
|
10852
10903
|
/** 初始化配置项 */ _proto._initOptions = function _initOptions(options) {
|
|
10904
|
+
var _this = this;
|
|
10853
10905
|
if (options === void 0) options = {};
|
|
10854
10906
|
var _this_options_loggerOptions, _this_options_definitionOptions_list, _this_options_definitionOptions, _this_options_videoLevelList;
|
|
10855
10907
|
// 先对模块级默认配置做一次深拷贝,得到全新的嵌套对象/数组,
|
|
@@ -10902,7 +10954,13 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10902
10954
|
});
|
|
10903
10955
|
// prettier-ignore
|
|
10904
10956
|
this.i18n = new I18n(locales, {
|
|
10905
|
-
defaultLocale: language
|
|
10957
|
+
defaultLocale: language,
|
|
10958
|
+
// 语言包缺 key 时,底层默认返回 `[missing "zh.XXX" translation]`,
|
|
10959
|
+
// 这种占位串一旦透到 UI 上对用户毫无意义。挂在 i18n 实例上统一兜底,
|
|
10960
|
+
// 这样控件内直接调用 `i18n.t()` 的地方也能受益,无需逐处改造。
|
|
10961
|
+
customizeMissing: function customizeMissing(scope, variables) {
|
|
10962
|
+
return _this._missingText(scope, variables);
|
|
10963
|
+
}
|
|
10906
10964
|
});
|
|
10907
10965
|
// 默认清晰度列表
|
|
10908
10966
|
if (((_this_options_definitionOptions = this.options.definitionOptions) == null ? void 0 : (_this_options_definitionOptions_list = _this_options_definitionOptions.list) == null ? void 0 : _this_options_definitionOptions_list.length) > 0 || ((_this_options_videoLevelList = this.options.videoLevelList) == null ? void 0 : _this_options_videoLevelList.length) > 0) {
|
|
@@ -11927,6 +11985,6 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
11927
11985
|
zh: zh,
|
|
11928
11986
|
en: en
|
|
11929
11987
|
};
|
|
11930
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.6
|
|
11988
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.6';
|
|
11931
11989
|
|
|
11932
11990
|
export { Control, EVENTS, Fullscreen, Loading, Message, Play, Poster, Rec, Theme, Utils, Volume };
|
package/dist/index.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @ezuikit/player-theme v3.1.6
|
|
3
|
-
* Copyright (c) 2026-09-
|
|
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
|
(function (global, factory) {
|
|
@@ -4455,7 +4455,8 @@
|
|
|
4455
4455
|
cancel: '取消',
|
|
4456
4456
|
ok: '确定',
|
|
4457
4457
|
close: '关闭',
|
|
4458
|
-
BTN_REC_LIST_TITLE: '录像片段'
|
|
4458
|
+
BTN_REC_LIST_TITLE: '录像片段',
|
|
4459
|
+
UNKOWN_ISSUE: '未知问题 【{{scope}}】'
|
|
4459
4460
|
};
|
|
4460
4461
|
|
|
4461
4462
|
// 不要出现多层的的数据, 数据铺平
|
|
@@ -4739,7 +4740,8 @@
|
|
|
4739
4740
|
cancel: 'Cancel',
|
|
4740
4741
|
ok: 'Ok',
|
|
4741
4742
|
close: 'Close',
|
|
4742
|
-
BTN_REC_LIST_TITLE: 'Records'
|
|
4743
|
+
BTN_REC_LIST_TITLE: 'Records',
|
|
4744
|
+
UNKOWN_ISSUE: 'Unknown issue [{{scope}}]'
|
|
4743
4745
|
};
|
|
4744
4746
|
|
|
4745
4747
|
/**
|
|
@@ -12458,6 +12460,11 @@
|
|
|
12458
12460
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
12459
12461
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
12460
12462
|
}
|
|
12463
|
+
/**
|
|
12464
|
+
* 语言包缺 key 时的兜底文案 key
|
|
12465
|
+
*
|
|
12466
|
+
* 拼写沿用语言包中既有的 `UNKOWN_ISSUE`(少了一个 N),改名属破坏性变更,故保持原样。
|
|
12467
|
+
*/ var UNKOWN_ISSUE_KEY = 'UNKOWN_ISSUE';
|
|
12461
12468
|
var THEME_DEFAULT_OPTIONS = {
|
|
12462
12469
|
dblClickFullscreen: true,
|
|
12463
12470
|
language: 'zh',
|
|
@@ -12533,7 +12540,7 @@
|
|
|
12533
12540
|
*/ _this._footerMoreControl = null, /** 头部控件 @since 0.0.1 @private */ _this._header = null, /** 低部控件 @since 0.0.1 @private */ _this._footer = null, /** 回放底部时间轴 @since 0.0.1 @private */ _this._recFooter = null, /**
|
|
12534
12541
|
* 移动端扩展容器, 扩展的控件渲染在指定容器以外, 仅只用端适用, 为了可以放置大的控件和方便开发接入
|
|
12535
12542
|
* @private
|
|
12536
|
-
*/ _this._mobileExtend = null, /** @since 0.0.1 @private */ _this._interactiveResult = null, /** @since 0.0.1 @private */ _this._themeData = null, _this._fullscreen = null, _this.zoomUtil = null, /** 清除屏幕旋转 */ _this._cleanupOrientation = null, /** resizeObserver 监听销毁 */ _this._cleanUpResizeObserver = null, /** 容器的宽 */ _this._width = 0, /** 容器的高 */ _this._height = 0, /** 当前容器的全屏状态 true: 全屏, false: 非全屏 */ _this._isCurrentFullscreen = false, /** 屏幕旋转角度 0 | 90 | 180 | 270 */ _this._orientationAngle = 0, _this._url = '', /** 是否播放中 @private */ _this._playing = false, /** @private 加载中 */ _this._loading = false, /** 音量 */ _this._volume = 0, /** 静音 */ _this._muted = false, /** 电子放大倍数 @private */ _this._zoom = 1, /** 放大中 true: 可缩放状态,false: 禁止缩放状态(不能缩放) @private */ _this._zooming = false, /** 录制中 @private */ _this._recording = false, /** 对讲中 @private */ _this._talking = false, /** 倍速 @private */ _this._speed = 1, /** 自定清晰度 @private */ _this._videoLevelAuto = false, /** 清晰度列表 */ _this.videoLevelList = [], /** 回放片段列表 */ _this.recordList = [], /**
|
|
12543
|
+
*/ _this._mobileExtend = null, /** @since 0.0.1 @private */ _this._interactiveResult = null, /** @since 0.0.1 @private */ _this._themeData = null, _this._fullscreen = null, _this.zoomUtil = null, /** 清除屏幕旋转 */ _this._cleanupOrientation = null, /** resizeObserver 监听销毁 */ _this._cleanUpResizeObserver = null, /** 容器的宽 */ _this._width = 0, /** 容器的高 */ _this._height = 0, /** 当前容器的全屏状态 true: 全屏, false: 非全屏 */ _this._isCurrentFullscreen = false, /** 屏幕旋转角度 0 | 90 | 180 | 270 */ _this._orientationAngle = 0, _this._url = '', /** 是否播放中 @private */ _this._playing = false, /** @private 加载中 */ _this._loading = false, /** 音量 */ _this._volume = 0, /** 静音 */ _this._muted = false, /** 正在兜底的原始 scope,非 null 表示处于兜底取值中(用于避免 customizeMissing 无限递归) */ _this._missingScope = null, /** 电子放大倍数 @private */ _this._zoom = 1, /** 放大中 true: 可缩放状态,false: 禁止缩放状态(不能缩放) @private */ _this._zooming = false, /** 录制中 @private */ _this._recording = false, /** 对讲中 @private */ _this._talking = false, /** 倍速 @private */ _this._speed = 1, /** 自定清晰度 @private */ _this._videoLevelAuto = false, /** 清晰度列表 */ _this.videoLevelList = [], /** 回放片段列表 */ _this.recordList = [], /**
|
|
12537
12544
|
* 播放区间(片段分享),null 表示不约束。
|
|
12538
12545
|
* 由 SDK 层在初始化时通过 props 下发,主题层据此决定日历/回放类型按钮
|
|
12539
12546
|
* 是否渲染、片段进度条是否渲染。区间没有运行时变更入口。
|
|
@@ -12796,6 +12803,50 @@
|
|
|
12796
12803
|
}
|
|
12797
12804
|
};
|
|
12798
12805
|
/**
|
|
12806
|
+
* 获取多语言文案
|
|
12807
|
+
*
|
|
12808
|
+
* 相比直接用 `theme.i18n.t()`:返回类型收窄为 `string`(底层签名是 `string | number`,
|
|
12809
|
+
* 调用处不必再写 `as string`)。缺失 key 的兜底由 i18n 实例上的 `customizeMissing`
|
|
12810
|
+
* 统一处理,因此两者在兜底行为上一致。
|
|
12811
|
+
* @param scope 多语言 key
|
|
12812
|
+
* @param variables 插值变量,如 `{ zoom: 8 }`;传 `defaultvalue` 可指定自己的兜底文案
|
|
12813
|
+
* @returns 文案;scope 不存在时返回「未知问题 【scope】」
|
|
12814
|
+
* @example
|
|
12815
|
+
* ```ts
|
|
12816
|
+
* theme.t('ZOOM_LIMIT_MAX', { zoom: 8 });
|
|
12817
|
+
* theme.t('NOT_EXIST_KEY'); // 未知问题 【NOT_EXIST_KEY】
|
|
12818
|
+
* theme.t('NOT_EXIST_KEY', { defaultvalue: '自定义兜底' }); // 自定义兜底
|
|
12819
|
+
* ```
|
|
12820
|
+
*/ _proto.t = function t(scope, variables) {
|
|
12821
|
+
return this.i18n.t(scope, variables);
|
|
12822
|
+
};
|
|
12823
|
+
/**
|
|
12824
|
+
* 语言包缺 key 时的兜底文案(`customizeMissing` 的实现)
|
|
12825
|
+
*
|
|
12826
|
+
* 注意底层是把本方法的返回值「原样返回」、不再做插值,所以这里借
|
|
12827
|
+
* `i18n.t(UNKOWN_ISSUE)` 完成插值。而这一次取值本身也可能缺失
|
|
12828
|
+
* (如 `language` 传了不存在的语言,当前语言包整体不存在),
|
|
12829
|
+
* 那会再次回调到这里造成无限递归,因此用重入标记兜住,退化为直接返回原始 scope。
|
|
12830
|
+
*
|
|
12831
|
+
* 注:`options.locales` 与内置语言包是深合并,无法移除内置的 UNKOWN_ISSUE,
|
|
12832
|
+
* 因此正常配置下不会走到退化分支。
|
|
12833
|
+
* @param scope 缺失的多语言 key
|
|
12834
|
+
* @param variables 原始插值变量
|
|
12835
|
+
*/ _proto._missingText = function _missingText(scope, variables) {
|
|
12836
|
+
// 兜底文案自身也缺失(如当前语言的语言包不存在):直接返回最初的 scope,
|
|
12837
|
+
// 而不是兜底 key 本身,否则用户看到的是 'UNKOWN_ISSUE' 这种无意义内容
|
|
12838
|
+
if (this._missingScope !== null) return "" + this._missingScope;
|
|
12839
|
+
this._missingScope = scope;
|
|
12840
|
+
try {
|
|
12841
|
+
// scope 放在最后,避免调用方传入同名变量把它覆盖掉
|
|
12842
|
+
return this.i18n.t(UNKOWN_ISSUE_KEY, _extends({}, variables, {
|
|
12843
|
+
scope: scope
|
|
12844
|
+
}));
|
|
12845
|
+
} finally{
|
|
12846
|
+
this._missingScope = null;
|
|
12847
|
+
}
|
|
12848
|
+
};
|
|
12849
|
+
/**
|
|
12799
12850
|
* 销毁包括事件、控件 ...
|
|
12800
12851
|
*
|
|
12801
12852
|
* Destroy (including events, controls...)
|
|
@@ -12851,6 +12902,7 @@
|
|
|
12851
12902
|
// 私有方法
|
|
12852
12903
|
// ==============================================================================================
|
|
12853
12904
|
/** 初始化配置项 */ _proto._initOptions = function _initOptions(options) {
|
|
12905
|
+
var _this = this;
|
|
12854
12906
|
if (options === void 0) options = {};
|
|
12855
12907
|
var _this_options_loggerOptions, _this_options_definitionOptions_list, _this_options_definitionOptions, _this_options_videoLevelList;
|
|
12856
12908
|
// 先对模块级默认配置做一次深拷贝,得到全新的嵌套对象/数组,
|
|
@@ -12903,7 +12955,13 @@
|
|
|
12903
12955
|
});
|
|
12904
12956
|
// prettier-ignore
|
|
12905
12957
|
this.i18n = new I18n(locales, {
|
|
12906
|
-
defaultLocale: language
|
|
12958
|
+
defaultLocale: language,
|
|
12959
|
+
// 语言包缺 key 时,底层默认返回 `[missing "zh.XXX" translation]`,
|
|
12960
|
+
// 这种占位串一旦透到 UI 上对用户毫无意义。挂在 i18n 实例上统一兜底,
|
|
12961
|
+
// 这样控件内直接调用 `i18n.t()` 的地方也能受益,无需逐处改造。
|
|
12962
|
+
customizeMissing: function customizeMissing(scope, variables) {
|
|
12963
|
+
return _this._missingText(scope, variables);
|
|
12964
|
+
}
|
|
12907
12965
|
});
|
|
12908
12966
|
// 默认清晰度列表
|
|
12909
12967
|
if (((_this_options_definitionOptions = this.options.definitionOptions) == null ? void 0 : (_this_options_definitionOptions_list = _this_options_definitionOptions.list) == null ? void 0 : _this_options_definitionOptions_list.length) > 0 || ((_this_options_videoLevelList = this.options.videoLevelList) == null ? void 0 : _this_options_videoLevelList.length) > 0) {
|
|
@@ -13928,7 +13986,7 @@
|
|
|
13928
13986
|
zh: zh,
|
|
13929
13987
|
en: en
|
|
13930
13988
|
};
|
|
13931
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.6
|
|
13989
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.6';
|
|
13932
13990
|
|
|
13933
13991
|
// 不要动这里的代码, 这个出口是为了编译成 umd 规范的文件
|
|
13934
13992
|
|
package/dist/style.js
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -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';
|
|
@@ -1525,18 +1525,14 @@ declare class Theme extends EventEmitter {
|
|
|
1525
1525
|
readonly recDropdownChange: "recDropdownChange";
|
|
1526
1526
|
readonly recListChange: "recListChange";
|
|
1527
1527
|
readonly alarmMessageChange: "alarmMessageChange";
|
|
1528
|
-
readonly setLoggerOptions: "setLoggerOptions";
|
|
1529
|
-
* 更多控件(footer more)
|
|
1530
|
-
* @since 0.0.1
|
|
1531
|
-
* @private
|
|
1532
|
-
*/
|
|
1528
|
+
readonly setLoggerOptions: "setLoggerOptions";
|
|
1533
1529
|
readonly records: "records";
|
|
1534
1530
|
readonly ptzSpeedChange: "ptzSpeedChange";
|
|
1535
1531
|
readonly setVideoLevelList: "setVideoLevelList";
|
|
1536
1532
|
readonly currentVideoLevel: "currentVideoLevel";
|
|
1537
1533
|
readonly currentVideoLevelAuto: "currentVideoLevelAuto";
|
|
1538
1534
|
readonly setAllDayRecTimes: "setAllDayRecTimes";
|
|
1539
|
-
readonly getOSDTime: "getOSDTime";
|
|
1535
|
+
readonly getOSDTime: "getOSDTime"; /** 头部控件 @since 0.0.1 @private */
|
|
1540
1536
|
readonly playbackEnd: "playbackEnd";
|
|
1541
1537
|
readonly control: {
|
|
1542
1538
|
readonly play: "Control.play";
|
|
@@ -1772,12 +1768,13 @@ declare class Theme extends EventEmitter {
|
|
|
1772
1768
|
SPEED_CANCEL: string;
|
|
1773
1769
|
GET_SPEED: string;
|
|
1774
1770
|
MAX_SPEED_LIMIT: string;
|
|
1771
|
+
/** 版本号 @since 0.0.1 */
|
|
1775
1772
|
MIN_SPEED_LIMIT: string;
|
|
1776
|
-
SPEED_SWITCH_ERRROR: string;
|
|
1773
|
+
SPEED_SWITCH_ERRROR: string; /** 播放器配置项 */
|
|
1777
1774
|
SPEED_SWITCH_NOT_SUPPORT: string;
|
|
1778
1775
|
SEEK_CANNOT_CROSS_DAYS: string;
|
|
1779
1776
|
SEEK_TIMEFORMAT_ERROR: string;
|
|
1780
|
-
PAUSE: string;
|
|
1777
|
+
PAUSE: string; /** 多语言对象 https://www.npmjs.com/package/@ezuikit/utils-i18n @since 0.0.1 */
|
|
1781
1778
|
PAUSE_FAILED: string;
|
|
1782
1779
|
RESUME: string;
|
|
1783
1780
|
RESUME_FAILED: string;
|
|
@@ -1786,7 +1783,7 @@ declare class Theme extends EventEmitter {
|
|
|
1786
1783
|
NO_CLOUD_RECORD: string;
|
|
1787
1784
|
CHANGE_VIDEO_LEVEL: string;
|
|
1788
1785
|
CHANGE_VIDEO_LEVEL_FAIL: string;
|
|
1789
|
-
GET_VIDEO_LEVEL_LIST: string;
|
|
1786
|
+
GET_VIDEO_LEVEL_LIST: string;
|
|
1790
1787
|
PLEASE_INPUT_RIGHT_VIDEO_LEVEL: string;
|
|
1791
1788
|
VIDEO_LEVEL_NOT_SUPPORT: string;
|
|
1792
1789
|
VIDEO_LEVEL_AUTO: string;
|
|
@@ -1796,6 +1793,10 @@ declare class Theme extends EventEmitter {
|
|
|
1796
1793
|
VIDEO_LEVEL_SUPER: string;
|
|
1797
1794
|
VIDEO_LEVEL_EXTREME: string;
|
|
1798
1795
|
VIDEO_LEVEL_3K: string;
|
|
1796
|
+
/**
|
|
1797
|
+
* @since 0.0.1
|
|
1798
|
+
* @private
|
|
1799
|
+
*/
|
|
1799
1800
|
VIDEO_LEVEL_4k: string;
|
|
1800
1801
|
RESET_THEME: string;
|
|
1801
1802
|
BTN_PLAY: string;
|
|
@@ -1816,10 +1817,7 @@ declare class Theme extends EventEmitter {
|
|
|
1816
1817
|
BTN_ZOOM: string;
|
|
1817
1818
|
BTN_3D_ZOOM: string;
|
|
1818
1819
|
BTN_PTZ: string;
|
|
1819
|
-
BTN_GLOBAL_FULLSCREEN: string;
|
|
1820
|
-
* 移动端扩展容器, 扩展的控件渲染在指定容器以外, 仅只用端适用, 为了可以放置大的控件和方便开发接入
|
|
1821
|
-
* @private
|
|
1822
|
-
*/
|
|
1820
|
+
BTN_GLOBAL_FULLSCREEN: string;
|
|
1823
1821
|
BTN_EXIT_GLOBAL_FULLSCREEN: string;
|
|
1824
1822
|
BTN_FULLSCREEN: string;
|
|
1825
1823
|
BTN_EXIR_FULLSCREEN: string;
|
|
@@ -1843,10 +1841,9 @@ declare class Theme extends EventEmitter {
|
|
|
1843
1841
|
RECORDS: string;
|
|
1844
1842
|
OPEN_SOUND: string;
|
|
1845
1843
|
CLOSE_SOUND: string;
|
|
1846
|
-
SOUND_OPENED: string;
|
|
1844
|
+
SOUND_OPENED: string;
|
|
1847
1845
|
ZOOM: string;
|
|
1848
1846
|
START_ZOOM: string;
|
|
1849
|
-
/** 容器的高 */
|
|
1850
1847
|
CLOSE_ZOOM: string;
|
|
1851
1848
|
ZOOM_ADD: string;
|
|
1852
1849
|
ZOOM_SUB: string;
|
|
@@ -1856,7 +1853,7 @@ declare class Theme extends EventEmitter {
|
|
|
1856
1853
|
ZOOM_LIMIT_MIN: string;
|
|
1857
1854
|
ZOOM_NOT_ENABLED: string;
|
|
1858
1855
|
'3D_ZOOM': string;
|
|
1859
|
-
'3D_ZOOM_DISABLE': string;
|
|
1856
|
+
'3D_ZOOM_DISABLE': string; /** 屏幕旋转角度 0 | 90 | 180 | 270 */
|
|
1860
1857
|
'3D_ZOOM_FAILED': string;
|
|
1861
1858
|
START_3D_ZOOM: string;
|
|
1862
1859
|
CLOSE_3D_ZOOM: string;
|
|
@@ -1871,25 +1868,18 @@ declare class Theme extends EventEmitter {
|
|
|
1871
1868
|
WEB_FULLSCREEN: string;
|
|
1872
1869
|
WEB_FULLSCREEN_EXIT: string;
|
|
1873
1870
|
DESTROY: string;
|
|
1874
|
-
/** 回放片段列表 */
|
|
1875
1871
|
GET_CAPACITY: string;
|
|
1876
1872
|
GET_PTZ_STATUS: string;
|
|
1877
1873
|
GET_PTZ_STATUS_FAILED: string;
|
|
1878
1874
|
MOBILE_HIDE_PTZ: string;
|
|
1879
1875
|
OPTION_PTZ_FAILED: string;
|
|
1880
1876
|
MOBILE_PTZ_TIPS: string;
|
|
1881
|
-
PTZ_FAST: string;
|
|
1877
|
+
PTZ_FAST: string;
|
|
1882
1878
|
PTZ_MID: string;
|
|
1883
1879
|
PTZ_SLOW: string;
|
|
1884
1880
|
PTZ_SPEED: string;
|
|
1885
1881
|
DEVICE_ZOOM: string;
|
|
1886
|
-
/**
|
|
1887
|
-
* 录像回放的月份列表 @private
|
|
1888
|
-
*/
|
|
1889
1882
|
DEVICE_FOCUS: string;
|
|
1890
|
-
/**
|
|
1891
|
-
* 录像回放的月份列表 @private
|
|
1892
|
-
*/
|
|
1893
1883
|
NOT_SUPPORT_DEVICE_ZOOM: string;
|
|
1894
1884
|
NOT_SUPPORT_FOCUS: string;
|
|
1895
1885
|
MIRROR: string;
|
|
@@ -1903,13 +1893,19 @@ declare class Theme extends EventEmitter {
|
|
|
1903
1893
|
GET_FEC_PARAMS: string;
|
|
1904
1894
|
SET_FEC_PARAMS_FAILED: string;
|
|
1905
1895
|
GET_FEC_PARAMS_FAILED: string;
|
|
1906
|
-
|
|
1896
|
+
/**
|
|
1897
|
+
* 录像回放的月份列表 @private
|
|
1898
|
+
*/
|
|
1899
|
+
GET_FEC_PARAMS_SUPPORT_VERSION: string; /**
|
|
1900
|
+
* 录像回放的月份列表 @private
|
|
1901
|
+
*/
|
|
1907
1902
|
SET_WATERMARK: string;
|
|
1908
|
-
FETCH_THEME_FAILED: string;
|
|
1903
|
+
FETCH_THEME_FAILED: string; /** 清理 header/footer 动画 定时器 @private */
|
|
1909
1904
|
cancel: string;
|
|
1910
1905
|
ok: string;
|
|
1911
1906
|
close: string;
|
|
1912
1907
|
BTN_REC_LIST_TITLE: string;
|
|
1908
|
+
UNKOWN_ISSUE: string;
|
|
1913
1909
|
};
|
|
1914
1910
|
en: {
|
|
1915
1911
|
391001: string;
|
|
@@ -1990,7 +1986,7 @@ declare class Theme extends EventEmitter {
|
|
|
1990
1986
|
396506: string;
|
|
1991
1987
|
396508: string;
|
|
1992
1988
|
396509: string;
|
|
1993
|
-
396510: string;
|
|
1989
|
+
396510: string;
|
|
1994
1990
|
396511: string;
|
|
1995
1991
|
396512: string;
|
|
1996
1992
|
396513: string;
|
|
@@ -2000,24 +1996,19 @@ declare class Theme extends EventEmitter {
|
|
|
2000
1996
|
396517: string;
|
|
2001
1997
|
396518: string;
|
|
2002
1998
|
396519: string;
|
|
2003
|
-
/**
|
|
2004
|
-
* 录像回放的月份列表 @private
|
|
2005
|
-
*/
|
|
2006
1999
|
396520: string;
|
|
2007
|
-
/**
|
|
2008
|
-
* 录像回放的月份列表 @private
|
|
2009
|
-
*/
|
|
2010
2000
|
396700: string;
|
|
2011
|
-
/**
|
|
2012
|
-
* 录像回放的月份列表 @private
|
|
2013
|
-
*/
|
|
2014
2001
|
396701: string;
|
|
2015
2002
|
397001: string;
|
|
2016
2003
|
397002: string;
|
|
2017
2004
|
397003: string;
|
|
2018
2005
|
397004: string;
|
|
2019
2006
|
397005: string;
|
|
2020
|
-
397006: string;
|
|
2007
|
+
397006: string; /**
|
|
2008
|
+
* 首帧同步 Live/RecDropdown 激活态的监听器引用。
|
|
2009
|
+
* 每次 `_renderTheme` 重新绑定前需先移除旧引用,避免 changeTheme 累积监听。
|
|
2010
|
+
* @private
|
|
2011
|
+
*/
|
|
2021
2012
|
397007: string;
|
|
2022
2013
|
399000: string;
|
|
2023
2014
|
399001: string;
|
|
@@ -2116,6 +2107,12 @@ declare class Theme extends EventEmitter {
|
|
|
2116
2107
|
BTN_ZOOM: string;
|
|
2117
2108
|
BTN_3D_ZOOM: string;
|
|
2118
2109
|
BTN_PTZ: string;
|
|
2110
|
+
/**
|
|
2111
|
+
* 当前播放状态
|
|
2112
|
+
* ```ts
|
|
2113
|
+
* theme.playing // boolean
|
|
2114
|
+
* ```
|
|
2115
|
+
*/
|
|
2119
2116
|
BTN_GLOBAL_FULLSCREEN: string;
|
|
2120
2117
|
BTN_EXIT_GLOBAL_FULLSCREEN: string;
|
|
2121
2118
|
BTN_FULLSCREEN: string;
|
|
@@ -2175,9 +2172,7 @@ declare class Theme extends EventEmitter {
|
|
|
2175
2172
|
MOBILE_HIDE_PTZ: string;
|
|
2176
2173
|
OPTION_PTZ_FAILED: string;
|
|
2177
2174
|
MOBILE_PTZ_TIPS: string;
|
|
2178
|
-
PTZ_FAST: string;
|
|
2179
|
-
* 是否在缩放中
|
|
2180
|
-
*/
|
|
2175
|
+
PTZ_FAST: string;
|
|
2181
2176
|
PTZ_MID: string;
|
|
2182
2177
|
PTZ_SLOW: string;
|
|
2183
2178
|
PTZ_SPEED: string;
|
|
@@ -2203,6 +2198,7 @@ declare class Theme extends EventEmitter {
|
|
|
2203
2198
|
ok: string;
|
|
2204
2199
|
close: string;
|
|
2205
2200
|
BTN_REC_LIST_TITLE: string;
|
|
2201
|
+
UNKOWN_ISSUE: string;
|
|
2206
2202
|
};
|
|
2207
2203
|
};
|
|
2208
2204
|
/** 版本号 @since 0.0.1 */
|
|
@@ -2290,6 +2286,8 @@ declare class Theme extends EventEmitter {
|
|
|
2290
2286
|
private _volume;
|
|
2291
2287
|
/** 静音 */
|
|
2292
2288
|
private _muted;
|
|
2289
|
+
/** 正在兜底的原始 scope,非 null 表示处于兜底取值中(用于避免 customizeMissing 无限递归) */
|
|
2290
|
+
private _missingScope;
|
|
2293
2291
|
/** 电子放大倍数 @private */
|
|
2294
2292
|
_zoom: number;
|
|
2295
2293
|
/** 放大中 true: 可缩放状态,false: 禁止缩放状态(不能缩放) @private */
|
|
@@ -2631,6 +2629,37 @@ declare class Theme extends EventEmitter {
|
|
|
2631
2629
|
* @param {0 | 1 | 2} scaleMode - 缩放模式, 0: 窗口铺满, 1: 等比缩放大边铺满, 2: 等比缩放小边铺满
|
|
2632
2630
|
*/
|
|
2633
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;
|
|
2634
2663
|
/**
|
|
2635
2664
|
* 销毁包括事件、控件 ...
|
|
2636
2665
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ezuikit/player-theme",
|
|
3
|
-
"version": "3.1.6
|
|
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.1.0",
|
|
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",
|