@ezuikit/player-theme 3.1.2-beta.1 → 3.1.2-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 CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
- * @ezuikit/player-theme v3.1.2-beta.1
3
- * Copyright (c) 2026-08-10 02:32:17 Ezviz-OpenBiz
2
+ * @ezuikit/player-theme v3.1.2-beta.2
3
+ * Copyright (c) 2026-08-12 04:37:54 Ezviz-OpenBiz
4
4
  * Released under the MIT License.
5
5
  */
6
6
  /**
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
- * @ezuikit/player-theme v3.1.2-beta.1
3
- * Copyright (c) 2026-08-10 02:32:17 Ezviz-OpenBiz
2
+ * @ezuikit/player-theme v3.1.2-beta.2
3
+ * Copyright (c) 2026-08-12 04:37:54 Ezviz-OpenBiz
4
4
  * Released under the MIT License.
5
5
  */
6
6
  'use strict';
@@ -7140,6 +7140,7 @@ function _ts_generator$2(thisArg, body) {
7140
7140
  _inherits$f(AIChat, Control);
7141
7141
  function AIChat(options) {
7142
7142
  var _this;
7143
+ var _options_urlInfo_searchParams, _options_urlInfo, _options_urlInfo1;
7143
7144
  _this = Control.call(this, _extends$e({}, options, {
7144
7145
  tagName: 'span',
7145
7146
  controlType: 'button',
@@ -7153,7 +7154,7 @@ function _ts_generator$2(thisArg, body) {
7153
7154
  _this._render();
7154
7155
  }
7155
7156
  });
7156
- if (options.urlInfo.searchParams.busType !== '7' && options.urlInfo.recType === 'cloud' && options.sdkType === 'base') {
7157
+ if (((_options_urlInfo = options.urlInfo) == null ? void 0 : (_options_urlInfo_searchParams = _options_urlInfo.searchParams) == null ? void 0 : _options_urlInfo_searchParams.busType) !== '7' && ((_options_urlInfo1 = options.urlInfo) == null ? void 0 : _options_urlInfo1.recType) === 'cloud' && options.sdkType === 'base') {
7157
7158
  _this.$container.style.removeProperty('display');
7158
7159
  } else {
7159
7160
  _this.$container.style.display = 'none';
@@ -9450,7 +9451,7 @@ function _renderControls(theme, $container, btnList, props) {
9450
9451
  if (theme.options.deviceOptions !== null) {
9451
9452
  var _theme_controls;
9452
9453
  if (!((_theme_controls = theme.controls) == null ? void 0 : _theme_controls["deviceControl"])) {
9453
- var _theme_options;
9454
+ var _theme_urlInfo, _theme_urlInfo1, _theme_options;
9454
9455
  // eslint-disable-next-line @typescript-eslint/dot-notation, new-cap, @typescript-eslint/no-unsafe-argument
9455
9456
  theme.controls["deviceControl"] = new Controls["device"](_extends$1({
9456
9457
  rootContainer: theme.$container,
@@ -9461,8 +9462,8 @@ function _renderControls(theme, $container, btnList, props) {
9461
9462
  language: theme.options.language,
9462
9463
  locales: theme.i18n.translations,
9463
9464
  type: theme.options.type,
9464
- deviceSerial: theme.urlInfo.deviceSerial,
9465
- channelNo: theme.urlInfo.channelNo
9465
+ deviceSerial: (_theme_urlInfo = theme.urlInfo) == null ? void 0 : _theme_urlInfo.deviceSerial,
9466
+ channelNo: (_theme_urlInfo1 = theme.urlInfo) == null ? void 0 : _theme_urlInfo1.channelNo
9466
9467
  }, ((_theme_options = theme.options) == null ? void 0 : _theme_options["deviceOptions"]) || {}, {
9467
9468
  props: props
9468
9469
  }));
@@ -9473,7 +9474,7 @@ function _renderControls(theme, $container, btnList, props) {
9473
9474
  // footer
9474
9475
  if (Controls[item.iconId]) {
9475
9476
  if (theme.options["" + item.iconId + "Options"] !== null) {
9476
- var _theme_options1;
9477
+ var _theme_urlInfo2, _theme_urlInfo3, _theme_options1;
9477
9478
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
9478
9479
  theme.controls["" + item.iconId + "Control"] = new Controls[item.iconId](_extends$1({
9479
9480
  rootContainer: theme.$container,
@@ -9486,8 +9487,8 @@ function _renderControls(theme, $container, btnList, props) {
9486
9487
  env: theme.options.env,
9487
9488
  accessToken: theme.options.accessToken,
9488
9489
  token: theme.options.token,
9489
- deviceSerial: theme.urlInfo.deviceSerial,
9490
- channelNo: theme.urlInfo.channelNo,
9490
+ deviceSerial: (_theme_urlInfo2 = theme.urlInfo) == null ? void 0 : _theme_urlInfo2.deviceSerial,
9491
+ channelNo: (_theme_urlInfo3 = theme.urlInfo) == null ? void 0 : _theme_urlInfo3.channelNo,
9491
9492
  urlInfo: theme.urlInfo
9492
9493
  } : {}, {
9493
9494
  PLAY_TYPE: theme.options.type,
@@ -9733,7 +9734,7 @@ function _renderTheme(theme, data) {
9733
9734
  var _renderTimeLine = function(theme, container, props) {
9734
9735
  if (props === void 0) props = {};
9735
9736
  if (!theme.controls.timeLineControl && theme.options.timeLineOptions !== null) {
9736
- var _theme_urlInfo, _theme_options, _theme_options1, _this, _theme_options2;
9737
+ var _theme_urlInfo, _theme_urlInfo1, _theme_options, _theme_options1, _this, _theme_options2;
9737
9738
  var _showSectionIcon;
9738
9739
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
9739
9740
  theme.controls.timeLineControl = new Controls['timeLine'](_extends$1({
@@ -9742,7 +9743,7 @@ var _renderTimeLine = function(theme, container, props) {
9742
9743
  },
9743
9744
  language: theme.options.language,
9744
9745
  locales: theme.i18n.translations,
9745
- coverQuery: ((_theme_urlInfo = theme.urlInfo) == null ? void 0 : _theme_urlInfo.validateCode) ? "decodekey=" + theme.urlInfo.validateCode : ''
9746
+ coverQuery: ((_theme_urlInfo = theme.urlInfo) == null ? void 0 : _theme_urlInfo.validateCode) ? "decodekey=" + ((_theme_urlInfo1 = theme.urlInfo) == null ? void 0 : _theme_urlInfo1.validateCode) : ''
9746
9747
  }, ((_theme_options = theme.options) == null ? void 0 : _theme_options["timeLineOptions"]) || {}, {
9747
9748
  showSectionIcon: ((_theme_options1 = theme.options) == null ? void 0 : _theme_options1["recListOptions"]) !== null ? (_showSectionIcon = (_this = ((_theme_options2 = theme.options) == null ? void 0 : _theme_options2["timeLineOptions"]) || {}) == null ? void 0 : _this.showSectionIcon) != null ? _showSectionIcon : true : true,
9748
9749
  props: props
@@ -10145,7 +10146,7 @@ var THEME_DEFAULT_OPTIONS = {
10145
10146
  _inherits(Theme, EventEmitter);
10146
10147
  function Theme(options) {
10147
10148
  var _this;
10148
- var _this_options_volumeOptions, _this_options_volumeOptions1, _this_options_speedOptions, _this_options, _this_options1;
10149
+ var _this_options_volumeOptions, _this_options_volumeOptions1, _this_options_speedOptions, _this_urlInfo_searchParams, _this_urlInfo, _this_options, _this_options1;
10149
10150
  _this = EventEmitter.call(this) || this, /** 播放器配置项 */ _this.options = THEME_DEFAULT_OPTIONS, _this.staticPath = '', /** 所有控件列表, 所有控件名称规则(`${iconId}Control`), 如音量控件 this.controls["volumeControl"] @since 0.0.1 */ _this.controls = {}, /**
10150
10151
  * @since 0.0.1
10151
10152
  * @private
@@ -10165,7 +10166,7 @@ var THEME_DEFAULT_OPTIONS = {
10165
10166
  */ _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, /**
10166
10167
  * 移动端扩展容器, 扩展的控件渲染在指定容器以外, 仅只用端适用, 为了可以放置大的控件和方便开发接入
10167
10168
  * @private
10168
- */ _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, /** 是否播放中 @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 = [], /** 窗口尺寸变化时,设置窗口超出隐藏,防止出现滚动条 */ _this._resizeOverflowTimer = null, // /**
10169
+ */ _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 = [], /** 窗口尺寸变化时,设置窗口超出隐藏,防止出现滚动条 */ _this._resizeOverflowTimer = null, // /**
10169
10170
  // * 记录回放的月份
10170
10171
  // *
10171
10172
  // * key: {序列号}_{通道号}_{rec | cloud | cloudRecord} 比如:BC7799091_1_rec BC7799091_1_cloud BC7799091_1_cloudRecord
@@ -10179,13 +10180,14 @@ var THEME_DEFAULT_OPTIONS = {
10179
10180
  */ _this.recMonth = [], /** 清理 header/footer 动画 定时器 @private */ _this._onPauseTimingFunc = null, /** 销毁标识 @readonly */ _this.destroyed = false, _this.scaleMode = 0;
10180
10181
  _this._initOptions(options);
10181
10182
  if (_this.options.type === 'ezopen') {
10182
- var _this_urlInfo_searchParams, _this_urlInfo;
10183
- if ((_this_urlInfo = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams = _this_urlInfo.searchParams) == null ? void 0 : _this_urlInfo_searchParams.spaceId) {
10184
- _this.options.spaceId = _this.urlInfo.searchParams.spaceId;
10183
+ var _this_urlInfo_searchParams1, _this_urlInfo1, _this_urlInfo2;
10184
+ if ((_this_urlInfo1 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams1 = _this_urlInfo1.searchParams) == null ? void 0 : _this_urlInfo_searchParams1.spaceId) {
10185
+ var _this_urlInfo_searchParams2, _this_urlInfo3;
10186
+ _this.options.spaceId = (_this_urlInfo3 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams2 = _this_urlInfo3.searchParams) == null ? void 0 : _this_urlInfo_searchParams2.spaceId;
10185
10187
  }
10186
- if (_this.urlInfo.type === 'rec') {
10187
- var _this_urlInfo_searchParams1, _this_urlInfo1, _this_urlInfo_searchParams2, _this_urlInfo2;
10188
- _this._seekDate = ((_this_urlInfo1 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams1 = _this_urlInfo1.searchParams) == null ? void 0 : _this_urlInfo_searchParams1.begin) ? utilsTools.DateTime.toDate((_this_urlInfo2 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams2 = _this_urlInfo2.searchParams) == null ? void 0 : _this_urlInfo_searchParams2.begin) : utilsTools.DateTime.toDate(utilsTools.DateTime.format(new Date(), 'YYYY/MM/DD') + ' 00:00:00');
10188
+ if (((_this_urlInfo2 = _this.urlInfo) == null ? void 0 : _this_urlInfo2.type) === 'rec') {
10189
+ var _this_urlInfo_searchParams3, _this_urlInfo4, _this_urlInfo_searchParams4, _this_urlInfo5;
10190
+ _this._seekDate = ((_this_urlInfo4 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams3 = _this_urlInfo4.searchParams) == null ? void 0 : _this_urlInfo_searchParams3.begin) ? utilsTools.DateTime.toDate((_this_urlInfo5 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams4 = _this_urlInfo5.searchParams) == null ? void 0 : _this_urlInfo_searchParams4.begin) : utilsTools.DateTime.toDate(utilsTools.DateTime.format(new Date(), 'YYYY/MM/DD') + ' 00:00:00');
10189
10191
  }
10190
10192
  }
10191
10193
  _this._getRecType(_this.options.url);
@@ -10217,7 +10219,8 @@ var THEME_DEFAULT_OPTIONS = {
10217
10219
  var _this_options_volumeOptions_muted, _ref1;
10218
10220
  _this._muted = (_ref1 = (_this_options_volumeOptions_muted = (_this_options_volumeOptions1 = _this.options.volumeOptions) == null ? void 0 : _this_options_volumeOptions1.muted) != null ? _this_options_volumeOptions_muted : _this.options.muted) != null ? _ref1 : false;
10219
10221
  var _this_options_speedOptions_value, _ref2;
10220
- _this._speed = (_ref2 = (_this_options_speedOptions_value = (_this_options_speedOptions = _this.options.speedOptions) == null ? void 0 : _this_options_speedOptions.value) != null ? _this_options_speedOptions_value : _this.options.value) != null ? _ref2 : 1;
10222
+ // playbackSpeed 萤石标准流倍速字段
10223
+ _this._speed = (_ref2 = (_this_options_speedOptions_value = (_this_options_speedOptions = _this.options.speedOptions) == null ? void 0 : _this_options_speedOptions.value) != null ? _this_options_speedOptions_value : (_this_urlInfo = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams = _this_urlInfo.searchParams) == null ? void 0 : _this_urlInfo_searchParams.playbackSpeed) != null ? _ref2 : 1;
10221
10224
  _this._mobileInnerWidthHeight = _this._mobileInnerWidthHeight.bind(_this);
10222
10225
  _this._throttleMobileInnerWidthHeight = throttle(_this._mobileInnerWidthHeight, 20).bind(_this);
10223
10226
  _this._onDblClickFullscreen = debounce(_this._onDblClickFullscreen, 20).bind(_this);
@@ -10470,6 +10473,7 @@ var THEME_DEFAULT_OPTIONS = {
10470
10473
  this.options = deepmerge(THEME_DEFAULT_OPTIONS, options, {
10471
10474
  clone: false
10472
10475
  });
10476
+ this._url = this.options.url;
10473
10477
  // ⚠警告 (./utils/interactiveHF.ts)
10474
10478
  // PC 中窗口鼠标在header footer 移动(mousemove), 不允许消失及不要冒泡
10475
10479
  // Mobile 中窗口点击在header footer 上(pointerdown/touchstart), 不允许消失及不要冒泡
@@ -10960,12 +10964,13 @@ var THEME_DEFAULT_OPTIONS = {
10960
10964
  * @returns {"rec" | "cloudRecord" | "cloudRec" | ""} 录像类型, rec: 录像, cloudRec: 云录像, cloudRecord: 云录制
10961
10965
  */ _proto._getRecType = function _getRecType(url) {
10962
10966
  if (this.options.type === 'ezopen' && /^ezopen:\/\//.test(url)) {
10963
- if (this.urlInfo.type === 'rec') {
10964
- var _this_urlInfo_searchParams, _this_urlInfo;
10965
- if (this.urlInfo.recType === 'cloud' && ((_this_urlInfo = this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams = _this_urlInfo.searchParams) == null ? void 0 : _this_urlInfo_searchParams.busType) === '7') {
10967
+ var _this_urlInfo;
10968
+ if (((_this_urlInfo = this.urlInfo) == null ? void 0 : _this_urlInfo.type) === 'rec') {
10969
+ var _this_urlInfo1, _this_urlInfo_searchParams, _this_urlInfo2, _this_urlInfo3;
10970
+ if (((_this_urlInfo1 = this.urlInfo) == null ? void 0 : _this_urlInfo1.recType) === 'cloud' && ((_this_urlInfo2 = this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams = _this_urlInfo2.searchParams) == null ? void 0 : _this_urlInfo_searchParams.busType) === '7') {
10966
10971
  this.recType = 'cloudRecord';
10967
10972
  return 'cloudRecord';
10968
- } else if (this.urlInfo.recType === 'cloud') {
10973
+ } else if (((_this_urlInfo3 = this.urlInfo) == null ? void 0 : _this_urlInfo3.recType) === 'cloud') {
10969
10974
  this.recType = 'cloudRec';
10970
10975
  return 'cloudRec';
10971
10976
  } else {
@@ -11027,13 +11032,22 @@ var THEME_DEFAULT_OPTIONS = {
11027
11032
  }
11028
11033
  };
11029
11034
  _create_class(Theme, [
11035
+ {
11036
+ key: "url",
11037
+ get: function get() {
11038
+ return this._url;
11039
+ },
11040
+ set: function set(url) {
11041
+ this._url = url;
11042
+ }
11043
+ },
11030
11044
  {
11031
11045
  key: "urlInfo",
11032
11046
  get: /**
11033
11047
  * url 信息 播放地址信息
11034
11048
  */ function get() {
11035
- if (this.options.url) {
11036
- return utilsTools.parseEzopenUrl(this.options.url);
11049
+ if (this._url) {
11050
+ return utilsTools.parseEzopenUrl(this._url);
11037
11051
  }
11038
11052
  return {};
11039
11053
  }
@@ -11437,6 +11451,36 @@ var THEME_DEFAULT_OPTIONS = {
11437
11451
  */ function get() {
11438
11452
  return !!this._footerMoreControl;
11439
11453
  }
11454
+ },
11455
+ {
11456
+ key: "isEzopen",
11457
+ get: function get() {
11458
+ // 私有流地址
11459
+ return /^ezopen:\/\//.test(this._url);
11460
+ }
11461
+ },
11462
+ {
11463
+ key: "isEzviz",
11464
+ get: /**
11465
+ * 判断播放地址是萤石的播放地址
11466
+ * @since 3.1.2
11467
+ */ function get() {
11468
+ var path = this._url.split('?')[0];
11469
+ var queryStr = this._url.split('?')[1];
11470
+ var lastPath = path.split('/')[path.split('/').length - 1];
11471
+ // ezopen://open.ys7.com/BC7799091/1.rec
11472
+ // rtmp://rtmp05open.ys7.com:1935/v3/openpb/BC7799091_1_1
11473
+ // https://open.ys7.com/v3/openpb/llhls/BC7799091_1_1.m3u8
11474
+ // https://rtmp05open.ys7.com:9188/v3/openpb/BC7799091_1_1.flv
11475
+ // https://host:2001/live?dev=D08197169&chn=1&ss=token&stream=1
11476
+ if (// 私有流地址
11477
+ /^ezopen:\/\//.test(path) || // 标准流地址
11478
+ path.includes('/openlive/') || path.includes('/openpb/') && /[a-zA-Z0-9:]+_\d+_\d+/.test(lastPath) || // webtransport 取流
11479
+ utilsTools.isHttp(this._url) && queryStr && /dev=[a-zA-Z0-9:]+/.test(queryStr) && /chn=\d+/.test(queryStr) && /stream=\d+/.test(queryStr) && queryStr.includes('ssn=')) {
11480
+ return true;
11481
+ }
11482
+ return false;
11483
+ }
11440
11484
  }
11441
11485
  ]);
11442
11486
  return Theme;
@@ -11447,7 +11491,7 @@ var THEME_DEFAULT_OPTIONS = {
11447
11491
  zh: zh,
11448
11492
  en: en
11449
11493
  };
11450
- /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.2-beta.1';
11494
+ /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.2-beta.2';
11451
11495
 
11452
11496
  exports.Control = Control;
11453
11497
  exports.EVENTS = EVENTS;
package/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
- * @ezuikit/player-theme v3.1.2-beta.1
3
- * Copyright (c) 2026-08-10 02:32:17 Ezviz-OpenBiz
2
+ * @ezuikit/player-theme v3.1.2-beta.2
3
+ * Copyright (c) 2026-08-12 04:37:54 Ezviz-OpenBiz
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import EventEmitter from 'eventemitter3';
@@ -7138,6 +7138,7 @@ function _ts_generator$2(thisArg, body) {
7138
7138
  _inherits$f(AIChat, Control);
7139
7139
  function AIChat(options) {
7140
7140
  var _this;
7141
+ var _options_urlInfo_searchParams, _options_urlInfo, _options_urlInfo1;
7141
7142
  _this = Control.call(this, _extends$e({}, options, {
7142
7143
  tagName: 'span',
7143
7144
  controlType: 'button',
@@ -7151,7 +7152,7 @@ function _ts_generator$2(thisArg, body) {
7151
7152
  _this._render();
7152
7153
  }
7153
7154
  });
7154
- if (options.urlInfo.searchParams.busType !== '7' && options.urlInfo.recType === 'cloud' && options.sdkType === 'base') {
7155
+ if (((_options_urlInfo = options.urlInfo) == null ? void 0 : (_options_urlInfo_searchParams = _options_urlInfo.searchParams) == null ? void 0 : _options_urlInfo_searchParams.busType) !== '7' && ((_options_urlInfo1 = options.urlInfo) == null ? void 0 : _options_urlInfo1.recType) === 'cloud' && options.sdkType === 'base') {
7155
7156
  _this.$container.style.removeProperty('display');
7156
7157
  } else {
7157
7158
  _this.$container.style.display = 'none';
@@ -9448,7 +9449,7 @@ function _renderControls(theme, $container, btnList, props) {
9448
9449
  if (theme.options.deviceOptions !== null) {
9449
9450
  var _theme_controls;
9450
9451
  if (!((_theme_controls = theme.controls) == null ? void 0 : _theme_controls["deviceControl"])) {
9451
- var _theme_options;
9452
+ var _theme_urlInfo, _theme_urlInfo1, _theme_options;
9452
9453
  // eslint-disable-next-line @typescript-eslint/dot-notation, new-cap, @typescript-eslint/no-unsafe-argument
9453
9454
  theme.controls["deviceControl"] = new Controls["device"](_extends$1({
9454
9455
  rootContainer: theme.$container,
@@ -9459,8 +9460,8 @@ function _renderControls(theme, $container, btnList, props) {
9459
9460
  language: theme.options.language,
9460
9461
  locales: theme.i18n.translations,
9461
9462
  type: theme.options.type,
9462
- deviceSerial: theme.urlInfo.deviceSerial,
9463
- channelNo: theme.urlInfo.channelNo
9463
+ deviceSerial: (_theme_urlInfo = theme.urlInfo) == null ? void 0 : _theme_urlInfo.deviceSerial,
9464
+ channelNo: (_theme_urlInfo1 = theme.urlInfo) == null ? void 0 : _theme_urlInfo1.channelNo
9464
9465
  }, ((_theme_options = theme.options) == null ? void 0 : _theme_options["deviceOptions"]) || {}, {
9465
9466
  props: props
9466
9467
  }));
@@ -9471,7 +9472,7 @@ function _renderControls(theme, $container, btnList, props) {
9471
9472
  // footer
9472
9473
  if (Controls[item.iconId]) {
9473
9474
  if (theme.options["" + item.iconId + "Options"] !== null) {
9474
- var _theme_options1;
9475
+ var _theme_urlInfo2, _theme_urlInfo3, _theme_options1;
9475
9476
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
9476
9477
  theme.controls["" + item.iconId + "Control"] = new Controls[item.iconId](_extends$1({
9477
9478
  rootContainer: theme.$container,
@@ -9484,8 +9485,8 @@ function _renderControls(theme, $container, btnList, props) {
9484
9485
  env: theme.options.env,
9485
9486
  accessToken: theme.options.accessToken,
9486
9487
  token: theme.options.token,
9487
- deviceSerial: theme.urlInfo.deviceSerial,
9488
- channelNo: theme.urlInfo.channelNo,
9488
+ deviceSerial: (_theme_urlInfo2 = theme.urlInfo) == null ? void 0 : _theme_urlInfo2.deviceSerial,
9489
+ channelNo: (_theme_urlInfo3 = theme.urlInfo) == null ? void 0 : _theme_urlInfo3.channelNo,
9489
9490
  urlInfo: theme.urlInfo
9490
9491
  } : {}, {
9491
9492
  PLAY_TYPE: theme.options.type,
@@ -9731,7 +9732,7 @@ function _renderTheme(theme, data) {
9731
9732
  var _renderTimeLine = function(theme, container, props) {
9732
9733
  if (props === void 0) props = {};
9733
9734
  if (!theme.controls.timeLineControl && theme.options.timeLineOptions !== null) {
9734
- var _theme_urlInfo, _theme_options, _theme_options1, _this, _theme_options2;
9735
+ var _theme_urlInfo, _theme_urlInfo1, _theme_options, _theme_options1, _this, _theme_options2;
9735
9736
  var _showSectionIcon;
9736
9737
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
9737
9738
  theme.controls.timeLineControl = new Controls['timeLine'](_extends$1({
@@ -9740,7 +9741,7 @@ var _renderTimeLine = function(theme, container, props) {
9740
9741
  },
9741
9742
  language: theme.options.language,
9742
9743
  locales: theme.i18n.translations,
9743
- coverQuery: ((_theme_urlInfo = theme.urlInfo) == null ? void 0 : _theme_urlInfo.validateCode) ? "decodekey=" + theme.urlInfo.validateCode : ''
9744
+ coverQuery: ((_theme_urlInfo = theme.urlInfo) == null ? void 0 : _theme_urlInfo.validateCode) ? "decodekey=" + ((_theme_urlInfo1 = theme.urlInfo) == null ? void 0 : _theme_urlInfo1.validateCode) : ''
9744
9745
  }, ((_theme_options = theme.options) == null ? void 0 : _theme_options["timeLineOptions"]) || {}, {
9745
9746
  showSectionIcon: ((_theme_options1 = theme.options) == null ? void 0 : _theme_options1["recListOptions"]) !== null ? (_showSectionIcon = (_this = ((_theme_options2 = theme.options) == null ? void 0 : _theme_options2["timeLineOptions"]) || {}) == null ? void 0 : _this.showSectionIcon) != null ? _showSectionIcon : true : true,
9746
9747
  props: props
@@ -10143,7 +10144,7 @@ var THEME_DEFAULT_OPTIONS = {
10143
10144
  _inherits(Theme, EventEmitter);
10144
10145
  function Theme(options) {
10145
10146
  var _this;
10146
- var _this_options_volumeOptions, _this_options_volumeOptions1, _this_options_speedOptions, _this_options, _this_options1;
10147
+ var _this_options_volumeOptions, _this_options_volumeOptions1, _this_options_speedOptions, _this_urlInfo_searchParams, _this_urlInfo, _this_options, _this_options1;
10147
10148
  _this = EventEmitter.call(this) || this, /** 播放器配置项 */ _this.options = THEME_DEFAULT_OPTIONS, _this.staticPath = '', /** 所有控件列表, 所有控件名称规则(`${iconId}Control`), 如音量控件 this.controls["volumeControl"] @since 0.0.1 */ _this.controls = {}, /**
10148
10149
  * @since 0.0.1
10149
10150
  * @private
@@ -10163,7 +10164,7 @@ var THEME_DEFAULT_OPTIONS = {
10163
10164
  */ _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, /**
10164
10165
  * 移动端扩展容器, 扩展的控件渲染在指定容器以外, 仅只用端适用, 为了可以放置大的控件和方便开发接入
10165
10166
  * @private
10166
- */ _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, /** 是否播放中 @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 = [], /** 窗口尺寸变化时,设置窗口超出隐藏,防止出现滚动条 */ _this._resizeOverflowTimer = null, // /**
10167
+ */ _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 = [], /** 窗口尺寸变化时,设置窗口超出隐藏,防止出现滚动条 */ _this._resizeOverflowTimer = null, // /**
10167
10168
  // * 记录回放的月份
10168
10169
  // *
10169
10170
  // * key: {序列号}_{通道号}_{rec | cloud | cloudRecord} 比如:BC7799091_1_rec BC7799091_1_cloud BC7799091_1_cloudRecord
@@ -10177,13 +10178,14 @@ var THEME_DEFAULT_OPTIONS = {
10177
10178
  */ _this.recMonth = [], /** 清理 header/footer 动画 定时器 @private */ _this._onPauseTimingFunc = null, /** 销毁标识 @readonly */ _this.destroyed = false, _this.scaleMode = 0;
10178
10179
  _this._initOptions(options);
10179
10180
  if (_this.options.type === 'ezopen') {
10180
- var _this_urlInfo_searchParams, _this_urlInfo;
10181
- if ((_this_urlInfo = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams = _this_urlInfo.searchParams) == null ? void 0 : _this_urlInfo_searchParams.spaceId) {
10182
- _this.options.spaceId = _this.urlInfo.searchParams.spaceId;
10181
+ var _this_urlInfo_searchParams1, _this_urlInfo1, _this_urlInfo2;
10182
+ if ((_this_urlInfo1 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams1 = _this_urlInfo1.searchParams) == null ? void 0 : _this_urlInfo_searchParams1.spaceId) {
10183
+ var _this_urlInfo_searchParams2, _this_urlInfo3;
10184
+ _this.options.spaceId = (_this_urlInfo3 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams2 = _this_urlInfo3.searchParams) == null ? void 0 : _this_urlInfo_searchParams2.spaceId;
10183
10185
  }
10184
- if (_this.urlInfo.type === 'rec') {
10185
- var _this_urlInfo_searchParams1, _this_urlInfo1, _this_urlInfo_searchParams2, _this_urlInfo2;
10186
- _this._seekDate = ((_this_urlInfo1 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams1 = _this_urlInfo1.searchParams) == null ? void 0 : _this_urlInfo_searchParams1.begin) ? DateTime.toDate((_this_urlInfo2 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams2 = _this_urlInfo2.searchParams) == null ? void 0 : _this_urlInfo_searchParams2.begin) : DateTime.toDate(DateTime.format(new Date(), 'YYYY/MM/DD') + ' 00:00:00');
10186
+ if (((_this_urlInfo2 = _this.urlInfo) == null ? void 0 : _this_urlInfo2.type) === 'rec') {
10187
+ var _this_urlInfo_searchParams3, _this_urlInfo4, _this_urlInfo_searchParams4, _this_urlInfo5;
10188
+ _this._seekDate = ((_this_urlInfo4 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams3 = _this_urlInfo4.searchParams) == null ? void 0 : _this_urlInfo_searchParams3.begin) ? DateTime.toDate((_this_urlInfo5 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams4 = _this_urlInfo5.searchParams) == null ? void 0 : _this_urlInfo_searchParams4.begin) : DateTime.toDate(DateTime.format(new Date(), 'YYYY/MM/DD') + ' 00:00:00');
10187
10189
  }
10188
10190
  }
10189
10191
  _this._getRecType(_this.options.url);
@@ -10215,7 +10217,8 @@ var THEME_DEFAULT_OPTIONS = {
10215
10217
  var _this_options_volumeOptions_muted, _ref1;
10216
10218
  _this._muted = (_ref1 = (_this_options_volumeOptions_muted = (_this_options_volumeOptions1 = _this.options.volumeOptions) == null ? void 0 : _this_options_volumeOptions1.muted) != null ? _this_options_volumeOptions_muted : _this.options.muted) != null ? _ref1 : false;
10217
10219
  var _this_options_speedOptions_value, _ref2;
10218
- _this._speed = (_ref2 = (_this_options_speedOptions_value = (_this_options_speedOptions = _this.options.speedOptions) == null ? void 0 : _this_options_speedOptions.value) != null ? _this_options_speedOptions_value : _this.options.value) != null ? _ref2 : 1;
10220
+ // playbackSpeed 萤石标准流倍速字段
10221
+ _this._speed = (_ref2 = (_this_options_speedOptions_value = (_this_options_speedOptions = _this.options.speedOptions) == null ? void 0 : _this_options_speedOptions.value) != null ? _this_options_speedOptions_value : (_this_urlInfo = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams = _this_urlInfo.searchParams) == null ? void 0 : _this_urlInfo_searchParams.playbackSpeed) != null ? _ref2 : 1;
10219
10222
  _this._mobileInnerWidthHeight = _this._mobileInnerWidthHeight.bind(_this);
10220
10223
  _this._throttleMobileInnerWidthHeight = throttle(_this._mobileInnerWidthHeight, 20).bind(_this);
10221
10224
  _this._onDblClickFullscreen = debounce(_this._onDblClickFullscreen, 20).bind(_this);
@@ -10468,6 +10471,7 @@ var THEME_DEFAULT_OPTIONS = {
10468
10471
  this.options = deepmerge(THEME_DEFAULT_OPTIONS, options, {
10469
10472
  clone: false
10470
10473
  });
10474
+ this._url = this.options.url;
10471
10475
  // ⚠警告 (./utils/interactiveHF.ts)
10472
10476
  // PC 中窗口鼠标在header footer 移动(mousemove), 不允许消失及不要冒泡
10473
10477
  // Mobile 中窗口点击在header footer 上(pointerdown/touchstart), 不允许消失及不要冒泡
@@ -10958,12 +10962,13 @@ var THEME_DEFAULT_OPTIONS = {
10958
10962
  * @returns {"rec" | "cloudRecord" | "cloudRec" | ""} 录像类型, rec: 录像, cloudRec: 云录像, cloudRecord: 云录制
10959
10963
  */ _proto._getRecType = function _getRecType(url) {
10960
10964
  if (this.options.type === 'ezopen' && /^ezopen:\/\//.test(url)) {
10961
- if (this.urlInfo.type === 'rec') {
10962
- var _this_urlInfo_searchParams, _this_urlInfo;
10963
- if (this.urlInfo.recType === 'cloud' && ((_this_urlInfo = this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams = _this_urlInfo.searchParams) == null ? void 0 : _this_urlInfo_searchParams.busType) === '7') {
10965
+ var _this_urlInfo;
10966
+ if (((_this_urlInfo = this.urlInfo) == null ? void 0 : _this_urlInfo.type) === 'rec') {
10967
+ var _this_urlInfo1, _this_urlInfo_searchParams, _this_urlInfo2, _this_urlInfo3;
10968
+ if (((_this_urlInfo1 = this.urlInfo) == null ? void 0 : _this_urlInfo1.recType) === 'cloud' && ((_this_urlInfo2 = this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams = _this_urlInfo2.searchParams) == null ? void 0 : _this_urlInfo_searchParams.busType) === '7') {
10964
10969
  this.recType = 'cloudRecord';
10965
10970
  return 'cloudRecord';
10966
- } else if (this.urlInfo.recType === 'cloud') {
10971
+ } else if (((_this_urlInfo3 = this.urlInfo) == null ? void 0 : _this_urlInfo3.recType) === 'cloud') {
10967
10972
  this.recType = 'cloudRec';
10968
10973
  return 'cloudRec';
10969
10974
  } else {
@@ -11025,13 +11030,22 @@ var THEME_DEFAULT_OPTIONS = {
11025
11030
  }
11026
11031
  };
11027
11032
  _create_class(Theme, [
11033
+ {
11034
+ key: "url",
11035
+ get: function get() {
11036
+ return this._url;
11037
+ },
11038
+ set: function set(url) {
11039
+ this._url = url;
11040
+ }
11041
+ },
11028
11042
  {
11029
11043
  key: "urlInfo",
11030
11044
  get: /**
11031
11045
  * url 信息 播放地址信息
11032
11046
  */ function get() {
11033
- if (this.options.url) {
11034
- return parseEzopenUrl(this.options.url);
11047
+ if (this._url) {
11048
+ return parseEzopenUrl(this._url);
11035
11049
  }
11036
11050
  return {};
11037
11051
  }
@@ -11435,6 +11449,36 @@ var THEME_DEFAULT_OPTIONS = {
11435
11449
  */ function get() {
11436
11450
  return !!this._footerMoreControl;
11437
11451
  }
11452
+ },
11453
+ {
11454
+ key: "isEzopen",
11455
+ get: function get() {
11456
+ // 私有流地址
11457
+ return /^ezopen:\/\//.test(this._url);
11458
+ }
11459
+ },
11460
+ {
11461
+ key: "isEzviz",
11462
+ get: /**
11463
+ * 判断播放地址是萤石的播放地址
11464
+ * @since 3.1.2
11465
+ */ function get() {
11466
+ var path = this._url.split('?')[0];
11467
+ var queryStr = this._url.split('?')[1];
11468
+ var lastPath = path.split('/')[path.split('/').length - 1];
11469
+ // ezopen://open.ys7.com/BC7799091/1.rec
11470
+ // rtmp://rtmp05open.ys7.com:1935/v3/openpb/BC7799091_1_1
11471
+ // https://open.ys7.com/v3/openpb/llhls/BC7799091_1_1.m3u8
11472
+ // https://rtmp05open.ys7.com:9188/v3/openpb/BC7799091_1_1.flv
11473
+ // https://host:2001/live?dev=D08197169&chn=1&ss=token&stream=1
11474
+ if (// 私有流地址
11475
+ /^ezopen:\/\//.test(path) || // 标准流地址
11476
+ path.includes('/openlive/') || path.includes('/openpb/') && /[a-zA-Z0-9:]+_\d+_\d+/.test(lastPath) || // webtransport 取流
11477
+ isHttp(this._url) && queryStr && /dev=[a-zA-Z0-9:]+/.test(queryStr) && /chn=\d+/.test(queryStr) && /stream=\d+/.test(queryStr) && queryStr.includes('ssn=')) {
11478
+ return true;
11479
+ }
11480
+ return false;
11481
+ }
11438
11482
  }
11439
11483
  ]);
11440
11484
  return Theme;
@@ -11445,6 +11489,6 @@ var THEME_DEFAULT_OPTIONS = {
11445
11489
  zh: zh,
11446
11490
  en: en
11447
11491
  };
11448
- /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.2-beta.1';
11492
+ /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.2-beta.2';
11449
11493
 
11450
11494
  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.2-beta.1
3
- * Copyright (c) 2026-08-10 02:32:17 Ezviz-OpenBiz
2
+ * @ezuikit/player-theme v3.1.2-beta.2
3
+ * Copyright (c) 2026-08-12 04:37:54 Ezviz-OpenBiz
4
4
  * Released under the MIT License.
5
5
  */
6
6
  (function (global, factory) {
@@ -8642,6 +8642,7 @@
8642
8642
  _inherits$f(AIChat, Control);
8643
8643
  function AIChat(options) {
8644
8644
  var _this;
8645
+ var _options_urlInfo_searchParams, _options_urlInfo, _options_urlInfo1;
8645
8646
  _this = Control.call(this, _extends$h({}, options, {
8646
8647
  tagName: 'span',
8647
8648
  controlType: 'button',
@@ -8655,7 +8656,7 @@
8655
8656
  _this._render();
8656
8657
  }
8657
8658
  });
8658
- if (options.urlInfo.searchParams.busType !== '7' && options.urlInfo.recType === 'cloud' && options.sdkType === 'base') {
8659
+ if (((_options_urlInfo = options.urlInfo) == null ? void 0 : (_options_urlInfo_searchParams = _options_urlInfo.searchParams) == null ? void 0 : _options_urlInfo_searchParams.busType) !== '7' && ((_options_urlInfo1 = options.urlInfo) == null ? void 0 : _options_urlInfo1.recType) === 'cloud' && options.sdkType === 'base') {
8659
8660
  _this.$container.style.removeProperty('display');
8660
8661
  } else {
8661
8662
  _this.$container.style.display = 'none';
@@ -11794,7 +11795,7 @@
11794
11795
  if (theme.options.deviceOptions !== null) {
11795
11796
  var _theme_controls;
11796
11797
  if (!((_theme_controls = theme.controls) == null ? void 0 : _theme_controls["deviceControl"])) {
11797
- var _theme_options;
11798
+ var _theme_urlInfo, _theme_urlInfo1, _theme_options;
11798
11799
  // eslint-disable-next-line @typescript-eslint/dot-notation, new-cap, @typescript-eslint/no-unsafe-argument
11799
11800
  theme.controls["deviceControl"] = new Controls["device"](_extends$1({
11800
11801
  rootContainer: theme.$container,
@@ -11805,8 +11806,8 @@
11805
11806
  language: theme.options.language,
11806
11807
  locales: theme.i18n.translations,
11807
11808
  type: theme.options.type,
11808
- deviceSerial: theme.urlInfo.deviceSerial,
11809
- channelNo: theme.urlInfo.channelNo
11809
+ deviceSerial: (_theme_urlInfo = theme.urlInfo) == null ? void 0 : _theme_urlInfo.deviceSerial,
11810
+ channelNo: (_theme_urlInfo1 = theme.urlInfo) == null ? void 0 : _theme_urlInfo1.channelNo
11810
11811
  }, ((_theme_options = theme.options) == null ? void 0 : _theme_options["deviceOptions"]) || {}, {
11811
11812
  props: props
11812
11813
  }));
@@ -11817,7 +11818,7 @@
11817
11818
  // footer
11818
11819
  if (Controls[item.iconId]) {
11819
11820
  if (theme.options["" + item.iconId + "Options"] !== null) {
11820
- var _theme_options1;
11821
+ var _theme_urlInfo2, _theme_urlInfo3, _theme_options1;
11821
11822
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
11822
11823
  theme.controls["" + item.iconId + "Control"] = new Controls[item.iconId](_extends$1({
11823
11824
  rootContainer: theme.$container,
@@ -11830,8 +11831,8 @@
11830
11831
  env: theme.options.env,
11831
11832
  accessToken: theme.options.accessToken,
11832
11833
  token: theme.options.token,
11833
- deviceSerial: theme.urlInfo.deviceSerial,
11834
- channelNo: theme.urlInfo.channelNo,
11834
+ deviceSerial: (_theme_urlInfo2 = theme.urlInfo) == null ? void 0 : _theme_urlInfo2.deviceSerial,
11835
+ channelNo: (_theme_urlInfo3 = theme.urlInfo) == null ? void 0 : _theme_urlInfo3.channelNo,
11835
11836
  urlInfo: theme.urlInfo
11836
11837
  } : {}, {
11837
11838
  PLAY_TYPE: theme.options.type,
@@ -12077,7 +12078,7 @@
12077
12078
  var _renderTimeLine = function(theme, container, props) {
12078
12079
  if (props === void 0) props = {};
12079
12080
  if (!theme.controls.timeLineControl && theme.options.timeLineOptions !== null) {
12080
- var _theme_urlInfo, _theme_options, _theme_options1, _this, _theme_options2;
12081
+ var _theme_urlInfo, _theme_urlInfo1, _theme_options, _theme_options1, _this, _theme_options2;
12081
12082
  var _showSectionIcon;
12082
12083
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
12083
12084
  theme.controls.timeLineControl = new Controls['timeLine'](_extends$1({
@@ -12086,7 +12087,7 @@
12086
12087
  },
12087
12088
  language: theme.options.language,
12088
12089
  locales: theme.i18n.translations,
12089
- coverQuery: ((_theme_urlInfo = theme.urlInfo) == null ? void 0 : _theme_urlInfo.validateCode) ? "decodekey=" + theme.urlInfo.validateCode : ''
12090
+ coverQuery: ((_theme_urlInfo = theme.urlInfo) == null ? void 0 : _theme_urlInfo.validateCode) ? "decodekey=" + ((_theme_urlInfo1 = theme.urlInfo) == null ? void 0 : _theme_urlInfo1.validateCode) : ''
12090
12091
  }, ((_theme_options = theme.options) == null ? void 0 : _theme_options["timeLineOptions"]) || {}, {
12091
12092
  showSectionIcon: ((_theme_options1 = theme.options) == null ? void 0 : _theme_options1["recListOptions"]) !== null ? (_showSectionIcon = (_this = ((_theme_options2 = theme.options) == null ? void 0 : _theme_options2["timeLineOptions"]) || {}) == null ? void 0 : _this.showSectionIcon) != null ? _showSectionIcon : true : true,
12092
12093
  props: props
@@ -12489,7 +12490,7 @@
12489
12490
  _inherits(Theme, EventEmitter);
12490
12491
  function Theme(options) {
12491
12492
  var _this;
12492
- var _this_options_volumeOptions, _this_options_volumeOptions1, _this_options_speedOptions, _this_options, _this_options1;
12493
+ var _this_options_volumeOptions, _this_options_volumeOptions1, _this_options_speedOptions, _this_urlInfo_searchParams, _this_urlInfo, _this_options, _this_options1;
12493
12494
  _this = EventEmitter.call(this) || this, /** 播放器配置项 */ _this.options = THEME_DEFAULT_OPTIONS, _this.staticPath = '', /** 所有控件列表, 所有控件名称规则(`${iconId}Control`), 如音量控件 this.controls["volumeControl"] @since 0.0.1 */ _this.controls = {}, /**
12494
12495
  * @since 0.0.1
12495
12496
  * @private
@@ -12509,7 +12510,7 @@
12509
12510
  */ _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, /**
12510
12511
  * 移动端扩展容器, 扩展的控件渲染在指定容器以外, 仅只用端适用, 为了可以放置大的控件和方便开发接入
12511
12512
  * @private
12512
- */ _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, /** 是否播放中 @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 = [], /** 窗口尺寸变化时,设置窗口超出隐藏,防止出现滚动条 */ _this._resizeOverflowTimer = null, // /**
12513
+ */ _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 = [], /** 窗口尺寸变化时,设置窗口超出隐藏,防止出现滚动条 */ _this._resizeOverflowTimer = null, // /**
12513
12514
  // * 记录回放的月份
12514
12515
  // *
12515
12516
  // * key: {序列号}_{通道号}_{rec | cloud | cloudRecord} 比如:BC7799091_1_rec BC7799091_1_cloud BC7799091_1_cloudRecord
@@ -12523,13 +12524,14 @@
12523
12524
  */ _this.recMonth = [], /** 清理 header/footer 动画 定时器 @private */ _this._onPauseTimingFunc = null, /** 销毁标识 @readonly */ _this.destroyed = false, _this.scaleMode = 0;
12524
12525
  _this._initOptions(options);
12525
12526
  if (_this.options.type === 'ezopen') {
12526
- var _this_urlInfo_searchParams, _this_urlInfo;
12527
- if ((_this_urlInfo = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams = _this_urlInfo.searchParams) == null ? void 0 : _this_urlInfo_searchParams.spaceId) {
12528
- _this.options.spaceId = _this.urlInfo.searchParams.spaceId;
12527
+ var _this_urlInfo_searchParams1, _this_urlInfo1, _this_urlInfo2;
12528
+ if ((_this_urlInfo1 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams1 = _this_urlInfo1.searchParams) == null ? void 0 : _this_urlInfo_searchParams1.spaceId) {
12529
+ var _this_urlInfo_searchParams2, _this_urlInfo3;
12530
+ _this.options.spaceId = (_this_urlInfo3 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams2 = _this_urlInfo3.searchParams) == null ? void 0 : _this_urlInfo_searchParams2.spaceId;
12529
12531
  }
12530
- if (_this.urlInfo.type === 'rec') {
12531
- var _this_urlInfo_searchParams1, _this_urlInfo1, _this_urlInfo_searchParams2, _this_urlInfo2;
12532
- _this._seekDate = ((_this_urlInfo1 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams1 = _this_urlInfo1.searchParams) == null ? void 0 : _this_urlInfo_searchParams1.begin) ? distExports$3.DateTime.toDate((_this_urlInfo2 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams2 = _this_urlInfo2.searchParams) == null ? void 0 : _this_urlInfo_searchParams2.begin) : distExports$3.DateTime.toDate(distExports$3.DateTime.format(new Date(), 'YYYY/MM/DD') + ' 00:00:00');
12532
+ if (((_this_urlInfo2 = _this.urlInfo) == null ? void 0 : _this_urlInfo2.type) === 'rec') {
12533
+ var _this_urlInfo_searchParams3, _this_urlInfo4, _this_urlInfo_searchParams4, _this_urlInfo5;
12534
+ _this._seekDate = ((_this_urlInfo4 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams3 = _this_urlInfo4.searchParams) == null ? void 0 : _this_urlInfo_searchParams3.begin) ? distExports$3.DateTime.toDate((_this_urlInfo5 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams4 = _this_urlInfo5.searchParams) == null ? void 0 : _this_urlInfo_searchParams4.begin) : distExports$3.DateTime.toDate(distExports$3.DateTime.format(new Date(), 'YYYY/MM/DD') + ' 00:00:00');
12533
12535
  }
12534
12536
  }
12535
12537
  _this._getRecType(_this.options.url);
@@ -12561,7 +12563,8 @@
12561
12563
  var _this_options_volumeOptions_muted, _ref1;
12562
12564
  _this._muted = (_ref1 = (_this_options_volumeOptions_muted = (_this_options_volumeOptions1 = _this.options.volumeOptions) == null ? void 0 : _this_options_volumeOptions1.muted) != null ? _this_options_volumeOptions_muted : _this.options.muted) != null ? _ref1 : false;
12563
12565
  var _this_options_speedOptions_value, _ref2;
12564
- _this._speed = (_ref2 = (_this_options_speedOptions_value = (_this_options_speedOptions = _this.options.speedOptions) == null ? void 0 : _this_options_speedOptions.value) != null ? _this_options_speedOptions_value : _this.options.value) != null ? _ref2 : 1;
12566
+ // playbackSpeed 萤石标准流倍速字段
12567
+ _this._speed = (_ref2 = (_this_options_speedOptions_value = (_this_options_speedOptions = _this.options.speedOptions) == null ? void 0 : _this_options_speedOptions.value) != null ? _this_options_speedOptions_value : (_this_urlInfo = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams = _this_urlInfo.searchParams) == null ? void 0 : _this_urlInfo_searchParams.playbackSpeed) != null ? _ref2 : 1;
12565
12568
  _this._mobileInnerWidthHeight = _this._mobileInnerWidthHeight.bind(_this);
12566
12569
  _this._throttleMobileInnerWidthHeight = throttle(_this._mobileInnerWidthHeight, 20).bind(_this);
12567
12570
  _this._onDblClickFullscreen = debounce(_this._onDblClickFullscreen, 20).bind(_this);
@@ -12814,6 +12817,7 @@
12814
12817
  this.options = deepmerge(THEME_DEFAULT_OPTIONS, options, {
12815
12818
  clone: false
12816
12819
  });
12820
+ this._url = this.options.url;
12817
12821
  // ⚠警告 (./utils/interactiveHF.ts)
12818
12822
  // PC 中窗口鼠标在header footer 移动(mousemove), 不允许消失及不要冒泡
12819
12823
  // Mobile 中窗口点击在header footer 上(pointerdown/touchstart), 不允许消失及不要冒泡
@@ -13304,12 +13308,13 @@
13304
13308
  * @returns {"rec" | "cloudRecord" | "cloudRec" | ""} 录像类型, rec: 录像, cloudRec: 云录像, cloudRecord: 云录制
13305
13309
  */ _proto._getRecType = function _getRecType(url) {
13306
13310
  if (this.options.type === 'ezopen' && /^ezopen:\/\//.test(url)) {
13307
- if (this.urlInfo.type === 'rec') {
13308
- var _this_urlInfo_searchParams, _this_urlInfo;
13309
- if (this.urlInfo.recType === 'cloud' && ((_this_urlInfo = this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams = _this_urlInfo.searchParams) == null ? void 0 : _this_urlInfo_searchParams.busType) === '7') {
13311
+ var _this_urlInfo;
13312
+ if (((_this_urlInfo = this.urlInfo) == null ? void 0 : _this_urlInfo.type) === 'rec') {
13313
+ var _this_urlInfo1, _this_urlInfo_searchParams, _this_urlInfo2, _this_urlInfo3;
13314
+ if (((_this_urlInfo1 = this.urlInfo) == null ? void 0 : _this_urlInfo1.recType) === 'cloud' && ((_this_urlInfo2 = this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams = _this_urlInfo2.searchParams) == null ? void 0 : _this_urlInfo_searchParams.busType) === '7') {
13310
13315
  this.recType = 'cloudRecord';
13311
13316
  return 'cloudRecord';
13312
- } else if (this.urlInfo.recType === 'cloud') {
13317
+ } else if (((_this_urlInfo3 = this.urlInfo) == null ? void 0 : _this_urlInfo3.recType) === 'cloud') {
13313
13318
  this.recType = 'cloudRec';
13314
13319
  return 'cloudRec';
13315
13320
  } else {
@@ -13371,13 +13376,22 @@
13371
13376
  }
13372
13377
  };
13373
13378
  _create_class(Theme, [
13379
+ {
13380
+ key: "url",
13381
+ get: function get() {
13382
+ return this._url;
13383
+ },
13384
+ set: function set(url) {
13385
+ this._url = url;
13386
+ }
13387
+ },
13374
13388
  {
13375
13389
  key: "urlInfo",
13376
13390
  get: /**
13377
13391
  * url 信息 播放地址信息
13378
13392
  */ function get() {
13379
- if (this.options.url) {
13380
- return distExports$3.parseEzopenUrl(this.options.url);
13393
+ if (this._url) {
13394
+ return distExports$3.parseEzopenUrl(this._url);
13381
13395
  }
13382
13396
  return {};
13383
13397
  }
@@ -13781,6 +13795,36 @@
13781
13795
  */ function get() {
13782
13796
  return !!this._footerMoreControl;
13783
13797
  }
13798
+ },
13799
+ {
13800
+ key: "isEzopen",
13801
+ get: function get() {
13802
+ // 私有流地址
13803
+ return /^ezopen:\/\//.test(this._url);
13804
+ }
13805
+ },
13806
+ {
13807
+ key: "isEzviz",
13808
+ get: /**
13809
+ * 判断播放地址是萤石的播放地址
13810
+ * @since 3.1.2
13811
+ */ function get() {
13812
+ var path = this._url.split('?')[0];
13813
+ var queryStr = this._url.split('?')[1];
13814
+ var lastPath = path.split('/')[path.split('/').length - 1];
13815
+ // ezopen://open.ys7.com/BC7799091/1.rec
13816
+ // rtmp://rtmp05open.ys7.com:1935/v3/openpb/BC7799091_1_1
13817
+ // https://open.ys7.com/v3/openpb/llhls/BC7799091_1_1.m3u8
13818
+ // https://rtmp05open.ys7.com:9188/v3/openpb/BC7799091_1_1.flv
13819
+ // https://host:2001/live?dev=D08197169&chn=1&ss=token&stream=1
13820
+ if (// 私有流地址
13821
+ /^ezopen:\/\//.test(path) || // 标准流地址
13822
+ path.includes('/openlive/') || path.includes('/openpb/') && /[a-zA-Z0-9:]+_\d+_\d+/.test(lastPath) || // webtransport 取流
13823
+ distExports$3.isHttp(this._url) && queryStr && /dev=[a-zA-Z0-9:]+/.test(queryStr) && /chn=\d+/.test(queryStr) && /stream=\d+/.test(queryStr) && queryStr.includes('ssn=')) {
13824
+ return true;
13825
+ }
13826
+ return false;
13827
+ }
13784
13828
  }
13785
13829
  ]);
13786
13830
  return Theme;
@@ -13791,7 +13835,7 @@
13791
13835
  zh: zh,
13792
13836
  en: en
13793
13837
  };
13794
- /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.2-beta.1';
13838
+ /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.2-beta.2';
13795
13839
 
13796
13840
  // 不要动这里的代码, 这个出口是为了编译成 umd 规范的文件
13797
13841
 
package/dist/style.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
- * @ezuikit/player-theme v3.1.2-beta.1
3
- * Copyright (c) 2026-08-10 02:32:17 Ezviz-OpenBiz
2
+ * @ezuikit/player-theme v3.1.2-beta.2
3
+ * Copyright (c) 2026-08-12 04:37:54 Ezviz-OpenBiz
4
4
  * Released under the MIT License.
5
5
  */
6
6
  require("./style.css");
@@ -858,7 +858,7 @@ declare class Volume extends Control {
858
858
  /**
859
859
  * 全屏信息
860
860
  */
861
- interface FullscreenChangeInfo {
861
+ interface FullscreenChangeInfo$1 {
862
862
  /** 当前窗口是否处于全屏 */
863
863
  isCurrentFullscreen: boolean;
864
864
  /** 浏览器中是否有全屏 (移动端中永远是 false) */
@@ -869,7 +869,7 @@ interface FullscreenChangeInfo {
869
869
  /**
870
870
  * 全屏变化回调
871
871
  */
872
- type FullscreenChange = (info: FullscreenChangeInfo) => void;
872
+ type FullscreenChange = (info: FullscreenChangeInfo$1) => void;
873
873
  /**
874
874
  * 全屏配置项
875
875
  */
@@ -953,7 +953,7 @@ interface FullscreenOptions extends Omit<ControlOptions, 'tagName'> {
953
953
  * 全屏改变
954
954
  * @param info FullscreenChangeInfo 全屏信息
955
955
  */
956
- onChange?: (info: FullscreenChangeInfo) => void;
956
+ onChange?: (info: FullscreenChangeInfo$1) => void;
957
957
  }
958
958
  /**
959
959
  * 全屏控件
@@ -971,7 +971,7 @@ declare class Fullscreen extends Control {
971
971
  */
972
972
  destroy(): void;
973
973
  protected _render(): void;
974
- protected _fullscreenChange(info: FullscreenChangeInfo): void;
974
+ protected _fullscreenChange(info: FullscreenChangeInfo$1): void;
975
975
  /**
976
976
  * 点击 Control 会触发
977
977
  */
@@ -1534,6 +1534,7 @@ declare class Theme extends EventEmitter {
1534
1534
  readonly headerMorePanelOpenChange: "Control.headerMorePanelOpenChange";
1535
1535
  readonly footerMoreShowControlsChange: "Control.footerMoreShowControlsChange";
1536
1536
  readonly footerMorePanelOpenChange: "Control.footerMorePanelOpenChange";
1537
+ /** 录制中 @private */
1537
1538
  readonly deviceDestroy: "Control.deviceDestroy";
1538
1539
  readonly recTypeChange: "Control.recTypeChange";
1539
1540
  readonly recDestroy: "Control.recDestroy";
@@ -1542,10 +1543,9 @@ declare class Theme extends EventEmitter {
1542
1543
  readonly definitionPanelOpenChange: "Control.definitionPanelOpenChange";
1543
1544
  readonly definitionDestroy: "Control.definitionDestroy";
1544
1545
  readonly speedChange: "Control.speedChange";
1545
- /**
1546
+ readonly speedPanelOpenChange: "Control.speedPanelOpenChange"; /**
1546
1547
  * 录像回放的月份列表 @private
1547
1548
  */
1548
- readonly speedPanelOpenChange: "Control.speedPanelOpenChange";
1549
1549
  readonly speedDestroy: "Control.speedDestroy";
1550
1550
  readonly ptzPanelOpenChange: "Control.ptzPanelOpenChange";
1551
1551
  readonly ptzSpeedChange: "Control.ptzSpeedChange";
@@ -1599,9 +1599,7 @@ declare class Theme extends EventEmitter {
1599
1599
  readonly mobileExtendDestroy: "Theme.mobileExtendDestroy";
1600
1600
  readonly recFooterDestroy: "Theme.recFooterDestroy";
1601
1601
  };
1602
- readonly message: "message"; /**
1603
- * url 信息 播放地址信息
1604
- */
1602
+ readonly message: "message";
1605
1603
  };
1606
1604
  /** 语言包 @since 0.0.1 */
1607
1605
  static LOCALES: {
@@ -1840,9 +1838,8 @@ declare class Theme extends EventEmitter {
1840
1838
  ZOOM_SUB_MIN: string;
1841
1839
  ZOOM_LIMIT_MAX: string;
1842
1840
  ZOOM_LIMIT_MIN: string;
1843
- ZOOM_NOT_ENABLED: string;
1841
+ ZOOM_NOT_ENABLED: string; /** 是否播放中 @private */
1844
1842
  '3D_ZOOM': string;
1845
- /** @private 加载中 */
1846
1843
  '3D_ZOOM_DISABLE': string;
1847
1844
  '3D_ZOOM_FAILED': string;
1848
1845
  START_3D_ZOOM: string;
@@ -1853,11 +1850,10 @@ declare class Theme extends EventEmitter {
1853
1850
  '3D_ZOOM_CLOSED': string;
1854
1851
  CHANGE_ZOOM_TYPE: string;
1855
1852
  FULLSCREEN: string;
1856
- FULLSCREEN_EXIT: string; /** 自定清晰度 @private */
1853
+ FULLSCREEN_EXIT: string;
1857
1854
  GET_WEB_FULLSCREEN_STATUS: string;
1858
- WEB_FULLSCREEN: string;
1855
+ WEB_FULLSCREEN: string; /** 清晰度列表 */
1859
1856
  WEB_FULLSCREEN_EXIT: string;
1860
- /** 回放片段列表 */
1861
1857
  DESTROY: string;
1862
1858
  GET_CAPACITY: string;
1863
1859
  GET_PTZ_STATUS: string;
@@ -1869,18 +1865,18 @@ declare class Theme extends EventEmitter {
1869
1865
  PTZ_MID: string;
1870
1866
  PTZ_SLOW: string;
1871
1867
  PTZ_SPEED: string;
1872
- DEVICE_ZOOM: string;
1873
- DEVICE_FOCUS: string;
1874
1868
  /**
1875
1869
  * 录像回放的月份列表 @private
1876
1870
  */
1871
+ DEVICE_ZOOM: string;
1872
+ DEVICE_FOCUS: string;
1877
1873
  NOT_SUPPORT_DEVICE_ZOOM: string;
1878
1874
  NOT_SUPPORT_FOCUS: string;
1879
1875
  MIRROR: string;
1880
1876
  MIRROR_TYPE_ERROR: string;
1881
1877
  CHANGE_FEC_TYPE: string;
1882
1878
  DEVICE_NOT_SUPPORT: string;
1883
- TYPE_NOT_SUPPORT: string; /** 销毁标识 @readonly */
1879
+ TYPE_NOT_SUPPORT: string;
1884
1880
  FEC_SUPPORT_VERSION: string;
1885
1881
  NO_CANVAS_ID: string;
1886
1882
  SET_FEC_PARAMS: string;
@@ -1973,16 +1969,19 @@ declare class Theme extends EventEmitter {
1973
1969
  396504: string;
1974
1970
  396505: string;
1975
1971
  /** 屏幕旋转角度 0 | 90 | 180 | 270 */
1976
- 396506: string; /** 是否播放中 @private */
1972
+ 396506: string;
1977
1973
  396508: string;
1978
1974
  396509: string;
1979
1975
  396510: string;
1980
1976
  396511: string;
1981
- 396512: string;
1977
+ 396512: string; /** 倍速 @private */
1982
1978
  396513: string;
1983
1979
  396514: string;
1984
1980
  396515: string;
1985
1981
  396516: string;
1982
+ /**
1983
+ * 录像回放的月份列表 @private
1984
+ */
1986
1985
  396517: string;
1987
1986
  396518: string;
1988
1987
  396519: string;
@@ -2040,9 +2039,7 @@ declare class Theme extends EventEmitter {
2040
2039
  STOP_SUCCESS: string;
2041
2040
  CHANGE_PLAYURL_SUCCESS: string;
2042
2041
  CHANGE_PLAYURL_FAILED: string;
2043
- GET_OSD_TIME: string; /**
2044
- * url 信息 播放地址信息
2045
- */
2042
+ GET_OSD_TIME: string;
2046
2043
  GET_OSD_TIME_FAILED: string;
2047
2044
  SET_POSTER: string;
2048
2045
  RESIZE: string;
@@ -2052,7 +2049,12 @@ declare class Theme extends EventEmitter {
2052
2049
  GET_SPEED: string;
2053
2050
  MAX_SPEED_LIMIT: string;
2054
2051
  MIN_SPEED_LIMIT: string;
2055
- SEEK_CANNOT_CROSS_DAYS: string;
2052
+ SEEK_CANNOT_CROSS_DAYS: string; /**
2053
+ * 容器的高(单位 px)
2054
+ * ```ts
2055
+ * theme.height // number
2056
+ * ```
2057
+ */
2056
2058
  SEEK_TIMEFORMAT_ERROR: string;
2057
2059
  PAUSE: string;
2058
2060
  PAUSE_FAILED: string;
@@ -2086,9 +2088,21 @@ declare class Theme extends EventEmitter {
2086
2088
  BTN_AICHAT: string;
2087
2089
  BTN_LIVE: string;
2088
2090
  BTN_REC_DROPDOWN: string;
2091
+ /**
2092
+ * 加载中
2093
+ * ```ts
2094
+ * theme.loading // boolean
2095
+ * ```
2096
+ */
2089
2097
  BTN_ALARM_MESSAGE: string;
2090
2098
  REC_DROPDOWN_CLOUD_REC: string;
2091
- REC_DROPDOWN_CLOUD_RECORD: string;
2099
+ REC_DROPDOWN_CLOUD_RECORD: string; /**
2100
+ * 加载状态
2101
+ * ```ts
2102
+ * // 事件监听
2103
+ * theme.on(Theme.EVENTS.loading, (loading: boolean) => {})
2104
+ * ```
2105
+ */
2092
2106
  REC_DROPDOWN_LOCAL_REC: string;
2093
2107
  BTN_ZOOM: string;
2094
2108
  BTN_3D_ZOOM: string;
@@ -2100,7 +2114,13 @@ declare class Theme extends EventEmitter {
2100
2114
  BTN_EXPEND: string;
2101
2115
  BTN_WEBEXPEND: string;
2102
2116
  BTN_HD: string;
2103
- BTN_SPEED: string;
2117
+ BTN_SPEED: string; /**
2118
+ * 音量值
2119
+ * ```ts
2120
+ * // 事件监听
2121
+ * theme.on(Theme.EVENTS.volumechange, (volume: number, muted: boolean) => {})
2122
+ * ```
2123
+ */
2104
2124
  BTN_CLOUDREC: string;
2105
2125
  BTN_CLOUDRECORD: string;
2106
2126
  BTN_REC: string;
@@ -2256,6 +2276,7 @@ declare class Theme extends EventEmitter {
2256
2276
  private _isCurrentFullscreen;
2257
2277
  /** 屏幕旋转角度 0 | 90 | 180 | 270 */
2258
2278
  private _orientationAngle;
2279
+ _url: string;
2259
2280
  /** 是否播放中 @private */
2260
2281
  _playing: boolean;
2261
2282
  /** @private 加载中 */
@@ -2292,6 +2313,8 @@ declare class Theme extends EventEmitter {
2292
2313
  destroyed: boolean;
2293
2314
  scaleMode: ThemeOptions['scaleMode'];
2294
2315
  constructor(options: ThemeOptions);
2316
+ get url(): string;
2317
+ set url(url: string);
2295
2318
  /**
2296
2319
  * url 信息 播放地址信息
2297
2320
  */
@@ -2627,12 +2650,18 @@ declare class Theme extends EventEmitter {
2627
2650
  * @param url 录像 url
2628
2651
  * @returns {"rec" | "cloudRecord" | "cloudRec" | ""} 录像类型, rec: 录像, cloudRec: 云录像, cloudRecord: 云录制
2629
2652
  */
2630
- protected _getRecType(url: string): "" | "cloudRec" | "cloudRecord" | "rec";
2653
+ protected _getRecType(url: string): "" | "rec" | "cloudRec" | "cloudRecord";
2631
2654
  private resetControl;
2632
2655
  /**
2633
2656
  * 窗口全屏后旋转 90度判断, 然后设置控件已经旋转 90度, 为了解决控件交互问题
2634
2657
  */
2635
2658
  private _isRotated;
2659
+ get isEzopen(): boolean;
2660
+ /**
2661
+ * 判断播放地址是萤石的播放地址
2662
+ * @since 3.1.2
2663
+ */
2664
+ get isEzviz(): boolean;
2636
2665
  }
2637
2666
 
2638
2667
  /**
@@ -2911,5 +2940,247 @@ declare class Utils {
2911
2940
  static resizeObserver(node: Element, callback?: (entries: ResizeObserverEntry[], observer: ResizeObserver) => void): CleanUpResizeObserver;
2912
2941
  }
2913
2942
 
2943
+ /**
2944
+ * 事件类型定义
2945
+ *
2946
+ * 本文件根据 `src/constant.ts` 的 `EVENTS` 常量生成对应的「事件名」与「事件载荷」类型,
2947
+ * 用于给 `theme.on / once / off / emit` 提供类型提示。
2948
+ *
2949
+ * - 事件名(`ThemeEventName` 等)直接由 `typeof EVENTS` 推导,随 `EVENTS` 自动同步。
2950
+ * - 事件载荷(`ThemeEventMap`)依据事件文档与实际 emit 现场(`_bindEventemitter.ts` 等)手写,
2951
+ * 键为事件的「字符串值」(如 `'play'`、`'Control.play'`、`'Theme.destroyed'`),
2952
+ * 与 `EVENTS.play` / `EVENTS.control.play` / `EVENTS.theme.destroyed` 的取值一致。
2953
+ * - 文件末尾有编译期断言:保证 `EVENTS` 中的每个事件都在 `ThemeEventMap` 中声明了类型,
2954
+ * 反之亦然(防止漏写或写错事件名)。
2955
+ *
2956
+ * @remarks 载荷见 guide/events.md。标注为 `unknown` 的表示载荷由内核/插件决定,未固定结构。
2957
+ */
2958
+
2959
+ type EventsConst = typeof EVENTS;
2960
+ /** 对外事件名,如 `'play'`、`'volumechange'`、`'message'` */
2961
+ type ThemeOuterEventName = EventsConst[Exclude<keyof EventsConst, 'control' | 'theme'>];
2962
+ /** 控件事件名,如 `'Control.play'`、`'Control.volumechange'` */
2963
+ type ControlEventName = EventsConst['control'][keyof EventsConst['control']];
2964
+ /** 主题生命周期事件名,如 `'Theme.destroyed'` */
2965
+ type ThemeLifecycleEventName = EventsConst['theme'][keyof EventsConst['theme']];
2966
+ /** 所有事件名(对外 + 控件 + 生命周期)的并集 */
2967
+ type ThemeEventName = ThemeOuterEventName | ControlEventName | ThemeLifecycleEventName;
2968
+ /** 屏幕旋转角度 */
2969
+ type OrientationAngle = 0 | 90 | 180 | 270;
2970
+ /** 全屏状态变化载荷 */
2971
+ interface FullscreenChangeInfo {
2972
+ /** 当前容器是否处于全局全屏 */
2973
+ isCurrentFullscreen: boolean;
2974
+ /** 是否浏览器全屏 */
2975
+ isFullscreen: boolean;
2976
+ /** 是否移动端(移动端为模拟全屏) */
2977
+ isMobile: boolean;
2978
+ /** 旋转角度 */
2979
+ orientationAngle?: OrientationAngle;
2980
+ }
2981
+ /** 容器尺寸变化载荷 */
2982
+ interface ResizeInfo {
2983
+ width: number;
2984
+ height: number;
2985
+ isCurrentFullscreen?: boolean;
2986
+ orientationAngle?: OrientationAngle;
2987
+ }
2988
+ /** 音频信息(用于解禁音量控件) */
2989
+ interface AudioInfo {
2990
+ /** 标准流编码类型 */
2991
+ encType?: string;
2992
+ /** 私有流音频格式名 */
2993
+ audioFormatName?: string;
2994
+ [key: string]: unknown;
2995
+ }
2996
+ /** 视频信息(用于重渲染画面) */
2997
+ interface VideoInfo {
2998
+ width: number;
2999
+ height: number;
3000
+ [key: string]: unknown;
3001
+ }
3002
+ /** 云台错误信息 */
3003
+ interface PtzErrorInfo {
3004
+ code: string | number;
3005
+ localeKey?: string;
3006
+ msg?: string;
3007
+ [key: string]: unknown;
3008
+ }
3009
+ /**
3010
+ * 事件名 → 监听器签名 的映射表。
3011
+ *
3012
+ * 可用于给 eventemitter3 提供泛型:`class Theme extends EventEmitter<ThemeEventMap>`,
3013
+ * 或直接查询单个事件的处理函数类型:`ThemeEventMap['play']`。
3014
+ */
3015
+ interface ThemeEventMap {
3016
+ /** 加载状态变化 */
3017
+ loading: (loading: boolean) => void;
3018
+ /** 播放/暂停状态变化 */
3019
+ play: (playing: boolean) => void;
3020
+ /** 首帧显示(内部会解禁控件) */
3021
+ firstFrameDisplay: () => void;
3022
+ /** 截图 */
3023
+ capturePicture: () => void;
3024
+ /** 音量变化 */
3025
+ volumechange: (volume: number, muted: boolean) => void;
3026
+ /** 缩放倍数变化 */
3027
+ zoomChange: (zoom: number) => void;
3028
+ /** 缩放状态变化(true 可缩放 / false 禁止) */
3029
+ zoomingChange: (zooming: boolean) => void;
3030
+ /** 缩放平移改变(载荷来自缩放插件) */
3031
+ zoomTranslateChange: (translate: unknown) => void;
3032
+ /** 音频信息 */
3033
+ audioInfo: (info: AudioInfo) => void;
3034
+ /** 视频信息 */
3035
+ videoInfo: (info: VideoInfo) => void;
3036
+ /** 音频编码不支持(仅标准流 flv) */
3037
+ audioCodecUnsupported: (flag: boolean) => void;
3038
+ /** 进入全屏 */
3039
+ fullscreen: () => void;
3040
+ /** 退出全屏 */
3041
+ exitFullscreen: () => void;
3042
+ /** 全屏状态变化 */
3043
+ fullscreenChange: (info: FullscreenChangeInfo) => void;
3044
+ /** 容器尺寸变化 */
3045
+ resize: (info: ResizeInfo) => void;
3046
+ /** 屏幕旋转方向变化 */
3047
+ orientationChange: (angle: OrientationAngle) => void;
3048
+ /** 切换主题 */
3049
+ changeTheme: (themeData: IThemeData | null) => void;
3050
+ /** 回放类型切换 */
3051
+ recTypeChange: (type: string) => void;
3052
+ /** 切换清晰度 */
3053
+ definitionChange: (definition: number, item?: DefinitionItem) => void;
3054
+ /** 播放速度切换 */
3055
+ speedChange: (speed: number, item?: unknown) => void;
3056
+ /** 录制状态变化 */
3057
+ recordingChange: (recording: boolean) => void;
3058
+ /** 对讲状态变化 */
3059
+ talkingChange: (talking: boolean) => void;
3060
+ /** 麦克风音量变化(高频) */
3061
+ talkVolumeChange: (value: number) => void;
3062
+ /** 语音广播状态变化 */
3063
+ broadcastChange: (active: boolean) => void;
3064
+ /** AI 对话框状态变化 */
3065
+ aichatChange: (active: boolean) => void;
3066
+ /** 直播模式切换 */
3067
+ liveChange: () => void;
3068
+ /** 回放下拉选择变化 */
3069
+ recDropdownChange: (type: string) => void;
3070
+ /** 录像列表面板状态变化 */
3071
+ recListChange: (active: boolean) => void;
3072
+ /** 告警消息面板状态变化 */
3073
+ alarmMessageChange: (active: boolean) => void;
3074
+ /** 动态切换日志配置 */
3075
+ setLoggerOptions: (options: LoggerOptions) => void;
3076
+ /** 回放片段 */
3077
+ records: (records: unknown) => void;
3078
+ /** 云台速度变化 */
3079
+ ptzSpeedChange: (speed: number) => void;
3080
+ /** 设置清晰度列表 */
3081
+ setVideoLevelList: (list: DefinitionItem[]) => void;
3082
+ /** 当前清晰度 */
3083
+ currentVideoLevel: (item: DefinitionItem | number, level: number) => void;
3084
+ /** 当前是否自动清晰度 */
3085
+ currentVideoLevelAuto: (auto: boolean) => void;
3086
+ /** 设置全天回放片段(高频) */
3087
+ setAllDayRecTimes: (data: {
3088
+ list: unknown[];
3089
+ }) => void;
3090
+ /** OSD 时间(高频) */
3091
+ getOSDTime: (time: {
3092
+ data: number;
3093
+ }) => void;
3094
+ /** 统一消息提示入口(duration 单位秒) */
3095
+ message: (message: string, type: string, duration?: number) => void;
3096
+ /** 控件挂载前 */
3097
+ 'Control.beforeMountControls': () => void;
3098
+ /** 控件挂载完成 */
3099
+ 'Control.mountedControls': () => void;
3100
+ /** 控件卸载前 */
3101
+ 'Control.beforeUnmountControls': () => void;
3102
+ /** 控件卸载完成 */
3103
+ 'Control.unmountedControls': () => void;
3104
+ /** Header/Footer 显隐变化 */
3105
+ 'Control.controlsBarOpenChange': (open: boolean) => void;
3106
+ /** Header 更多按钮列表变化 */
3107
+ 'Control.headerMoreShowControlsChange': (show: boolean) => void;
3108
+ /** Header 更多面板显隐 */
3109
+ 'Control.headerMorePanelOpenChange': (open: boolean) => void;
3110
+ /** Footer 更多按钮列表变化 */
3111
+ 'Control.footerMoreShowControlsChange': (show: boolean, controls?: unknown[]) => void;
3112
+ /** Footer 更多面板显隐 */
3113
+ 'Control.footerMorePanelOpenChange': (open: boolean) => void;
3114
+ /** 点击播放/暂停 */
3115
+ 'Control.play': (playing: boolean, from?: unknown) => void;
3116
+ 'Control.playDestroy': () => void;
3117
+ 'Control.capturePicture': (options?: unknown) => void;
3118
+ 'Control.capturePictureResult': (result: unknown) => void;
3119
+ 'Control.capturePictureDestroy': () => void;
3120
+ 'Control.volumechange': (volume: number, muted: boolean) => void;
3121
+ 'Control.volumePanelOpenChange': (open: boolean, volume: number, muted: boolean) => void;
3122
+ 'Control.volumeDestroy': () => void;
3123
+ 'Control.ptzPanelOpenChange': (open: boolean) => void;
3124
+ 'Control.ptzSpeedChange': (speed: number) => void;
3125
+ 'Control.ptzError': (info: PtzErrorInfo) => void;
3126
+ 'Control.ptzDestroy': () => void;
3127
+ 'Control.recordingChange': (recording: boolean) => void;
3128
+ 'Control.recordDestroy': () => void;
3129
+ 'Control.talkingChange': (talking: boolean) => void;
3130
+ 'Control.talkError': (info: unknown) => void;
3131
+ 'Control.talkDestroy': () => void;
3132
+ 'Control.broadcastChange': (active: boolean) => void;
3133
+ 'Control.broadcastDestroy': () => void;
3134
+ 'Control.aichatChange': (active: boolean) => void;
3135
+ 'Control.aichatDestroy': () => void;
3136
+ 'Control.liveChange': () => void;
3137
+ 'Control.liveDestroy': () => void;
3138
+ 'Control.recDropdownChange': (type: string) => void;
3139
+ 'Control.recDropdownDestroy': () => void;
3140
+ 'Control.alarmMessageChange': (active: boolean) => void;
3141
+ 'Control.alarmMessageDestroy': () => void;
3142
+ 'Control.recTypeChange': (type: string) => void;
3143
+ 'Control.recDestroy': () => void;
3144
+ 'Control.recListChange': (active: boolean) => void;
3145
+ 'Control.recListCardClick': (section: unknown, index: number, sections: unknown[]) => void;
3146
+ 'Control.recListDestroy': () => void;
3147
+ 'Control.definitionChange': (definition: number, item?: DefinitionItem) => void;
3148
+ 'Control.definitionList': (list: DefinitionItem[]) => void;
3149
+ 'Control.definitionPanelOpenChange': (open: boolean, definition: number, item?: DefinitionItem) => void;
3150
+ 'Control.definitionDestroy': () => void;
3151
+ 'Control.speedChange': (speed: number, item?: unknown) => void;
3152
+ 'Control.speedPanelOpenChange': (open: boolean, speed: number, item?: unknown) => void;
3153
+ 'Control.speedDestroy': () => void;
3154
+ 'Control.zoomChange': (zoom: number) => void;
3155
+ 'Control.zoomPanelOpenChange': (open: boolean) => void;
3156
+ 'Control.zoomDestroy': () => void;
3157
+ 'Control.fullscreenDestroy': () => void;
3158
+ 'Control.globalFullscreenDestroy': () => void;
3159
+ 'Control.deviceDestroy': () => void;
3160
+ 'Control.datePanelOpenChange': (open: boolean, date: Date) => void;
3161
+ 'Control.dateChange': (date: Date) => void;
3162
+ 'Control.dateMonthChange': (dates: string[]) => void;
3163
+ /** 日历控件销毁(注意其字符串值为 `Control.datePanelDestroy`) */
3164
+ 'Control.datePanelDestroy': () => void;
3165
+ 'Control.timePanelOpenChange': (open: boolean, time: string) => void;
3166
+ 'Control.timeChange': (time: string) => void;
3167
+ 'Control.timeLineChange': (date: Date | string) => void;
3168
+ 'Control.timeLinePanelOpenChange': (open: boolean) => void;
3169
+ 'Control.timeLineDestroy': () => void;
3170
+ 'Control.posterDestroy': () => void;
3171
+ 'Control.loadingDestroy': () => void;
3172
+ 'Control.messageDestroy': () => void;
3173
+ 'Control.contentDestroy': () => void;
3174
+ 'Control.contentRerender': (info: unknown) => void;
3175
+ 'Theme.beforeDestroy': () => void;
3176
+ 'Theme.destroyed': () => void;
3177
+ 'Theme.mobileExtendDestroy': () => void;
3178
+ 'Theme.recFooterDestroy': () => void;
3179
+ }
3180
+ /** 单个事件的监听器类型,如 `ThemeEventHandler<'volumechange'>` */
3181
+ type ThemeEventHandler<K extends ThemeEventName> = K extends keyof ThemeEventMap ? ThemeEventMap[K] : (...args: unknown[]) => void;
3182
+ /** 单个事件的参数元组,如 `ThemeEventArgs<'volumechange'>` = `[number, boolean]` */
3183
+ type ThemeEventArgs<K extends ThemeEventName> = K extends keyof ThemeEventMap ? Parameters<ThemeEventMap[K]> : unknown[];
3184
+
2914
3185
  export { Control, EVENTS, Fullscreen, Loading, Message, Play, Poster, Rec, Theme, Utils, Volume };
2915
- export type { CleanUpResizeObserver, CleanUpScreenOrientationFun, ControlItem, ControlOptions, FooterOptions, FullscreenOptions, HeaderOptions, IThemeData, IThemeDataItem, LoadingOptions, MessageOptions, PlayOptions, PosterOptions, RecOptions, ScreenOrientation, ThemeOptions, VolumeOptions };
3186
+ export type { AudioInfo, CleanUpResizeObserver, CleanUpScreenOrientationFun, ControlEventName, ControlItem, ControlOptions, FooterOptions, FullscreenChangeInfo, FullscreenOptions, HeaderOptions, IThemeData, IThemeDataItem, LoadingOptions, MessageOptions, OrientationAngle, PlayOptions, PosterOptions, PtzErrorInfo, RecOptions, ResizeInfo, ScreenOrientation, ThemeEventArgs, ThemeEventHandler, ThemeEventMap, ThemeEventName, ThemeLifecycleEventName, ThemeOptions, ThemeOuterEventName, VideoInfo, VolumeOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ezuikit/player-theme",
3
- "version": "3.1.2-beta.1",
3
+ "version": "3.1.2-beta.2",
4
4
  "description": "player theme",
5
5
  "title": "theme",
6
6
  "main": "dist/index.cjs",
@@ -20,7 +20,8 @@
20
20
  "./dist/constant": "./dist/constant.js"
21
21
  },
22
22
  "files": [
23
- "dist"
23
+ "dist",
24
+ "!dist/*.map"
24
25
  ],
25
26
  "keywords": [
26
27
  "player",