@ezuikit/player-theme 2.1.0-beta.7 → 2.1.0-beta.9

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 v2.1.0-beta.7
3
- * Copyright (c) 2026-01-06 Ezviz-OpenBiz
2
+ * @ezuikit/player-theme v2.1.0-beta.9
3
+ * Copyright (c) 2026-01-08 Ezviz-OpenBiz
4
4
  * Released under the MIT License.
5
5
  */
6
6
  /**
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
- * @ezuikit/player-theme v2.1.0-beta.7
3
- * Copyright (c) 2026-01-06 Ezviz-OpenBiz
2
+ * @ezuikit/player-theme v2.1.0-beta.9
3
+ * Copyright (c) 2026-01-08 Ezviz-OpenBiz
4
4
  * Released under the MIT License.
5
5
  */
6
6
  'use strict';
@@ -3739,7 +3739,7 @@ function _set_prototype_of$j(o, p) {
3739
3739
  _inherits$j(Content, EventEmitter);
3740
3740
  function Content(options) {
3741
3741
  var _this;
3742
- _this = EventEmitter.call(this) || this, _this._scaleMode = 0, _this._originWidth = 0, _this._originHeight = 0, _this._width = 0, _this._height = 0;
3742
+ _this = EventEmitter.call(this) || this, _this._scaleMode = 0, _this._cleanUpResizeObserver = null, _this._originWidth = 0, _this._originHeight = 0, _this._width = 0, _this._height = 0;
3743
3743
  _this.options = options;
3744
3744
  _this._scaleMode = options.scaleMode || 0;
3745
3745
  _this.$wrapper = document.createElement('div');
@@ -3757,9 +3757,10 @@ function _set_prototype_of$j(o, p) {
3757
3757
  _this.on(EVENTS.videoInfo, function(originWidth, originHeight) {
3758
3758
  _this.rerender(originWidth, originHeight);
3759
3759
  });
3760
- _this.on(EVENTS.resize, function() {
3760
+ // prettier-ignore
3761
+ _this._cleanUpResizeObserver = Utils.resizeObserver(_this.$wrapper, throttle(function() {
3761
3762
  _this.rerender();
3762
- });
3763
+ }, 20));
3763
3764
  return _this;
3764
3765
  }
3765
3766
  var _proto = Content.prototype;
@@ -3792,6 +3793,7 @@ function _set_prototype_of$j(o, p) {
3792
3793
  if (this._scaleMode === THEME_SCALE_MODE_TYPE.fullAuto) {
3793
3794
  objectFill = 'cover';
3794
3795
  }
3796
+ // 容器和视频的分辨率都需要有值才能计算
3795
3797
  if (width > 0 && height > 0 && this._originWidth > 0 && this._originHeight > 0 && this.$video) {
3796
3798
  var left = (width - this._originWidth) / 2;
3797
3799
  var top = (height - this._originHeight) / 2;
@@ -3825,6 +3827,10 @@ function _set_prototype_of$j(o, p) {
3825
3827
  };
3826
3828
  _proto.destroy = function destroy() {
3827
3829
  var _this_$wrapper;
3830
+ if (this._cleanUpResizeObserver) {
3831
+ this._cleanUpResizeObserver.unobserve == null ? void 0 : this._cleanUpResizeObserver.unobserve.call(this._cleanUpResizeObserver);
3832
+ this._cleanUpResizeObserver = null;
3833
+ }
3828
3834
  if (this.$video) {
3829
3835
  this.$video.remove();
3830
3836
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -9634,8 +9640,7 @@ function _renderControls(theme, $container, btnList, props) {
9634
9640
  }
9635
9641
  function _renderTheme(theme, data) {
9636
9642
  return _async_to_generator$1(function() {
9637
- var _theme_posterControl, _filterThemeData_header, _filterThemeData_footer, _theme_options_mobileExtendOptions_controls, _theme_options_mobileExtendOptions, // 重新计算画面渲染
9638
- _theme_contentControl_rerender, _theme_contentControl, themeData, filterThemeData, props, _$_filterLeftRightControls, leftBtns, rightBtns, _theme_controls, _theme_controls1, _$_filterLeftRightControls1, leftBtns1, rightBtns1, _filterThemeData_footer_btnList, list, _needTimeLine, hasPtz, _theme_options_mobileExtendOptions1, _theme_options_mobileExtendOptions2, _theme_options_mobileExtendOptions3, _theme_options_mobileExtendOptions_controls1, _theme_options_mobileExtendOptions4, _filterThemeData_header1, _filterThemeData_footer1, _filterThemeData_footer_btnList1;
9643
+ var _theme_posterControl, _filterThemeData_header, _filterThemeData_footer, _theme_options_mobileExtendOptions_controls, _theme_options_mobileExtendOptions, themeData, filterThemeData, props, _$_filterLeftRightControls, leftBtns, rightBtns, _theme_controls, _theme_controls1, _$_filterLeftRightControls1, leftBtns1, rightBtns1, _filterThemeData_footer_btnList, list, _needTimeLine, hasPtz, _theme_options_mobileExtendOptions1, _theme_options_mobileExtendOptions2, _theme_options_mobileExtendOptions3, _theme_options_mobileExtendOptions_controls1, _theme_options_mobileExtendOptions4, _filterThemeData_header1, _filterThemeData_footer1, _filterThemeData_footer_btnList1;
9639
9644
  return _ts_generator$1(this, function(_state) {
9640
9645
  switch(_state.label){
9641
9646
  case 0:
@@ -9817,7 +9822,6 @@ function _renderTheme(theme, data) {
9817
9822
  }
9818
9823
  }
9819
9824
  theme.emit(EVENTS.control.mountedControls);
9820
- (_theme_contentControl = theme.contentControl) == null ? void 0 : (_theme_contentControl_rerender = _theme_contentControl.rerender) == null ? void 0 : _theme_contentControl_rerender.call(_theme_contentControl);
9821
9825
  if (!theme.playing) theme._disabled(true);
9822
9826
  _controlEventemitter(theme);
9823
9827
  return [
@@ -11390,7 +11394,7 @@ var THEME_DEFAULT_OPTIONS = {
11390
11394
  zh: zh,
11391
11395
  en: en
11392
11396
  };
11393
- /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.1.0-beta.7';
11397
+ /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.1.0-beta.9';
11394
11398
 
11395
11399
  exports.Control = Control;
11396
11400
  exports.EVENTS = EVENTS;
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
- * @ezuikit/player-theme v2.1.0-beta.7
3
- * Copyright (c) 2026-01-06 Ezviz-OpenBiz
2
+ * @ezuikit/player-theme v2.1.0-beta.9
3
+ * Copyright (c) 2026-01-08 Ezviz-OpenBiz
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import EventEmitter from 'eventemitter3';
@@ -3737,7 +3737,7 @@ function _set_prototype_of$j(o, p) {
3737
3737
  _inherits$j(Content, EventEmitter);
3738
3738
  function Content(options) {
3739
3739
  var _this;
3740
- _this = EventEmitter.call(this) || this, _this._scaleMode = 0, _this._originWidth = 0, _this._originHeight = 0, _this._width = 0, _this._height = 0;
3740
+ _this = EventEmitter.call(this) || this, _this._scaleMode = 0, _this._cleanUpResizeObserver = null, _this._originWidth = 0, _this._originHeight = 0, _this._width = 0, _this._height = 0;
3741
3741
  _this.options = options;
3742
3742
  _this._scaleMode = options.scaleMode || 0;
3743
3743
  _this.$wrapper = document.createElement('div');
@@ -3755,9 +3755,10 @@ function _set_prototype_of$j(o, p) {
3755
3755
  _this.on(EVENTS.videoInfo, function(originWidth, originHeight) {
3756
3756
  _this.rerender(originWidth, originHeight);
3757
3757
  });
3758
- _this.on(EVENTS.resize, function() {
3758
+ // prettier-ignore
3759
+ _this._cleanUpResizeObserver = Utils.resizeObserver(_this.$wrapper, throttle(function() {
3759
3760
  _this.rerender();
3760
- });
3761
+ }, 20));
3761
3762
  return _this;
3762
3763
  }
3763
3764
  var _proto = Content.prototype;
@@ -3790,6 +3791,7 @@ function _set_prototype_of$j(o, p) {
3790
3791
  if (this._scaleMode === THEME_SCALE_MODE_TYPE.fullAuto) {
3791
3792
  objectFill = 'cover';
3792
3793
  }
3794
+ // 容器和视频的分辨率都需要有值才能计算
3793
3795
  if (width > 0 && height > 0 && this._originWidth > 0 && this._originHeight > 0 && this.$video) {
3794
3796
  var left = (width - this._originWidth) / 2;
3795
3797
  var top = (height - this._originHeight) / 2;
@@ -3823,6 +3825,10 @@ function _set_prototype_of$j(o, p) {
3823
3825
  };
3824
3826
  _proto.destroy = function destroy() {
3825
3827
  var _this_$wrapper;
3828
+ if (this._cleanUpResizeObserver) {
3829
+ this._cleanUpResizeObserver.unobserve == null ? void 0 : this._cleanUpResizeObserver.unobserve.call(this._cleanUpResizeObserver);
3830
+ this._cleanUpResizeObserver = null;
3831
+ }
3826
3832
  if (this.$video) {
3827
3833
  this.$video.remove();
3828
3834
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -9632,8 +9638,7 @@ function _renderControls(theme, $container, btnList, props) {
9632
9638
  }
9633
9639
  function _renderTheme(theme, data) {
9634
9640
  return _async_to_generator$1(function() {
9635
- var _theme_posterControl, _filterThemeData_header, _filterThemeData_footer, _theme_options_mobileExtendOptions_controls, _theme_options_mobileExtendOptions, // 重新计算画面渲染
9636
- _theme_contentControl_rerender, _theme_contentControl, themeData, filterThemeData, props, _$_filterLeftRightControls, leftBtns, rightBtns, _theme_controls, _theme_controls1, _$_filterLeftRightControls1, leftBtns1, rightBtns1, _filterThemeData_footer_btnList, list, _needTimeLine, hasPtz, _theme_options_mobileExtendOptions1, _theme_options_mobileExtendOptions2, _theme_options_mobileExtendOptions3, _theme_options_mobileExtendOptions_controls1, _theme_options_mobileExtendOptions4, _filterThemeData_header1, _filterThemeData_footer1, _filterThemeData_footer_btnList1;
9641
+ var _theme_posterControl, _filterThemeData_header, _filterThemeData_footer, _theme_options_mobileExtendOptions_controls, _theme_options_mobileExtendOptions, themeData, filterThemeData, props, _$_filterLeftRightControls, leftBtns, rightBtns, _theme_controls, _theme_controls1, _$_filterLeftRightControls1, leftBtns1, rightBtns1, _filterThemeData_footer_btnList, list, _needTimeLine, hasPtz, _theme_options_mobileExtendOptions1, _theme_options_mobileExtendOptions2, _theme_options_mobileExtendOptions3, _theme_options_mobileExtendOptions_controls1, _theme_options_mobileExtendOptions4, _filterThemeData_header1, _filterThemeData_footer1, _filterThemeData_footer_btnList1;
9637
9642
  return _ts_generator$1(this, function(_state) {
9638
9643
  switch(_state.label){
9639
9644
  case 0:
@@ -9815,7 +9820,6 @@ function _renderTheme(theme, data) {
9815
9820
  }
9816
9821
  }
9817
9822
  theme.emit(EVENTS.control.mountedControls);
9818
- (_theme_contentControl = theme.contentControl) == null ? void 0 : (_theme_contentControl_rerender = _theme_contentControl.rerender) == null ? void 0 : _theme_contentControl_rerender.call(_theme_contentControl);
9819
9823
  if (!theme.playing) theme._disabled(true);
9820
9824
  _controlEventemitter(theme);
9821
9825
  return [
@@ -11388,6 +11392,6 @@ var THEME_DEFAULT_OPTIONS = {
11388
11392
  zh: zh,
11389
11393
  en: en
11390
11394
  };
11391
- /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.1.0-beta.7';
11395
+ /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.1.0-beta.9';
11392
11396
 
11393
11397
  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 v2.1.0-beta.7
3
- * Copyright (c) 2026-01-06 Ezviz-OpenBiz
2
+ * @ezuikit/player-theme v2.1.0-beta.9
3
+ * Copyright (c) 2026-01-08 Ezviz-OpenBiz
4
4
  * Released under the MIT License.
5
5
  */
6
6
  (function (global, factory) {
@@ -5367,7 +5367,7 @@
5367
5367
  _inherits$j(Content, EventEmitter);
5368
5368
  function Content(options) {
5369
5369
  var _this;
5370
- _this = EventEmitter.call(this) || this, _this._scaleMode = 0, _this._originWidth = 0, _this._originHeight = 0, _this._width = 0, _this._height = 0;
5370
+ _this = EventEmitter.call(this) || this, _this._scaleMode = 0, _this._cleanUpResizeObserver = null, _this._originWidth = 0, _this._originHeight = 0, _this._width = 0, _this._height = 0;
5371
5371
  _this.options = options;
5372
5372
  _this._scaleMode = options.scaleMode || 0;
5373
5373
  _this.$wrapper = document.createElement('div');
@@ -5385,9 +5385,10 @@
5385
5385
  _this.on(EVENTS.videoInfo, function(originWidth, originHeight) {
5386
5386
  _this.rerender(originWidth, originHeight);
5387
5387
  });
5388
- _this.on(EVENTS.resize, function() {
5388
+ // prettier-ignore
5389
+ _this._cleanUpResizeObserver = Utils.resizeObserver(_this.$wrapper, throttle(function() {
5389
5390
  _this.rerender();
5390
- });
5391
+ }, 20));
5391
5392
  return _this;
5392
5393
  }
5393
5394
  var _proto = Content.prototype;
@@ -5420,6 +5421,7 @@
5420
5421
  if (this._scaleMode === THEME_SCALE_MODE_TYPE.fullAuto) {
5421
5422
  objectFill = 'cover';
5422
5423
  }
5424
+ // 容器和视频的分辨率都需要有值才能计算
5423
5425
  if (width > 0 && height > 0 && this._originWidth > 0 && this._originHeight > 0 && this.$video) {
5424
5426
  var left = (width - this._originWidth) / 2;
5425
5427
  var top = (height - this._originHeight) / 2;
@@ -5453,6 +5455,10 @@
5453
5455
  };
5454
5456
  _proto.destroy = function destroy() {
5455
5457
  var _this_$wrapper;
5458
+ if (this._cleanUpResizeObserver) {
5459
+ this._cleanUpResizeObserver.unobserve == null ? void 0 : this._cleanUpResizeObserver.unobserve.call(this._cleanUpResizeObserver);
5460
+ this._cleanUpResizeObserver = null;
5461
+ }
5456
5462
  if (this.$video) {
5457
5463
  this.$video.remove();
5458
5464
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -11750,8 +11756,7 @@
11750
11756
  }
11751
11757
  function _renderTheme(theme, data) {
11752
11758
  return _async_to_generator$1(function() {
11753
- var _theme_posterControl, _filterThemeData_header, _filterThemeData_footer, _theme_options_mobileExtendOptions_controls, _theme_options_mobileExtendOptions, // 重新计算画面渲染
11754
- _theme_contentControl_rerender, _theme_contentControl, themeData, filterThemeData, props, _$_filterLeftRightControls, leftBtns, rightBtns, _theme_controls, _theme_controls1, _$_filterLeftRightControls1, leftBtns1, rightBtns1, _filterThemeData_footer_btnList, list, _needTimeLine, hasPtz, _theme_options_mobileExtendOptions1, _theme_options_mobileExtendOptions2, _theme_options_mobileExtendOptions3, _theme_options_mobileExtendOptions_controls1, _theme_options_mobileExtendOptions4, _filterThemeData_header1, _filterThemeData_footer1, _filterThemeData_footer_btnList1;
11759
+ var _theme_posterControl, _filterThemeData_header, _filterThemeData_footer, _theme_options_mobileExtendOptions_controls, _theme_options_mobileExtendOptions, themeData, filterThemeData, props, _$_filterLeftRightControls, leftBtns, rightBtns, _theme_controls, _theme_controls1, _$_filterLeftRightControls1, leftBtns1, rightBtns1, _filterThemeData_footer_btnList, list, _needTimeLine, hasPtz, _theme_options_mobileExtendOptions1, _theme_options_mobileExtendOptions2, _theme_options_mobileExtendOptions3, _theme_options_mobileExtendOptions_controls1, _theme_options_mobileExtendOptions4, _filterThemeData_header1, _filterThemeData_footer1, _filterThemeData_footer_btnList1;
11755
11760
  return _ts_generator$1(this, function(_state) {
11756
11761
  switch(_state.label){
11757
11762
  case 0:
@@ -11933,7 +11938,6 @@
11933
11938
  }
11934
11939
  }
11935
11940
  theme.emit(EVENTS.control.mountedControls);
11936
- (_theme_contentControl = theme.contentControl) == null ? void 0 : (_theme_contentControl_rerender = _theme_contentControl.rerender) == null ? void 0 : _theme_contentControl_rerender.call(_theme_contentControl);
11937
11941
  if (!theme.playing) theme._disabled(true);
11938
11942
  _controlEventemitter(theme);
11939
11943
  return [
@@ -13506,7 +13510,7 @@
13506
13510
  zh: zh,
13507
13511
  en: en
13508
13512
  };
13509
- /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.1.0-beta.7';
13513
+ /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.1.0-beta.9';
13510
13514
 
13511
13515
  // 不要动这里的代码, 这个出口是为了编译成 umd 规范的文件
13512
13516
 
package/dist/style.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
- * @ezuikit/player-theme v2.1.0-beta.7
3
- * Copyright (c) 2026-01-06 Ezviz-OpenBiz
2
+ * @ezuikit/player-theme v2.1.0-beta.9
3
+ * Copyright (c) 2026-01-08 Ezviz-OpenBiz
4
4
  * Released under the MIT License.
5
5
  */
6
6
  require("./style.css");
@@ -1224,6 +1224,7 @@ declare class Content extends EventEmitter {
1224
1224
  /** 配置项 */
1225
1225
  options: ContentOptions;
1226
1226
  private _scaleMode?;
1227
+ private _cleanUpResizeObserver;
1227
1228
  private _originWidth;
1228
1229
  private _originHeight;
1229
1230
  private _width;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ezuikit/player-theme",
3
- "version": "2.1.0-beta.7",
3
+ "version": "2.1.0-beta.9",
4
4
  "description": "player theme",
5
5
  "title": "theme",
6
6
  "main": "dist/index.js",