@ezuikit/player-theme 2.1.0-beta.8 → 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 +2 -2
- package/dist/index.js +13 -11
- package/dist/index.mjs +13 -11
- package/dist/index.umd.js +13 -11
- package/dist/style.js +2 -2
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/constant.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @ezuikit/player-theme v2.1.0-beta.
|
|
3
|
-
* Copyright (c) 2026-01-
|
|
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
|
-
|
|
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,9 +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, // 重新计算画面渲染
|
|
9639
|
-
_theme_contentControl_rerender1, _theme_contentControl1, 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;
|
|
9640
9644
|
return _ts_generator$1(this, function(_state) {
|
|
9641
9645
|
switch(_state.label){
|
|
9642
9646
|
case 0:
|
|
@@ -9648,7 +9652,6 @@ function _renderTheme(theme, data) {
|
|
|
9648
9652
|
themeData = _state.sent();
|
|
9649
9653
|
_unmountedControls(theme);
|
|
9650
9654
|
if (Object.prototype.toString.call(themeData) !== '[object Object]') {
|
|
9651
|
-
(_theme_contentControl1 = theme.contentControl) == null ? void 0 : (_theme_contentControl_rerender1 = _theme_contentControl1.rerender) == null ? void 0 : _theme_contentControl_rerender1.call(_theme_contentControl1);
|
|
9652
9655
|
// 主题空
|
|
9653
9656
|
return [
|
|
9654
9657
|
2
|
|
@@ -9819,7 +9822,6 @@ function _renderTheme(theme, data) {
|
|
|
9819
9822
|
}
|
|
9820
9823
|
}
|
|
9821
9824
|
theme.emit(EVENTS.control.mountedControls);
|
|
9822
|
-
(_theme_contentControl = theme.contentControl) == null ? void 0 : (_theme_contentControl_rerender = _theme_contentControl.rerender) == null ? void 0 : _theme_contentControl_rerender.call(_theme_contentControl);
|
|
9823
9825
|
if (!theme.playing) theme._disabled(true);
|
|
9824
9826
|
_controlEventemitter(theme);
|
|
9825
9827
|
return [
|
|
@@ -11392,7 +11394,7 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
11392
11394
|
zh: zh,
|
|
11393
11395
|
en: en
|
|
11394
11396
|
};
|
|
11395
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.1.0-beta.
|
|
11397
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.1.0-beta.9';
|
|
11396
11398
|
|
|
11397
11399
|
exports.Control = Control;
|
|
11398
11400
|
exports.EVENTS = EVENTS;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @ezuikit/player-theme v2.1.0-beta.
|
|
3
|
-
* Copyright (c) 2026-01-
|
|
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
|
-
|
|
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,9 +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, // 重新计算画面渲染
|
|
9637
|
-
_theme_contentControl_rerender1, _theme_contentControl1, 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;
|
|
9638
9642
|
return _ts_generator$1(this, function(_state) {
|
|
9639
9643
|
switch(_state.label){
|
|
9640
9644
|
case 0:
|
|
@@ -9646,7 +9650,6 @@ function _renderTheme(theme, data) {
|
|
|
9646
9650
|
themeData = _state.sent();
|
|
9647
9651
|
_unmountedControls(theme);
|
|
9648
9652
|
if (Object.prototype.toString.call(themeData) !== '[object Object]') {
|
|
9649
|
-
(_theme_contentControl1 = theme.contentControl) == null ? void 0 : (_theme_contentControl_rerender1 = _theme_contentControl1.rerender) == null ? void 0 : _theme_contentControl_rerender1.call(_theme_contentControl1);
|
|
9650
9653
|
// 主题空
|
|
9651
9654
|
return [
|
|
9652
9655
|
2
|
|
@@ -9817,7 +9820,6 @@ function _renderTheme(theme, data) {
|
|
|
9817
9820
|
}
|
|
9818
9821
|
}
|
|
9819
9822
|
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
9823
|
if (!theme.playing) theme._disabled(true);
|
|
9822
9824
|
_controlEventemitter(theme);
|
|
9823
9825
|
return [
|
|
@@ -11390,6 +11392,6 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
11390
11392
|
zh: zh,
|
|
11391
11393
|
en: en
|
|
11392
11394
|
};
|
|
11393
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.1.0-beta.
|
|
11395
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.1.0-beta.9';
|
|
11394
11396
|
|
|
11395
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.
|
|
3
|
-
* Copyright (c) 2026-01-
|
|
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
|
-
|
|
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,9 +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, // 重新计算画面渲染
|
|
11755
|
-
_theme_contentControl_rerender1, _theme_contentControl1, 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;
|
|
11756
11760
|
return _ts_generator$1(this, function(_state) {
|
|
11757
11761
|
switch(_state.label){
|
|
11758
11762
|
case 0:
|
|
@@ -11764,7 +11768,6 @@
|
|
|
11764
11768
|
themeData = _state.sent();
|
|
11765
11769
|
_unmountedControls(theme);
|
|
11766
11770
|
if (Object.prototype.toString.call(themeData) !== '[object Object]') {
|
|
11767
|
-
(_theme_contentControl1 = theme.contentControl) == null ? void 0 : (_theme_contentControl_rerender1 = _theme_contentControl1.rerender) == null ? void 0 : _theme_contentControl_rerender1.call(_theme_contentControl1);
|
|
11768
11771
|
// 主题空
|
|
11769
11772
|
return [
|
|
11770
11773
|
2
|
|
@@ -11935,7 +11938,6 @@
|
|
|
11935
11938
|
}
|
|
11936
11939
|
}
|
|
11937
11940
|
theme.emit(EVENTS.control.mountedControls);
|
|
11938
|
-
(_theme_contentControl = theme.contentControl) == null ? void 0 : (_theme_contentControl_rerender = _theme_contentControl.rerender) == null ? void 0 : _theme_contentControl_rerender.call(_theme_contentControl);
|
|
11939
11941
|
if (!theme.playing) theme._disabled(true);
|
|
11940
11942
|
_controlEventemitter(theme);
|
|
11941
11943
|
return [
|
|
@@ -13508,7 +13510,7 @@
|
|
|
13508
13510
|
zh: zh,
|
|
13509
13511
|
en: en
|
|
13510
13512
|
};
|
|
13511
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.1.0-beta.
|
|
13513
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.1.0-beta.9';
|
|
13512
13514
|
|
|
13513
13515
|
// 不要动这里的代码, 这个出口是为了编译成 umd 规范的文件
|
|
13514
13516
|
|
package/dist/style.js
CHANGED
package/dist/types/index.d.ts
CHANGED